
import * as master from '@eui/automation/wdio.conf.js'
import EuiReporter from '@eui/automation/core/reporter/eui-reporter.js'
import testSuites from './suites.json' assert { type: "json" }
import userData from './userdata.json' assert { type: "json" }

export const config = Object.assign(master.config, {
  screenshot: 'fail',  // never, fail or always
  saveScreenshotToJson: false,
  browserlog: 'always',  // never, fail or always
  baseUrl: 'https://eui.ecdevops.eu/eui-showcase-ux-10.x',
  specs: ['./tests/**/*.spec.js'],
  logLevel: 'error',
  suites: testSuites,
  maxInstances: 3,
  capabilities: [
    {
      browserName: "chrome",
      "goog:chromeOptions": {
        // args: ['disable-infobars', '--headless=new', '--window-size=1920,1080', '--incognito'],
        args: ['disable-infobars', '--window-size=1920,1080', '--incognito'],
      },
      "goog:loggingPrefs": { browser: "ALL", driver: "ALL", performance: "ALL" },
    },
  ],
  app: 'EUI',
  env: 'TST',
  userenv: 'ACC',
  testUsers: ['xxx', 'yyy'],
  testUserData: userData,
  automationProtocol:'webdriver',
  services: [],
  reporters: ['spec',
    ['allure', {
      outputDir: 'allure-results-tst',
      reportDir: 'allure-report-tst',
      cleanBefore: true,
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: false,
      openReport: false // CAREFULL, should be false when run on CI execution or other execution agent
    }],
    [EuiReporter, {
      loggerOptions: {
        reportDir: 'jsonReportTst'
      },
      publishers: []
    }]]
});


