End-to-end test automation framework for amazon.com, built with Playwright and TypeScript.
Demonstrates a production-ready three-layer Test Automation Framework (TAF) applied to a real-world e-commerce scenario: signing in, searching for a product, and adding it to a wish list.
- Page Object Model — every page is a dedicated TypeScript class; locators live in the constructor, actions are methods
- Custom Playwright fixtures — page objects and credentials are injected into tests via
test.extend(), keeping specs clean and free of setup boilerplate - Three-layer architecture — Test Script → Business Logic (POMs + Fixtures) → Core Library, with strict layer boundaries
- Secure credential handling — credentials loaded from
.envat runtime with fail-fast validation; never hardcoded or logged - Resilient locators — role-based and data-attribute selectors over fragile CSS classes; locale-aware where Amazon localises its UI
Feature: Insert searched item on Amazon wish list
Scenario: Search for a MacBook Air, sign in, and add the item successfully to the wish list
Given I am on the Amazon homepage
And I click in the "Sign In" button
And I enter "youremail@provider.com" into the field "Email"
And I enter "yourpw" into the field "Password"
And I click in the "Sign In" button
And I click in the "Search In" button selecting the "Computers" Category
And I enter "macBook Air" in the search box
And I click in the "Search" button
And I click in the image of the first result in the search list result page
And I click in the button "Add to List" in the item page
And I click in the button "View Your List" in the "Add to List" page
Then My wish list, should be populated with the item macBook Air| Playwright | Browser automation & web-first assertions |
| TypeScript | Type safety across the entire framework |
| dotenv | Secure runtime credential loading |
- Node.js 22+
- An Amazon account with at least one wish list
npm install
npx playwright install chromium
copy .env.example .env # fill in AMAZON_EMAIL and AMAZON_PASSWORDnpm run test:headed # headed — browser visible (recommended)
npm test # headless
npm run test:report # open the HTML report