LP1989195: Use nightwatch for e2e testing angular client
[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   }
79 };
80
81 function loadServices() {
82   try {
83     Services.seleniumServer = require('selenium-server');
84   } catch (err) {}
85
86   try {
87     Services.chromedriver = require('chromedriver');
88   } catch (err) {}
89
90   try {
91     Services.geckodriver = require('geckodriver');
92   } catch (err) {}
93 }