Skip to main content

Prerequisites

Before you begin, make sure the following are installed on your machine:
RequirementVersionNotes
Java (JDK)21Set JAVA_HOME to the JDK 21 installation directory
Apache Maven3.xConfirm with mvn -v
Google ChromeLatest stableSelenium 4 manages ChromeDriver automatically — no manual download needed
Selenium 4 includes a built-in driver manager, but it still requires a matching version of Google Chrome to be installed. If Chrome is missing or outdated, the test run will fail immediately when the browser tries to launch.

Set up and run your first test

1

Clone the repository

Clone the project to your local machine and open it in your IDE.
git clone https://github.com/NoMeCompila/RIU-Web-App-Automation.git
cd RIU-Web-App-Automation
The project is a standard Maven project. IntelliJ IDEA will detect the pom.xml automatically and import all dependencies when you open the folder.
2

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:
mvn dependency:resolve
Key dependencies pulled from Maven Central:
LibraryVersion
selenium-java4.18.1
cucumber-java7.15.0
cucumber-testng7.15.0
testng7.9.0
allure-cucumber7-jvm2.27.0
cucumber-picocontainer7.15.0
aspectjweaver1.9.21
3

Run the test suite

Execute the full test suite with Maven. The maven-surefire-plugin picks up the TestRunner class automatically and runs all scenarios tagged @smoke.
mvn test
What happens when you run mvn test:
  1. Maven compiles the project and resolves dependencies.
  2. Surefire starts TestNG with the AspectJ weaving agent attached (required for Allure step capture).
  3. TestRunner instructs Cucumber to discover every .feature file under classpath:features and run scenarios tagged @smoke.
  4. For each scenario, Hooks.setUp() opens a new maximized Chrome window.
  5. Step definitions in RiuSteps execute against https://www.riu.com/es.
  6. Hooks.tearDown() closes the browser after each scenario, regardless of pass or fail.
  7. Raw Allure result files are written to target/allure-results/.
The @smoke scenario that runs by default is:
@smoke
Scenario: Navegar a la página de RIU y abrir el formulario de registro
  Given que el usuario navega a la pagina principal de RIU
  When el usuario acepta las cookies
  And hace clic en el boton de registrarse
  And completa el formulario de registro sin fechas
  Then se deberia mostrar la validación de campo requerido para fecha
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.
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.
4

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:
mvn allure:serve
Maven launches a local web server and opens the Allure report automatically at http://localhost:PORT. The port is chosen dynamically.Option B — Allure CLIIf you have the Allure CLI installed globally:
allure serve target/allure-results
To generate a static report directory instead of serving it:
allure generate target/allure-results --clean -o target/allure-report
allure open target/allure-report
mvn allure:serve is the easiest option for most developers because it requires no global CLI installation — the allure-maven plugin (version 2.12.0) is already declared in pom.xml.

Expected output

Passing run

When the scenario passes you will see output similar to the following in your terminal:
[INFO] --- maven-surefire-plugin:3.2.5:test ---
[INFO] Running runners.TestRunner

Scenario: Navegar a la página de RIU y abrir el formulario de registro  # features/RegistroRiu.feature:4
  Given que el usuario navega a la pagina principal de RIU               # steps.RiuSteps.navegarARiu()
  When el usuario acepta las cookies                                      # steps.RiuSteps.aceptarCookies()
  And hace clic en el boton de registrarse                                # steps.RiuSteps.clicRegistrarse()
  And completa el formulario de registro sin fechas                       # steps.RiuSteps.completaElFormularioDeRegistro()
  Then se deberia mostrar la validación de campo requerido para fecha     # steps.RiuSteps.verificarFormulario()

1 Scenarios (1 passed)
5 Steps (5 passed)

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

Failing run

If the scenario fails — for example because the page title changed or the cookie banner was not found — you will see:
[INFO] Running runners.TestRunner

Scenario: Navegar a la página de RIU y abrir el formulario de registro
  Given que el usuario navega a la pagina principal de RIU               # FAILED
    java.lang.AssertionError: ¡Error! El título de la página no es el esperado.
    Expected: RIU Hotels & Resorts · Web Oficial · RIU.com
    Actual:   ...

1 Scenarios (1 failed)
5 Steps (1 failed, 4 skipped)

[INFO] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] BUILD FAILURE
Failed steps are highlighted in red in the Allure report, and skipped steps (those that never executed because an earlier step failed) appear in grey. Each step shows its execution time and any assertion error message.
Because the tests target a live website (https://www.riu.com/es), flaky failures can occur if the site is slow, temporarily unavailable, or if the page structure changes. All BasePage interactions include a 10-second explicit wait, which covers normal network latency.

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

Build docs developers (and LLMs) love