Skip to content

test(regression): tag logout-flow as @stable and remove isVisible().catch() anti-pattern - #254

Merged
daniellicnerski1 merged 1 commit into
mainfrom
test/logout-flow-stable
May 19, 2026
Merged

test(regression): tag logout-flow as @stable and remove isVisible().catch() anti-pattern#254
daniellicnerski1 merged 1 commit into
mainfrom
test/logout-flow-stable

Conversation

@daniellicnerski1

Copy link
Copy Markdown
Collaborator

Summary

  • Refactored the 3 tests in tests/tests-automations/regression/core-functionality/auth/logout-flow.spec.ts to replace isVisible().catch(() => false) + toBeFalsy() with expect(...).toBeHidden({ timeout: 5000 }). The previous form swallowed any locator exception into false, making the assertion pass for the wrong reasons.
  • Validated end-to-end through the 7-step playwright-test-linter pipeline (typecheck, lint, static checklist, run, force-fail per test, --trace=on, backend error audit — all green).
  • Tagged the 3 tests as @stable and updated the corresponding bullets in QA-CHECKLIST.md from [-] to [x].

Test plan

  • npm run typecheck — clean
  • npx eslint <spec> — 0 errors, warnings within accepted project-wide patterns (count reduced 16→13 after refactor)
  • npx playwright test <spec> --workers=1 --retries=0 — 3 passed (11.0s)
  • Force-fail per test: inverted toBeHiddentoBeVisible({ timeout: 2000 }) fails at the expected line; reverted; passes again
  • --trace=on run — 3 passed (13.0s) with trace
  • Zero 🚨 Backend Error occurrences (the /auto_login 500 is intercepted by page.route and never hits the real backend)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Tags three logout-flow tests as @stable and replaces the isVisible().catch(() => false) + toBeFalsy() anti-pattern with expect(...).toBeHidden({ timeout: 5000 }), which properly waits for the element to hide and surfaces real locator errors instead of swallowing them.

Changes:

  • Refactor 3 visibility assertions to use toBeHidden web-first assertion
  • Add @stable tag to all 3 logout-flow tests
  • Update QA-CHECKLIST.md to mark the two corresponding bullets as [x]

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/tests-automations/regression/core-functionality/auth/logout-flow.spec.ts Replace anti-pattern with toBeHidden; tag tests as @stable
QA-CHECKLIST.md Mark "Logout — should redirect to login screen" and "Session cleanup after logout" as [x]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@daniellicnerski1
daniellicnerski1 merged commit a92e4a8 into main May 19, 2026
3 checks passed
@Victor-w-Madeira
Victor-w-Madeira deleted the test/logout-flow-stable branch May 19, 2026 15:57
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