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 43
43
{{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
44
44
</ span >
45
45
</ 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 ">
47
47
< ul >
48
48
{{ range $f5Sites }}
49
49
< li >
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ test.describe('Smoke test for header', () => {
46
46
test ( 'F5 Sites button works' , async ( { page } ) => {
47
47
const f5SitesButton = await page . getByTestId ( 'header__f5sites__button' ) ;
48
48
await f5SitesButton . click ( ) ;
49
- const f5SitesContent = await page . getByTestId ( 'header__f5sites_content ' ) ;
49
+ const f5SitesContent = await page . getByTestId ( 'header__f5sites__content ' ) ;
50
50
await expect ( f5SitesContent . count ( ) ) . toBeTruthy ( ) ;
51
51
} ) ;
52
52
} ) ;
Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ test.describe('Smoke test for sidebar', () => {
56
56
test ( 'each section page on sidebar renders' , async ( { page } ) => {
57
57
/* Click on each link */
58
58
const sidebarPages = await page . getByTestId ( 'sidebar__page' ) . all ( ) ;
59
+ let i = 0 ;
59
60
for ( const sidebarPage of sidebarPages ) {
60
- await waitFor ( async ( ) => await handleConsentPopup ( page ) ) ;
61
+ await waitFor ( async ( ) => await handleConsentPopup ( page , i > 0 ) ) ;
61
62
await openPage ( page , sidebarPage ) ;
62
63
await runSmokeTestOnPage ( page ) ;
64
+ i += 1 ;
63
65
}
64
66
} ) ;
65
67
} ) ;
Original file line number Diff line number Diff line change @@ -11,14 +11,15 @@ export async function runSmokeTestOnPage(page) {
11
11
}
12
12
13
13
// 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 ;
21
17
}
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 ( ) ;
22
23
}
23
24
24
25
const sleep = ( ms ) => new Promise ( ( r ) => setTimeout ( r , ms ) ) ;
You can’t perform that action at this time.
0 commit comments