Project to test Serenity with Selenium and Cucumber
Ricardo Ángel Muhamed ricardo.muhamed@gmail.com
#Teacher Sergio Sacristan
Basic automated search through Vueling.com and structuring the application code following,
- POM
- Builder
- Usage of WebElementFace
- src/main/java.../domain: DTO objects (for the data interface of every page)
- src/main/java.../pages: Page objects
- 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
- 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
- From IntelliJ: See intelliJ config.
- From command line: gradle check
gradle test -Dcucumber.options="--tags @something"
gradle aggregate
Then you can check the dashboard from index.html, it's located inside ./target/serenity