There has been explosive growth in JavaScript Automation Frameworks usage over the past few years.
You might ask why? I believe that one of the main reasons for this is that there are a lot more web applications that are now using technology like AngularJs and React, so of course, this is giving rise to many more JavaScript developers in the field.
I originally created this post in 2016, but since then, lots have changed. So I went ahead and deleted the libraries that are no longer maintained.
Read on to learn the following:
- shift left with testing automation
- the top javascript automation frameworks
- more details for each framework
INDEX
Shift Left Test Automation Javascript Frameworks
What are the Top JavaScript Automation Frameworks?
1. Jest
2. Puppeteer
3. Playwright
4. Jasmine
5. Nightwatch.js
6. Nemo.js
7. Cypress.io
JavaScript Automation Frameworks Wrap-Up
Shift Left Test Automation Javascript Frameworks
Most companies are also making a test-first, shift-left move in their development practices due to a larger demand from developers who want to create their own tests in the language they are most familiar with: JavaScript.
Many front-end developers and programmers also want to create their own automated tests to get quick feedback on whether or not they’ve broken a code in their application while checking in new code or making changes to the existing codebase.
In my last post, I showed you the top 14 general Open Source Test Automation Frameworks You Need to Know, but what are the top JavaScript Automation Frameworks?
What are the Top JavaScript Automation Frameworks?
Most of you are probably wondering what the top test automation frameworks for JavaScript actually are.
Here’s what I found. I ranked the JavaScript test automation frameworks in order of popularity based on a combination of GitHub stars and NPM downloads numbers:
1. Jest
When I first wrote this post, I don't think Jest even existed. Now it seems to be one of the more popular automation javascript frameworks out there. Based on its GitHub and NPM number, it jumps straight to the number #1 spot.
Jest is used by Facebook to test all JavaScript code, including React applications. It's easy to set up since they really focused on making it a zero-configuration experience. Jest comes with all of the capabilities of a bunch of tools that you don't really need to worry about integrating at all.
• 38.3 GitHub Stars
• 107,733 NPM downloads in the last month
2. Puppeteer
Since its release, Puppeteer pretty much made PhantomJS obsolete. Puppeteer is a Node library. It gives you a high-level API to control headless browsers like Chrome or Chromium. You can also configure it to use full (non-headless) Chrome or Chromium.
• 76.8k GitHub Stars
• 58,366 NPMdownloads in the last month
3. Playwright
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox, and WebKit with a single API.
• 35.4k GitHub Stars
• 1,273,433 NPM downloads in the last month
4. Jasmine
Jasmine is a behavior-driven JavaScript framework for testing JavaScript code. This is the “go–to” unit testing framework for many developers, including Derick Bailey from watchmecode.net.
In my TestTalk with Derick, he mentioned that he knows it's not the most up-to-date framework out there; there are other test frameworks that push forward faster and more frequently. But he’s not necessarily interested in staying on the cutting edge (or even the leading edge) of the testing world. Derick is more interested in long-term stability, support, and simplicity, which he finds in Jasmine, which is why he continues to stick with it.
For many developers, Jasmine is still their main go-to JavaScript testing tool because of its simplicity and getting things up and running.
• 15.3k GitHub Stars
• 1,385,198 NPM downloads in the last month
5. Nightwatch.js
Nightwatch.js describes itself as an easy-to-use Node.js-based end-to-end (E2E) testing solution for browser-based apps and websites. It uses the Selenium WebDriver API to perform commands and assertions on DOM elements for front–end testing.
Think of Nightwatch.js as a testing framework that is written in JavaScript and designed for web developers. Nightwatch.js gives you an API for writing your test — your test would basically be just node modules — and the runner itself is a Node.js application.
Nightwatch.js test runner can execute tests in parallel. It also works with Selenium Grid and Sauce Labs, and sometimes, more importantly, it has good documentation.
• 11k GitHub Stars
• 131,501 NPM downloads in the last month
6. Nemo.js
Nemo.js is an open-source, Node.js automation framework that was developed by PayPal. Nemo.js provides a simple way to add Selenium automation to your Node.js web projects. It also provides plugin architecture to incorporate custom features into your tests.
For more in-depth examples on how to get started with Nemo.js, check out Nilesh Kulkarni's Automation Guild session on Getting Started with Javascript Selenium Automation using Nemo.js.
• 165 GitHub Stars
• 31,387 NPM downloads in the last month
7. Cypress.io
You might be asking what about a tool for javascript in automation testing?
If you're looking for help with javascript UI automation, Cypress.io is another tool that is rapidly gaining in popularity.
And unlike tools like Selenium, Cypress is a more developer-centric test automation framework that focuses on making test-driven development (TDD) a reality for developers and test engineers. One of its design principles was to be able to package and bundle everything together to make the entire end-to-end testing experience pleasant and simple.
To learn more, check out my interview with the Founder and the VP of engineering at Cypress.
Test Automation Tips & Training
JavaScript Automation Frameworks Wrap-Up
JavaScript, once thought of as a toy language, is now becoming one of the most-known languages for the web.
If you are involved in testing JavaScript-based web applications, you’ll really benefit from learning one of these JavaScript automation frameworks to help boost the productivity of your current teams and enhance your future career options.
This should give you an idea of what is out there already and hopefully give you enough info to check out more.
These are the top frameworks I’ve come across. But as I mentioned earlier, there are tons of JavaScript test automation framework popups everywhere, so I’ll definitely be adding to this list as time goes on.
If one of your favorite automation with Javascript frameworks is not listed, please let me know, and I’ll add it.
Nice informations !
Joe – Really useful information. Does any of the above js test frameworks can be utilized to automate jquery applications?
Great article!
You said that: “Because the testing is headless, the scripts run much faster than a traditional browser-based approach would.”
But I read another article that said the contrary: “Headless browsers aren’t faster than real browsers: contrary to popular belief, headless browsers aren’t faster than real browsers. Most of the time that it takes to load a page is the actual network content: html, JavaScript, images and CSS. This still has to be loaded by a headless browser, it just doesn’t have to render the pixels to a screen. Browser vendors like Google Chrome and Mozilla Firefox invest a lot of time/effort/money to make their browsers and JavaScript engines super fast which we can leverage by running tests in them.”
So, what do you think??
Nice information Joe. I am an automation tester with primary skills in QTP, selenium with python binding. I am a beginner in javascript. I am trying to learn javascript but yet to completely internalise the need to do so for testing. Would you mind guiding me?
I suggest to take a look at CodeceptJS: http://codecept.io/
WOW – this looks awesome! Thanks for link Alessandro!
Thanks for the article!
TestCafe was released recently. It’s a pure node.js end-to-end solution for testing web apps. It takes care of all the stages: starting browsers, running tests, gathering test results and generating reports. TestCafe doesn’t need browser plugins – it works in all popular modern browsers out-of-the-box.
https://devexpress.github.io/testcafe/
Thanks Alexander! I’ll check it out
Squish – Squish uses property-based object identification (independent of screen position), and is able to record and replay test scripts written in JavaScript, Perl, Python, Ruby or Tcl.
The article is very interesting, thank you very much for sharing the information.
My only comment is that i think the following statement is slightly inaccurate
“It’s also frequently described as a framework that falls somewhere in the middle of a unit testing and end-to-end test tool that is regularly by both Developers and QA testers.”
Protractor like Selenium is an E2E testing framework. Instead I would say that the “Karma” automation framework is more in the middle of the unit testing and E2E testing
Thanks for such informative article Joe,however I would strongly suggest to add Mocha+ chai combination considering its wide user base.
Hi Christian – thanks! I believe you are right
Great article. I’m starting to evangelize using raw webdriver js for automated testing. Do you have a link to the ‘analysis’ by dave haeffner showing selenium downloads for javascript?
Thanks for the great article!
I included it in the “links” section of my article “A Complete Guide to Testing JavaScript in 2017”:
https://medium.com/powtoon-engineering/a-complete-guide-to-testing-javascript-in-2017-a217b4cd5a2a
Awesome – thanks. Why does your article’s formatting look so much better than mine? Does medium handle the formatting for you automatically?
Executing end-to-end and regression tests using the Protractor Framework has freed a lot of testing Protractor longtime, It’s like its an end to end testing framework. It arranged to want a vital development effort from the team to create the tests. Still, there will be a frequent payback for these purposes during the software development lifecycle.
Hi All ,
Is there is any UI testing automation framework that scans the UI or web page . And tell us the differences between all browsers pixel by pixel .
Examples :
1. How image looks in IE / FF / Safari / Chrome and we can catch the differences
2. How header text or other UI controls looks in different browsers . And we can catch the same
I was looking for a quick comparision and found it here! I think you should be also including about Test Cafe https://github.com/DevExpress/testcafe
My guess it, when the article was written, Test Cafe was not that popular!
The test can be written using typescript and also has extensions to test angular pages.
Thanks Maq just interviewed the folks at TestCafe and will update this post soon,
Hi … My question is – If I want to Automate any Web UI using JavaScript, then what all tools are required ?
[ Like in case of Web UI Automation using Java, we need Java + selenium. And TestNG and Maven will be add-on. ]
Please help.
Interesting article. How about TestCafe?
Hi Raghu, you might want to try with WebDriverIO (https://webdriver.io/). It’s an automation testing framework for NodeJS which can be used for E2E testing on both browser and mobile application.
Do Nightwatch and WebdriverIO support automating Angular JS application as well? If yes, which one is better?
Hello,
Perfect once, As a part of Web automation Testing company The article is really helpful for me…I would love to share this with my team