Skip to content

Diegocortes15/selenium-automation-framework-saucedemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenium Automation Framework Saucedemo

Dependencies used

  • Selenium 4
  • TestNG
  • Log4J2
  • Allure
  • JsonSimple

Pattern design used

  • Page Object Model (Thinking in a scalable and dynamic web automation framework)
  • Factory (Applied in WebDriverFactory Class for create difference webdrives intances with the requested browser)

Prerequisites to run the project

  • JDK 11 (Environment variable)
  • Maven (Environment variable)
  • Allure (Environment variable)
  • Docker (Optional if you want to run it remotely)
  • IDE (ex. IntelliJ)

How set environment variables

  1. Download and save the folders where you want. Look at the links above.
  2. Take in mind the path where you are saving your folders **that contains jdk.
  3. Copy jdk path.
  4. On windows, in search bar, type environment variables and click on Edit the system environment variables.

environment variables

  1. In the System properties window, click environment variables.
  2. In Environment variables window in Advanced tab, in System variables section, double click Path.
  3. In Edit environment variable click New button and paste the path that contains jdk, then click Ok.
  4. Close the open windows and that's all to install JDK 🥳.

environment variables (2)

Browsers

Installed:

  • Chrome
  • Firefox
  • Microsoft Edge

Download and open project

Workaround 1

Download project

  1. Click on the code button in this repository
  2. Select the Download Zip option
  3. Extract the .zip file with the Extract here option
  4. Place the project folder on the desired location

Workaround 2 - Gitbash

  1. Select the folder when you would like clone the project
  2. Open gitbash, copy and paste the following command
git clone https://github.com/Diegocortes15/selenium-automation-framework-saucedemo.git

image

Run project

Open the project with the desired IDE, then run the following command.

Local ⚠

To run the project locally you make sure that in App Class the PLATFORM variable must be set as local then in folder project you can run the following command.

mvn clean verify

Remote ⚠

Note You need Docker installed on your machine to run the following commands!

To run the project remotely you make sure that in App Class the PLATFORM variable must be set as remote then you must run the docker container with the following command

docker-compose -f docker/docker-compose.yml up -d

Then, you must use the following command to run our tests

mvn clean verify

Once our tests have finished you must run the following command to stop our docker container

docker-compose -f docker/docker-compose.yml down

Open allure report

To open allure report run the following command

allure serve target/allure-results

Animation 5 (1)