Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BASE_URL=https://demo.playwright.dev/todomvc/
API_BASE_URL=https://jsonplaceholder.typicode.com
REELLY_BASE_URL=https://find.reelly.io
# Optional: a registered address for the opt-in live OTP request test.
REELLY_EMAIL=
60 changes: 40 additions & 20 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
name: Playwright Tests
name: Playwright tests

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
timeout-minutes: 60
name: Test (${{ matrix.project }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
project: [chromium, firefox, webkit]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Type-check framework
run: npm run typecheck
- name: Install browser
run: npx playwright install --with-deps ${{ matrix.project }}
- name: Run tests
run: npx playwright test --project=${{ matrix.project }}
- name: Upload report and failure evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-${{ matrix.project }}
path: |
playwright-report/
test-results/
retention-days: 14
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
.DS_Store
playwright-report/
test-results/
blob-report/
.env
.DS_Store
5 changes: 0 additions & 5 deletions .vscode/extensions.json

This file was deleted.

9 changes: 0 additions & 9 deletions CODE_OF_CONDUCT.md

This file was deleted.

34 changes: 17 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License
MIT License

Copyright (c) Microsoft Corporation.
Copyright (c) 2026 Denys Ishchuk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
119 changes: 95 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,112 @@
# 🎭 Playwright Examples
# Playwright Web Automation Framework

This repo is used to demonstrate various testing scenarios with [Playwright](https://playwright.dev/) 🎭 with Node.js.
[![Playwright tests](https://github.com/DenIce44/playwright-web-automation-framework/actions/workflows/playwright.yml/badge.svg)](https://github.com/DenIce44/playwright-web-automation-framework/actions/workflows/playwright.yml)

## Run Playwright example tests
A portfolio project by **Denys Ishchuk** demonstrating maintainable UI and API automation with Playwright and TypeScript. The framework turns test strategy into executable, cross-browser release evidence—not just a collection of scripts.

### Install dependencies
## What this project demonstrates

Start by cloning the repo and installing the dependencies:
- Page Object Model with responsibility-focused methods
- Positive, negative, and state-transition UI scenarios
- Passwordless authentication coverage against a real product login flow
- API status, header, and response-body validation
- Data separated from test behavior
- Smoke tagging for fast feedback
- Chromium, Firefox, and WebKit coverage
- Parallel execution with CI retries
- HTML and JUnit reporting
- Traces, screenshots, and videos for failure triage
- GitHub Actions quality gates and retained evidence
- A documented, risk-based [test strategy](docs/TEST-STRATEGY.md)

## Test targets

- UI: [Playwright TodoMVC demo](https://demo.playwright.dev/todomvc)
- Authentication: [Reelly AI](https://find.reelly.io/auth/login)
- API: [JSONPlaceholder](https://jsonplaceholder.typicode.com)

These public demo services keep the project reproducible and free of employer code or confidential data.

## Project structure

```text
.
├── .github/workflows/ # Cross-browser CI pipeline
├── docs/ # Test strategy and quality decisions
├── pages/ # Page objects
├── test-data/ # Reusable test inputs
├── tests/
│ ├── api/ # REST API scenarios
│ └── ui/ # Browser scenarios
├── playwright.config.ts # Execution, reporting, and evidence settings
└── tsconfig.json # Strict TypeScript checks
```

## Run locally

Prerequisites: Node.js 20+ and npm.

```bash
npm ci
npx playwright install
npm test
```

Useful commands:

```bash
npm install
npm run test:smoke # fastest critical-path signal
npm run test:api # API suite only
npm run test:reelly # Reelly AI sign-in coverage on Chromium
npm run test:chromium # one browser
npm run test:ui # interactive Playwright UI
npm run typecheck # validate TypeScript without emitting files
npm run report # open the latest HTML report
```

Use the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) to run the tests in the tests folder from VS Code or run the following command in the terminal:
## Configuration

The defaults run without secrets. Override targets through environment variables when needed:

```bash
BASE_URL=https://demo.playwright.dev/todomvc/ \
API_BASE_URL=https://jsonplaceholder.typicode.com \
npm test
```

See [.env.example](.env.example) for supported values. Never commit credentials or environment-specific secrets.

### Reelly AI sign-in suite

The Reelly flow is passwordless: a registered user enters an email address and receives a six-digit one-time code. The default suite safely checks the public login contract, required-field behavior, invalid email validation, and recovery/registration paths without sending email or storing account data.

The live code-request scenario is deliberately opt-in. Run it with a registered test account:

```bash
npx playwright test --ui
REELLY_EMAIL=qa-account@example.com npm run test:reelly
```

## Contributing
The test confirms that Reelly advances to the one-time-code step. End-to-end OTP submission is excluded until the framework has a controlled mailbox/API fixture; this avoids committing secrets, depending on a human-readable inbox, or repeatedly messaging real users in CI.

## Quality decisions

- Tests assert user-visible outcomes rather than implementation details where practical.
- Page objects encapsulate interactions; business assertions stay readable in specifications.
- Test data is deterministic and unique to each browser context.
- CI captures evidence only when useful, balancing debuggability and storage.
- The test strategy states both coverage and deliberate exclusions.

## Author

**Denys Ishchuk** — QA Engineer with four years of manual testing experience, test-strategy ownership, performance testing with Apache JMeter, team leadership, and growing automation expertise.

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
- [GitHub](https://github.com/DenIce44)
- [LinkedIn](https://www.linkedin.com/in/denys-i-273b3a247)

When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
## Attribution

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
This repository began as a fork of Microsoft's `playwright-examples`. The portfolio framework, structure, documentation, and showcased scenarios have been redesigned for original demonstration purposes. Playwright is maintained by Microsoft and is used under its applicable license.

## Trademarks
## License

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
MIT
41 changes: 0 additions & 41 deletions SECURITY.md

This file was deleted.

25 changes: 0 additions & 25 deletions SUPPORT.md

This file was deleted.

49 changes: 49 additions & 0 deletions docs/TEST-STRATEGY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Test strategy

## Objective

Provide fast, maintainable evidence that critical TodoMVC behavior, Reelly AI passwordless sign-in, and representative REST API contracts remain usable across supported browsers.

## Coverage model

| Layer | Coverage | Purpose |
| --- | --- | --- |
| UI smoke | Create a task | Fast signal that the main journey works |
| UI functional | Complete, filter, and clear tasks | Validate state transitions and user-visible behavior |
| UI negative | Reject whitespace-only tasks | Exercise an important input boundary |
| Auth smoke | Render Reelly's passwordless login contract | Detect a broken entry point or missing controls |
| Auth validation | Reject empty and malformed email input | Prevent avoidable requests and give actionable feedback |
| Auth navigation | Expose support and account-registration paths | Preserve recovery options for blocked users |
| Auth live (opt-in) | Request an OTP for a controlled registered account | Verify the email-to-code transition without storing credentials |
| API positive | Read and create posts | Validate status, headers, and response contracts |
| API negative | Request an unknown resource | Validate expected failure behavior |

## Risk priorities

1. A user cannot create or retain a task.
2. Filtering shows incorrect task state.
3. Removing completed work also removes active work.
4. A user cannot start Reelly's passwordless sign-in flow or receives unclear validation.
5. Reelly's recovery or registration paths become unavailable.
6. API status codes or core identifiers break their expected contract.
7. Browser-specific behavior causes inconsistent results.

## Execution

- Pull requests run the full suite on Chromium, Firefox, and WebKit.
- `@smoke` scenarios provide a quick local confidence check.
- `@reelly` identifies the Reelly authentication suite; `@live-auth` marks its opt-in email-sending scenario.
- CI runs Reelly's public, non-message-sending checks and skips the live scenario unless `REELLY_EMAIL` is explicitly provided.
- CI retries failures twice and records a trace on the first retry.
- Screenshots and videos are retained only for failures to support triage without excessive artifacts.

## Out of scope

The public demo applications do not represent a controlled production system. Security, accessibility, visual regression, load testing, and destructive API persistence are intentionally outside this sample's current scope. Completing Reelly OTP authentication is also excluded until a controlled mailbox or test-only API can supply rotating codes without human or production-account dependency.

## Exit criteria

- All critical-path tests pass on all configured browsers.
- No focused tests (`test.only`) enter CI.
- Failure artifacts are available for any unsuccessful CI run.
- Changes to behavior include corresponding test and strategy updates.
Loading