dev-resources.site
for different kinds of informations.
Exploring WebdriverIO
Hello QA's,
I recently bumped into WebdriverIO during my search for a better UI automation tool. Being into Selenium+Java, I have always found it to be hectic building frameworks, implementing listeners / hooks and wrappers, writing custom reporters / loggers and what not. But this new NodeJS based tool ( in fact, almost all the new age tools including Cypress and Playwright ) has made things simpler; be it the setup or integration with third party tools. I wanted to share with you what I found catchy with this particular tool. The points below might be applicable to others as well but for now let's focus on WebdriverIO.
- Setup - All you need to have as pre requisite is a node installation and an IDE. The npm will do the rest for you.
- Configuration - The whole bulky framework is now reduced to a single config.js file. You just command the WebdriverIO "Hey! Run the tests with chrome." Or "I want you to generate an allure report for my test". And that's it. WebdriverIO does it for you. The reporters, logging, hooks, drivers, test framework; all these are mentioned in the conf.js file.
- Integrate any kind of tests you wish to; be it Web UI or Mobile App UI or even API/ webservices calls. This is one of the features which made me pick WebdriverIO. I work on projects that has test scenarios integrated with Web + Mobile App + REST API. And most of the UI automation tools out there doesn't have this capability of integrating mobile app testing. WebdriverIO lets you achieve this by integrating Appium to your test suite.
- Run your tests anywhere without touching your code. WebdriverIO executes your tests in local env as well as any cloud platforms ( saucelabs, browserstack etc. ). You just mention it in your config.js and leave the rest to WebdriverIO.
- Multiremote - a feature that helps you handle multiple browser / driver sessions within the same worker. You can use this for cross browser testing, a server client app testing or a web + mobile app integrated testing.
- Multiple test frameworks support - mocha, jasmine and cucumber. I was able to maintain two different test suites within the same project - cucumber based suite for e2e tests and mocha based suite for data driven tests.
- Features like Isolated test contexts, auto-waiting, own assertion library, component testing.
- And a detailed documentation.
But still I feel few things are missing in WebdriverIO which would have made my life easier.
- Better debug options
- Better ways to handle flaky tests
- A code generator for recording the tests
Here is one sample project I have done. The WebdriverIO team was kind enough to list this among their boilerplate projects.
Featured ones: