title: logging in with cypress/puppeteer
body: <p>I have an application that uses Okta to log in. I am trying to set up an automation test using Cypress with Puppeteer. The problem I am having is that when I launch puppeteer with <code>{headless: true}</code>, it doesn't fill in the login form. <code>{headless: false}</code> opens another browser window outside of Cypress and works as expected. It fills in the login form, logs in correctly, but I can't run any cypress tests in that window.</p>
  
  <pre><code>on('task', {
    login({username, password}) {
      return (async () =&gt; {
        const browser = await puppeteer.launch({headless: false});
        const page = await browser.newPage();
        await page.goto(config.baseUrl);
        await page.waitForNavigation();
        await page.waitFor('#okta-signin-username');
        await page.type('#okta-signin-username', username, {delay: 100});
        await page.waitFor('#okta-signin-password');
        await page.type('#okta-signin-password', password, {delay: 100});
        await page.click('#okta-signin-submit');
        await page.waitForNavigation();
        return true;
      };
    });
  </code></pre>
  
  <p>Here's how it's being used:</p>
  
  <pre><code>it('my test', () =&gt; {
    cy.visit('/');
    cy.viewport(1280, 1024);
    cy.login('username', 'password');
  
    //tests go here
  });
  </code></pre>
  
  <p>The above code opens Chromium and correctly logs in but then the tests fail. It doesn't log in with {headless: true}. Am I missing something here?
  Any help would be appreciated.</p>
  
  <p>Thanks</p>