TK
Menu

Test Automation

Selenium Page-Object UI Tests (Java, TestNG)

Seven TestNG UI tests for an e-commerce demo store, built on the Page Object Model: sign-in validation, a successful login, product listing and add to cart. Credentials are passed in at run time.

Problem

A take-home QA assessment: automate the sign-in and shopping flows of an e-commerce demo store in a way that's readable and maintainable.

Approach

  • Page Object Model: LoginForm, MyAccount and Clothing hold the locators and actions; tests never touch locators directly.
  • Seven TestNG tests: sign-in form shown, invalid credentials, missing fields, email format highlighting (red and green), successful login, sorted product listing, and add to cart.
  • Maven build, with Surefire running the testng.xml suite.

Result

  • 7 of 7 tests passed in the 2022 run (TestNG reports included in the repository).
  • In 2026 the code was cleaned up for publishing: the test account, other email addresses and a machine-specific driver path were removed from the code and are now passed as system properties. The suite compiles on Java 11; the demo store itself is no longer online.

What this shows

Maintainable UI automation with page objects, positive and negative test design, and keeping credentials out of source code.