Transmit an automated test case to a source code management server
Squash TM allows test cases to be written in BDD and Gherkin. These scenarios can be transmitted in .feature or .robot format to a remote repository on a source code management server. They are thus easily available for automation.
Each keyword in the scenario can be implemented in the framework selected by the automation engineer as long as this framework is able to interpret the Gherkin language, link a Gherkin script to the implemented methods, execute a Gherkin script (automated actions and controls) and generate an execution report.
After the implementation, the execution can be launched from the Squash TM interface or from a CI/CD pipeline (via Jenkins or Squash Orchestrator).
Transmit Gherkin and BDD test cases
To transmit a Gherkin or BDD test case to a source code management server, you absolutely must:
- have activated an automation workflow on the project (Squash advanced, Squash simple or Jira)
- have configured the repository of the source code management server on the project
- have selected the test case as being eligible for automation
Please visit the page Configure the Project's Automation to activate the workflow and set up the repository associated with the project.
Three methods of transmitting a test case are available:
- from the Automation block of a test case with the button
- from the Test Cases workspace, via the button and then the Transmit for automation option once you have selected several test cases in the tree view. Please note that for mass transmission to work, the automation workflow must be activated on all projects containing selected items. Otherwise, the option is disabled.
- from the Ready for transmission anchor icon in the Automation workspace via the button once you have selected the test cases in the table (only for advanced Squash workflow).
When a user transmits Gherkin or BDD test cases as part of the native or remote automation workflow, the following actions are performed:
- Writing the files to the local repository as <id_ct><name_ct>.feature or <id_ct><name_ct>.robot.
- Transmission of files to the remote repository. All added or modified files contained in the "working directory" are added to the git index. A one-minute timer is triggered by Squash TM at the end of which a commit is performed followed by a push. A re-base is performed if necessary. Any transmission carried out on this repository during the one-minute delay resets the timer and adds the new files to the git index.
- Displaying files transmitted to the remote repository
Displaying scripts in the source code management server
The scripted test cases are displayed in the remote repository inside the configured working directory. Based on the choice made in the project settings, it is possible to use the Squash TM tree structure in the repository. When the option is active, the test cases are structured in the same way on both sides. In case it is not active, the test cases arrive at the root of the defined working directory.
Squash TM formats the BDD test cases written in the application in accordance with the automation language defined in the project configuration. It adds some information.
Cucumber test cases are displayed in Git as follows:
While the Robot Framework test cases are displayed as follows: