browse(function ($browser) { $browser->visit('/micropub/create') ->assertSee('You are authenticated'); }); } public function test_client_page_creates_new_note() { $faker = \Faker\Factory::create(); $note = $faker->text; $this->browse(function ($browser) use ($note) { $browser->visit(route('micropub-client')) ->type('textarea[name="content"]', $note) ->press('submit'); sleep(2); $this->assertDatabaseHas('notes', ['note' => $note]); }); //reset database $newNote = \App\Note::where('note', $note)->first(); $newNote->forceDelete(); } }