Laravel Dusk: Timeout with the first test in the Class Hello, I'm facing a weird issue ...
The first test in my class got a timeout, if i duplicate it with "2" in the end of the function name, it's work Oo.
My driver and chromer are updated !
<?php
namespace Tests\Browser\Controllers\FollowController;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use Throwable;
class FollowProductToggleTest extends DuskTestCase {
/**
* @test
* @throws Throwable
*/
public function followProductGuestTest(): void {
$this->browse(function (Browser $browser) {
$browser->visit(route('homepage'));
$browser->assertPresent('#show-login');
$browser->waitFor('#products-list .product:first-child [data-follow]');
$browser->script("document.querySelector('#products-list .product:first-child [data-follow]').scrollIntoView({ block: 'center' });");
$browser->click('#products-list .product:first-child [data-follow]');
$browser->waitFor('.flash-info');
$browser->assertPresent('.flash-info.show');
});
}
/**
* @test
* @throws Throwable
*/
public function followProductGuest2Test(): void {
$this->browse(function (Browser $browser) {
$browser->visit(route('homepage'));
$browser->assertPresent('#show-login');
$browser->waitFor('#products-list .product:first-child [data-follow]');
$browser->script("document.querySelector('#products-list .product:first-child [data-follow]').scrollIntoView({ block: 'center' });");
$browser->click('#products-list .product:first-child [data-follow]');
$browser->waitFor('.flash-info');
$browser->assertPresent('.flash-info.show');
});
}
/**
* @test
* @throws Throwable
*/
public function followProductUserTest(): void {
$this->browse(function (Browser $browser) {
$browser->visit(route('homepage'));
$browser->assertPresent('#show-login');
$browser->click('#show-login');
$browser->waitFor('.side-auth-content.show');
if($browser->value('input[name="login[email]"]') == "") $browser->keys('input[name="login[email]"]', '[email protected] ');
if($browser->value('input[name="login[password]"]') == "") $browser->keys('input[name="login[password]"]', '1234');
$browser->press('#form-login_submit');
$browser->waitUntilMissing('#form-login_submit');
$browser->waitFor('#products-list .product:first-child [data-follow]');
$browser->script("document.querySelector('#products-list .product:first-child [data-follow]').scrollIntoView({ block: 'center' });");
$browser->click('#products-list .product:first-child [data-follow]');
$browser->waitFor('.flash-success');
$browser->assertPresent('.flash-success.show');
});
}
}
Do you know how can i fixe it ? I don't konw where i should look to give more information to help you ....
Hello, Little up,
I should add a fakeTest at the begining of all my test files ^^'
/**
* @test
* @throws Throwable
*/
public function fakeTest(): void {
$this->browse(function (Browser $browser) {
$browser->visit(route('homepage'));
$browser->assertPresent('#show-login');
});
}
I still have this issue ... ='(
I still have my issue, there is a screenshot. All my dusk Class begin by fakeTest ...
No answer ? Does anyone have a lead ?
Am I the only one with this problem ?
Arrrgggggghhhhh I finally found the solution. In my laravel dusk configuration, driver function, the headless was '--headless=new' and not '--headless'
If anyone have the problem ...
Please sign in or create an account to participate in this conversation.