Test Automation with Javascript based tools, libs & frameworks
Test Automation with Javascript based tools, libs & frameworks matrix by features :
As JavaScript automated testing frameworks have matured below have risen as the most popular and can be categorized by their protocols:
Jest is the testing framework created and maintained by Facebook. It spiked in popularity and became the most popular testing library in 2017 and stayed in the first place since then.
It was initially based on Jasmine which I will discuss later. Over time, Facebook replaced most of its functionality and added a lot of features on top of it.
Cypress is a direct competitor of TestCafe. They are doing relatively the same, which is injecting tests into a website, but they try to do it in a more modern, flexible and convenient way.
The difference between them is that Cypress.io runs itself in the browser and controls your tests from there where TestCafe runs in Node.js and controls the tests through a serialized communication with its injected script in the browser.
Parallel testing was introduced in version 3.10.
TestCafe is a great alternative to Selenium-Based tools. It was rewritten and open-sourced at the end of 2016.
TestCafe had also a paid version that offered non-programming testing tools. It has been deprecated and got replaced by the new TestCafe Studio.
TestCafe injects itself into the website as JavaScript scripts instead of controlling the browsers themselves like Selenium does. This allows it to run on any browser, including on mobile devices, and have full control over the JavaScript execution loop.
Recommended by LinkedIn
Puppeteer is a Node.js library, developed by Google. It provides a convenient Node.js API to control Chrome or Headless Chrome through an API the browser exposes: the DevTools Protocol.
Headless Chrome is just a regular Chrome v59+ that is launched with the
--headless flag. When Chrome is run in headless mode, it exposes an API to control it, and as said before, Puppeteer is the JavaScript tool that Google provides to control it.
Notice that different testing tools can also use Headless Chrome and Firefox. For example TestCafe, Karma, and Cypress.
Playwright is like Puppeteer extended to more browsers. It is developed by Microsoft by the team that originally developed Puppeteer.
The library automates Chromium, Firefox, and WebKit (Safari) by using the DevTools Protocol for Chromium, and similar technologies for other browsers.
It’s worth mentioning that since the library is pretty fresh (It was released in January 2020), breaking changes may be made in the near future and some things might not work or be documented as expected at the moment.
Conclusion
JavaScript automated test ecosystem has evolved alongside it to better suit the needs of modern web application development. Currently, three general approaches have solidified:
Regardless of the technique used, each JavaScript automated test framework has its pros and cons. The better we understand where these frameworks/tools excels and falls short, the more equipped we are to select the test framework that best fits our environment and context.
Javascript tools learning path : It is a nice learning path any one can explore:
https://testautomationu.applitools.com/learningpaths.html?id=web-ui-javascript-pat