Skip to content

rmuhamed/mdas_testing_selenium_automated_search

Repository files navigation

MDAS - Fundamentos de pruebas - Práctica Selenium

Project to test Serenity with Selenium and Cucumber

Responsible

Ricardo Ángel Muhamed ricardo.muhamed@gmail.com

#Teacher Sergio Sacristan

Getting started - Overview

Basic automated search through Vueling.com and structuring the application code following,

  • POM
  • Builder
  • Usage of WebElementFace

Structure

Application mirror

  • src/main/java.../domain: DTO objects (for the data interface of every page)
  • src/main/java.../pages: Page objects

Application tests

  • src/test/resources/features: create a structure in order to have all the features of a page in the same folder.
  • src/test/java/,,,/builders: use the patter Builder and Data Builder in order to encapsulate the managemenet of the data needed for the tests.
  • src/test/java/,,,/domain: DTO to access the API of the AUT (application under test).
  • src/test/java/,,,/services: use the pattern Facade to encapsulate the initialization of the data scenario. This initialization should be done be calling the API services of the AUT or DB (using a DAO), but never initialize the data calling another pages of the AUT.
  • src/test/java/,,,/stepsdefs: create a StepDef per Feature, and follow the same package structure as the related feature
    • For commonn steps to different stepDef, but within the same folder, create a CommonStepDef
    • Use Serenity.getCurrentSession().put/get to share common data between related steps definitions classes
  • src/test/java/,,,/tests: here you have the classes to run the tests

Configuration

  • This is a gradle project, you can import it from your favorite IDE as Gradle project.
  • To verify that all is up to date with dependencies and test compilation, execute the gradle task: testClasses
    gradlew.bat testClasses
  • Before execute the tests, execute the gradle task: downloadChromeDriverServer

Compilation

Execution

gradle test -Dcucumber.options="--tags @something"

Reports generation

gradle aggregate

Then you can check the dashboard from index.html, it's located inside ./target/serenity

Releases

No releases published

Packages

No packages published