# Gondola Test Designer
# Introduction
The Gondola Test Designer allows you to easily write and edit Action Based Testing (ABT) test.
We'll discuss some basic Action Based Testing concepts in this section.
# Default ABT Template
When you create an ABT test, the default template will be shown in the Gondola Test Designer.
- Test Configuration is a section for:
- Tests' Initial and Final Methods
- The Suite's Initial and Final Methods
- Other Settings
- Test Cases:
- Test cases
- Automation keywords
# ABT Test Items
# Test Module
In an ABT project, a Test Module is represented by a test file.
- A Test Module has at least one Test Case but usually more.
- The name of the file is the name of the Test Module
- Test Modules can be found under the
src/tests
folder of a project. This sample project will make it clearer. - Test files are TypeScript files that can be edited in GTD or as a normal
.ts
files in VSCode.
# Test Configuration Keywords
In GTD you can use the following Keywords to organize your test module:
- Test Initial: defines a set of actions that will be executed before each test case begins.
- Test Final: defines a set of actions that will be executed after each test case ends.
- Suite Initial: defines a set of actions that will be executed before the test module begins
- Suite Final: defines a set of actions that will be executed after the test module ends.
# Test Cases
In an ABT project, there is at least one Test Case in a Test Module.
- In GTD, you can create a new test case by entering the keyword
Test Case
in any cell on the first column under the TEST CASES section. - You should enter a value for Test Case description. If your test case is untitled, it may be difficult to find in a report.
- All test steps and action lines below a Test Case belong to that test case until another Test Case is defined. In other words, an test case is a block which contains keywords for steps and actions.
# Built-In Actions
Gondola built-in actions allow you to perform a myriad of functions to test your application. They include actions like click, enter, and getJSONValue For a list of Built-In Actions refer to the Gondola API. There is an extended set of actions for mobile applications like tap and swipe. Please go to this page for supported mobile built-in actions.
# User-defined Methods
User can create new methods (or action) based on built-in actions by using Page Object Model. Please read this article for more information on Page Object.
# Automation Scripting
In order to implement an automation script, you have to use executable keywords. It's usually matched with the step belows to implement an automation script:
- If there is no blank action line, add a new one.
- Input the keyword in any cell of the first column and hit Enter
- Gondola will automatically display the parameter(s) for that keyword in the next cells
- Enter a value for the parameter
Note
- Executable Keywords are:
- Gondola built-in actions
- Methods from Page Objects
- If a keyword is executable, the "predictive text" feature will work.
# Statements
When using statements in a Test Case, use one of following keywords:
- If: to open an If block and specify a condition
- Else: a block of code to be run, when the first condition is false
- While: to open a While block and specify a condition
# Variables
Variables declared in the Test Configuration Section are available to all of the Test Cases in the Test Module i.e. Global Variable.
Variables declared inside a Test Case are only available to that Test Case i.e. Local Variable.
If the variables are in a Test Configuration Keyword section they are Local to that section even if declared under the Test Configurations section.
Variables are set using the following syntax [set variable
] [<name of variable>
] [<value of variable>
] [<type of variable>
]
Following steps are used to create a variable:
- If there is a blank line, create one.
- Type
set variable
in the cell on the first column - Type the variable's name in the next cell
- Variable names can contain alphabets and numeric digits.
- They cannot contain spaces and special characters, except the underscore (_) and the dollar ($) sign.
- Variable names cannot begin with a digit.
- Type the variable's value in the third cell
- Type the variable's type in the fourth cell
- GTD suports 4 basic types which are string, number, bool and any.
- If the variable type cell is blank (or filled with any), the type will be any and the variable's value will be treated as a string and you have to add $ before the value if you want the value is a number or boolean value (true or false)
For example:
To use a variable in an action line use $
as an indicator