https://github.com/geozi/selenium-java-junit-ulelement
Showcases the use of Selenium with Java and JUnit for performing functional tests on an <ul> element.
https://github.com/geozi/selenium-java-junit-ulelement
functional-testing junit5 oop selenium-java surefire-reporting
Last synced: 11 months ago
JSON representation
Showcases the use of Selenium with Java and JUnit for performing functional tests on an <ul> element.
- Host: GitHub
- URL: https://github.com/geozi/selenium-java-junit-ulelement
- Owner: geozi
- Created: 2024-08-12T15:24:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T11:55:37.000Z (about 1 year ago)
- Last Synced: 2025-02-07T06:23:36.869Z (about 1 year ago)
- Topics: functional-testing, junit5, oop, selenium-java, surefire-reporting
- Language: Java
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# selenium-java-junit-ulelement

### About the project
The project showcases the use of Selenium with Java and JUnit for performing functional tests on an `
- ` element.
- ` sub-element of the `
- ` element. Taking advantage of JUnit's ordering capabilities, the test classes are run according to a custom order (horizontal testing).
- ` sub-element | Test class |
|------------- | ------------- | ------------- |
| #1 | 'Subject' link | SubjectLinkTest |
| #2 | 'Publisher' link | PublisherLinkTest |
| #3 | 'Language' link | LanguageLinkTest |
| #4 | 'Collections' link | CollectionsLinkTest |Furthermore, each class contains test methods that correspond to a series of simulated steps per `
- ` sub-element. As in the case of the test classes, the test methods are run according to a custom order (vertical testing).
### Prerequisites
* Java 17 or higher,
* Intellij IDEA (or any other Java IDE),
* Maven,
* Selenium.### Dependencies
```xml
org.seleniumhq.selenium
selenium-java
4.23.0
org.seleniumhq.selenium
selenium-firefox-driver
4.23.0
org.seleniumhq.selenium
selenium-chrome-driver
4.23.0
org.junit.jupiter
junit-jupiter-engine
5.10.3
test
org.junit.jupiter
junit-jupiter-api
5.10.3
test
```### Further documentation
For more information, please check the provided javadoc.
[^1]: Disclaimer: This website was tested in order to showcase the use of Selenium with Java and JUnit 5, and such testing does not constitute an endorsement or promotion of said website.
| Ordering number | `
- ` sub-element | Test class |
### Website[^1]
The website where the element is located is the https://oapen.org/ .
### Web element under test
The web element tested was an `
- ` element found on the landing page of the website:
### OOP
To make full use of Java as a pure Object-Oriented language and, by extension, optimize code organization, a small class hierarchy was developed. Each subclass simulates a concrete user action.
### Horizontal vs vertical testing
There are 4 test classes, each of which corresponds to a `