File tree Expand file tree Collapse file tree
testsupport/devsandbox-dashboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,12 +131,18 @@ func handleCookiesConsent(t *testing.T, page playwright.Page) {
131131 contentFrame := iframe .ContentFrame ()
132132 require .NotNil (t , contentFrame )
133133
134- // find the agree button
135- agreeButton := contentFrame .GetByRole ("button" , playwright.FrameLocatorGetByRoleOptions {
134+ // TrustArc can show different modals (e.g. full consent vs. simplified); accept whichever button is present.
135+ agreeProceed := contentFrame .GetByRole ("button" , playwright.FrameLocatorGetByRoleOptions {
136136 Name : "Agree and proceed with" ,
137137 })
138138
139- err = agreeButton .Click ()
139+ // to some us states, like texas, it appears the "Cookie Preferences and Opt-Out Rights" modal
140+ acceptDefault := contentFrame .GetByRole ("button" , playwright.FrameLocatorGetByRoleOptions {
141+ Name : "Accept default" ,
142+ })
143+ consentButton := agreeProceed .Or (acceptDefault )
144+
145+ err = consentButton .Click ()
140146 require .NoError (t , err )
141147
142148 // wait for iframe to disappear (indicates cookie acceptance complete)
You can’t perform that action at this time.
0 commit comments