From 68d238b32a4182e22cec5bfd8d23b007eba5719b Mon Sep 17 00:00:00 2001 From: Manuel Kiessling Date: Sun, 26 Feb 2017 22:05:29 +0100 Subject: [PATCH] Specced #37, testcase removal feature. --- .../Functional/TestcasesFunctionalWebTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/php/tests/AppBundle/Functional/TestcasesFunctionalWebTest.php b/php/tests/AppBundle/Functional/TestcasesFunctionalWebTest.php index a9e13a6..503055d 100644 --- a/php/tests/AppBundle/Functional/TestcasesFunctionalWebTest.php +++ b/php/tests/AppBundle/Functional/TestcasesFunctionalWebTest.php @@ -258,4 +258,23 @@ public function testTestcaseEdit() count($crawler->filter('table.testcases span.label-default:contains("*/15")')) ); } + + public function testTestcaseDeletionOnIndexPage() + { + $this->resetDatabase(); + $client = $this->getClientThatRegisteredAndActivatedADemoUser(); + $crawler = $client->request('GET', '/testcases/'); + + $this->assertSame('Demo User Testcase One', trim($crawler->filter('.testcase-entry-cell h4')->eq(0)->text())); + + $buttonNode = $crawler->selectButton('Delete'); + $form = $buttonNode->form(); + $client->submit($form); + + $crawler = $client->followRedirect(); + + $this->assertSame(1, count($crawler->filter('h4:contains("Your testcases")'))); + + $this->assertEmpty($crawler->filter('.testcase-entry-cell h4')->eq(0)); + } }