Skip to content

Conversation

@abhishek305
Copy link
Contributor

This PR introduces a comprehensive End-to-End (E2E) test suite for the Contentstack Gatsby Starter App using Playwright + TypeScript.

The setup follows Page Object Model (POM) principles, includes custom fixtures for dependency injection, and focuses on core user flows, navigation, and accessibility.


✨ Key Changes

  • Added a new e2e/ workspace with a fully isolated Playwright setup

  • Implemented 7 spec files covering 28 E2E test cases

  • Adopted Page Object Model with 6 reusable page classes

  • Introduced custom Playwright fixtures for shared setup and test dependencies

  • Configured TypeScript, Playwright config, and HTML reporting

  • Added comprehensive documentation (README.md) for setup and execution


🧪 Test Coverage

Spec File Tests Coverage
home.spec.ts 5 Home page load, primary navigation
about.spec.ts 5 About page, hero banner, navigation
blog.spec.ts 5 Blog listing, content container
blog-post.spec.ts 3 Blog post navigation, content validation
contact.spec.ts 5 Contact page, main content rendering
navigation.spec.ts 2 Cross-page navigation consistency
accessibility.spec.ts 3 Alt text, semantic HTML, single h1


🗂 Project Structure

e2e/
├── pages/              # Page Object Models (BasePage, HomePage, etc.)
├── tests/              # Test specifications
├── fixtures/           # Playwright test fixtures
├── utils/              # Helper utilities
├── playwright.config.ts
├── package.json
├── tsconfig.json
└── README.md


▶️ How to Run

# Install dependencies
cd e2e
npm install
npx playwright install chromium

# Start Gatsby dev server (separate terminal)
npm run develop

# Run tests
npm test              # Headless
npm run test: headed   # With browser UI
npm run test:debug    # Debug mode


⚙️ Configuration Details

  • Browser: Chromium (single browser for faster execution)

  • Retries: 2

  • Timeout: 30s per test

  • Reports: HTML report generated at playwright-report/


✅ Benefits

  • Improves confidence in critical user journeys

  • Ensures navigation and content consistency across pages

  • Adds baseline accessibility coverage

  • Provides a scalable and maintainable E2E testing foundation

@abhishek305 abhishek305 requested a review from a team as a code owner January 9, 2026 06:46
@abhishek305 abhishek305 requested review from a team and rijil-tr January 9, 2026 09:13
Amitkanswal
Amitkanswal previously approved these changes Jan 9, 2026
Copy link
Contributor

@Amitkanswal Amitkanswal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants