Permalink
Browse files

TodoSeleniumAppTest (一啟動顯示 3 筆 task)

1 parent 0e217b2 commit 4a6b32c4e35fff6779eb4ac36f279970cf328f68 Sam.IO.Hsiao committed Oct 18, 2016
Showing with 39 additions and 0 deletions.
  1. +39 −0 tests/TodoSeleniumAppTest.php
@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types = 1);
+
+use App\Task;
+
+class TodoSeleniumAppTest extends TestCaseSelenium
+{
+ /** @var string */
+ private $rootURL = 'todo2';
+
+ protected function tearDown()
+ {
+ DB::table('tasks')->truncate();
+ parent::tearDown();
+ }
+
+ /** @test */
+ public function 一啟動顯示3筆task()
+ {
+ factory(Task::class)->create(['name' => 'Task 1']);
+ factory(Task::class)->create(['name' => 'Task 2']);
+ factory(Task::class)->create(['name' => 'Task 3']);
+
+ $this->visit($this->rootURL)
+ ->see('Task 1')
+ ->see('Task 2')
+ ->see('Task 3')
+ ->seeInDatabase('tasks', [
+ 'name' => 'Task 1',
+ ])
+ ->seeInDatabase('tasks', [
+ 'name' => 'Task 2',
+ ])
+ ->seeInDatabase('tasks', [
+ 'name' => 'Task 3',
+ ]);
+ }
+}

0 comments on commit 4a6b32c

Please sign in to comment.