In this video, we will do 2 Test automation examples with NodeJS based WebdriverIO test framework:
- Web browser automation (Chrome) with WebdriverIO
- Android Mobile Automation with WebdriverIO and Appium
Before starting, You can check this “Test Automation of Web Applications with Selenium” webinar doc on https://testingbootcamp.com/selenium-ile-web-uygulama-test-otomasyonu-23de3f2b67bd
Requirements:
- Visual Studio Code IDE
- NodeJS Installation
- WebdriverIO Installation via Terminal or Command Line
npm install — save-dev @wdio/cli
- Install Allure Commandline CLI utility
brew install allure
- Appium Server Installation via Terminal or Command Line (Not required for Chrome web automation)
npm install -g appium
- Android Studio installation with the latest SDK and command-line tools (Not required for Chrome web automation)
Web browser automation (Chrome) with WebdriverIO
- Open Terminal or CMD window
- Execute this command on terminal “npm show chromedriver version” and learn the latest version of the npm package.
- Update your Chrome browser to the latest version
- Open wdio-web-chrome project with VS Code. Open “wdio-web-chrome/package.json” file and update the chromedriver version number if you need with returning value from this command “npm show chromedriver version”.
- Navigate to the project folder and execute this command on terminal “npm install”
- Run the tests with this command “npm run wdio”
Android Mobile Automation with WebdriverIO and Appium
- Open Terminal or CMD window
- Start Appium server with this command “appium &”
- Open wdio-appium-android-allure project with VS Code. Open “wdio-appium-android-allure/wdio.conf.js” file. Edit deviceName and UDID values with your connected Android device or Android emulator
- Install Facebook and login to your account on your device or simulator
- Open a new terminal window, navigate to the project folder and run the tests with this command “npm run wdio”. The automation code will be executed for your installed Facebook app on your device.
- Execute this command “allure open” on the terminal after the test has been finished. That will automatically open a browser window to show the test results.
GitHub:
https://github.com/software-testing-bootcamp/S2E5-nodejs-webdriverio
Resources:
- https://code.visualstudio.com/
- https://nodejs.org/en/download/
- https://webdriver.io/
- https://docs.qameta.io/allure/#_mocha
- https://appium.io/
- https://developer.android.com/studio
Youtube Webinar Video: