Using BDD and Robot Framework in Squash AUTOM
This page describes how to use BDD and Robot Framework: declaring Gherkin test cases, implementing the tests, and running them.
Overview of the process
We will use the following personas in this HOWTO:
- Pravash, the product owner for the project;
- Fabrice, the functional tester;
- Antonine, the automation programmer in charge of implementing the test cases defined by Fabrice;
- Annita, the Squash TM administrator.
The phases we will describe are:
Squash TM administrator
|Set up Squash TM|
|Write test cases|
|Transmit test cases|
|Get test cases|
|Automate test cases|
|Deliver automated test cases|
|Indicate automation is performed|
|Run automated tests|
(You can click a phase to access it directly.)
Some initial remarks
This HOWTO uses
- Squash TM 4.0.0
- Robot Framework 5.0
- The Browser library 12.1.0
- Robocop 2.1.0
- Node.js 16.14.2
- Python 3.10.2
but its content is mostly applicable to any version of these, only some technical details will change if using another version of Squash TM, Robot Framework, or Python.
Installing Prestashop as a SUT example
We need an example SUT for illustrating the BDD test lifecycle. For this purpose, we use the demo of Prestashop. If you want to reproduce the steps described in this document, this page describes how to install Prestashop.
This example describes how to perform User Interface tests. Their goal is to verify that the UI behaves properly, not to check that user workflows are handled as expected (e.g. that an order is properly generated and recorded in the order database).
That workflows should be tested at the service level, by calling the Web Service API (SOAP, REST, GraphQL…) of the SUT. Web Services tend to be much more stable that the UI, so the maintenance cost is lower for Web Service tests than for UI tests. Web Service tests are also simpler and faster to write.
The example provided here does not currently contain Web Service tests.
Accessing the code
The code used in this sample is available in https://gitlab.com/henixdevelopment/open-source/code-samples/howto-bdd-robotframework-01.