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:
- Finds the username field
- Inputs the proper email address, and clicks next
- Enters the password to log in
- Once it passes Google Authentication, it verifies the title of the page is "Expense"
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
- Finding the username field
- Inputting the proper test email address
0 h1 tags identified Expense App E2E Initial Test Suite index page for Expense should work just fine
- [31m✗ should sign in correctly with test user·[39m
- [31m- ·[39m·[31mFailed: No element found using locator: By(css selector, *[id="identifierId"])
- [39m at elementArrayFinder.getWebElements.then (/codebuild/output/src609592849/src/node_modules/protractor/built/element.js:814:27)
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
Angular could not be found on the page
which makes no sense since it's an SPA – 0CDc0d3r