Creating A Test Automation Portfolio Episode 3: Taiko, Gauge and JavaScript

  • OVERVIEW
  • Languge: JavaScript
  • IDE: Visual Studio Code
  • Source Code Management Tool: Github via Github Desktop
  • Type of Tests: Taiko, Gauge UI and API level automation
  • Website Tested: Various including The-Internet, Gauge.org

Intro

This episode is a brief one, all about my continuing odyssey of creating a test automation portfolio. This time, I’m following the advice the incredible Steve Mellor gave me some time ago and diving into ThoughtWork’s open source library Taiko and framework Gauge (which I still inexplicably spell “Guage”. every. single. time).

We’ve recently started using this where I work too, so having a sandbox to practice in has been cool.

The Project

I wanted to demonstrate a standard way that testers may like to begin creating a framework at this level – namely taking a free example one from somewhere else. There is a reason to “Google” is a recognised verb in the Oxford English Dictionary people!

So, what does it do?

Conveniently, the community/guys at Gauge have realised folks don’t like to reinvent the wheel too, so have created a set of example GitHub repo’s to get you started:-

https://github.com/getgauge-examples/

I chose “js-taiko” as I wanted to use JavaScript, which I believe I may have used before but certainly not recently. Note – it is true what they say about learning the basics of coding before you dive into automation, as once you have that you really don’t panic when a new language is thrown into the mix.

The tests do lots of basics to demonstrate the simplicity of Taiko and Gauge working together, such as interacting with various websites through smart selectors, form authentication, use of table-driven test data and mocks. It is very simple to pick up, and I found debugging nice and clear too.

Key Features

My strategy was basic, namely:-

  • Install the cloned framework, and get it up and running.
  • Get the existing tests to run (this took longer than I thought, a lot had changed in the couple of years since the original repo had been created).
  • Add in a few new tests from scratch

Here is a video of the tests successfully passing when executed in VSCode.

A short video of my Gauge Taiko JS test cases executing via the NPM Test command in a VSCode terminal window

The Code

I’ve published my repo as a template, which means you can use it as a basis to begin your automation framework. Check it out here:-

https://github.com/askherconsulting/taiko-gauge-javascript-vscode-test-automation

As I learn more, I’ll add more.

Lessons Learned

I was definitely reminded of the importance of having a jump off point – creating a lot of this stuff from scratch would have been extremely time consuming. Also, using an old repo is sometimes more trouble than its worth (approx 50% of test cases in this did not pass first time round, but it was actually a good learning curve to try and solve the puzzle of why!). Onwards!

Advertisement

4 thoughts on “Creating A Test Automation Portfolio Episode 3: Taiko, Gauge and JavaScript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: