Getting Started with Automation of User Journey Tests - Softrams

  • Culture
  • Human Experience
  • Test

Murali M
April 16, 2021 504 views

Team working on user journey testing

Two individuals working on their laptops on various work related items

My previous post, ‘Automating User Journey Tests‘, talked about the need for accessibility of user journey tests for each team member and how we chose Gauge as our framework of choice. I also introduced our open source steps library to make this possible for everybody in the team, irrespective of their programming background, to be able to contribute to user journey tests. In this post, I will expand on how to get started with the framework.

Please note that we expect the first few steps of this setup to be done by team members with a programming background and offer a fully configured workspace to the rest of the team members. Refer your colleagues with devops, development or automation skills to this repo that offers a fully setup workspace as well if your teams use container based workspaces.

Install Dependencies

These instructions are good for installing Gauge on MacOS. Please refer to Gauge docs for installing on Windows or Linux environments.

Before we begin, you must have Nodejs installed. You may install with homebrew or use appropriate installation package from Nodejs downloads page.

// Install Nodejs
brew install node

// Install Gauge
brew install gauge

// Alternately, you may also use NPM to install Gauge
// npm install -g @getgauge/cli

While not mandatory, we strongly recommend using VSCode as code editor or integrated development environment, as Gauge comes with a great extension for VSCode that makes working with user journey tests a breeze.

Setting up a new project

Start by creating a new folder for the user journey automation project and go inside the new folder created. If you would like to add user journey automation to an existing project, go to the respective folder and follow the command prompts below to proceed further.

// Create a new folder
mkdir gauge-taiko-demo

// go inside the folder
cd gauge-taiko-demo

// initialize a new Gauge project, that uses javascript and Taiko driver/test runner.
gauge init js

// Run default tests generated to verify everything is successful
npm test

Using Gauge Taiko Steps

In the next couple of steps, we will install Gauge Taiko Steps that will help build user journey tests for a majority of common scenarios without developing any code. Please refer to documentation at https://github.com/softrams/gauge-taiko-steps for more details.

// Install Gauge Taiko Steps
npm i @softrams/gauge-taiko-steps

// To include Gauge Taiko Steps to your project, update STEP_IMPL_DIR variable in./env/default/js.properties from: STEP_IMPL_DIR = tests to
STEP_IMPL_DIR = node_modules/@softrams/gauge-taiko-steps/lib, \
                tests

// Delete the default files generated during project setup
rm specs/example.spec
rm tests/step_implementation.js

That’s all! This setup is everything you need to build your first user journey test.

Creating Your First User Journey Test

Create a new file inside specs folder. For this demo, this file will be called, navigation.spec. Open the file in an editor and start creating your first step.

In the first step, we will just open cdc.gov website and check if text “About CDC” exists.

# Navigation User Journey Test
You may optionally add any notes in Markdown format

## Open CDC.gov website and check for text "About CDC" exists
* Goto "https://www.cdc.gov"
* Check text "About CDC" exists 

That’s it! Go ahead and run tests now. If everything is setup properly, you should see test executed successfully.

// Run tests
npm test

// You should see an output like this, if everything goes well

> gauge-taiko-template@ test /demos/gauge-taiko-demo
> gauge run specs/

# Navigation User Journey Test
  ## Open the CDC.gov website	 ✔ ✔

Successfully generated html-report to => /demos/gauge-taiko-demo/reports/html-report/index.html

Specifications:	1 executed	1 passed	0 failed	0 skipped
Scenarios:	1 executed	1 passed	0 failed	0 skipped

Total time taken: 3.512s

You may now open the test report in HTML file to easily review tests.

open ./reports/html-report/index.html

Here is a sample screenshot of the HTML report

In the upcoming posts, I will cover various capabilities and build a variety of user journey tests including accessibility audits without any additional programming. Please let me know if you have any questions or feedback by leaving a comment.



More Stories

  • Shedding Light on DarkSide

    David Knife
    May 21, 2021

    Ransomware is a type of malware that infects the victim's computer and attempts to have them pay a “ransom” to use it again. DarkSide is a type of ransomware attack that was first seen in 2020. Once it infects a network, it exfiltrates unencrypted data.

  • Understanding ClickJacking

    Harshita
    September 7, 2021

    Explore ClickJacking; an interface-based attack where a user is tricked into clicking on a website or application in order to obtain user information. Learn more the different ways to protect yourself from such malicious attacks.

  • Photo by Pixabay on Pexels.com showing a thought bubble that leads to a "lightbulb" breakthrough

    Psychology in User Experience

    Murali M
    September 24, 2020

    The most obvious connection between psychology and UX is in the assessment of the users. Psychologists are able to offer insight about the user which extends beyond the standard demographics one might expect (i.e., age, gender, career, etc.).