{"size": 2428, "ext": "js", "max_stars_repo_path": "nightwatch.conf.js", "max_stars_repo_name": "TheScienceMuseum/collectionsonline", "max_stars_repo_stars_event_min_datetime": "2016-06-12T16:27:35.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-19T22:49:50.000Z", "max_issues_repo_path": "nightwatch.conf.js", "max_issues_repo_name": "TheScienceMuseum/collectionsonline", "max_issues_repo_issues_event_min_datetime": "2016-06-13T10:34:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T15:22:19.000Z", "max_forks_repo_path": "nightwatch.conf.js", "max_forks_repo_name": "TheScienceMuseum/collectionsonline", "max_forks_repo_forks_event_min_datetime": "2016-06-28T09:47:14.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-01T02:51:08.000Z"}
{"max_stars_count": 44, "max_issues_count": 1278, "max_forks_count": 6, "avg_line_length": 24.7755102041, "max_line_length": 74, "alphanum_fraction": 0.5733113674}
const fs = require('fs');
const binpath = './node_modules/nightwatch/bin/';
const TRAVIS_JOB_NUMBER = process.env.TRAVIS_JOB_NUMBER;
const SELENIUM_PORT = process.env.NW_ENV === 'travis' ? 4445 : 4444;

module.exports = {
  src_folders: ['test/client'],
  output_folder: 'reports',
  custom_commands_path: '',
  custom_assertions_path: '',
  page_objects_path: '',
  globals_path: '',

  selenium: {
    start_process: true,
    server_path: binpath + 'selenium.jar',
    log_path: '',
    host: '127.0.0.1',
    port: SELENIUM_PORT,
    cli_args: {
      'webdriver.chrome.driver': binpath + 'chromedriver'
    }
  },

  test_settings: {
    travis: {
      launch_url: 'ondemand.saucelabs.com:80',
      selenium_port: 80,
      selenium_host: 'ondemand.saucelabs.com',
      silent: true,
      username: process.env.SAUCE_USERNAME,
      access_key: process.env.SAUCE_ACCESS_KEY,
      screenshots: {
        enabled: false,
        path: ''
      },
      globals: {
        waitForConditionTimeout: 10000
      },
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          w3c: false,
          args: ['--disable-dev-shm-usage']
        },
        javascriptEnabled: true,
        acceptSslCerts: true,
        build: `build-${TRAVIS_JOB_NUMBER}`,
        'tunnel-identifier': TRAVIS_JOB_NUMBER
      }
    },

    default: {
      launch_url: 'http://localhost',
      selenium_port: 4444,
      selenium_host: 'localhost',
      silent: true,
      screenshots: {
        enabled: false,
        path: ''
      },
      globals: {
        waitForConditionTimeout: 10000
      },
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          w3c: false,
          args: ['--disable-dev-shm-usage']
        },
        javascriptEnabled: true,
        acceptSslCerts: true
      }
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          w3c: false,
          args: ['--disable-dev-shm-usage']
        },
        javascriptEnabled: true,
        acceptSslCerts: true
      }
    }
  }
};

fs.stat(binpath + 'selenium.jar', function (err, stat) {
  if (err || !stat || stat.size < 1) {
    // require('selenium-download').ensure(binpath, function (error) {
    //   if (error) throw new Error(error);
    //   console.log('✔ Selenium & Chromedriver downloaded to:', binpath);
    // });
  }
});
