I’m excited to be presenting at this year’s ATTAC (Australian Test & Tech Automation Conference) in Melbourne on 24th May on establishing automated e2e web testing in Node.js:
Node.js is so hot right now. Whether you’re looking at quality engineering jobs at a new and upcoming startup, or at an established corporate, chances are you’ll see Node.js on the tech stack. But establishing automated e2e web testing in Node.js is hard since it’s very different to traditional web automation technology. In this talk Alister will use nearly four years of Node.js experience to bring clarity to the somewhat confusing Node.js landscape, going into detail on things like asynchronous promises, ECMAScript transpiling, npm vs yarn and monorepos.
Adventures of end-to-end automated web testing in Node.js #
I attended the first conference last year in Melbourne and loved the format (single day, single track), affordability (tickets from AUD$199) and technical subject matter.
Early bird tickets are on sale now. I hope to see you there!
We use CircleCI to run our automated end-to-end (e2e) tests for WordPress.com.
We run our tests pretty frequently – not only against every individual change coming through – but we also run them in Production every time someone deploys (about 30 times per day) – as well as every 6 hours to cover weekends and quiet periods of deployments to make sure our hardware and other changes haven’t impacted our key customer flows.
Originally CircleCI didn’t support scheduled jobs so we set up our own infrastructure to schedule jobs to call the CircleCI API which executed the tests.
Fortunately version 2.0 of the CircleCI config now natively supports scheduling jobs which is exactly what we want to do. Since it also uses cron, the default scheduling format, it was very easy to create our jobs in CircleCI.
A great presentation from the recent 2018 Selenium Conference with a few shout-outs to this blog. I really like what Wes and Kurt were able to achieve using AWS Lambda – amazingly fast e2e tests running in parallel.
I have dodged the AngularJS /Protractor bullet for many years now. May last foray, some 5 years ago, was a cluster to put it mildly! Cucumberjs/Angularjs/Protractor/chai/mocha/ the stack was in its infancy and failed miserably!! Many cycles were spent pulling fixes from our own repos instead of waiting for PRs to get done. This was in stark contrast to the ease and stability of the automation I wrote using Watir-Webdriver and eventually Watir.
I am now faced with automating the regression test cases for an Angularjs App.
Question: Do I finally jump back into the using stack that almost caused me to lose my mind, or is it possible to use Watir/Selenium to build out meaningful e2e UI automation for an angularjs app as we dawn on 2019?
It’s still my opinion in 2018 that writing e2e tests in Node using either Protractor or WebDriverJs is still more difficult than using Watir in Ruby.
Sure using async functions with await commands makes things easier than before (see examples in our project), when you would have first come across Protractor, but I still feel like there’s a lot of catching up to do to get to the stability and ease-of-use of Watir.
My decision would come down to whether others on your project are going to be comfortable maintaining tests in ruby – if they are I’d use Ruby and Watir, otherwise I’d revisit Protractor if they really want to use Node.
I only speak at one conference a year and this year that conference will be the first ever Australian Testbash in Sydney on October 19, 2018:
At WordPress.com we constantly deliver changes to our millions of customers – in the past month alone we released our React web client 563 times; over 18 releases every day. We don’t conduct any manual regression testing, and we only employ 5 software testers in a company of ~680 people with ~230 developers across . So, how do we ensure our customers get a consistently great user experience with all this rapid change?
Our automated end-to-end (e2e) tests give us confidence to release small frequent changes constantly to all our different applications and platforms knowing that our customers can continue to use our products to achieve their desires.
Alister will share how these automated tests are written and work, some of the benefits and challenges we’ve seen in implementing these tests, and what we have planned for future iterations.
Takeaways: How to effectively use automated end-to-end testing to ensure a consistent user experience in high frequency delivery environments
First of all thanks for sharing all your insights on this blog. I regularly try to come back to your blog and I helped me grow as a QA Engineer quite a lot.
Could you help me and point me in the right direction?
You can write synchronous tests (like using Watir/Ruby) against asynchronous web interfaces, you just need to use the waiting/polling mechanisms (or write/extend your own) – the same as you need to do in asynchronous test automation tools.
I have tried to use cypress.io but the way it controls sites (through proxies) has (current) limitations like not working on iFrames and cross-domains which are deal-breakers for our end-to-end testing needs at present.
I’m glad I’ve been able to help you grow over the years.
Hey! In order to test the security of a website, I’m trying to create hundreds of accounts. However, after a certain limit, there is always an error which prevents me from going further.
How can I hide/change my ip address during each iteration with watir?
I can understand why there would be this limitation in place as this activity seems suspicious from a systems perspective.
Watir can’t change the IP address. You can use an anonymous browser profile and/or delete cookies for different account creation runs but this probably won’t help.
I’d speak to your development/devops/systems team to whitelist your IP address(es) you are using for this purpose.