From 43ea6f7b89f5372193207a073d85fd5c499510e6 Mon Sep 17 00:00:00 2001 From: devadula-nandan Date: Wed, 11 Dec 2024 17:13:42 +0530 Subject: [PATCH] fix: pageHeader avt 1 --- .../PageHeader/PageHeader-test.avt.e2e.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/e2e/components/PageHeader/PageHeader-test.avt.e2e.js b/e2e/components/PageHeader/PageHeader-test.avt.e2e.js index 7b06c767c1..98f8197ccb 100644 --- a/e2e/components/PageHeader/PageHeader-test.avt.e2e.js +++ b/e2e/components/PageHeader/PageHeader-test.avt.e2e.js @@ -173,12 +173,17 @@ test.describe('PageHeader @avt', () => { (await page.locator('*:focus').textContent()) === 'Secondary button'; await page.keyboard.press('Tab'); (await page.locator('*:focus').textContent()) === 'Primary button'; - // reset focus to first focusable element - await page.getByRole('link', { name: 'Home page' }).focus(); - // changes position when header collapsed - await page.locator(`.page-header-stories__dummy-content`).first().hover(); - await page.mouse.wheel(0, 180); - await pressTabKey(page, 4); + + // collapse header through args + await visitStory(page, { + component: 'PageHeader', + id: 'ibm-products-components-page-header-pageheader--fully-loaded-and-some&args=collapseHeader:!true', + globals: { + carbonTheme: 'white', + }, + }); + await page.screenshot({ animations: 'disabled' }); + await pressTabKey(page, 5); await expect( page.getByRole('button', { name: 'Page actions...' }) ).toBeFocused();