nightwatch.conf.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. // Autogenerated by Nightwatch
  2. // Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
  3. const Services = {}; loadServices();
  4. module.exports = {
  5. // An array of folders (excluding subfolders) where your tests are located;
  6. // if this is not specified, the test source must be passed as the second argument to the test runner.
  7. src_folders: [],
  8. // See https://nightwatchjs.org/guide/working-with-page-objects/
  9. page_objects_path: '',
  10. // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands
  11. custom_commands_path: '',
  12. // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions
  13. custom_assertions_path: '',
  14. // See https://nightwatchjs.org/guide/#external-globals
  15. globals_path : '',
  16. webdriver: {},
  17. test_settings: {
  18. default: {
  19. disable_error_log: false,
  20. launch_url: 'http://localhost:5000',
  21. screenshots: {
  22. enabled: false,
  23. path: 'screens',
  24. on_failure: true
  25. },
  26. desiredCapabilities: {
  27. browserName : 'firefox'
  28. },
  29. webdriver: {
  30. start_process: true,
  31. server_path: (Services.geckodriver ? Services.geckodriver.path : '')
  32. }
  33. },
  34. safari: {
  35. desiredCapabilities : {
  36. browserName : 'safari',
  37. alwaysMatch: {
  38. acceptInsecureCerts: false
  39. }
  40. },
  41. webdriver: {
  42. port: 4445,
  43. start_process: true,
  44. server_path: '/usr/bin/safaridriver'
  45. }
  46. },
  47. firefox: {
  48. desiredCapabilities : {
  49. browserName : 'firefox',
  50. alwaysMatch: {
  51. // Enable this if you encounter unexpected SSL certificate errors in Firefox
  52. // acceptInsecureCerts: true,
  53. 'moz:firefoxOptions': {
  54. args: [
  55. // '-headless',
  56. // '-verbose'
  57. ],
  58. }
  59. }
  60. },
  61. webdriver: {
  62. start_process: true,
  63. port: 5555,
  64. server_path: (Services.geckodriver ? Services.geckodriver.path : ''),
  65. cli_args: [
  66. // very verbose geckodriver logs
  67. // '-vv'
  68. '--port',
  69. '5555'
  70. ]
  71. }
  72. },
  73. chrome: {
  74. desiredCapabilities : {
  75. browserName : 'chrome',
  76. chromeOptions : {
  77. // This tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
  78. // w3c: false,
  79. // More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
  80. args: [
  81. //'--no-sandbox',
  82. //'--ignore-certificate-errors',
  83. //'--allow-insecure-localhost',
  84. //'--headless'
  85. ]
  86. }
  87. },
  88. webdriver: {
  89. start_process: true,
  90. port: 9515,
  91. server_path: (Services.chromedriver ? Services.chromedriver.path : ''),
  92. cli_args: [
  93. // --verbose
  94. ]
  95. }
  96. },
  97. //////////////////////////////////////////////////////////////////////////////////
  98. // Configuration for when using the Selenium service, either locally or remote, |
  99. // like Selenium Grid |
  100. //////////////////////////////////////////////////////////////////////////////////
  101. selenium: {
  102. // Selenium Server is running locally and is managed by Nightwatch
  103. selenium: {
  104. start_process: true,
  105. port: 4444,
  106. server_path: (Services.seleniumServer ? Services.seleniumServer.path : ''),
  107. cli_args: {
  108. 'webdriver.gecko.driver': (Services.geckodriver ? Services.geckodriver.path : ''),
  109. 'webdriver.chrome.driver': (Services.chromedriver ? Services.chromedriver.path : ''),
  110. 'webdriver.ie.driver': (Services.iedriver ? Services.iedriver.path : '')
  111. }
  112. }
  113. },
  114. 'selenium.chrome': {
  115. extends: 'selenium',
  116. desiredCapabilities: {
  117. browserName: 'chrome',
  118. chromeOptions : {
  119. w3c: false
  120. }
  121. }
  122. },
  123. 'selenium.firefox': {
  124. extends: 'selenium',
  125. desiredCapabilities: {
  126. browserName: 'firefox',
  127. 'moz:firefoxOptions': {
  128. args: [
  129. // '-headless',
  130. // '-verbose'
  131. ]
  132. }
  133. }
  134. },
  135. 'ie': {
  136. extends: 'selenium',
  137. desiredCapabilities: {
  138. browserName: 'internet explorer'
  139. }
  140. },
  141. }
  142. };
  143. function loadServices() {
  144. try {
  145. Services.seleniumServer = require('selenium-server');
  146. } catch (err) {}
  147. try {
  148. Services.chromedriver = require('chromedriver');
  149. } catch (err) {}
  150. try {
  151. Services.geckodriver = require('geckodriver');
  152. } catch (err) {}
  153. try {
  154. Services.iedriver = require('iedriver');
  155. } catch (err) {}
  156. }