Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guedesrodriguezleonardo/selenium-java-junit

Web Automation testing framework using Selenium, JUnit and Java
https://github.com/guedesrodriguezleonardo/selenium-java-junit

java junit selenium selenium-java test-automation web-testing

Last synced: 6 days ago
JSON representation

Web Automation testing framework using Selenium, JUnit and Java

Awesome Lists containing this project

README

        

# selenium-java-junit ⛩ī¸

This project is an automated testing project that utilizes JUnit and Selenium to perform web application testing. The primary focus of this project is to test [adminces](http://cestore.ces.com.uy/adminces/), a platform developed by CES, this platform was created to enable students at the CES(Centro de Ensayos de Software) to conduct software testing activities.

## Project structure

The project follows a structured organization to maintain code readability and separation of concerns. Key components include:

- 🗐 Page Object Pattern: The project uses the Page Object Pattern to separate test logic from web page interaction. This approach enhances test maintainability and readability.

- 📁 Test Classes: Test cases are organized into JUnit test classes, each focusing on specific test scenarios.

## How to run

### Selecting the Browser:

You can specify the browser to be used for testing by editing the [config.properties](src\main\resources\config.properties) file in your project's resources directory. Here's how to set up different browsers:

- **To use Google Chrome:**

1. Uncomment the following lines in `config.properties`:
```properties
#Google Chrome Config
browser=Google Chrome
browserVersion= 117.0.5938.88 (64-bit)
```
2. Comment out other browser configurations by adding `#` at the beginning of each line, like this:
```properties
#Mozilla Firefox Config
#browser=Mozilla Firefox
#browserVersion= 117.0.1 (64-bit)
```

- **To use Mozilla Firefox:**

1. Uncomment the following lines in `config.properties`:
```properties
#Mozilla Firefox Config
browser=Mozilla Firefox
browserVersion=
```
2. Comment out other browser configurations by adding `#` at the beginning of each line, like this:
```properties
#Google Chrome Config
#browser=Google Chrome
#browserVersion= 117.0.5938.88 (Official Build) (64-bit)
```

Ensure you save the changes before running the tests. The selected browser will be used for test execution.
`Only one browser configuration should be uncommented, and the rest should be commented to avoid conflicts.`

### Running Test Suites

1. Open IntelliJ IDEA, and ensure the project is loaded.

2. Locate the test suite within the project's ```src\test\java\uy\com\ces\suites``` directory.

3. Right-click on the test suite you wish to run.

4. Select "Run" from the context menu.

5. Examine the test suite results displayed in IntelliJ IDEA to assess the outcomes of the individual tests executed within the suite.

### Running Individual Tests

1. Open IntelliJ IDEA, and ensure the project is loaded.

2. Locate the test class within the project's ```src\test\java\uy\com\ces\tests``` directory.

3. Right-click on the specific test class you want to run.

4. Select "Run" from the context menu.

5. Review the test results displayed in the IntelliJ IDEA UI to see the outcomes of the executed test cases, including passed and failed tests.

### 📚 Allure Report
This project uses the Allure Report to generate an interactive report that provides information about the test results.
After running the tests, the report can be generated by running the command
```
allure generate && allure open
```