<commit_before>'use strict'

import path from 'path'
import fs from 'fs'
import ejs from 'ejs'
import npmInstallPackage from 'npm-install-package'
import inquirer from 'inquirer'
import optimist from 'optimist'

import Launcher from './launcher'
import pkg from '../package.json'

/**
 * 💌 Dear contributors 💌
 * ========================================================================
 * If you are awesome and have created a new reporter, service or framework
 * adaption feel free to add it to this list and make a PR so people know
 * that your add-on is available and supported. Thanks, you 🚀!
 * ========================================================================
 */
const SUPPORTED_FRAMEWORKS = [
    'mocha',   // https://github.com/webdriverio/wdio-mocha-framework
    'jasmine', // https://github.com/webdriverio/wdio-jasmine-framework
    'cucumber' // https://github.com/webdriverio/wdio-cucumber-framework
]
const SUPPORTED_REPORTER = [
    ' dot - https://github.com/webdriverio/wdio-dot-reporter',
    ' junit - https://github.com/webdriverio/wdio-junit-reporter',
    ' allure - https://github.com/webdriverio/wdio-allure-reporter'
]
const SUPPORTED_SERVICES = [
    ' sauce - https://github.com/webdriverio/wdio-sauce-service'
]

const VERSION = pkg.version
const ALLOWED_ARGV = ['host', 'port', 'path', 'user', 'key', 'logLevel', 'coloredLogs', 'screenshotPath',
                      'baseUrl', 'waitforTimeout', 'framework', 'reporters', 'suite', 'cucumberOpts', 'jasmineOpts', 'mochaOpts',
                      'connectionRetryTimeout', 'connectionRetryCount']

optimist
    .usage('WebdriverIO CLI runner\n\n' +
        'Usage: wdio [options] [configFile]\n' +
        'config file defaults to wdio.conf.js\n' +
        'The [options] object will override values from the config file.')

    .describe('help', 'prints WebdriverIO help menu')
    .alias('help', 'h')
    .describe('version', 'prints WebdriverIO version')
    .alias('version', 'v')
    .describe('host', 'Selenium server host address')
    .describe('port', 'Selenium server port')
    .describe('path', 'Selenium server path (default: /wd/hub)')
    .describe('user', 'username if using a cloud service as Selenium backend')
    .alias('user', 'u')
    .describe('key', 'corresponding access key to the user')
    .alias('key', 'k')
    .describe('logLevel', 'level of logging verbosity (default: silent)')
    .alias('logLevel', 'l')
    .describe('coloredLogs', 'if true enables colors for log output (default: true)')
    .alias('coloredLogs', 'c')
    .describe('screenshotPath', 'saves a screenshot to a given path if a command fails')
    .alias('screenshotPath', 's')
    .describe('baseUrl', 'shorten url command calls by setting a base url')
    .alias('baseUrl', 'b')
    .describe('waitforTimeout', 'timeout for all waitForXXX commands (default: 500ms)')
    .alias('waitforTimeout', 'w')
    .describe('framework', 'defines the framework (Mocha, Jasmine or Cucumber) to run the specs (default: mocha)')
    .alias('framework', 'f')
    .describe('reporters', 'reporter to print out the results on stdout')
    .alias('reporters', 'r')
    .describe('suite', 'overwrites the specs attribute and runs the defined suite')
    .describe('cucumberOpts.*', 'Cucumber options, see the full list options at https://github.com/webdriverio/wdio-cucumber-framework#cucumberopts-options')
    .describe('jasmineOpts.*', 'Jasmine options, see the full list options at https://github.com/webdriverio/wdio-jasmine-framework#jasminenodeopts-options')
    .describe('mochaOpts.*', 'Mocha options, see the full list options at http://mochajs.org')

    .check((arg) => {
        if (arg._.length > 1) {
            throw new Error('Error: more than one config file specified')
        }
    })

let argv = optimist.parse(process.argv.slice(2))

if (argv.help) {
    optimist.showHelp()
    process.exit(0)
}

if (argv.version) {
    console.log(`v${VERSION}`)
    process.exit(0)
}

/**
 * use wdio.conf.js default file name if no config was specified
 * otherwise run config sequenz
 */
let configFile = argv._[0]
if (!configFile) {
    if (fs.existsSync('./wdio.conf.js')) {
        configFile = './wdio.conf.js'
    } else {
        argv._[0] = 'config'
    }
}

let configMode = false
if (argv._[0] === 'config') {
    configMode = true
    console.log(`
=========================
WDIO Configuration Helper
=========================
`)
    inquirer.prompt([{
        type: 'list',
        name: 'backend',
        message: 'Where do you want to execute your tests?',
        choices: [
            'On my local machine',
            'In the cloud using Sauce Labs, Browsertack or Testingbot',
            'In the cloud using a different service',
            'I have my own Selenium cloud'
        ]<commit_msg>minor wording [ci skip]<commit_after>'use strict'

import path from 'path'
import fs from 'fs'
import ejs from 'ejs'
import npmInstallPackage from 'npm-install-package'
import inquirer from 'inquirer'
import optimist from 'optimist'

import Launcher from './launcher'
import pkg from '../package.json'

/**
 * 💌 Dear contributors 💌
 * ========================================================================
 * If you are awesome and have created a new reporter, service or framework
 * adaption feel free to add it to this list and make a PR so people know
 * that your add-on is available and supported. Thanks, you 🚀!
 * ========================================================================
 */
const SUPPORTED_FRAMEWORKS = [
    'mocha',   // https://github.com/webdriverio/wdio-mocha-framework
    'jasmine', // https://github.com/webdriverio/wdio-jasmine-framework
    'cucumber' // https://github.com/webdriverio/wdio-cucumber-framework
]
const SUPPORTED_REPORTER = [
    ' dot - https://github.com/webdriverio/wdio-dot-reporter',
    ' junit - https://github.com/webdriverio/wdio-junit-reporter',
    ' allure - https://github.com/webdriverio/wdio-allure-reporter'
]
const SUPPORTED_SERVICES = [
    ' sauce - https://github.com/webdriverio/wdio-sauce-service'
]

const VERSION = pkg.version
const ALLOWED_ARGV = ['host', 'port', 'path', 'user', 'key', 'logLevel', 'coloredLogs', 'screenshotPath',
                      'baseUrl', 'waitforTimeout', 'framework', 'reporters', 'suite', 'cucumberOpts', 'jasmineOpts', 'mochaOpts',
                      'connectionRetryTimeout', 'connectionRetryCount']

optimist
    .usage('WebdriverIO CLI runner\n\n' +
        'Usage: wdio [options] [configFile]\n' +
        'config file defaults to wdio.conf.js\n' +
        'The [options] object will override values from the config file.')

    .describe('help', 'prints WebdriverIO help menu')
    .alias('help', 'h')
    .describe('version', 'prints WebdriverIO version')
    .alias('version', 'v')
    .describe('host', 'Selenium server host address')
    .describe('port', 'Selenium server port')
    .describe('path', 'Selenium server path (default: /wd/hub)')
    .describe('user', 'username if using a cloud service as Selenium backend')
    .alias('user', 'u')
    .describe('key', 'corresponding access key to the user')
    .alias('key', 'k')
    .describe('logLevel', 'level of logging verbosity (default: silent)')
    .alias('logLevel', 'l')
    .describe('coloredLogs', 'if true enables colors for log output (default: true)')
    .alias('coloredLogs', 'c')
    .describe('screenshotPath', 'saves a screenshot to a given path if a command fails')
    .alias('screenshotPath', 's')
    .describe('baseUrl', 'shorten url command calls by setting a base url')
    .alias('baseUrl', 'b')
    .describe('waitforTimeout', 'timeout for all waitForXXX commands (default: 500ms)')
    .alias('waitforTimeout', 'w')
    .describe('framework', 'defines the framework (Mocha, Jasmine or Cucumber) to run the specs (default: mocha)')
    .alias('framework', 'f')
    .describe('reporters', 'reporter to print out the results on stdout')
    .alias('reporters', 'r')
    .describe('suite', 'overwrites the specs attribute and runs the defined suite')
    .describe('cucumberOpts.*', 'Cucumber options, see the full list options at https://github.com/webdriverio/wdio-cucumber-framework#cucumberopts-options')
    .describe('jasmineOpts.*', 'Jasmine options, see the full list options at https://github.com/webdriverio/wdio-jasmine-framework#jasminenodeopts-options')
    .describe('mochaOpts.*', 'Mocha options, see the full list options at http://mochajs.org')

    .check((arg) => {
        if (arg._.length > 1) {
            throw new Error('Error: more than one config file specified')
        }
    })

let argv = optimist.parse(process.argv.slice(2))

if (argv.help) {
    optimist.showHelp()
    process.exit(0)
}

if (argv.version) {
    console.log(`v${VERSION}`)
    process.exit(0)
}

/**
 * use wdio.conf.js default file name if no config was specified
 * otherwise run config sequenz
 */
let configFile = argv._[0]
if (!configFile) {
    if (fs.existsSync('./wdio.conf.js')) {
        configFile = './wdio.conf.js'
    } else {
        argv._[0] = 'config'
    }
}

let configMode = false
if (argv._[0] === 'config') {
    configMode = true
    console.log(`
=========================
WDIO Configuration Helper
=========================
`)
    inquirer.prompt([{
        type: 'list',
        name: 'backend',
        message: 'Where do you want to execute your tests?',
        choices: [
            'On my local machine',
            'In the cloud using Sauce Labs, Browserstack or Testingbot',
            'In the cloud using a different service',
            'I have my own Selenium cloud'
        ]
{'fraction_non_alphanumeric': 0.1785677164535911, 'fraction_numerical': 0.0020787859889824342, 'mean_word_length': 3.492063492063492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '441593', 'n_tokens_mistral': 3051, 'n_tokens_neox': 2899, 'n_words': 841}