Closed hughgrigg closed 4 years ago
The test should use visit()
and not get()
:
<?php
namespace Tests\Feature;
use Tests\TestCase;
class ContinueTest extends TestCase
{
public function testContinue()
{
$this->visit('/')->assertResponseOk()->see('Continue');
$this->click('Continue');
}
}
What if I want to check redirect and click in one test?
visit
doesn't see redirect, but click
requires visit
Description:
Getting an error from
InteractsWithPages
sayingCall to a member function selectLink() on null
when trying to run a browser kit test. Looks likecrawler
is null on the class at that point.Steps To Reproduce:
composer require laravel/browser-kit-testing --dev
as in the documentation.Test looks like this:
The parent
Tests\TestCase
class looks like this: