Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bamboo-integration/config-parallel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
reporters: [
'dot',
['junit', {
outputDir: './testresults/',
outputFileFormat: function (options) {
return `results-${options.cid}.xml`;
}
}]
],
// ...
})
12 changes: 12 additions & 0 deletions bamboo-integration/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
reporters: [
'dot',
['junit', {
outputDir: './testresults/'
}]
],
// ...
})
13 changes: 13 additions & 0 deletions browser/mobile-flags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
capabilities: {
platformName: 'iOS',
app: 'net.company.SafariLauncher',
udid: '123123123123abc',
deviceName: 'iPhone',
// ...
}
// ...
})
29 changes: 29 additions & 0 deletions browserstack/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
//...
user: '<browserstack_username>' || process.env.BROWSERSTACK_USERNAME,
key: '<browserstack_access_key>' || process.env.BROWSERSTACK_ACCESS_KEY,
commonCapabilities: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never seen commonCapabilities, is this new?

'bstack:options': {
projectName: "Your static project name goes here",
buildName: "Your static build/job name goes here"
}
},
services: [
['browserstack', {
accessibility: true,
// Optional configuration options
accessibilityOptions: {
'wcagVersion': 'wcag21a',
'includeIssueType': {
'bestPractice': false,
'needsReview': true
},
'includeTagsInTestingScope': ['Specify tags of test cases to be included'],
'excludeTagsInTestingScope': ['Specify tags of test cases to be excluded']
},
}]
],
//...
});
11 changes: 11 additions & 0 deletions capabilities/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
capabilities: [{
browserName: 'chrome',
'custom:caps': {
// custom configurations
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
// ...

For consistency

}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}]
}]
// ...

For consistency

})
10 changes: 10 additions & 0 deletions cloud-services/config-env-variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
})

if (process.env.CI) {
config.user = process.env.SAUCE_USERNAME
config.key = process.env.SAUCE_ACCESS_KEY
}
13 changes: 13 additions & 0 deletions cloud-services/config-perfecto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
hostname: "your_cloud_name.perfectomobile.com",
path: "/nexperience/perfectomobile/wd/hub",
port: 443,
protocol: "https",
// ...
capabilities: [{
// ...
securityToken: "your security token"
}],
})
Comment on lines +11 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
securityToken: "your security token"
}],
})
securityToken: "your security token"
// ...
}],
// ...
})

For consistency

8 changes: 8 additions & 0 deletions component-testing/config-selenium-grid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
runner: ['browser', {
// network IP of the machine that runs the WebdriverIO process
host: 'http://172.168.0.2'
}]
Comment on lines +4 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runner: ['browser', {
// network IP of the machine that runs the WebdriverIO process
host: 'http://172.168.0.2'
}]
// ...
runner: ['browser', {
// network IP of the machine that runs the WebdriverIO process
host: 'http://172.168.0.2'
}],
// ...

For consistency

})
11 changes: 11 additions & 0 deletions component-testing/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
mochaOpts: {
ui: 'tdd',
// provide a setup script to run in the browser
require: './__fixtures__/setup.js'
},
// ...
})
30 changes: 30 additions & 0 deletions configuration-file/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
runner: 'local',
specs: [
'test/spec/**',
['group/spec/**']
],
maxInstances: 10,
capabilities: [
{
browserName: 'chrome',
},
{
browserName: 'firefox',
}
],
logLevel: 'info',
outputDir: './logs',
baseUrl: 'http://localhost:8080',
waitforTimeout: 30000,
framework: 'mocha',
reporters: [
'dot',
'allure'
],
mochaOpts: {
ui: 'bdd'
},
})
19 changes: 19 additions & 0 deletions configuration/config-headers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Buffer } from 'buffer';
import { defineConfig } from '@wdio/config'

// Read the username and password from environment variables
const username = process.env.SELENIUM_GRID_USERNAME;
const password = process.env.SELENIUM_GRID_PASSWORD;

// Combine the username and password with a colon separator
const credentials = `${username}:${password}`;
// Encode the credentials using Base64
const encodedCredentials = Buffer.from(credentials).toString('base64');

export const config = defineConfig({
// ...
headers: {
Authorization: `Basic ${encodedCredentials}`
}
// ...
})
5 changes: 5 additions & 0 deletions configuration/config-resolve-snapshot-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
resolveSnapshotPath: (testPath, snapExtension) => testPath + snapExtension,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resolveSnapshotPath: (testPath, snapExtension) => testPath + snapExtension,
// ...
resolveSnapshotPath: (testPath, snapExtension) => testPath + snapExtension,
// ...

For consistency

})
7 changes: 7 additions & 0 deletions custom-reporter/config-npm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
reporter: ['custom'],
// ...
})
21 changes: 21 additions & 0 deletions custom-reporter/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from '@wdio/config'
import CustomReporter from './reporter/my.custom.reporter'

export const config = defineConfig({
// ...
reporters: [
/**
* use imported reporter class
*/
[CustomReporter, {
someOption: 'foobar'
}],
/**
* use absolute path to reporter
*/
['/path/to/reporter.js', {
someOption: 'foobar'
}]
],
// ...
})
7 changes: 7 additions & 0 deletions custom-service/config-npm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
services: ['custom'],
// ...
})
21 changes: 21 additions & 0 deletions custom-service/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from '@wdio/config'
import CustomService from './service/my.custom.service'

export const config = defineConfig({
// ...
services: [
/**
* use imported service class
*/
[CustomService, {
someOption: true
}],
/**
* use absolute path to service
*/
['/path/to/service.js', {
someOption: true
}]
],
// ...
})
17 changes: 17 additions & 0 deletions debugging/config-dynamic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from '@wdio/config'

const debug = process.env.DEBUG
const defaultCapabilities = ...
const defaultTimeoutInterval = ...
const defaultSpecs = ...

export const config = defineConfig({
// ...
maxInstances: debug ? 1 : 100,
capabilities: debug ? [{ browserName: 'chrome' }] : defaultCapabilities,
execArgv: debug ? ['--inspect'] : [],
jasmineOpts: {
defaultTimeoutInterval: debug ? (24 * 60 * 60 * 1000) : defaultTimeoutInterval
}
// ...
})
13 changes: 13 additions & 0 deletions debugging/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
maxInstances: 1,
specs: [
'**/myspec.spec.js'
],
capabilities: [{
browserName: 'firefox'
}],
// ...
})
19 changes: 19 additions & 0 deletions docker/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
capabilities: [{
maxInstances: 1,
browserName: 'chrome',
'goog:chromeOptions': {
args: [
'--no-sandbox',
'--disable-infobars',
'--headless',
'--disable-gpu',
'--window-size=1440,735'
],
}
}],
// ...
})
9 changes: 9 additions & 0 deletions electron/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
// ...
services: [['electron', {
appEntryPoint: './path/to/bundled/electron/main.bundle.js',
appArgs: [/** ... */],
}]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}]]
}]],
// ...

For consistency

})
17 changes: 17 additions & 0 deletions frameworks/publish-report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { v4 as uuidv4 } from 'uuid'
import { defineConfig } from '@wdio/config'
import { publishCucumberReport } from '@wdio/cucumber-framework';

export const config = defineConfig({
// ... Other Configuration Options
cucumberOpts: {
// ... Cucumber Options Configuration
format: [
['message', `./reports/${uuidv4()}.ndjson`],
['json', './reports/test-report.json']
]
},
async onComplete() {
await publishCucumberReport('./reports');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
},
// ...

For consistency

})
Empty file added frameworks/serenity.js
Empty file.
16 changes: 16 additions & 0 deletions getting-started/ocr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from '@wdio/config'

export const config = defineConfig({
//...
services: [
// your other services
[
"ocr",
{
contrast: 0.25,
imagesFolder: ".tmp/",
language: "eng",
},
],
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
],
],
// ...

For consistency

});
4 changes: 3 additions & 1 deletion getting-started/run-in-script.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import fs from 'node:fs'
import { remote } from 'webdriverio'
import { defineConfig } from '@wdio/config'

const browser = await remote({
const config = defineConfig({
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: process.env.CI ? ['headless', 'disable-gpu', 'window-size=1200,800'] : []
}
}
Comment on lines 6 to 11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: process.env.CI ? ['headless', 'disable-gpu', 'window-size=1200,800'] : []
}
}
// ...
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: process.env.CI ? ['headless', 'disable-gpu', 'window-size=1200,800'] : []
}
}
// ...

For consistency

})
const browser = await remote(config)

await browser.url('https://webdriver.io')
const apiLink = await browser.$('=API')
Expand Down
Loading
Loading