Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera

uno-de-piera/DatatablesTest.php Secret

Created May 31, 2020
Embed
What would you like to do?
<?php
namespace Tests\Browser;
use App\User;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
/**
* Class DatatablesTest
* @package Tests\Browser
* @group datatables
*/
class DatatablesTest extends DuskTestCase
{
use DatabaseMigrations;
public function testDatatablesCheckLoad()
{
factory(User::class, 10)->create();
$user = User::find(2);
$this->browse(function ($browser) use($user)
{
$browser->loginAs($user)
->visit('/users/datatables')
//->pause(500) //peticiones ajax
->waitForText('Siguiente')
->with('.table', function (Browser $table) use ($user)
{
$table->assertSee($user->email);
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment