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
60 changes: 12 additions & 48 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
# .github/workflows/playwright-daily.yml
# Runs Playwright test shards with TestDino (staging) + merges reports


name: Run Playwright tests

on:
Expand Down Expand Up @@ -344,6 +345,7 @@ jobs:
echo "STATE=${{ secrets.STATE }}" >> .env
echo "COUNTRY=${{ secrets.COUNTRY }}" >> .env
echo "ZIP_CODE=${{ secrets.ZIP_CODE }}" >> .env

# ✅ Cache npm dependencies
- name: Cache npm dependencies
uses: actions/cache@v3
Expand All @@ -352,65 +354,27 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

# ✅ Install dependencies + TestDino (.tgz) + Playwright browsers
- name: Install dependencies & browsers
run: |
npm ci
npx playwright install --with-deps chromium firefox webkit
# ✅ Run Playwright shard with TestDino (STAGING)
npm install
npm install --save-dev @testdino/playwright@latest
npx playwright install --with-deps chromium webkit firefox

# ✅ Run Playwright shard with TestDino
- name: Run Playwright shard with TestDino
env:
TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
TESTDINO_SERVER_URL: https://staging-api.testdino.com
TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
run: |
npx playwright test \
--shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} \
--grep "@chromium|@firefox|@webkit|@android|@ios|@api" \
# ✅ Upload blob report (needed for merge)
--grep="@chromium|@firefox|@webkit|@android|@ios|@api" \
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: ./blob-report
retention-days: 1

merge-reports:
name: Merge Reports
needs: run-tests
if: always()
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20'

# ✅ Install deps (TestDino not required here)
- name: Install dependencies
run: |
npm ci
npx playwright install --with-deps
# ✅ Download all shard blob reports
- name: Download all blob reports
uses: actions/download-artifact@v4
with:
path: ./all-blob-reports
pattern: blob-report-*
merge-multiple: true

# ✅ Merge Playwright HTML report
- name: Merge Playwright HTML report
run: |
npx playwright merge-reports ./all-blob-reports
# ✅ Upload merged Playwright report
- name: Upload combined Playwright report
uses: actions/upload-artifact@v4
with:
name: Playwright Test Report
path: ./playwright-report
retention-days: 14
retention-days: 1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ node_modules/

# Playwright
/playwright/.auth/

package-lock.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Test Health](https://staging-api.testdino.com/api/badge/project_6994031bf797fc2987c032d8.svg)](https://staging.testdino.com/org_698309c81aa085a66fc43343/projects/project_6994031bf797fc2987c032d8) [![Flaky](https://staging-api.testdino.com/api/badge/project_6994031bf797fc2987c032d8.svg?type=flaky)](https://staging.testdino.com/org_698309c81aa085a66fc43343/projects/project_6994031bf797fc2987c032d8) [![Tests](https://staging-api.testdino.com/api/badge/project_6994031bf797fc2987c032d8.svg?type=tests)](https://staging.testdino.com/org_698309c81aa085a66fc43343/projects/project_6994031bf797fc2987c032d8)
# Ecommerce demo store - Playwright (javascript) tests

Automated end-to-end tests for Ecommerce demo store using [Playwright](https://playwright.dev/).
Expand Down
110 changes: 0 additions & 110 deletions package-lock.json

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@types/node": "^24.1.0"
},
"dependencies": {
"@testdino/playwright": "^1.0.10",
"dotenv": "^17.2.1",
"playwright": "^1.55.0"
}
Expand Down
5 changes: 5 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export default defineConfig({
}],
['blob', { outputDir: 'blob-report' }], // Blob reporter for merging
['json', { outputFile: './playwright-report/report.json' }],

['@testdino/playwright', {
token: process.env.TESTDINO_TOKEN,
serverUrl: 'https://staging-api.testdino.com',
}],
],

use: {
Expand Down
30 changes: 27 additions & 3 deletions tests/cart_checkout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ test.describe('Application E2E Tests', () => {
========================================= */
test.describe('Delete Product from Cart', () => {

test('User can delete selected product from cart',{tag: '@ios'}, async () => {
test('User can delete selected product from cart', {
tag: ['@ios', '@regression', '@cart'],
annotation: [
{ type: 'testdino:priority', description: 'P1' },
{ type: 'testdino:owner', description: 'team-commerce' },
{ type: 'testdino:feature', description: 'cart' },
{ type: 'testdino:context', description: 'Cart item removal flow — search product, add to cart, then delete. Verifies empty cart state.' },
],
}, async () => {
const productName = 'GoPro HERO10 Black';
const startTime = Date.now();

Expand Down Expand Up @@ -77,7 +85,15 @@ test.describe('Application E2E Tests', () => {
========================================= */
test.describe('Single Order and Cancellation', () => {

test('New user can place and cancel order @chromium', {tag: '@chromium'}, async () => {
test('New user can place and cancel order', {
tag: ['@chromium', '@smoke', '@e2e'],
annotation: [
{ type: 'testdino:priority', description: 'P0' },
{ type: 'testdino:owner', description: 'team-commerce' },
{ type: 'testdino:feature', description: 'checkout' },
{ type: 'testdino:context', description: 'Full E2E: register → login → browse → add to cart → checkout → place order → cancel. Critical path for new user conversion.' },
],
}, async () => {
const email = `test+${Date.now()}@test.com`;
const startTime = Date.now();
let registrationTime, checkoutTime;
Expand Down Expand Up @@ -171,7 +187,15 @@ test.describe('Application E2E Tests', () => {
========================================= */
test.describe('Update Personal Information', () => {

test('User can update personal info @firefox', {tag: '@firefox'}, async () => {
test('User can update personal info', {
tag: ['@firefox', '@regression', '@profile'],
annotation: [
{ type: 'testdino:priority', description: 'P2' },
{ type: 'testdino:owner', description: 'team-frontend' },
{ type: 'testdino:feature', description: 'profile' },
{ type: 'testdino:context', description: 'User profile update flow. Verifies personal info can be modified after login.' },
],
}, async () => {
const startTime = Date.now();
await login();
await allPages.userPage.clickOnUserProfileIcon();
Expand Down
10 changes: 9 additions & 1 deletion tests/login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ async function logout() {

test.describe('Login', () => {
test.describe('Authentication', () => {
test('Verify that user can login and logout successfully ', {tag: '@chromium'}, async () => {
test('Verify that user can login and logout successfully ', {
tag: ['@chromium', '@smoke', '@auth'],
annotation: [
{ type: 'testdino:priority', description: 'P0' },
{ type: 'testdino:owner', description: 'team-auth' },
{ type: 'testdino:feature', description: 'auth' },
{ type: 'testdino:context', description: 'Core login/logout flow. Validates authentication against storedemo. Failure blocks all authenticated tests.' },
],
}, async () => {
const loginStart = Date.now();
await login();
const loginTime = Date.now() - loginStart;
Expand Down
20 changes: 18 additions & 2 deletions tests/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ test.describe('Navigation', () => {
========================================= */
test.describe('Verify Navbar Links', () => {

test('Verify that all the navbar links work correctly', {tag: '@firefox'}, async () => {
test('Verify that all the navbar links work correctly', {
tag: ['@firefox', '@smoke', '@navigation'],
annotation: [
{ type: 'testdino:priority', description: 'P1' },
{ type: 'testdino:owner', description: 'team-frontend' },
{ type: 'testdino:feature', description: 'navigation' },
{ type: 'testdino:context', description: 'Validates all top-level navbar links — Home, All Products, Contact Us, About Us. Core navigation smoke test.' },
],
}, async () => {
const startTime = Date.now();
let navigationCount = 0;

Expand Down Expand Up @@ -107,7 +115,15 @@ test.describe('Navigation', () => {
========================================= */
test.describe('Submit Contact Us Form', () => {

test('Verify that user can submit Contact Us form successfully', {tag: '@firefox'}, async () => {
test('Verify that user can submit Contact Us form successfully', {
tag: ['@firefox', '@regression', '@contact'],
annotation: [
{ type: 'testdino:priority', description: 'P2' },
{ type: 'testdino:owner', description: 'team-frontend' },
{ type: 'testdino:feature', description: 'contact' },
{ type: 'testdino:context', description: 'Contact Us form submission with authenticated user. Validates form fill and success message.' },
],
}, async () => {
const startTime = Date.now();
await login();

Expand Down
30 changes: 27 additions & 3 deletions tests/orders.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ test.describe('Orders', () => {
test.describe('Existing User Address CRUD', () => {

test(
'Verify that user can add, edit, and delete addresses after login', {tag: '@ios'}, async () => {
'Verify that user can add, edit, and delete addresses after login', {
tag: ['@ios', '@regression', '@address'],
annotation: [
{ type: 'testdino:priority', description: 'P1' },
{ type: 'testdino:owner', description: 'team-commerce' },
{ type: 'testdino:feature', description: 'address' },
{ type: 'testdino:context', description: 'Full address CRUD cycle — add, edit, delete. Tests address management for existing authenticated users.' },
],
}, async () => {
const startTime = Date.now();
let addTime, editTime, deleteTime;

Expand Down Expand Up @@ -125,7 +133,15 @@ test.describe('Orders', () => {
test.describe('New User Address Creation', () => {

test(
'Verify that new user can add address from Address section', {tag: '@android'}, async () => {
'Verify that new user can add address from Address section', {
tag: ['@android', '@regression', '@address'],
annotation: [
{ type: 'testdino:priority', description: 'P2' },
{ type: 'testdino:owner', description: 'team-commerce' },
{ type: 'testdino:feature', description: 'address' },
{ type: 'testdino:context', description: 'New user address creation from the Address section. Validates the add-new-address menu and form.' },
],
}, async () => {
const startTime = Date.now();
await login();

Expand Down Expand Up @@ -166,7 +182,15 @@ test.describe('Orders', () => {
test.describe('Multiple Quantity Purchase', () => {

test(
'Verify that user can purchase multiple quantities in a single order', {tag: '@android'}, async () => {
'Verify that user can purchase multiple quantities in a single order', {
tag: ['@android', '@smoke', '@orders'],
annotation: [
{ type: 'testdino:priority', description: 'P0' },
{ type: 'testdino:owner', description: 'team-commerce' },
{ type: 'testdino:feature', description: 'orders' },
{ type: 'testdino:context', description: 'Multi-quantity order placement. Searches product, increases cart quantity to 3, completes Cash on Delivery checkout.' },
],
}, async () => {
const productName = 'GoPro HERO10 Black';
const startTime = Date.now();
const quantity = 3;
Expand Down
Loading
Loading