Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eataborda/ui-selenium
Selenium UI automation with Java + Junit5 + Gradle + Allure
https://github.com/eataborda/ui-selenium
allure-java allure-report allure-reports allure2 gradle gradle-java gradle-kotlin-dsl java junit5 selenium selenium-java selenium-webdriver
Last synced: 3 months ago
JSON representation
Selenium UI automation with Java + Junit5 + Gradle + Allure
- Host: GitHub
- URL: https://github.com/eataborda/ui-selenium
- Owner: eataborda
- Created: 2022-06-06T21:01:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T09:05:42.000Z (3 months ago)
- Last Synced: 2024-11-18T10:22:22.693Z (3 months ago)
- Topics: allure-java, allure-report, allure-reports, allure2, gradle, gradle-java, gradle-kotlin-dsl, java, junit5, selenium, selenium-java, selenium-webdriver
- Language: Java
- Homepage: https://eataborda.github.io/ui-selenium/
- Size: 19.1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![automation-ui-test-run](https://github.com/eataborda/ui-selenium/actions/workflows/automation-ui-test-run.yml/badge.svg)](https://github.com/eataborda/ui-selenium/actions/workflows/automation-ui-test-run.yml)
[![Junit5](https://img.shields.io/badge/Junit5-5.10.3-blue)](https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine)
[![Selenium](https://img.shields.io/badge/Selenium-4.24.0-blue)](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java)
[![Gradle](https://img.shields.io/badge/Gradle-8.9-blue)](https://gradle.org/releases/)# Selenium UI automation
A basic UI automation using Java + Junit + Selenium + Gradle. Automation
created to test the [Sauce Demo](https://www.saucedemo.com/) pageContains:
- Basic build.gradle.kts config to execute Selenium tests with Junit5
- UI automation using the POM pattern
- Allure HTML report## Use sample project locally
- Verify that you have `Git`
- Verify that you have `Java` installed, also that you already setup the following environment variables: `$PATH` and `$JAVA_HOME`
- Clone the repository and move inside that path:
```shellscript
$ git clone [email protected]:eataborda/ui-selenium.git
$ cd ./ui-selenium
```### Run tests
- Run all tests on the src (Can select: chrome, firefox, edge):
```
$ ./gradlew -Ddriver="chrome"
```
- Run all tests inside a class or a specific method using junit tags (@Tag):
```
$ ./gradlew -DincludeTags="regression" -Ddriver="firefox"
```
In this way you can use the following tags depending on the tests you need to run:
- General: regression, smoke
- Class level: standard-user, locked-out-user, problem-user
- Method level (@Test): buy-items, remove-cart-items, cart-items-persistence, order-inventory-items, verify-checkout-data, login-locked-user,
login-wrong-password, inventory-item-src-issues, inventory-filter-issues### Generate report
Once you have run the tests you can generate the Allure report by running the following command:
```
$ allure generate build/allure-results --clean
```
After running the above command successfully you will be able to find the report in the following path: `your-project-path/allure-report`### Open the report
Locally you can open the report in two ways:
- Using the command:
```
$ allure open /your-project-path/allure-report
```
The command starts a local web server and show the report directory's contents. Opens the report in your default browser.
- Opening the report file `/your-project-path/allure-report/index.html` in the browser of your choice. This shows the static contents of the report directory without starting any local web server.