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.
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
/securewithout 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.
Required tools:
- Node.js 20 or newer
- npm
- Git
Verify Node.js:
node --versionVerify npm:
npm --versionVerify Git:
git --versionInstall project dependencies:
npm installInstall Playwright browsers:
npx playwright install- Clone the repository.
git clone <repository-url>
cd Origami-Risk-QA-Homework- Install dependencies.
npm install- Install Playwright browsers.
npx playwright install- Create the
.envfile from the example file.
Linux/macOS:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .env- 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=2Environment variables:
ENV: selected environment name, for exampleqaordev.QA_URL: base URL used whenENV=qa.DEV_URL: base URL used whenENV=dev.BASE_URL: fallback target host whenENVis not set.LOGIN_PATH: login route.LOGIN_USERNAME: valid username.LOGIN_PASSWORD: valid password.HEADLESS: runs browsers hidden whentrue; visible whenfalse.PW_WORKERS: number of parallel workers.
Run all tests headless:
npm testRun all tests headed:
npm run test:headedRun all mandatory tests:
npm run test:mandatoryRun all extra tests identified by Kelvin Calcano:
npm run test:extraRun all smoke tests:
npm run test:smokeRun all negative tests:
npm run test:negativeOpen the HTML report:
npm run report- JavaScript
- Playwright Test
- dotenv for environment configuration
- GitHub Actions for CI
.
|-- .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
- 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.
- 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.
For questions or collaboration, contact me on LinkedIn:
https://www.linkedin.com/in/kelvin-calcano-qa-automation/