Level 50
try this
$this->visit('/product/1')
->see('Product #1');
$this->visit('/product/2')
->see('Product #2');
I am testing my Laravel 5.5 application with BrowserKitTestCase package. I receive an failure every time if I use visit() method more than one time in one single test, for example:
/* @test */
function my_simple_test(){
$this->visit('product/1')
->see('Product #1');
$this->visit('product/2')
->see('Product #2'); // assertion fails
}
but on the same time following tests are passed:
/* @test */
function my_simple_test_1(){
$this->visit('product/1')
->see('Product #1');
/* @test */
function my_simple_test_2(){
$this->visit('product/2')
->see('Product #2'); // assertion passes
}
Is it some possibility to use visit() few times in the same test? It was a case previously with Laravel 5.1.
UPDATE:
If I use visit() twice in the same test it looks like page is cached and on call $this->visit('product/2') I still see data from /product/1.
UPDATE-2:
It happens only if I visit the same route with different parameters, test like following is passed:
/* @test */
function my_simple_test(){
$this->visit('products')
->see('All Products');
$this->visit('product/2')
->see('Product #2'); // assertion passes
}
Please or to participate in this conversation.