Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimNastoyashchy committed Nov 30, 2022
0 parents commit 1a57c40
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/package-lock.json
Binary file added app/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk
Binary file not shown.
69 changes: 69 additions & 0 deletions config/wdio-android.conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import {join} from 'path';

exports.config = {

autoCompileOpts: {
autoCompile: true,
tsNodeOpts: {
transpileOnly: true,
project: 'test/tsconfig.json'
}
},
//
// ====================
// Runner Configuration
// ====================
//
port: 4723,
specs: ["./test/specs/android/*.ts"],
// Patterns to exclude.
exclude: [],
//
// ============
// Capabilities
// ============
//
maxInstances: 1,
capabilities: [
{
platformName: 'Android',
maxInstances: 1,
'appium:deviceName': 'Pixel_3_10.0',
'appium:platformVersion': '10.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
'appium:app': join(process.cwd(), './app/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk'),
// @ts-ignore
'appium:appWaitActivity': 'com.swaglabsmobileapp.MainActivity',
'appium:newCommandTimeout': 240,
},
],
//
// ===================
// Test Configurations
// ===================
logLevel: "info",
bail: 0,
baseUrl: "http://localhost",
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: [
[
"appium",
{
args: {
address: "localhost",
port: 4723,
},
logPath: "./",
},
],
],
framework: "mocha",
reporters: ["spec"],
mochaOpts: {
ui: "bdd",
timeout: 60000,
},
};
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "webdriverio-tests",
"version": "0.1.0",
"description": "",
"private": true,
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@wdio/appium-service": "^7.25.1",
"@wdio/cli": "^7.25.1",
"@wdio/local-runner": "^7.25.1",
"@wdio/mocha-framework": "^7.25.1",
"@wdio/spec-reporter": "^7.25.1",
"appium": "^2.0.0-beta.44",
"appium-uiautomator2-driver": "^2.7.0",
"appium-xcuitest-driver": "^4.12.0",
"chromedriver": "^106.0.1",
"wdio-chromedriver-service": "^8.0.0",
"ts-node": "^10.8.0",
"typescript": "^4.6.4"
},
"scripts": {
"wdioAndroid": "wdio run config/wdio-android.conf.ts"
}
}
10 changes: 10 additions & 0 deletions test/specs/android/logIn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe("My Login Demo", () => {
beforeEach(async () => {
await $("~open menu").click();
await $('//*[@text="Log In"]').click();
});

it("should not login with invalid credentials", async () => {

});
});
12 changes: 12 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"moduleResolution": "node",
"types": [
"node",
"webdriverio/async",
"@wdio/mocha-framework",
"expect-webdriverio"
],
"target": "es2019"
}
}

0 comments on commit 1a57c40

Please sign in to comment.