{"id":23392712,"url":"https://github.com/sharma-it/saucedemo-e2e-tests","last_synced_at":"2026-05-07T02:34:40.820Z","repository":{"id":267721176,"uuid":"902144165","full_name":"Sharma-IT/saucedemo-e2e-tests","owner":"Sharma-IT","description":"An end-to-end test suite for the Saucedemo website using Playwright and TypeScript","archived":false,"fork":false,"pushed_at":"2024-12-23T07:33:05.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T11:53:24.397Z","etag":null,"topics":["playwright","playwright-typescript","saucedemo","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/Sharma-IT","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sharma-IT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T01:55:45.000Z","updated_at":"2024-12-23T07:33:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a47cc36-5e61-4f17-b6a4-b245bb3a4e35","html_url":"https://github.com/Sharma-IT/saucedemo-e2e-tests","commit_stats":null,"previous_names":["sharma-it/saucedemo-e2e-tests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharma-IT%2Fsaucedemo-e2e-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharma-IT%2Fsaucedemo-e2e-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharma-IT%2Fsaucedemo-e2e-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharma-IT%2Fsaucedemo-e2e-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sharma-IT","download_url":"https://codeload.github.com/Sharma-IT/saucedemo-e2e-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247873403,"owners_count":21010447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["playwright","playwright-typescript","saucedemo","typescript"],"created_at":"2024-12-22T05:14:56.029Z","updated_at":"2026-05-07T02:34:40.781Z","avatar_url":"https://github.com/Sharma-IT.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saucedemo E2E Tests\n\nEnd-to-end test suite for the Saucedemo website using Playwright and TypeScript.\n\n## Features\n\n- Page Object Model (POM) architecture for better maintainability\n- Cross-browser testing support (Chrome, Firefox, Safari)\n- Mobile device testing support (Pixel 5, iPhone 12)\n- Comprehensive test reporting (HTML, List, JUnit)\n- CI/CD ready configuration\n- Automatic retries for flaky tests\n- Screenshot and video capture on test failure\n- Trace viewer support for debugging\n- State management with authentication persistence\n- Parallel test execution with sharding\n\n## Project Structure\n\n```\nsaucedemo-e2e-tests/\n├── tests/                       # Test files\n│   └── purchase-flow.spec.ts    # E2E tests for purchase flow\n├── page_objects/                # Page Object Models\n│   ├── cart.page.ts             # Cart page interactions\n│   ├── login.page.ts            # Login page interactions\n│   ├── inventory.page.ts        # Inventory page interactions\n│   ├── header.ts                # Header element interactions\n│   ├── sidebar.ts               # Sidebar element interactions\n│   └── checkout.page.ts         # Checkout page interactions\n├── fixtures/                    # Test fixtures and data\n│   ├── test-base.ts             # Base test configuration and fixtures\n│   └── test-data.ts             # Test data constants\n├── config/                      # Configuration files\n│   ├── global-setup.ts          # Global test setup\n│   └── global-teardown.ts       # Global test teardown\n├── playwright.config.ts         # Playwright configuration\n├── README.md                    # Project documentation\n└── docs/                        # Documentation files\n    └── license.md               # Project license information\n```\n\n## Getting Started\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/Sharma-IT/saucedemo-e2e-tests.git\n```\n\n2. Change into this repository's directory:\n\n```bash\ncd saucedemo-e2e-tests\n```\n\n3. Install dependencies:\n\n```bash\nnpm install\n```\n\n4. Install browsers:\n\n```bash\nnpm prepare\n```\n\n5. Run tests:\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests with UI\nnpm run test:ui\n\n# View test report\nnpm run test:report\n```\n\n## Test Coverage\n\n- Login functionality\n  - Standard user login\n  - Locked out user error handling\n- Product purchase flow\n  - Adding products to cart\n  - Checkout process\n  - Order confirmation\n- Cart functionality\n  - Adding/removing items\n  - Cart badge updates\n\n## Test Users and Environment Variables\n\nThis project demonstrates environment variable usage for test credentials, although for this demo site (saucedemo.com), the credentials are publicly available:\n\n```\nStandard User:\n- Username: standard_user\n- Password: secret_sauce\n\nLocked Out User:\n- Username: locked_out_user\n- Password: secret_sauce\n```\n\nThe project uses `.env` files and GitHub Secrets to showcase best practices for credential management:\n\n1. Local Development:\n   - Copy `.env.example` to `.env`\n   - Add the above credentials to your `.env` file\n   - `.env` is gitignored to demonstrate secure credential handling\n\n2. CI/CD:\n   - GitHub Secrets are used to demonstrate secure credential storage\n   - Secrets are injected as environment variables during test runs\n\nNote: While I'm using environment variables and secrets in this project, it's purely for demonstration purposes since these are public test credentials. In a real project, you would use this same pattern to secure actual sensitive credentials.\n\n## Configuration\n\nThe test suite is configured with:\n\n- Base URL: https://www.saucedemo.com\n- Browser support:\n  - Desktop: Chrome, Firefox, Safari\n  - Mobile: Pixel 5, iPhone 12\n- Test retries: 2 attempts\n- Timeouts:\n  - Global: 30 seconds\n  - Action: 15 seconds\n  - Navigation: 15 seconds\n- Test artifacts:\n  - Screenshots on failure\n  - Videos on failure\n  - Trace viewer support\n- Authentication state persistence\n- Parallel execution with test sharding\n\n## CI/CD Integration\n\nThe test suite is configured for CI/CD environments with:\n- Runs on Node.js 20 on Ubuntu latest\n- Parallel test execution:\n  - 3-way sharding for optimal distribution\n  - Fail-fast disabled for complete test visibility\n- Test reporting per shard:\n  - JUnit XML reports with passed test inclusion\n  - Individual shard test reports\n- Development safeguards:\n  - No focus mode in CI (forbidOnly)\n  - Automatic retries (2 attempts)\n- Performance optimisations:\n  - npm dependency caching\n  - Playwright browser caching\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharma-it%2Fsaucedemo-e2e-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharma-it%2Fsaucedemo-e2e-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharma-it%2Fsaucedemo-e2e-tests/lists"}