John X asks…
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
Grab a ticket before they sell out #
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.
Mudit Bhardwaj asks…
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.
I recently noticed the new Google Chrome project Puppeteer:
Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.
As someone who only runs WebDriver tests in Google Chrome anyway, this looks like a promising project that bypasses WebDriver to have full programmatic control of Google Chrome including for automated end-to-end (e2e) tests.
The thing I really love about this is no Chromedriver dependency and how installing the library installs Chromium by default which can be controlled headlessly with zero config or any other dependencies.
You can even develop scripts using this playground.
I set up a (very basic) demo project that uses Mocha + Puppeteer and it runs on CircleCI with zero config. Awesome.
Happy New Year! 🎉 One thing I love about the end of the year is going through all the lists I have made during the year and counting up my stats and reflecting on things. I read (to completion) 37 books (and abandoned a further 4) in 2017. Not quite as many as 2016 when I finished 48 books but I had some difficult circumstances with family illness in 2017.
Here’s five of my favourite books I read in 2017 (with Good Reads links):
The Art of Stillness: Adventures in Going Nowhere by Pico Iyer. This was the first TED book I read and having read quite a few more since it was probably my favourite. I read this at a part of the year where I was over-committing to too many things (travel, conferences, events) and it was a apt reminder to slow down and appreciate things. This book led me to my mindfulness meditation practice which I took up in the later part of the year (and have continued to do since then).
How to Fail at Almost Everything and Still Win Big: Kind of the Story of My Life by Scott Adams. I’m not a huge fan of Dilbert, but I’m a big Scott Adams fan after reading this book. The ideas I really like are the importance of systems over goals (a good blog post about that here), and that passion follows success (passion doesn’t lead to success: you can be passionate about something and really suck at it). Also the importance of diversification. An enjoyable well written read.
Payoff: The Hidden Logic That Shapes Our Motivations by Dan Ariely. The second TED book I read this year (I love the format!) and the best book about motivation I’ve read so far. I’ve tried to read Drive by Dan Pink a few times but haven’t been motivated to finish it. The thing I learnt from this book is that we lose meaning and motivation in life by outsourcing the hard work/small things (like cleaning, gardening, maintenance) – we accomplish more but get less.
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life by Mark Manson. This book is a bit weird. It’s hard to read, because it jumps all over the place, but there’s so much good content it’s still worth reading. I also wish the book had a really clear list of things I could take away from the book and do, rather than understanding the general message which is a bit bleak. Still a good book and enjoyable read after all that.
Deep Work: Rules for Focused Success in a Distracted World by Cal Newport. One of the last books I read this year it is particularly relevant to me working for a 100% distributed company in an asynchronous communication environment it’s easy to get distracted by constant chatter and noise and not focus enough on deep work. The thing about this book is that if you can master deep work in our current world it’s another skill that you can use to be very successful as it’s a huge competitive advantage.
*** BONUS ***
Not work related but I read a lot of fiction particularly thrillers. Michael Connelly’s latest Harry Bosch book Two Kinds of Truth was just fantastic: hard to describe how good it was.
Is there any way to make Watir click a link/button that is not visible? I wanted to switch from Capybara/CapybaraWebKit (which allows clicking non-visible elements) but I am stuck since Watir always times out on the click attempt.
In Watir, this looks something like:
browser.execute_script( "return arguments.click();", browser.link(:id => 'blah')
Hope this helps!