-
Notifications
You must be signed in to change notification settings - Fork 117
fix: Refactor Playwright tests for media type validation #2210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors Playwright tests for media type validation to address test failures caused by brittle string matching. The changes improve test robustness by using partial string matching instead of exact matching, and implement a centralized cleanup mechanism using test.afterEach.
Key changes:
- Replaced exact string matching with multiple partial assertions to make tests resilient to format variations
- Introduced a
selectorToResettracking variable andtest.afterEachhook for centralized test cleanup - Fixed spelling errors in test descriptions ("disbale" → "disabling") and variable naming (
video→musicin the music test)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test("Validate photo type by disbale it and check pop up", async ({admin }) => { | ||
| await backend.disableAnySettingAndSave("//label[@for='rtm-form-checkbox-11']"); | ||
|
|
||
| test.afterEach(async ({ admin }) => { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test("Validate photo type by disbale it and check pop up", async ({admin }) => { | ||
| await backend.disableAnySettingAndSave("//label[@for='rtm-form-checkbox-11']"); | ||
|
|
||
| test.afterEach(async ({ page, admin }) => { |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The page parameter is declared but never used in the afterEach hook. Consider removing it to keep the parameter list clean, as only admin is needed.
| test.afterEach(async ({ page, admin }) => { | |
| test.afterEach(async ({ admin }) => { |
The Playwright tests for the media type validation keeps failing due to incorrect strings.
This PR fixes the strings and makes the validation robust.