Skip to content

Commit

Permalink
Add appium driver (#85)
Browse files Browse the repository at this point in the history
* chore: add an example application for mobile pilot testing

The app contains 3 screens: emoji game, colors game, assertions screen

* feat & test: create Detox driver and add suitable tests

- "Import" the driver from the Detox project
- Add Detox id injection
- Remove native matchers and clarify the importance of using "by id"
- Add prompt handler to the package
- Add Pilot tests for each screen

* chore: code review changes

* chore: migrate appium-driver

* update package.lock

* add example app script

* apply lint

* disable var rule

* feat: add driver method for list item's

* fix: increase connection timeout

* update package.lock to be same as in master

* revert changes to pods files

* revert changes to vcs

* revert

* chore: remove global vars and update docs

* apply lint

* update package.json

* chore: remove jest and use webdriverio expect

* fix: chagne version selection for wedio/globals

---------

Co-authored-by: lironsh <[email protected]>
  • Loading branch information
tzvielwix and LironMShemen authored Feb 19, 2025
1 parent b754536 commit 5e7a282
Show file tree
Hide file tree
Showing 11 changed files with 664 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions packages/drivers/appium/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint'],
env: {
node: true,
jest: true,
es6: true,
},
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': 'off',
},
ignorePatterns: ['dist/', 'node_modules/', '*.js'],
};
28 changes: 28 additions & 0 deletions packages/drivers/appium/examples/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pilot from "@wix-pilot/core";
import { PromptHandler } from "../utils/promptHandler";
import { WebdriverIOAppiumFrameworkDriver } from "../index";

describe("Example Test Suite", () => {
let frameworkDriver: WebdriverIOAppiumFrameworkDriver;

before(async () => {
const promptHandler: PromptHandler = new PromptHandler();
frameworkDriver = new WebdriverIOAppiumFrameworkDriver();
pilot.init({
frameworkDriver,
promptHandler,
});
});

beforeEach(async () => {
pilot.start();
});

afterEach(async () => {
pilot.end();
});

it("perform test with pilot", async () => {
await pilot.autopilot("earn 2 points in the game");
});
});
38 changes: 38 additions & 0 deletions packages/drivers/appium/examples/wdio.conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import path from "path";

export const config = {
runner: "local",
specs: ["./**/*.test.ts"],
maxInstances: 1,

capabilities: [
{
platformName: "iOS",
"appium:deviceName": "iPhone 15 Pro",
"appium:automationName": "XCUITest",
"appium:app": path.resolve(
__dirname,
"../../detox/ExampleApp/ios/build/Build/Products/Release-iphonesimulator/ExampleApp.app",
),
},
],

logLevel: "info",
bail: 0,
baseUrl: "http://localhost",
waitforTimeout: 10000,
connectionRetryTimeout: 900000,
connectionRetryCount: 3,

services: ["appium"],
appium: {
command: "appium",
},

framework: "mocha",
reporters: ["spec"],
mochaOpts: {
ui: "bdd",
timeout: 600000,
},
};
Loading

0 comments on commit 5e7a282

Please sign in to comment.