title: Angular protractor testing a login feature
body: <p>I want to test a login flow but with this code I get the following error:
    <strong>- Failed: No element found using locator: By(css selector, mat-simple-snackbar)</strong></p>
  
  <pre><code>  describe('After login', () =&gt; {
     it('should show login message', () =&gt; {
     const emailInput = element.all(by.xpath('//*[@id="mat-input-1"]'));
     const passwordInput = element.all(by.xpath('//*[@id="mat-input-2"]'));
     emailInput.sendKeys('user@domain.com');
     passwordInput.sendKeys('Passw0rd!');
  
    element(by.css('#mat-dialog-0 &gt; login-form')).click().then(() =&gt; {
      browser.waitForAngular().then(() =&gt; {
        const loginMessage = element(by.tagName('mat-simple-snackbar'));
        expect(loginMessage.getText()).toEqual('Du är nu inloggad');
      });
    });
   });
  });
  </code></pre>
  
  <p>When the .click() is triggered a dialog with the loginform closes and page loads, but the snack-bar can't be found?</p>