Acceptance testing following the Screenplay Pattern with Cucumber and WebdriverIO. The base of the framework has been built with JavaScript programming language and Gherkin.
Path | Description |
---|---|
data | It is where we put all the data that we need to execute the test cases, such as headers, selectos, etc. |
facts | It is where we put all the classes that we need to initialize the execution of the test cases; we can say that it is related to the "Given step". |
features | It is where we put all user stories written in Gherkins. |
interactions | It is where we put all the classes related to the interactions with the SUT, such as the clicking button or the input of values in form fields. |
models | It is where we put a page or user interface component; in other words, it encapsulates the elements and actions that can be performed. |
questions | It is where we put all the classes to check if the task has been successful; we can say that it related to the "Then step". |
steps-definitions | It is where we put all our steps that are written in the "features" section. |
tasks | It is where we will put all the classes related to the business goal, the action that we do during the execution of the test case; we can say that it is related to the "When step". |
We need Node.js installed to execute the test. In particular, I used v19.8.1.
To install the framework, we must follow these steps:
-
git clone https://github.com/granchetti/google-test.git
-
npm install
To run the test case, we must follow these steps:
npm run test
We have to build a docker image in order to create the containers, for example:
-
docker build -t mytest -f dockerfile .
-
docker run -it mytest
To create the report, we must follow these steps:
-
npx allure generate allure-results --clean
-
npx allure serve allure-results
We have a Jenkinsfile with the configuration of a job in Jenkins.