From 9d7dea881d8a14c1a7e66ac805723329b462fb65 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 9 May 2023 10:53:39 -0400 Subject: [PATCH] LP#1989195: (follow-up) flesh out Chrome e2e options - add instructions to the cheat sheet - add a chrome-headless mode Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/CHEAT_SHEET.adoc | 12 ++++++++++++ Open-ILS/src/eg2/nightwatch.conf.js | 23 ++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletions(-) diff --git a/Open-ILS/src/eg2/CHEAT_SHEET.adoc b/Open-ILS/src/eg2/CHEAT_SHEET.adoc index e44ed3f..610d241 100644 --- a/Open-ILS/src/eg2/CHEAT_SHEET.adoc +++ b/Open-ILS/src/eg2/CHEAT_SHEET.adoc @@ -8,9 +8,21 @@ npm update npm install ng lint # check code formatting npm run test # unit tests + +# run end-to-end tests using Firefox ng e2e # end-to-end tests, be sure to set # MOZ_HEADLESS=1 if you aren't # running x11 + +# run end-to-end tests using Chrome +npm install --save-dev chromedriver # install ChromeDrive; you may + # need to tack on "@VERSION" + # to match the version of Chromium + # available to you +ng e2e --env chrome # ... if you have X11 +ng e2e --env chrome-headless # ... if you don't have X11 + + ng build --watch # compile dev mode ng build --configuration=production # compile production mode --------------------------------------------------------------------- diff --git a/Open-ILS/src/eg2/nightwatch.conf.js b/Open-ILS/src/eg2/nightwatch.conf.js index 4c26883..f89e639 100644 --- a/Open-ILS/src/eg2/nightwatch.conf.js +++ b/Open-ILS/src/eg2/nightwatch.conf.js @@ -77,7 +77,7 @@ module.exports = { }, // To test with chrome: // $ npm install --save-dev chromedriver - // $ ng e2e --evn chrome + // $ ng e2e --env chrome chrome: { desiredCapabilities : { browserName : 'chrome', @@ -91,6 +91,27 @@ module.exports = { cli_args: [ ] } + }, + // $ ng e2e --env chrome-headless + 'chrome-headless': { + desiredCapabilities : { + browserName : 'chrome', + alwaysMatch: { + acceptInsecureCerts: true, + }, + chromeOptions : { + args: ['headless', 'no-sandbox', 'disable-gpu'] + }, + chromeOptions : { + args: ['headless', 'no-sandbox', 'disable-gpu'] + } + }, + webdriver: { + start_process: true, + server_path: '', + cli_args: [ + ] + } } } }; -- 1.7.2.5