Skip to content

[WIP] Create reusable Playwright test utilities and custom assertions library - #686

Merged
arii merged 4 commits into
leaderfrom
copilot/create-playwright-test-library
Dec 1, 2025
Merged

[WIP] Create reusable Playwright test utilities and custom assertions library#686
arii merged 4 commits into
leaderfrom
copilot/create-playwright-test-library

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Contributor
  • Understand repository structure and existing test patterns
  • Create a centralized test utilities library at tests/playwright/lib/
    • Create index.ts - Main entry point that exports all utilities
    • Create assertions.ts - Custom domain-specific assertion functions
    • Create auth.ts - Authentication flow utilities
    • Create waits.ts - Specialized wait utilities
    • Create setup.ts - Data setup/teardown helpers
    • Create README.md - Comprehensive documentation with usage examples
  • Migrate existing helpers from test-helpers.ts to the new library structure
  • Update fixtures.ts to use the new library
  • Ensure backward compatibility with existing tests
  • Fix all code review issues
  • Pass all linting checks
  • Run CodeQL security check - No alerts found

Library Structure

tests/playwright/lib/
├── index.ts       # Main entry point (re-exports all utilities)
├── waits.ts       # Specialized wait utilities
├── assertions.ts  # Custom domain-specific assertions
├── auth.ts        # Authentication flow utilities
├── setup.ts       # Data setup/teardown helpers
└── README.md      # Documentation with usage examples

Usage

import {
  // Wait utilities
  waitForPageReady,
  waitForWebSocketConnection,
  waitForFontsLoaded,

  // Assertions
  assertPageSnapshot,
  assertTimerState,
  getDynamicContentMasks,

  // Auth utilities
  verifyAuthConfiguration,
  navigateToProtectedRoute,

  // Setup utilities
  setupMinimalVisualRegressionTest,
  replaceIframeWithStableWorkout,
} from './lib'
Original prompt

This section details on the original issue you should resolve

<issue_title>Create a Reusable Playwright Test Utilities and Custom Assertions Library</issue_title>
<issue_description>Develop a centralized library containing reusable Playwright test utilities and custom assertion functions. This library will encapsulate common testing patterns such as authentication flows, data setup/teardown, specialized waits, or domain-specific assertions. The goal is to minimize boilerplate, ensure consistency, and enhance the expressiveness and reliability of Playwright test suites.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 1, 2025 07:58
Co-authored-by: arii <342438+arii@users.noreply.github.com>
Co-authored-by: arii <342438+arii@users.noreply.github.com>
…tion

Co-authored-by: arii <342438+arii@users.noreply.github.com>
@arii
arii marked this pull request as ready for review December 1, 2025 08:13
@arii
arii merged commit ae9749c into leader Dec 1, 2025
4 checks passed
@arii
arii deleted the copilot/create-playwright-test-library branch December 1, 2025 08:13
Copilot AI requested a review from arii December 1, 2025 08:14
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.

Create a Reusable Playwright Test Utilities and Custom Assertions Library

2 participants