Automation testing

1. Automation with WebdriverIO

How to install WebdriverIO automation framework and run it.
Instagram example

Requirements:

  • Macbook
  • npm installed
  • IDE

Execute the following steps in your IDE. I will use Visual Studio Code AKA VS Code

1. Open the terminal, navigate to the folder of your preference and create a new one, get inside of it and run:
npm init wdio .
2. Ok to proceed? (y) - Letter y in () means its a default option. So hit enter to choose it
3. Where is your automation backend located? - Select: On my local machine and hit enter
4. Which framework do you want to use? - Mocha
5. Do you want to use a compiler? - No!
6. Where are your test specs located? - Just hit enter choose default path ./test/specs/**/*.js
7. Do you want WebdriverIO to autogenerate some test files? - Type in letter Y if you would like to get examples autogenerated for you, or n if you would not
8. Add following code to your newly created login-spec file from step above. Don't forget to update instagram username and password in the code below to yours.
9. Do you want to use page objects? - I say Y, so you could see their way of doing it
10. Where are your page objects located? - Hit enter to use default path ./test/pageobjects/**/*.js
11. Which reporter do you want to use? - Choose allure
12. Do you want to add a plugin to your test setup? - wait-for
13. Do you want to add a service to your test setup? - Chromedriver
14. What is the base url? - Either type in your base url, such as codemify.com, or simply hit enter to use default localhost. You can update it later when you need it
15. Do you want me to run `npm install`? - Hit enter to use default Yes option
16. You are all set! No run command below to run default test case that set up for you in test/specs/example.e2e.js
npx wdio wdio.conf.js
And as always, if something is funky, ask us at https://t.me/codemifyschool in a comment to any post
Previous Article
4. API Status Codes (Response Codes)
API Testing
Next Article
2. Page Object Model
Automation testing
We help ambitious people to get into Tech with no prior experience.