From d8e247f4fce3ab81003a0a0adf74951a21201f9d Mon Sep 17 00:00:00 2001 From: Bogdan Preda Date: Tue, 7 May 2024 14:59:49 +0300 Subject: [PATCH] chore: update test --- .../hfg/hfg-copyright-component.spec.ts | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/e2e-tests/specs/customizer/hfg/hfg-copyright-component.spec.ts b/e2e-tests/specs/customizer/hfg/hfg-copyright-component.spec.ts index ada6aacdb6..376e7bf95e 100644 --- a/e2e-tests/specs/customizer/hfg/hfg-copyright-component.spec.ts +++ b/e2e-tests/specs/customizer/hfg/hfg-copyright-component.spec.ts @@ -7,14 +7,14 @@ test('Checks the copyright in front-end', async ({ page }) => { page.locator('.hfg_footer .footer--row[data-show-on="desktop"]') ).toHaveText('Neve | Powered by WordPress'); await expect( - page.locator( - '.hfg_footer .footer--row[data-show-on="desktop"] a:first-child' - ) + page + .locator('.hfg_footer .footer--row[data-show-on="desktop"] a') + .nth(0) ).toHaveAttribute('href', 'https://themeisle.com/themes/neve/'); await expect( - page.locator( - '.hfg_footer .footer--row[data-show-on="desktop"] a:nth-child[1]' - ) + page + .locator('.hfg_footer .footer--row[data-show-on="desktop"] a') + .nth(1) ).toHaveAttribute('href', 'https://wordpress.org'); // Check that the text is also present for the Mobile footer @@ -23,13 +23,9 @@ test('Checks the copyright in front-end', async ({ page }) => { ).toHaveText('Neve | Powered by WordPress'); await expect( - page.locator( - '.hfg_footer .footer--row[data-show-on="mobile"] a:first-child' - ) + page.locator('.hfg_footer .footer--row[data-show-on="mobile"] a').nth(0) ).toHaveAttribute('href', 'https://themeisle.com/themes/neve/'); await expect( - page.locator( - '.hfg_footer .footer--row[data-show-on="mobile"] a:nth-child[1]' - ) + page.locator('.hfg_footer .footer--row[data-show-on="mobile"] a').nth(1) ).toHaveAttribute('href', 'https://wordpress.org'); });