Skip to content

Conversation

Copy link

Copilot AI commented Feb 1, 2026

Code review identified 9 test cases with conditional guards that create false positives—tests pass even when expected functionality is missing or broken.

Test Assertion Fixes:

  • SEO tests: Require meta description and canonical URL to exist rather than silently skipping validation when absent
  • Performance tests: Remove strict wall-clock timing against dev server (varies by machine/CI load) and filter request failures to same-origin only (excludes third-party CDN/transient network issues)
  • Locale switching tests: Assert language switcher and navigation links exist/visible before interaction instead of conditional guards
  • Navigation tests: Assert contact link visibility before clicking to catch regressions

Example - Before (false positive):

const languageSwitcher = page.locator('[data-locale-switcher]');
if (await languageSwitcher.count() > 0) {
  await languageSwitcher.click();
  await expect(page).toHaveURL(/\/de\//);
}
// Test passes even if switcher is missing

After (proper validation):

const languageSwitcher = page.locator('[data-locale-switcher]');
await expect(languageSwitcher).toBeVisible();
await languageSwitcher.click();
await expect(page).toHaveURL(/\/de\//);
// Test fails if switcher is missing/broken

💡 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 changed the title [WIP] Add Playwright tests for internationalization and accessibility Fix false positive test assertions in E2E test suite Feb 1, 2026
Copilot AI requested a review from danielmarv February 1, 2026 17:30
@danielmarv danielmarv closed this Feb 1, 2026
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.

2 participants