Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 31, 2020 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/94f24472a7c360ddadebad448c7d83dd to your computer and use it in GitHub Desktop.
Save uno-de-piera/94f24472a7c360ddadebad448c7d83dd to your computer and use it in GitHub Desktop.
<?php
public function testDatatablesPagination()
{
factory(User::class, 10)->create();
$userToLogin = User::find(2);
$userFirstOnNextPage = User::find(8);
$this->browse(function (Browser $browser) use($userToLogin, $userFirstOnNextPage)
{
$browser->loginAs($userToLogin)
->visit('/users/datatables')
->pause(1000) //peticiones ajax
->with('.table', function (Browser $table) use ($userToLogin)
{
$table->assertSee($userToLogin->email);
})
->assertSee('Siguiente')
->clickLink('Siguiente')
->pause(1000)
->assertSee($userFirstOnNextPage->email);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment