LP#1989195: (follow-up) flesh out Chrome e2e options
[evergreen-equinox.git] / Open-ILS / src / eg2 / nightwatch.conf.js
1 // Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
2 const Services = {}; loadServices();
3
4 //  _   _  _         _      _                     _          _
5 // | \ | |(_)       | |    | |                   | |        | |
6 // |  \| | _   __ _ | |__  | |_ __      __  __ _ | |_   ___ | |__
7 // | . ` || | / _` || '_ \ | __|\ \ /\ / / / _` || __| / __|| '_ \
8 // | |\  || || (_| || | | || |_  \ V  V / | (_| || |_ | (__ | | | |
9 // \_| \_/|_| \__, ||_| |_| \__|  \_/\_/   \__,_| \__| \___||_| |_|
10 //             __/ |
11 //            |___/
12
13 module.exports = {
14   // An array of folders (excluding subfolders) where your tests are located;
15   // if this is not specified, the test source must be passed as the second argument to the test runner.
16   src_folders: ['nightwatch/src'],
17
18   filter: ['**/*.spec.ts'],
19
20   // See https://nightwatchjs.org/guide/working-with-page-objects/
21   page_objects_path: ['nightwatch/pages/**'],
22
23   // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands
24   custom_commands_path: '',
25
26   // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions
27   custom_assertions_path: '',
28
29   // See https://nightwatchjs.org/guide/#external-globals
30   globals_path : '',
31
32   webdriver: {},
33
34   test_settings: {
35     default: {
36       disable_error_log: false,
37       launch_url: 'https://localhost',
38
39       screenshots: {
40         enabled: false,
41         path: 'screens',
42         on_failure: true
43       },
44
45       desiredCapabilities: {
46         browserName : 'firefox',
47         acceptInsecureCerts: true
48       },
49
50       webdriver: {
51         start_process: true,
52         server_path: ''
53       }
54     },
55
56     firefox: {
57       desiredCapabilities : {
58         browserName : 'firefox',
59         alwaysMatch: {
60           acceptInsecureCerts: true,
61           'moz:firefoxOptions': {
62             args: [
63               //'-headless',
64               // '-verbose'
65             ]
66           }
67         }
68       },
69       webdriver: {
70         start_process: true,
71         server_path: '',
72         cli_args: [
73           // very verbose geckodriver logs
74           // '-vv'
75         ]
76       }
77     },
78     // To test with chrome:
79     // $ npm install --save-dev chromedriver
80     // $ ng e2e --env chrome
81     chrome: {
82       desiredCapabilities : {
83         browserName : 'chrome',
84         alwaysMatch: {
85           acceptInsecureCerts: true,
86         }
87       },
88       webdriver: {
89         start_process: true,
90         server_path: '',
91         cli_args: [
92         ]
93       }
94     },
95     // $ ng e2e --env chrome-headless
96     'chrome-headless': {
97       desiredCapabilities : {
98         browserName : 'chrome',
99         alwaysMatch: {
100           acceptInsecureCerts: true,
101         },
102         chromeOptions : {
103             args: ['headless', 'no-sandbox', 'disable-gpu']
104         },
105         chromeOptions : {
106             args: ['headless', 'no-sandbox', 'disable-gpu']
107         }
108       },
109       webdriver: {
110         start_process: true,
111         server_path: '',
112         cli_args: [
113         ]
114       }
115     }
116   }
117 };
118
119 function loadServices() {
120   try {
121     Services.seleniumServer = require('selenium-server');
122   } catch (err) {}
123
124   try {
125     Services.chromedriver = require('chromedriver');
126   } catch (err) {}
127
128   try {
129     Services.geckodriver = require('geckodriver');
130   } catch (err) {}
131 }