phpunit - Laravel dusk changes the URL -


i have installed dusk laravel , since beginning tests have failed. instead of viewing page want return 404 error.

in order find out url test trying go instead of 1 want set custom 404 page , put following code in it:

$_server['request_uri']

now test return url tries , found adds "/session" end of url example if try check:

'http://localhost/', desiredcapabilities::chrome()

the test returns

<p>the requested url /session not found on server.</p>

if set url this:

'http://localhost/fortest', desiredcapabilities::chrome()

the test return:

<p>the requested url /fortest/session not found on server.</p>

i don't know if has laravel/dusk or phpunit or selenium. appreciated.

as pointed out in answer your previous question important configure app_url match local development environment.

/sessions default session file location when using native session driver.

for start create remote web driver instance default selenium server url , port:

'http://localhost:9515', desiredcapabilities::chrome() 

then run first test located in browser/exampletest.php , validate current url.

you can dump current url this:

public function testbasicexample() {      $this->browse( function ( browser $browser ) {         $browser->visit( '/' );         var_dump( $browser->driver->getcurrenturl() );     } );  } 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -