title: Angular/ Protractor E2E Test fails when run in Azure DevOps Pipeline. Passes locally
body: <p>I am trying to run e2e tests on my angular application. My tests pass locally when I run <code>ng e2e</code> but not in my pipeline. I'm going to share my protractor.conf, the pipeline tasks and the output I get from the task that fails below.</p>
  
  <p>Some more background:</p>
  
  <ul>
  <li>I am trying to run e2e code from an otherwise empty angular app. The
  test I am trying to run simply logs into AD by navigating to my
  website, entering a username/ password and then checking the that the
  user is redirected to my website.</li>
  <li>I am running this from a release
  pipeline where the repo containing the e2e tests is added as an
  artifact.</li>
  <li>I am using xpaths to find elements on the page</li>
  <li>I've omitted my jasmine code because I do not think it is relevant since the tests pass locally. However, if I'm wrong on this point let me know and I will post it.</li>
  </ul>
  
  <p><strong>protractor.conf.js</strong></p>
  
  <pre><code>const { SpecReporter } = require('jasmine-spec-reporter');
  
  process.env.CHROME_BIN = process.env.CHROME_BIN || require("puppeteer").executablePath();
  
  exports.config = {
    allScriptsTimeout: 11000,
    specs: [
      './src/**/*.e2e-spec.ts'
    ],
    capabilities: {
      chromeOptions: {
        args: ["--headless", "--disable-gpu", "--window-size=1200,900"],
        binary: process.env.CHROME_BIN
      },
      'browserName': 'chrome'
    },
    directConnect: true,
    baseUrl: 'http://localhost:4200/',
    framework: 'jasmine',
    jasmineNodeOpts: {
      showColors: true,
      defaultTimeoutInterval: 120000,
      print: function() {}
    },
    onPrepare() {
      require('ts-node').register({
        project: require('path').join(__dirname, './tsconfig.e2e.json')
      });
      jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
    }
  };
  </code></pre>
  
  <p><strong>Pipeline Tasks:</strong><br>
  <a href="https://i.stack.imgur.com/0ijm6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0ijm6.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/e62yE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e62yE.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/fEQcT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fEQcT.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/8cfgp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8cfgp.png" alt="enter image description here"></a></p>
  
  <p>Failed Task Output:
  <a href="https://i.stack.imgur.com/HOlRr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HOlRr.png" alt="enter image description here"></a></p>
  
  <p>Please help me get these tests to pass in azure</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: I have that 'Update Webdriver' task because I read I should do it somewhere, it doesn't actually change the outcome if it is there or not</p>