Prerequisites
Before you begin, make sure the following are installed on your machine:| Requirement | Version | Notes |
|---|---|---|
| Java (JDK) | 21 | Set JAVA_HOME to the JDK 21 installation directory |
| Apache Maven | 3.x | Confirm with mvn -v |
| Google Chrome | Latest stable | Selenium 4 manages ChromeDriver automatically — no manual download needed |
Set up and run your first test
Install dependencies
Maven downloads all required libraries on the first run. You can trigger this explicitly so the test run does not need to fetch anything:Key dependencies pulled from Maven Central:
| Library | Version |
|---|---|
selenium-java | 4.18.1 |
cucumber-java | 7.15.0 |
cucumber-testng | 7.15.0 |
testng | 7.9.0 |
allure-cucumber7-jvm | 2.27.0 |
cucumber-picocontainer | 7.15.0 |
aspectjweaver | 1.9.21 |
Run the test suite
Execute the full test suite with Maven. The What happens when you run This scenario navigates to the RIU homepage, accepts cookies, opens the registration modal, fills in all fields except the birth date, submits the form, and asserts that the required-field validation message appears for the date field.
maven-surefire-plugin picks up the TestRunner class automatically and runs all scenarios tagged @smoke.mvn test:- Maven compiles the project and resolves dependencies.
- Surefire starts TestNG with the AspectJ weaving agent attached (required for Allure step capture).
TestRunnerinstructs Cucumber to discover every.featurefile underclasspath:featuresand run scenarios tagged@smoke.- For each scenario,
Hooks.setUp()opens a new maximized Chrome window. - Step definitions in
RiuStepsexecute againsthttps://www.riu.com/es. Hooks.tearDown()closes the browser after each scenario, regardless of pass or fail.- Raw Allure result files are written to
target/allure-results/.
@smoke scenario that runs by default is:The test run opens a real Chrome window on your desktop. This is intentional — the framework runs in headed mode by default. Do not close or interact with the browser while tests are running.
View the Allure report
After the run completes, generate and open the HTML report. You have two options:Option A — Maven plugin (recommended)Serves the report in your browser directly from Maven without any additional tools:Maven launches a local web server and opens the Allure report automatically at To generate a static report directory instead of serving it:
http://localhost:PORT. The port is chosen dynamically.Option B — Allure CLIIf you have the Allure CLI installed globally:Expected output
Passing run
When the scenario passes you will see output similar to the following in your terminal:Failing run
If the scenario fails — for example because the page title changed or the cookie banner was not found — you will see:Next steps
Architecture overview
Understand how hooks, steps, pages, and utilities fit together
Writing tests
Add new Gherkin scenarios and step definitions
Adding page objects
Encapsulate new UI interactions in page classes
Allure reports
Explore the full reporting capabilities