Skip to content

savuvictor/selenium-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task description

Launch URL: https://www.saucedemo.com/

UC-1 Test Login form with empty credentials:

  1. Type any credentials into "Username" and "Password" fields.
  2. Clear the inputs.
  3. Hit the "Login" button.
  4. Check the error messages: "Username is required".

UC-2 Test Login form with credentials by passing Username:

  1. Type any credentials in username.
  2. Enter password.
  3. Clear the "Password" input.
  4. Hit the "Login" button.
  5. Check the error messages: "Password is required".

UC-3 Test Login form with credentials by passing Username & Password:

  1. Type credentials in username which are under Accepted username are sections.
  2. Enter password as secret sauce.
  3. Click on Login and validate the title “Swag Labs” in the dashboard.
  4. Provide parallel execution, add logging for tests and use Data Provider to parametrize tests.

Make sure that all tasks are supported by these 3 conditions: UC-1; UC-2; UC-3.


  • Please, add task description as README.md into your solution!
  • To perform the task use the various of additional options:
    • Test Automation tool: Selenium WebDriver;
    • Project Builder: Maven;
    • Browsers: 1) Chrome; 2) Edge;
    • Locators: XPath;
    • Test Runner: JUnit;

Bonus

Use the following patterns

  • Singleton
  • Builder]]
  • Decorator

Test automation approach: BDD; Assertions: Built-in assertions of Unit-runners JUnit vs TestNG; Loggers: SLF4J._


Solution

  • Java version: 17.0.12
  • Chrome, Firefox and Edge are supported
  • I use TestNG, and 1 test is left to fail on purpose, specifically

username = "locked_out_user"

Run the tests

mvn -Dbrowser=chrome -Denvironment=dev clean test
mvn -Dbrowser=firefox -Denvironment=dev clean test
mvn -Dbrowser=edge -Denvironment=dev clean test

TODOs

  • BDD Approach

About

Testing framework that uses selenium webdriver API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages