public function chapterCreation(\BookStack\Book $book) { $chapter = factory(\BookStack\Chapter::class)->make(['name' => 'My First Chapter']); $this->asAdmin()->visit($book->getUrl())->click('New Chapter')->seePageIs($book->getUrl() . '/chapter/create')->type($chapter->name, '#name')->type($chapter->description, '#description')->press('Save Chapter')->seePageIs($book->getUrl() . '/chapter/my-first-chapter')->see($chapter->name)->see($chapter->description); $chapter = \BookStack\Chapter::where('slug', '=', 'my-first-chapter')->where('book_id', '=', $book->id)->first(); return $chapter; }