/Selenium-Serenity-Junit-Template

Selenium Serenity Junit Template, Compatible with Maven or Gradle

Primary LanguageJava

Selenium Serenity Junit Template with Gradle or Maven as build tools to getting started with

To automate Selenium Webdriver binaries management in runtime am using webdrivermanager, an excellent library by Boni García

How to use?

Create the Page Objects of your Web application under pageobjects package, call those Page Objects in scenario steps under steps package and call those steps in jUnit tests under tests package (Sample Page Objects, testcase included in this template)

How to run?

Issue the below commands in project root directory

Gradle
./gradlew test aggregate

By default it runs in Chrome browser, you can specify which browser to use as well

./gradlew test aggregate -Dbrowser=firefox

aggregate in above command will generate Serenity HTML report under target/site/serenity

If you're on Windows replace ./gradlew with gradlew.bat

Currently supported browsers are

  • chrome
  • firefox
  • edge
  • ie
  • opera
Maven
mvn clean verify

Or

mvn clean verify -Dbrowser=firefox

Feel free to modify it to your own needs :)