Skip to content

Extend console-warnings E2E fixture to catch other warning categories #193

@pedropaulovc

Description

@pedropaulovc

Context

As part of Issue #186, we created a Playwright fixture (e2e/fixtures/console-warnings.ts) that fails tests on unexpected degraded mode warnings. This pattern could be extended to catch other types of warnings.

Proposed Enhancement

Extend the console-warnings fixture to:

  1. Allow tests to declare which warning categories they expect
  2. Fail on ANY unexpected console warnings (not just degraded mode)
  3. Support multiple warning categories with different opt-in flags

Example API

test.use({ 
  expectDegradedMode: true,
  expectDeprecationWarnings: true,
  allowAllWarnings: false  // strict mode
});

Benefits

  • Catch unexpected warnings earlier in development
  • More comprehensive test coverage
  • Better signal-to-noise ratio in console output

Implementation Notes

  • Maintain backward compatibility with existing expectDegradedMode flag
  • Consider performance impact of listening to all console messages
  • Document when to use strict mode vs. lenient mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions