From 4c00902a54e98400c0d9789c795e9efb7d3205ed Mon Sep 17 00:00:00 2001 From: Pablo Costa Date: Fri, 13 Dec 2024 15:14:49 -0300 Subject: [PATCH] Refactor "Should flag an incident" tests to use locators for element interactions and click (#3282) --- site/gatsby-site/playwright/e2e-full/cite.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/gatsby-site/playwright/e2e-full/cite.spec.ts b/site/gatsby-site/playwright/e2e-full/cite.spec.ts index 807a95372a..9595ad4663 100644 --- a/site/gatsby-site/playwright/e2e-full/cite.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/cite.spec.ts @@ -110,8 +110,8 @@ test.describe('Cite pages', () => { await page.goto(url + '#' + _id); - await page.click(`[id="r${_id}"] [data-cy="expand-report-button"]`); - await page.click(`[id="r${_id}"] [data-cy="flag-button"]`); + await page.locator(`[id="r${_id}"] [data-cy="expand-report-button"]`).click(); + await page.locator(`[id="r${_id}"] [data-cy="flag-button"]`).click(); const modal = page.locator('[data-cy="flag-report-3"]'); await expect(modal).toBeVisible(); @@ -120,7 +120,7 @@ test.describe('Cite pages', () => { await expect(modal.locator('[data-cy="flag-toggle"]')).toBeDisabled(); - await page.click('[aria-label="Close"]'); + await page.locator('[aria-label="Close"]').click(); await expect(modal).not.toBeVisible();