Permalink
Browse files

TodoSeleniumTest (新增 1 筆 task 立即刪除)

  • Loading branch information...
1 parent 329be5e commit c6f492dee8a09fb1c0bd97cf96dacb7ece89d0d0 Sam.IO.Hsiao committed Oct 18, 2016
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/TodoSeleniumTest.php
@@ -58,4 +58,25 @@ public function 新增1筆task並顯示在下方()
$this->assertContains('Task 1', $this->byTag('body')->text());
}
+
+ /** @test */
+ public function 新增1task立即刪除()
+ {
+ $this->url($this->rootURL);
+ $this->assertNotContains('Task 1', $this->byTag('body')->text());
+
+ $this->url($this->rootURL);
+ $this->byName('name')->value('Task 1');
+ $this->byXPath("//button[contains(text(), 'Add Task')]")->click();
+
+ sleep($this->ajaxDelay);
+
+ $this->assertContains('Task 1', $this->byTag('body')->text());
+
+ $this->byXPath("//button[contains(text(), 'Delete')]")->click();
+
+ sleep($this->ajaxDelay);
+
+ $this->assertNotContains('Task 1', $this->byTag('body')->text());
+ }
}

0 comments on commit c6f492d

Please sign in to comment.