Skip to content

Commit

Permalink
Merge pull request #417 from webdriverio/ws/v9-update
Browse files Browse the repository at this point in the history
Ws/v9-update
  • Loading branch information
wswebcreation authored Aug 23, 2024
2 parents 6f8c534 + 4e87cb9 commit 3336b84
Show file tree
Hide file tree
Showing 11 changed files with 6,314 additions and 6,507 deletions.
36 changes: 17 additions & 19 deletions config/saucelabs/wdio.android.rdc.app.conf.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { config as baseConfig } from './wdio.shared.sauce.conf.js';
import { config as baseConfig } from "./wdio.shared.sauce.conf.js";

export const config: WebdriverIO.Config = {
...baseConfig,

// ============
// Specs
// ============
specs: [
'../tests/specs/**/app*.spec.ts',
],
specs: ["../tests/specs/**/app*.spec.ts"],
exclude: [
// Exclude this one because the test can only be executed on emulators/simulators
'../tests/specs/**/app.biometric.login.spec.ts',
"../tests/specs/**/app.biometric.login.spec.ts",
],

// ============
Expand All @@ -21,32 +19,32 @@ export const config: WebdriverIO.Config = {
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
capabilities: [
{
maxInstances: 5,
platformName: 'Android',
"wdio:maxInstances": 5,
platformName: "Android",
// For more information about the supported Sauce Labs capabilities see:
// https://wiki.saucelabs.com/display/DOCS/Appium+Capabilities+for+Real+Device+Testing
// Sauce Labs RDC is not yet W3C compatible, that's why we use ts-ignore
// @ts-ignore
'appium:deviceName': 'Samsung Galaxy S[8912].*',
'appium:automationName': 'UiAutomator2',
'appium:orientation': 'PORTRAIT',
'sauce:options': {
"appium:deviceName": "Samsung Galaxy S[8912].*",
"appium:automationName": "UiAutomator2",
"appium:orientation": "PORTRAIT",
"sauce:options": {
// Keep the device connected between tests so we don't need to wait for the cleaning process
cacheId: 'jsy1v49pn10',
cacheId: "jsy1v49pn10",
idleTimeout: 180,
// Add a name to the test
name: 'wdio-demo-app-test',
build: `WebdriverIO Native Demo app, Android Real Devices: ${new Date().getTime()}`
name: "wdio-demo-app-test",
build: `WebdriverIO Native Demo app, Android Real Devices: ${new Date().getTime()}`,
},

'appium:newCommandTimeout': 240,
"appium:newCommandTimeout": 240,
// The path to the app that has been uploaded to the Sauce Storage,
// see https://wiki.saucelabs.com/display/DOCS/Application+Storage for more information
'appium:app': 'storage:filename=wdio-demo-app-android.apk',
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
"appium:app": "storage:filename=wdio-demo-app-android.apk",
"appium:appWaitActivity": "com.wdiodemoapp.MainActivity",
// Always default the language to a language you prefer so you know the app language is always as expected
'appium:language': 'en',
'appium:locale': 'en',
"appium:language": "en",
"appium:locale": "en",
},
],
};
30 changes: 14 additions & 16 deletions config/wdio.android.app.conf.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { join } from 'node:path';
import { config as baseConfig } from './wdio.shared.local.appium.conf.js';
import { join } from "node:path";
import { config as baseConfig } from "./wdio.shared.local.appium.conf.js";

export const config: WebdriverIO.Config = {
...baseConfig,

// ============
// Specs
// ============
specs: [
'../tests/specs/**/app*.spec.ts',
],
specs: ["../tests/specs/**/app*.spec.ts"],

// ============
// Capabilities
Expand All @@ -19,29 +17,29 @@ export const config: WebdriverIO.Config = {
capabilities: [
{
// The defaults you need to have in your config
platformName: 'Android',
maxInstances: 1,
platformName: "Android",
"wdio:maxInstances": 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here

//
// NOTE: Change this name according to the Emulator you have created on your local machine
'appium:deviceName': 'Pixel_7_Pro_Android_14_API_34',
"appium:deviceName": "Pixel_7_Pro_Android_14_API_34",
//
// NOTE: Change this version according to the Emulator you have created on your local machine
'appium:platformVersion': '14.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
"appium:platformVersion": "14.0",
"appium:orientation": "PORTRAIT",
"appium:automationName": "UiAutomator2",
// The path to the app
'appium:app': join(
"appium:app": join(
process.cwd(),
'apps',
"apps",
//
// NOTE: Change this name according to the app version you downloaded
'android.wdio.native.app.v1.0.8.apk',
"android.wdio.native.app.v1.0.8.apk"
),
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
'appium:newCommandTimeout': 240,
"appium:appWaitActivity": "com.wdiodemoapp.MainActivity",
"appium:newCommandTimeout": 240,
},
],
};
68 changes: 37 additions & 31 deletions config/wdio.android.app.cucumber.conf.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
import {join} from 'node:path';
import {config as baseConfig} from './wdio.shared.local.appium.conf.js';
import { join } from "node:path";
import { config as baseConfig } from "./wdio.shared.local.appium.conf.js";
import path from "path";
import url from 'node:url'
import url from "node:url";

const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
// We need to remove the `mochaOpts` from the `baseConfig` to have all
// Mocha references removed
const { mochaOpts, ...cleanBaseConfig } = baseConfig
const { mochaOpts, ...cleanBaseConfig } = baseConfig;

export const config: WebdriverIO.Config = {
... cleanBaseConfig,
...cleanBaseConfig,

// ============
// Specs
// ============
specs: [
'../tests/features/**/*.feature',
],
specs: ["../tests/features/**/*.feature"],
// ============
// Framework
// ============
// By default we use the Mocha framework, see the `wdio.shared.conf.ts` which is imported by `./wdio.shared.local.appium.conf.js`. For Cucumber we need to "redefine" the framework
framework: 'cucumber',
framework: "cucumber",
//
// You also need to specify where your step definitions are located.
// See also: https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cucumber-framework#cucumberopts-options
cucumberOpts: {
require: [path.join(__dirname, '..', 'tests', 'steps', 'login_and_signup_steps.ts')], // <string[]> (file/dir) require files before executing features
backtrace: false, // <boolean> show full backtrace for errors
compiler: [], // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
dryRun: false, // <boolean> invoke formatters without executing steps
failFast: false, // <boolean> abort the run on first failure
snippets: true, // <boolean> hide step definition snippets for pending steps
source: true, // <boolean> hide source URIs
strict: false, // <boolean> fail if there are any undefined or pending steps
timeout: 20000, // <number> timeout for step definitions
require: [
path.join(
__dirname,
"..",
"tests",
"steps",
"login_and_signup_steps.ts"
),
], // <string[]> (file/dir) require files before executing features
backtrace: false, // <boolean> show full backtrace for errors
compiler: [], // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
dryRun: false, // <boolean> invoke formatters without executing steps
failFast: false, // <boolean> abort the run on first failure
snippets: true, // <boolean> hide step definition snippets for pending steps
source: true, // <boolean> hide source URIs
strict: false, // <boolean> fail if there are any undefined or pending steps
timeout: 20000, // <number> timeout for step definitions
ignoreUndefinedDefinitions: false, // <boolean> Enable this config to treat undefined definitions as warnings.
scenarioLevelReporter: false // Enable this to make webdriver.io behave as if scenarios and not steps were the tests.
scenarioLevelReporter: false, // Enable this to make webdriver.io behave as if scenarios and not steps were the tests.
},
// ============
// Capabilities
Expand All @@ -46,29 +52,29 @@ export const config: WebdriverIO.Config = {
capabilities: [
{
// The defaults you need to have in your config
platformName: 'Android',
maxInstances: 1,
platformName: "Android",
"wdio:maxInstances": 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here

//
// NOTE: Change this name according to the Emulator you have created on your local machine
'appium:deviceName': 'Pixel_7_Pro_Android_14_API_34',
"appium:deviceName": "Pixel_7_Pro_Android_14_API_34",
//
// NOTE: Change this version according to the Emulator you have created on your local machine
'appium:platformVersion': '14.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
"appium:platformVersion": "14.0",
"appium:orientation": "PORTRAIT",
"appium:automationName": "UiAutomator2",
// The path to the app
'appium:app': join(
"appium:app": join(
process.cwd(),
'apps',
"apps",
//
// NOTE: Change this name according to the app version you downloaded
'android.wdio.native.app.v1.0.8.apk',
"android.wdio.native.app.v1.0.8.apk"
),
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
'appium:newCommandTimeout': 240,
"appium:appWaitActivity": "com.wdiodemoapp.MainActivity",
"appium:newCommandTimeout": 240,
},
],
};
25 changes: 12 additions & 13 deletions config/wdio.android.browser.conf.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { config as baseConfig } from './wdio.shared.local.appium.conf.js';
import { config as baseConfig } from "./wdio.shared.local.appium.conf.js";

export const config: WebdriverIO.Config = {
...baseConfig,

// ============
// Specs
// ============
specs: [
'../tests/specs/**/browser*.spec.ts',
],
specs: ["../tests/specs/**/browser*.spec.ts"],

// ============
// Capabilities
Expand All @@ -18,22 +16,23 @@ export const config: WebdriverIO.Config = {
capabilities: [
{
// The defaults you need to have in your config
platformName: 'Android',
browserName: 'chrome',
maxInstances: 1,
platformName: "Android",
browserName: "chrome",
"wdio:maxInstances": 1,
// For W3C the appium capabilities need to have an extension prefix
// http://appium.io/docs/en/writing-running-appium/caps/
// This is `appium:` for all Appium Capabilities which can be found here

//
// NOTE: Change this name according to the Emulator you have created on your local machine
'appium:deviceName': 'Pixel_7_Pro_Android_14_API_34',
"appium:deviceName": "Pixel_7_Pro_Android_14_API_34",
//
// NOTE: Change this version according to the Emulator you have created on your local machine
'appium:platformVersion': '14.0',
'appium:automationName': 'UiAutomator2',
'appium:orientation': 'PORTRAIT',
'appium:newCommandTimeout': 240,
"appium:platformVersion": "14.0",
"appium:automationName": "UiAutomator2",
"appium:orientation": "PORTRAIT",
"appium:newCommandTimeout": 240,
"wdio:enforceWebDriverClassic": true,
},
]
],
};
18 changes: 9 additions & 9 deletions config/wdio.browser.conf.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { config as baseConfig } from './wdio.shared.conf.js';
import { config as baseConfig } from "./wdio.shared.conf.js";

export const config: WebdriverIO.Config = {
...baseConfig,

// ============
// Specs
// ============
specs: ['../tests/specs/**/browser*.spec.ts'],
specs: ["../tests/specs/**/browser*.spec.ts"],

// ============
// Capabilities
Expand All @@ -15,17 +15,17 @@ export const config: WebdriverIO.Config = {
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
capabilities: [
{
browserName: 'chrome',
browserName: "chrome",
},
{
browserName: 'firefox',
browserName: "firefox",
},
{
browserName: 'edge',
browserName: "edge",
},
{
maxInstances: 1,
browserName: 'safari',
}
]
"wdio:maxInstances": 1,
browserName: "safari",
},
],
};
32 changes: 16 additions & 16 deletions config/wdio.ios.app.conf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'node:path';
import { config as baseConfig } from './wdio.shared.local.appium.conf.js';
import { join } from "node:path";
import { config as baseConfig } from "./wdio.shared.local.appium.conf.js";

const isGhActions = process.env.GITHUB_ACTION;

Expand All @@ -9,7 +9,7 @@ export const config: WebdriverIO.Config = {
// ============
// Specs
// ============
specs: ['../tests/specs/**/app*.spec.ts'],
specs: ["../tests/specs/**/app*.spec.ts"],

// ============
// Capabilities
Expand All @@ -19,30 +19,30 @@ export const config: WebdriverIO.Config = {
capabilities: [
{
// The defaults you need to have in your config
platformName: 'iOS',
maxInstances: 1,
platformName: "iOS",
"wdio:maxInstances": 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/

//
// NOTE: Change this name according to the Simulator you have created on your local machine
'appium:deviceName': isGhActions ? 'iPhone 14' : 'iPhone 15',
"appium:deviceName": isGhActions ? "iPhone 14" : "iPhone 15",
//
// NOTE: Change this version according to the Simulator Version you have created on your local machine
'appium:platformVersion': '17.2',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'XCUITest',
"appium:platformVersion": "17.2",
"appium:orientation": "PORTRAIT",
"appium:automationName": "XCUITest",
// The path to the app
'appium:app': join(
"appium:app": join(
process.cwd(),
'apps',
"apps",
// Change this name according to the app version you downloaded
'ios.simulator.wdio.native.app.v1.0.8.zip'
"ios.simulator.wdio.native.app.v1.0.8.zip"
),
'appium:newCommandTimeout': 240,
"appium:newCommandTimeout": 240,
// This is needed to wait for the webview context to become available
'appium:webviewConnectTimeout': 5000,
}
]
"appium:webviewConnectTimeout": 5000,
},
],
};
Loading

0 comments on commit 3336b84

Please sign in to comment.