LP#1989195: (follow-up) flesh out Chrome e2e options
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 9 May 2023 14:53:39 +0000 (10:53 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 9 May 2023 14:54:25 +0000 (10:54 -0400)
- add instructions to the cheat sheet
- add a chrome-headless mode

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/eg2/CHEAT_SHEET.adoc
Open-ILS/src/eg2/nightwatch.conf.js

index e44ed3f..610d241 100644 (file)
@@ -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
 ---------------------------------------------------------------------
index 4c26883..f89e639 100644 (file)
@@ -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: [
+        ]
+      }
     }
   }
 };