Skip to content

Repository files navigation

Origami-Risk-QA-Homework

Description

Origami-Risk-QA-Homework is a Playwright JavaScript test automation framework for validating the login functionality of The Internet Login Page.

The project uses Page Object Model, reusable fixtures, centralized test data, environment-based configuration, and Playwright reports to keep the test suite readable, maintainable, and easy to execute locally or in CI.

Scope

Current implemented suite validates:

  • Successful login with valid credentials.
  • Login error for an invalid username or invalid password.
  • Login attempts with empty fields.
  • Login attempts with leading and trailing spaces in credentials.
  • Login attempts with incorrect username or password casing.
  • Password field masking.
  • Form submission using the Enter key.
  • Logout flow and logout success message.
  • Direct navigation to /secure without authentication.
  • Browser back behavior after logout.
  • Flash message dismissal on both the Login page and the Secure Area page.
  • Login page layout in a mobile viewport.

The suite currently contains 19 tests in total:

  • 3 mandatory tests.
  • 16 extra tests.

The suite is independent, can run in any order, and each test receives an isolated browser context from Playwright.

Prerequisites

Required tools:

  • Node.js 20 or newer
  • npm
  • Git

Verify Node.js:

node --version

Verify npm:

npm --version

Verify Git:

git --version

Install project dependencies:

npm install

Install Playwright browsers:

npx playwright install

Setup

  1. Clone the repository.
git clone <repository-url>
cd Origami-Risk-QA-Homework
  1. Install dependencies.
npm install
  1. Install Playwright browsers.
npx playwright install
  1. Create the .env file from the example file.

Linux/macOS:

cp .env.example .env

Windows PowerShell:

Copy-Item .env.example .env
  1. Use the current environment values.

These values are safe to share because they belong to a public demo application:

ENV=qa
QA_URL=https://the-internet.herokuapp.com
DEV_URL=https://the-internet.herokuapp.com
BASE_URL=https://the-internet.herokuapp.com
LOGIN_PATH=/login
LOGIN_USERNAME=tomsmith
LOGIN_PASSWORD=SuperSecretPassword!
HEADLESS=true
PW_WORKERS=2

Environment variables:

  • ENV: selected environment name, for example qa or dev.
  • QA_URL: base URL used when ENV=qa.
  • DEV_URL: base URL used when ENV=dev.
  • BASE_URL: fallback target host when ENV is not set.
  • LOGIN_PATH: login route.
  • LOGIN_USERNAME: valid username.
  • LOGIN_PASSWORD: valid password.
  • HEADLESS: runs browsers hidden when true; visible when false.
  • PW_WORKERS: number of parallel workers.

Test Execution

Run all tests headless:

npm test

Run all tests headed:

npm run test:headed

Run all mandatory tests:

npm run test:mandatory

Run all extra tests identified by Kelvin Calcano:

npm run test:extra

Run all smoke tests:

npm run test:smoke

Run all negative tests:

npm run test:negative

Open the HTML report:

npm run report

Tech Stack

  • JavaScript
  • Playwright Test
  • dotenv for environment configuration
  • GitHub Actions for CI

Project Structure

.
|-- .github/workflows/       # CI pipeline
|-- api/                     # API clients/controllers placeholder for future hybrid flows
|-- docs/                    # Test catalog and framework notes
|-- fixtures/                # Playwright test fixtures and hooks
|-- reports/                 # Generated reports (ignored by git)
|-- test-data/               # Test users and data builders
|-- tests/                   # Business-flow specs
|-- ui/pages/                # Page Objects
|-- utils/                   # Config, constants, helpers, logger
|-- playwright.config.js     # Playwright execution config
`-- package.json

Reports And Evidence

  • HTML report: reports/playwright-html
  • JUnit report: reports/junit/results.xml
  • Screenshots are retained only on failure.
  • Traces are retained only on failure.
  • Videos are retained only on failure.

Design Principles

  • Tests describe business intent only.
  • Page Objects own locators and UI actions.
  • Fixtures provide reusable test setup.
  • Test data is centralized under test-data/.
  • No hard waits. Assertions and Playwright auto-waiting handle synchronization.
  • No shared browser state between tests.
  • Config and credentials come from environment variables with safe defaults.
  • Main branch is protected; changes should go through short PRs.

Contact

For questions or collaboration, contact me on LinkedIn:

https://www.linkedin.com/in/kelvin-calcano-qa-automation/

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages