From cb231abaaa1aad3e28669a9ffbea816b30cd281d Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Mon, 23 Jun 2025 16:40:38 +0300 Subject: [PATCH] fix: make landing e2e test specific (#60893) --- e2e/landing.spec.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/e2e/landing.spec.ts b/e2e/landing.spec.ts index 355632a163a..af258bbe28b 100644 --- a/e2e/landing.spec.ts +++ b/e2e/landing.spec.ts @@ -100,6 +100,18 @@ test.describe('Landing Top - Variation A', () => { translations.landing['h2-heading'].replace(/<\/?strong>/g, '') ); }); + + test('Hero image should have a description', async ({ isMobile, page }) => { + const captionText = page.getByText( + translations.landing['hero-img-description'] + ); + + if (isMobile) { + await expect(captionText).toBeHidden(); + } else { + await expect(captionText).toBeVisible(); + } + }); }); test.describe('Landing Page', () => { @@ -130,23 +142,15 @@ test.describe('Landing Page', () => { } }); - test('Hero image should have an alt and a description', async ({ - isMobile, - page - }) => { + test('Hero image should have an alt', async ({ isMobile, page }) => { const campersImage = page.getByAltText( translations.landing['hero-img-alt'] ); - const captionText = page.getByText( - translations.landing['hero-img-description'] - ); if (isMobile) { await expect(campersImage).toBeHidden(); - await expect(captionText).toBeHidden(); } else { await expect(campersImage).toBeVisible(); - await expect(captionText).toBeVisible(); } });