Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geozi/selenium-kariera-mainpage-searchbox
Showcases the use of Selenium with Java and JUnit for testing a search box at a job search website.
https://github.com/geozi/selenium-kariera-mainpage-searchbox
junit5 oop selenium-java surefire-reporting
Last synced: 20 days ago
JSON representation
Showcases the use of Selenium with Java and JUnit for testing a search box at a job search website.
- Host: GitHub
- URL: https://github.com/geozi/selenium-kariera-mainpage-searchbox
- Owner: geozi
- Created: 2024-08-03T08:47:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-03T10:19:34.000Z (5 months ago)
- Last Synced: 2024-08-04T09:54:26.760Z (5 months ago)
- Topics: junit5, oop, selenium-java, surefire-reporting
- Language: Java
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# selenium-kariera-mainpage-searchbox
![Demo App](https://img.shields.io/badge/demo_app-blue)### About the project
The project showcases the use of Selenium with Java and JUnit 5 for testing a search box at a job search website.### Website[^1]
The website where the element is located is the https://www.kariera.gr/en, a site dedicated to job matching in Greece.![karieta_screenshot](https://github.com/user-attachments/assets/7b23399f-a639-4c02-b649-fa9f82024a8c)
### Web element under test
The web element tested was the search box 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.
### Class and element-centered testing
There are two main test classes: the **ActionSimulatorTest** and the **MainPageSearchBoxTest**. The purpose of the **ActionSimulatorTest** class is to test the functionalities that are inherited by the subclasses, whereas the **MainPageSearchBoxTest** class uses the different subclasses to test the functionality of the search box. In particular, the **MainPageSearchBoxTest** class breaks down the simulated action into a series of steps, with each step corresponding to a test method that is executed in the same class instance.
| Test case step | Test method |
| ------------- | ------------- |
| #1 Open the website | openWebsite() |
| #2 Close the pop-up dialog | closeCookieDialog() |
| #3 Hover over the search box | hoverOverSearchBox() |
| #4 Click the search box | clickSearchBox() |
| #5 Type inside the search box | typeSearchTerm() |
| #6 Click the search button | clickSearchButton() |
| #7 Return to main page | goBackToMainPage() |
| #8 Quit the browser | quitBrowser() |### Prerequisites
* Java 17 or higher,
* Intellij IDEA (or any other Java IDE),
* Maven,
* Selenium.### Dependencies
```
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
org.junit.platform
junit-platform-suite-api
1.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.