There are a lot more things that you can add to your test suite using WebdriverIO. In this chapter we focus more on smaller items that we try out to get to know how it works. Therefor the objective is more to work with WebdriverIO to get to know its full potential.
Sauce Labs has a headless offering that allows you to quickly spin up containers to run tests in the earlier dev lifecycle. Try to run a test on Sauce using a headless container:
- Copy your test from chapter 2
- Modify it so it runs on our headless cloud
Tip: It is not difficult at all to run headless using WebdriverIO. Have a look at the options
WebdriverIO provides 😉.
WebdriverIO has some debugging capabilities that can be really useful in order to debug or author tests. Let's try them out:
- Run the
repl
command ofwdio
and play around with the browser in the terminal - Add the
debug
command to one of your tests from the previous chapter - Debug your test using the DevTools application in Chrome
While you are debugging your test in the terminal, try to open the DevTools application in Chrome and click on the green NodeJS icon at the top left of the window. This should open a new DevTools window that allows you interact with the browser using the Console tab in the DevTools application.
Sauce Labs for all Chrome browser tests on desktop certain extended debugging capabilities that can become useful for specific scenarios. Next to HAR file, console or performance capturing you can use custom commands to e.g. check the network activity of the page.
- Write a new Sauce Labs test for Chrome that checks if the google analytics call was made on our Vue Todo application
- Capture the performance metrics of the app with throttled and non throttled network conditions