"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0;
const base_config_1 = require("./base-config");
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return base_config_1.config; } });
const configuration_data_1 = require("./configuration-data");
const yargs_1 = __importDefault(require("yargs"));
const argv = yargs_1.default.options({
    browser: { type: 'string', demandOption: false },
    debug: { type: 'boolean', default: false },
    maxInstances: { type: 'number', demandOption: false }
}).parseSync();
base_config_1.config.capabilities = [
    {
        platform: 'ANY',
    },
];
base_config_1.config.cucumberOpts = {
    //   snippetSyntax: '',
    require: ['./test/e2e/steps/**/*.ts'],
    backtrace: true,
    failFast: false,
    snippets: false,
    source: true,
    profile: [],
    strict: true,
    tagsInTitle: true,
    timeout: 500000,
    ignoreUndefinedDefinitions: false,
    failAmbiguousDefinitions: true
};
base_config_1.config.specs = ['test/e2e/features/*.feature'];
if (argv.debug) {
    base_config_1.config.execArgv = ['--inspect'];
}
if (argv.browser === 'chrome') {
    base_config_1.config.capabilities = [
        {
            browserName: 'chrome',
            // 'goog:loggingPrefs': { browser: 'ALL', driver: 'ALL' },
            'goog:chromeOptions': {
                // To run chrome headless the following flags are required
                // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
                // Args: ['--headless', '--disable-gpu'],
                // args: [ 'disable-infobars' ],
                'excludeSwitches': ['enable-automation']
            },
        },
    ];
}
if (argv.browser === 'firefox') {
    base_config_1.config.capabilities = [
        {
            // MaxInstances can get overwritten per capability. So if you have an in house Selenium
            // Grid with only 5 firefox instance available you can make sure that n ot more than
            // 5 instance gets started at a time.
            maxInstances: 5,
            browserName: 'firefox',
            specs: ['test/ffOnly/*'],
            'moz:firefoxOptions': {
            // Flag to activate Firefox headless mode (see https://github.com/mozilla/geckodriver/blob/master/README.md#firefox-capabilities for more details about moz:firefoxOptions)
            // Args: ['-headless']
            },
            // If outputDir is provided WebdriverIO can capture driver session logs
            // It is possible to configure which logTypes to exclude.
            // ExcludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
            // ExcludeDriverLogs: ['bugreport', 'server'],
        },
    ];
}
if (typeof argv.generateSteps !== 'undefined') {
    base_config_1.config.cucumberOpts = {
        snippets: false,
        ignoreUndefinedDefinitions: false,
        require: ['./test/e2e/step-definitions/*.ts'], // <string[]> (file/dir) require files before executing features
    };
}
if (typeof argv.maxInstances !== 'undefined') {
    base_config_1.config.maxInstances = argv.maxInstances;
}
base_config_1.config.params = configuration_data_1.configurationParameters;
//# sourceMappingURL=local-conf.js.map