From c7883320d995045e30d627f14dc6fef8a9b79d15 Mon Sep 17 00:00:00 2001 From: Jochen <137506783+jochen-testingbot@users.noreply.github.com> Date: Fri, 15 Dec 2023 21:38:46 +0100 Subject: [PATCH] Add TestingBot example (#160) * add TestingBot example * update testingbot config * use spaces * Update config/testingbot/wdio.android.tb.app.conf.ts Co-authored-by: Christian Bromann --------- Co-authored-by: Christian Bromann --- README.md | 17 ++++++++ config/testingbot/wdio.android.tb.app.conf.ts | 41 +++++++++++++++++++ package.json | 2 + 3 files changed, 60 insertions(+) create mode 100644 config/testingbot/wdio.android.tb.app.conf.ts diff --git a/README.md b/README.md index c62a60f9..64c6ed77 100644 --- a/README.md +++ b/README.md @@ -365,6 +365,23 @@ $ npm run ios.browserstack.app $ npm run android.browserstack.app ``` +### TestingBot + +This boilerplate provides a setup for testing with TestingBot. Please check the [TestingBot](./config/testingbot)-folder to see the +setup for Android. + +Make sure you install the latest version of the `@wdio/testingbot-service` with + +```shell +npm install --save-dev @wdio/testingbot-service +``` + +You can use the script from [`package.json`](./package.json), to execute the tests in the TestingBot cloud: + +```sh +$ npm run android.testingbot.app +``` + ## FAQ See [FAQ](./docs/FAQ.md) diff --git a/config/testingbot/wdio.android.tb.app.conf.ts b/config/testingbot/wdio.android.tb.app.conf.ts new file mode 100644 index 00000000..855f1523 --- /dev/null +++ b/config/testingbot/wdio.android.tb.app.conf.ts @@ -0,0 +1,41 @@ +import { config as baseConfig } from '../wdio.shared.conf'; + +export const config: WebdriverIO.Config = { + ...baseConfig, + + // ============ + // Specs + // ============ + 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', + ], + + // ============================= + // TestingBot specific config + // ============================= + // User configuration + user: process.env.TESTINGBOT_KEY || 'TESTINGBOT_KEY', + key: process.env.TESTINGBOT_SECRET || 'TESTINGBOT_SECRET', + // Use testingbot service + services: ['testingbot'], + + // ============ + // Capabilities + // ============ + // For all capabilities please check + // http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities + capabilities: [ + { + // Set URL of the application under test + app: 'https://testingbot.com/appium/sample.apk', + + deviceName: 'Pixel 6', + platformName: 'Android', + version: '12.0', + }, + ], +}; diff --git a/package.json b/package.json index a9b4be05..06a81f26 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "android.sauce.emulators.app.us": "wdio run config/saucelabs/wdio.android.emulators.app.conf.ts", "android.sauce.rdc.app.eu": "REGION=eu wdio config/saucelabs/wdio.android.rdc.app.conf.ts", "android.sauce.rdc.app.us": "wdio run config/saucelabs/wdio.android.rdc.app.conf.ts", + "android.testingbot.app": "wdio ./config/testingbot/wdio.android.tb.app.conf.ts", "android.app": "wdio run config/wdio.android.app.conf.ts", "android.browser": "wdio run config/wdio.android.browser.conf.ts", "browser": "wdio run config/wdio.browser.conf.ts", @@ -51,6 +52,7 @@ "@wdio/mocha-framework": "^8.24.12", "@wdio/sauce-service": "^8.26.1", "@wdio/spec-reporter": "^8.24.12", + "@wdio/testingbot-service": "^8.26.1", "appium": "^2.2.3", "appium-uiautomator2-driver": "^2.34.2", "appium-xcuitest-driver": "^5.12.2",