test(regression): tag logout-flow as @stable and remove isVisible().catch() anti-pattern - #254
Merged
Merged
Conversation
…atch() anti-pattern
4 tasks
Contributor
There was a problem hiding this comment.
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
toBeHiddenweb-first assertion - Add
@stabletag 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/tests-automations/regression/core-functionality/auth/logout-flow.spec.tsto replaceisVisible().catch(() => false)+toBeFalsy()withexpect(...).toBeHidden({ timeout: 5000 }). The previous form swallowed any locator exception intofalse, making the assertion pass for the wrong reasons.playwright-test-linterpipeline (typecheck, lint, static checklist, run, force-fail per test, --trace=on, backend error audit — all green).@stableand updated the corresponding bullets inQA-CHECKLIST.mdfrom[-]to[x].Test plan
npm run typecheck— cleannpx 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)toBeHidden→toBeVisible({ timeout: 2000 })fails at the expected line; reverted; passes again--trace=onrun — 3 passed (13.0s) with trace🚨 Backend Erroroccurrences (the/auto_login500 is intercepted bypage.routeand never hits the real backend)