import { expectType } from 'tsd'
import type { Capabilities } from '@wdio/types'
class CustomService {
onPrepare() {
}
}
declare global {
namespace WebdriverIO {
interface Capabilities {
'wdio:customCaps'?: {
foo: string
bar: number
}
}
}
}
const configA: WebdriverIO.Config = {
beforeFeature () {
},
async onWorkerEnd (cid, exitCode, specs, retries) {
expectType<string>(cid)
expectType<number>(exitCode)
expectType<string[]>(specs)
expectType<number>(retries)
},
async beforeCommand (name) {
name.toLowerCase()
const title = await browser.getTitle()
title.slice(0, 1)
}
}
const config: WebdriverIO.Config = {
services: [
['sauce', {
sauceConnect: true,
sauceConnectOpts: {
directDomains: 'some.domain'
},
tunnelOwner: 123
}],
['appium', {
args: {
basePath: 'some/path',
port: true
}
}],
['browserstack', {
browserstackLocal: true,
forcedStop: 'no'
}],
['devtools', {
coverageReporter: {
enable: true,
type: 'foo'
}
}],
['firefox-profile', {
extensions: [],
profileDirectory: '/foo/bar',
proxy: { proxyType: 'direct' },
legay: false
}],
['static-server', {
folders: [{
mount: '',
path: ''
}],
port: 1234,
middleware: [{
mount: '',
middleware: ''
}]
}],
['testingbot', {
tbTunnel: true,
tbTunnelOpts: {
tunnelIdentifier: 'identifier',
tunnelVersion: 0,
apiKey: 'key',
apiSecret: 'secret',
}
}],
[CustomService, {
someOption: true
}]
],
reporters: [
['allure', {
issueLinkTemplate: 'foo',
useCucumberStepReporter: 'wrong-param'
}],
['sumologic', {
syncInterval: 'wrong param',
sourceAddress: 'http://foo'
}]
],
automationProtocol: 'webdriver',
logLevels: {
webdriver: 'info',
},
capabilities: [{
browserName: 'chrome',
'goog:chromeOptions': {
binary: 'path/to/chrome',
args: ['--no-first-run', '--enable-automation'],
prefs: {
'profile.managed_default_content_settings.popups': 1,
'profile.managed_default_content_settings.notifications': 1,
}
}
}, {
browserName: 'firefox',
'moz:firefoxOptions': {
binary: 'path/to/firefox',
profile: 'path/to/profile',
args: ['-headless'],
prefs: {
'browser.tabs.remote.autostart': false,
'toolkit.telemetry.reportingpolicy.firstRun': false,
},
log: { level: 'error' }
}
}, {
'selenoid:options': {
enableVNC: true,
enableVideo: true,
enableLog: true,
logName: 'test.log',
videoName: 'test.mp4'
}
}, {
'moon:options': {
logLevel: 'INFO',
mobileDevice: {
deviceName: 'Apple iPhone XR',
orientation: 'portrait' as Capabilities.MoonMobileDeviceOrientation
}
}
}, {
'wdio:customCaps': {
foo: 'bar',
bar: 123
}
}],
filesToWatch: [
'/foo/page-objects/**/*.page.js',
]
}