Skip to content

fix: Refactor Playwright tests for media type validation - #2210

Merged
NoumaanAhamed merged 4 commits into
developfrom
fix/update-playwright-tests-specs
Nov 20, 2025
Merged

NoumaanAhamed merged 4 commits into
developfrom
fix/update-playwright-tests-specs

Conversation

@NoumaanAhamed

@NoumaanAhamed NoumaanAhamed commented Nov 18, 2025 •

Copy link
Copy Markdown
Collaborator
image

The Playwright tests for the media type validation keeps failing due to incorrect strings.

This PR fixes the strings and makes the validation robust.

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

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 selectorToReset tracking variable and test.afterEach hook for centralized test cleanup
  • Fixed spelling errors in test descriptions ("disbale" → "disabling") and variable naming (video → music in 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.

@KMchaudhary
KMchaudhary requested a review from Copilot November 20, 2025 09:23

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

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

Copy link

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.

Suggested change
test.afterEach(async ({ page, admin }) => {
test.afterEach(async ({ admin }) => {

Copilot uses AI. Check for mistakes.
@NoumaanAhamed
NoumaanAhamed merged commit 40115ac into develop Nov 20, 2025
12 checks passed
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.

3 participants