import EuiReporter from '@eui/automation/core/reporter/eui-reporter.js';
import * as master from '@eui/automation/wdio.conf.js'
import testSuites from './suites.json' assert { type: "json" };
import userData from '../userdata.json' assert { type: "json" };
export const config = Object.assign(master.config, {
  runner: 'local',
  protocol: 'http',
  hostname: 'your.grid.server.url',
  port: 4444,
  path: '/wd/hub',
  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",
      platformName: 'WINDOWS',
      "goog:chromeOptions": {
        args: ['disable-infobars', '--window-size=1920,1080', '--incognito', '--headless=chrome'],
      },
      "goog:loggingPrefs": { browser: "ALL", driver: "ALL", performance: "ALL" },
    },
  ],
  app: 'AMS',
  env: 'TST',
  userenv: 'ACC',
  testUsers: ['xxx', 'yyy'],
  testUserData: userData,
  services: [],
  reporters: ['spec',
    ['allure', {
      outputDir: 'allure-results-tst',
      reportDir: 'allure-report-tst',
      cleanBefore: true,
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: false,
      openReport: true // CAREFULL, should be false when run on CI execution or other execution agent
    }],
    [EuiReporter, {
      loggerOptions: {
        reportDir: 'jsonReportTst'
      },
      publishers: []
    }]]
});


