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.
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
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
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.
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.