I have a webpage that requires Google Authentication before proceeding to an angular web page, and I've built some very basic end-to-end tests, which work like a charm in Linux with Chrome Headless:
Here's the final message I get in the Terminal: Executed 3 of 3 specs SUCCESS in 46 secs.
In AWS CodeBuild, though, we are ALSO using a Linux (Ubuntu) container, and that fails every single time.
Here's the first error:
...
Jasmine started
0 h1 tags identified Expense App E2E Initial Test Suite index page for Expense should work just fine
Here's the setup info in protractor.conf.js:
capabilities: {
'browserName': 'chrome',
chromeOptions: {
args: ["--headless", "--disable-dev-shm-usage", "--no-sandbox", "--disable-gpu", "--window-size=1280x960"]
}
},
directConnect: true, // Test scripts communicate directly with Chrome Driver, so they start up and run faster
From the package.json, I'm using: "e2e": "ng e2e --port 4200",
From the buildspec-test.yml, I have the following post_build command: - npm run e2e
Why does Chrome Headless find my webpage on http://localhost:4200 without issue on my local Linux issue, but fails to find it in AWS CodeBuild when they BOTH run Ubuntu Linux? Local version: Ubuntu 18.04.1 LTS AWS CodeBuild version: Ubuntu Ubuntu 14.04.5 LTS (Trusty)
Please let me know, and thanks in advance!
Sincerely,
PW
Yes, I do have this answer. A friend and coworker (Thanks, Bill T.) was able to create a Docker container with Ubuntu 18.04LTS, and let me run it within AWS CodeBuild, where it worked. This proved the issue: You cannot use headless chrome with the older Ubuntu 14.04.5 LTS. Start with nothing older than Ubuntu 18.04 LTS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With