From 72544f2b92c88d3b6b5e7c4e03b87559427d0772 Mon Sep 17 00:00:00 2001 From: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Date: Sat, 25 Oct 2025 10:50:51 +0700 Subject: [PATCH] test(e2e): scroll functionality for certification sections on /settings (#63038) --- e2e/settings.spec.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/e2e/settings.spec.ts b/e2e/settings.spec.ts index 5846fa42546..581c25b5a70 100644 --- a/e2e/settings.spec.ts +++ b/e2e/settings.spec.ts @@ -2,6 +2,7 @@ import { execSync } from 'child_process'; import { test, expect } from '@playwright/test'; import translations from '../client/i18n/locales/english/translations.json'; +import { currentCertifications } from '../shared/config/certification-settings'; import { alertToBeVisible } from './utils/alerts'; const settingsTestIds = { @@ -321,3 +322,23 @@ test.describe('Settings - New User', () => { await expect(claimFullStackCertButton).toBeDisabled(); }); }); + +test.describe('Setting - Hash Navigation', () => { + test('should scroll to certification sections when navigating with hash', async ({ + page + }) => { + for (const certSlug of currentCertifications) { + await page.goto(`/settings#cert-${certSlug}`); + + // Wait for scroll animation + await page.waitForTimeout(300); + + const certHeading = page.getByRole('heading', { + name: translations.certification.title[certSlug], + exact: true + }); + + await expect(certHeading).toBeInViewport(); + } + }); +});