title: Testing Error messages to be shown for user
body: <p>I'm trying to write a test to assert that my login page displays an error when the user enters an incorrect username or password.</p>
  
  <pre><code>    @if ($errors-&gt;any())
        &lt;p&gt;Looks like you’ve entered the wrong username or password. 
          &lt;a href="{{route('password.request')}}"&gt;
             Click here&lt;/a&gt; to reset your  password“ &lt;/p&gt;&lt;/div&gt;
      @endif        
  </code></pre>
  
  <p>The functionality is working fine and I can see the errors on page, but for some reason, I can't get my test to pass.</p>
  
  <p>->assertSessionHasErrors() is working fine, while ->assertSeeText() is not detecting the error messages in text.
  `</p>
  
  <pre><code>public function userSeesErrorMessage() {
    $user = factory('App\User')-&gt;create([
          'password' =&gt; bcrypt($password = 'test'),
      ]);
      $response = $this-&gt;followingRedirects()
      -&gt;post('/login', [
          'email' =&gt; $user-&gt;email,
          'password' =&gt; 'incorrectPassword'
      ]);
      $response-&gt;assertSeeText('Looks like you’ve entered the wrong username or password. Click here to reset your password');
  }`
  </code></pre>
  
  <p>The response seem to contain the whole document's HTML, except for the part about the errors.</p>
  
  <p>Any help would be much appreciated.</p>