Turbo charged JavaScript Testing framework

Turbo charged JavaScript Testing framework

AI-powered JavaScript testing framework

Vitaq AI turbo charges your JavaScript testing framework by working on top of platforms like Selenium and Appium. It supports JavaScript, Python, visual coding tools like Scriptworks and all CI tools. In addition it supports visual checking tools like Applitools and all cloud device platforms such as Saucelabs

This product has been developed to turbo charge your JavaScript Testing framework. By increasing UI and API test creation productivity. Using the power of AI machine learning algorithms, it provides continuous auto-generated tests. It also finds software functional bugs that other approaches miss. 

Mapping Mocha (or any other Test Framework) Code into Vitaq AI Test Automation Tool

Software Testers write their Automation code in their favourite IDE’s such as Eclipse, Intellij, Visual Studio Code etc. They quickly become productive in debugging their code in these IDE’s. This is due to their feature-rich syntax checking, code completion and debugging capabilities. QA and dev testers have their favourite IDE which they gain experience with over time since they have started coding. So we have made sure that our Vitaq AI users can keep this productivity by being able to use their IDE of choice. So they can continue to create, check and debug their code as they create it for Vitaq AI driven test automation.

Before mapping our existing Test Framework code such as Mocha into the Vitaq-AI Test Automation Tool. We need to understand Vitaq Test Actions and Test Activity Diagrams to know what they are and how they work. This will help the QA and dev tester make the transition to continuous autonomous testing.

Test Actions

Vitaq Test Actions typically represent web pages or app screens. The test scripts in these actions implement what the user can do, such as click a button or enter some data. The test data and sequences of Test Actions are auto-generated by Vitaq AI to efficiently fill the test space.

Test Activity Diagram

The Test Activity Diagram in VitaqAI Test Automation Tool is a highly visual approach for describing test scenarios. The diagrams make it easier to develop and automate the generation of intelligent tests for dynamically generated content in websites and mobile apps. Many call this type of approach Model Based testing. A Complete Test Activity Diagram consists of a number of Test Actions which are connected to their next allowable Test Actions. They model what the user wants to test in a particular user journey or use-case scenario based on their test requirements. 

Let’s now take a look at how Mocha Tests can be picked up and dropped into the Vitaq script section of a particular Test Action

1. Double Click on your desired Test Action for which you want to copy a Mocha JavaScript test. This might be a single function to complete a specific automated test or series of functions to test a whole web page. To Explain this concept we are going to use the user created “sign_In” Test Action of our Vitaq Test Activity diagram example below.

2. Go to the Sign_In function you have created in your Mocha Test.

3. We have used JS page object models for our Mocha tests. In our Mocha environment we have already created a signIn function which is present in the AutomationPracticeHome_Page js file. Therefore we can reuse that JS function from Mocha directly into Vitaq AI like this “AutomationPracticeHome_Page clickOnSignInLink()” inside the Vitaq sign_In Test Action script.

It is very easy to reuse all of your standard test framework code in the Vitaq AI Test Activity diagram.

Let’s now take a look at how your re-used Mocha test code can be enhanced to become data driven for highly variable exploratory tests by using Vitaq Test Activity Variables

As you can see above we have used the sign_In Test Action. It contains a simple click function which did not require any test data. QA test writers typically write their test code with fixed data values. But what if we want highly variable data that continuously changes? Luckily Vitaq has come up with a way of replacing our fixed data. This is called the  Vitaq Test Activity Variable and is the first step in turbo charging your JavaScript Testing framework.

Test Activity Variables

Vitaq Test Activity Variables are the test script variables which hold test data. Hence we can substitute them into our reused Mocha test code. In the Vitaq Test Action scripts we can call upon this test data dynamically as Vitaq AI runs. So when Vitaq AI is running, it is executing each Test Action Script in each Vitaq Test Action. Once a script is completed it chooses the next allowable test action in the diagram to execute next. All these next Test Action decisions and test data generation decisions are driven by the AI machine learning algorithms of Vitaq. These ensures we always “cover” our user journey requirements. Simply giving you continuous auto-generated AI-driven and coverage-led test scenarios.

Let’s look at the user journey example for User Registration. To test it we will need test data created for the user’s first name, last name, address and phone. We could stick to a very directed and static value based test data from Mocha. Or we can release the Power of variability by using the Vitaq Test Activity Variables. These will automatically create the data needed driven by the AI machine learning algorithms to the tool.

In the example for User Registration, we need the user’s first name , last name , address and phone number. All of this data can be kept inside the Test Activity Variables provided by VitaqAI Test Automation Tool.

A worked example to turbo charge your JavaScript Testing framework

Let’s go through the details of the newsletter Test Action. We have re-used our Mocha code in the Vitaq Test Action script. Now we require a newsLetterName Test Activity Variables for subscribing to newsletter of AutomationPractice.com. Let’s take a more detailed look at that to Understand it.

1) Double click on the newsletter Test Action where we are using the Vitaq Test Activity Variable named as newsLetterName Present under Activity Variable Tab on the Right Most Side After Action Properties Tab.

2) Inside the newsletter Test Action Script, we can see Test Activity Variable newsLetterName has been called using requestData(). This is one of the Vitaq AI library methods which we can simply use to generate and return new values for our defined Vitaq Test Activity Variables when they are called in a Test Action Script.

Each time Vitaq AI runs this Test Action and executes the JS Test Action Script, Vitaq AI will get to work. It will decide what are the most appropriate data values to create for the defined Test Activity Variables. This dynamically enhances your JavaScript Testing framework for Data Driven Testing.