{"id":14969331,"url":"https://github.com/igniteram/appium-webdriverio-typescript","last_synced_at":"2025-10-26T07:31:22.713Z","repository":{"id":26678978,"uuid":"109492421","full_name":"igniteram/appium-webdriverio-typescript","owner":"igniteram","description":"Test framework for automating mobile apps with appium using webdriverio \u0026 typescript!","archived":false,"fork":false,"pushed_at":"2022-12-08T17:02:11.000Z","size":3694,"stargazers_count":82,"open_issues_count":23,"forks_count":58,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-01-31T16:53:37.353Z","etag":null,"topics":["appium","cucumber","typescript","webdriverio"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igniteram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-04T12:19:32.000Z","updated_at":"2024-12-13T17:05:20.000Z","dependencies_parsed_at":"2023-01-14T07:30:17.085Z","dependency_job_id":null,"html_url":"https://github.com/igniteram/appium-webdriverio-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fappium-webdriverio-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fappium-webdriverio-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fappium-webdriverio-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fappium-webdriverio-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igniteram","download_url":"https://codeload.github.com/igniteram/appium-webdriverio-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284881,"owners_count":19446747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appium","cucumber","typescript","webdriverio"],"created_at":"2024-09-24T13:41:37.158Z","updated_at":"2025-10-26T07:31:22.248Z","avatar_url":"https://github.com/igniteram.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src= \"./images/appium-webdriverio-typescript.png\" height=300 alt=\"titleImage.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ci\u003e\u003cstrong\u003eTest framework for automating mobile apps with appium using webdriverio \u0026amp; typescript!\n\u003c/strong\u003e\u003c/i\u003e\n\u003cp\u003e\n\n---\n\n### \u003cp align=\"center\"\u003e [About](#about) **|** [Getting Started](#getting-started) **|** [Installation](#installation) **|** [Writing Tests](#writing-tests) **|** [Page Objects](#page-objects) **|** [Finding Elements](#finding-elements) **|** [Reports](#reports)\u003c/p\u003e\n\n## About\n\nCurrently this framework has been developed to run scripts in **ANDROID** platform with real device.\n\nThe tests run both on **Android Native App** and **Mobile Browser**. Chrome browser is configured currently for running browser tests.\n\n### Tech Stack\n\n* [Appium]() - This is the node server which interacts with the mobile devices\n* [WebdriverIO](http://webdriver.io/) - It is the selenium webdriver api bindings for node.js, It has a very simple api which could be used to automate web \u0026 browser apps in a fast and scalable way.\n* [Typescript(Javascript)](https://www.typescriptlang.org/) - It is the superset of javascript which has additional static typings and features like JAVA and other languaes. Now you could write your code which compiles to pure javascript.\n* [Cucumber](https://cucumber.io/) - The popular BDD test framework which helps us write automated tests. \n\n## Getting Started\n\n### Pre-requisites\n\n1. NodeJS installed globally in the system.\nhttps://nodejs.org/en/download/\n\n2.  JAVA(jdk) installed in the system.\n\n3. Andriod(sdk) installed in the system.\n\n4. Set **JAVA_HOME** \u0026 **ANDROID_HOME** paths correctly in the system.\n\n5. Chrome browser installed.\n\n6. Text Editor/IDE (Optional) installed--\u003eSublime/Visual Studio Code/Brackets.\n\n**Tip:** Install `npm install -g appium-doctor` and run it from the command-line which checks if your java jdk and android sdk paths are set correctly or not.\n\n## Installation\n\n### Setup Scripts\n\n* Clone the repository into a folder\n* Go inside the folder and run following command from terminal/command prompt\n```\nnpm install \n```\n* All the dependencies from package.json and typescript typings would be installed in node_modules folder.\n\n**Tip:** Use [**Yarn**](https://yarnpkg.com/en/docs/installing-dependencies)  to install your modules `npm install -g yarn` as it caches \u0026 locks them which would help us install correct versions of modules across various platforms without any issues. This project is configured with `yarn.lock` file. So you could make use of it.\n\n### Run Tests\n\n* First step is to start the `appium` server, This project includes the appium node module so you don't have to download it externally. You can run the appium server by the following npm command.\n\n```\nnpm run appium\n```\n* Next you have to transpile/compile your typescript files to javascript files, you could do this by running the command -\n\n```\nnpm run build\n```\n\nNext step is to execute the config files. This project has 2 config files -\n\n* [wdio.app.config.js](./config/wdio.app.config.js) - This config file is used to run tests in real mobile native apps.\nYou would have to change the `appium settings` to run tests in your device.\n\n```\ncapabilities: [\n{\n    appiumVersion: '1.7.1',                             // Appium module version\n    browserName: '',                                   // browser name is empty for native apps\n    platformName: 'Android',\n    app: './app/LGCalculator.apk',                     // Path to the native app\n    appPackage: 'com.android.calculator2',             // Package name of the app\n    appActivity: 'com.android.calculator2.Calculator', // App activity of the app\n    platformVersion: '5.1.1',                         // Android platform version of the device\n    deviceName: 'THF755e0384',                       // device name of the mobile device\n    waitforTimeout: waitforTimeout,\n    commandTimeout: commandTimeout,\n    newCommandTimeout: 30 * 60000,\n}\n],\n```\nTo know your device name you could run the  `adb devices` command which comes out of the box from Android SDK.\n\nThe node command to run Native app tests of this project is - \n\n```\nnpm run app-test\n```\nThe above command which is set in `package.json` internally calls the WebdriverIO's binary `wdio ./config/wdio.app.config.js`  and runs the app config file.\n\n* [wdio.browser.config.js](./config/wdio.browser.config.js) - This config file is used to run tests in the chrome browser of the configured mobile device. The appium settings would looks like this-\n\n```\ncapabilities: [\n{\n    appiumVersion: '1.7.1',\n    browserName: 'chrome',  // browser name should be specified\n    platformName: 'Android',\n    platformVersion: '5.1.1',\n    deviceName: 'THF755e0384', // device name is mandatory\n    waitforTimeout: waitforTimeout,\n    commandTimeout: commandTimeout,\n    newCommandTimeout: 30 * 60000,\n}\n],\n```\n\nThe node command to run browser tests of this project is - \n\n```\nnpm run browser-test\n```\nThe above command internally calls the WebdriverIO's binary `wdio ./config/wdio.browser.config.js`  and runs the browser config file.\n\n### Run Test Suite\n\nYou could run both the native app and browser tests by running the following command - \n\n```\nnpm test\n```\nThe above command internally calls `npm run app-test` and `npm run browser-test`.\n\n## Writing Tests\n\nCucumber framework has been integrated with thi project, WebdriverIO's `wdio-cucumber-framework` adapter helps write BDD style tests with Features \u0026 Step Definitions.\n\n```\nconst {Given, When, Then} = require('cucumber');\nimport {expect} from 'chai';\nimport {CalculatorPageObject} from '../pages/calcPage';\n\nconst calc: CalculatorPageObject = new CalculatorPageObject();\n\nGiven(/^I am on my mobile calculator app$/, () =\u003e {\n    const title = browser.getText('android.widget.TextView');\n    expect(title).to.equal('Calculator');\n});\n```\n## Page Objects\n\nThis framework is strictly written using page-object design pattern.\n\n```\nclass GooglePageObject {\n    public get searchTextBox(): any { return browser.element('#lst-ib'); }\n    public get searchButton(): any { return browser.element('button[name=\"btnG\"]'); }\n    public get results(): any { return browser.waitForVisible('#rso', 5000); }\n    public get firstLink(): any { return browser.element('#rso div._H1m._ees'); }\n}\n/*\nPublic Interface - export instances of classes\n**/\nexport const GooglePage = new GooglePageObject()\n```\n## Finding-Elements\n\nFinding elements in mobile apps and browser's could be tricky sometimes.\n\n* Best way to find elements in native mobile apps is using [**UIAutomatorViewer**](https://developer.android.com/training/testing/ui-automator.html) .This supports Android 4.3 and above only, If you are using android version less than that, you could use [**Selendriod**](http://selendroid.io/)\n* Best way to find elements in mobile browser is by ***Remote debugging with Chrome DevTools***.  I personally find it lot easier \u0026 hassle free. You could find detail steps about it in this [blog](http://toolsqa.com/mobile-automation/appium/inspect-elements-of-mobile-web-application/)\n\n## Reports\n\nCurrently this project has been integrated with [Allure-Reports](http://allure.qatools.ru/). WebdriverIO's `wdio-allure-reporter` helps us generate detailed reports of our mobile automated tests.\nOnce the test execution is finished you would find the **allure-results** folder generated automatically. Then you would have to run the following command to generate **HTML Report**\n\n```\nnpm run report\n```\n\n**Caveat:** Chrome browser has an issue rendering the AJAX requests from local files generated by allure, You could use **Firefox** for seeing the html report.\nYou could find more details about this issue [here](https://stackoverflow.com/questions/23997449/allure-report-nothing-shown-in-chrome)\n\n\u003cimg src=\"./images/allure.png\" alt=\"allure.png\"/\u003e\n\n\u003cimg src=\"./images/allure_graph.png\" alt=\"allure_graph.png\"/\u003e\n\n## License\n```   \nMIT License\n\nCopyright (c) 2017 Ram Pasala\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fappium-webdriverio-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figniteram%2Fappium-webdriverio-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fappium-webdriverio-typescript/lists"}