File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 4343 {{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
4444 </ span >
4545 </ button >
46- < div class ="dropdown-content " id ="dropdown-content " data-testid ="header__f5sites_content ">
46+ < div class ="dropdown-content " id ="dropdown-content " data-testid ="header__f5sites__content ">
4747 < ul >
4848 {{ range $f5Sites }}
4949 < li >
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ test.describe('Smoke test for header', () => {
4646 test ( 'F5 Sites button works' , async ( { page } ) => {
4747 const f5SitesButton = await page . getByTestId ( 'header__f5sites__button' ) ;
4848 await f5SitesButton . click ( ) ;
49- const f5SitesContent = await page . getByTestId ( 'header__f5sites_content ' ) ;
49+ const f5SitesContent = await page . getByTestId ( 'header__f5sites__content ' ) ;
5050 await expect ( f5SitesContent . count ( ) ) . toBeTruthy ( ) ;
5151 } ) ;
5252} ) ;
Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ test.describe('Smoke test for sidebar', () => {
5656 test ( 'each section page on sidebar renders' , async ( { page } ) => {
5757 /* Click on each link */
5858 const sidebarPages = await page . getByTestId ( 'sidebar__page' ) . all ( ) ;
59+ let i = 0 ;
5960 for ( const sidebarPage of sidebarPages ) {
60- await waitFor ( async ( ) => await handleConsentPopup ( page ) ) ;
61+ await waitFor ( async ( ) => await handleConsentPopup ( page , i > 0 ) ) ;
6162 await openPage ( page , sidebarPage ) ;
6263 await runSmokeTestOnPage ( page ) ;
64+ i += 1 ;
6365 }
6466 } ) ;
6567} ) ;
Original file line number Diff line number Diff line change @@ -11,14 +11,15 @@ export async function runSmokeTestOnPage(page) {
1111}
1212
1313// THE GDPR Consent button appears when test is run from EU locations. This handles that popup.
14- export async function handleConsentPopup ( page ) {
15- const consentContent = page . locator ( '#truste-consent-content' ) ;
16- const isConsentContentVisibile = await consentContent . isVisible ( ) ;
17- if ( isConsentContentVisibile ) {
18- const consentButton = page . locator ( '#truste-consent-required' ) ;
19- expect ( consentButton ) . toBeVisible ( ) ;
20- await consentButton . click ( ) ;
14+ export async function handleConsentPopup ( page , isClickedAlready = false ) {
15+ if ( isClickedAlready ) {
16+ return ;
2117 }
18+ const consentContent = page . locator ( '#truste-consent-content' ) ;
19+ await consentContent . waitFor ( { state : 'visible' } ) ;
20+ const consentButton = page . locator ( '#truste-consent-required' ) ;
21+ expect ( consentButton ) . toBeVisible ( ) ;
22+ await consentButton . click ( ) ;
2223}
2324
2425const sleep = ( ms ) => new Promise ( ( r ) => setTimeout ( r , ms ) ) ;
You can’t perform that action at this time.
0 commit comments