1- // Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
1+ // Copyright 2020-2026 the Pinniped contributors. All Rights Reserved.
22// SPDX-License-Identifier: Apache-2.0
33
44// Package browsertest provides integration test helpers for our browser-based tests.
@@ -19,7 +19,8 @@ import (
1919 "time"
2020
2121 chromedpbrowser "github.com/chromedp/cdproto/browser"
22- "github.com/chromedp/cdproto/dom"
22+ chromedpdom "github.com/chromedp/cdproto/dom"
23+ chromedppage "github.com/chromedp/cdproto/page"
2324 chromedpruntime "github.com/chromedp/cdproto/runtime"
2425 "github.com/chromedp/chromedp"
2526 "github.com/stretchr/testify/require"
@@ -137,8 +138,9 @@ func OpenBrowser(t *testing.T) *Browser {
137138 // Grant permission to write to the clipboard because the Pinniped formpost UI has a button to copy the
138139 // authcode to the clipboard, and we want to be able to use that button in tests.
139140 require .NoError (t , chromedp .Run (chromeCtx ,
140- chromedpbrowser .GrantPermissions (
141- []chromedpbrowser.PermissionType {chromedpbrowser .PermissionTypeClipboardSanitizedWrite },
141+ chromedpbrowser .SetPermission (
142+ & chromedpbrowser.PermissionDescriptor {Name : chromedppage .PermissionsPolicyFeatureClipboardWrite .String ()},
143+ chromedpbrowser .PermissionSettingGranted ,
142144 ),
143145 ))
144146
@@ -196,11 +198,11 @@ func (b *Browser) dumpPage(t *testing.T) {
196198 // Log the HTML of the current page.
197199 var html string
198200 b .runWithTimeout (t , b .timeout (), chromedp .ActionFunc (func (ctx context.Context ) error {
199- node , err := dom .GetDocument ().Do (ctx )
201+ node , err := chromedpdom .GetDocument ().Do (ctx )
200202 if err != nil {
201203 return err
202204 }
203- html , err = dom .GetOuterHTML ().WithNodeID (node .NodeID ).Do (ctx )
205+ html , err = chromedpdom .GetOuterHTML ().WithNodeID (node .NodeID ).Do (ctx )
204206 return err
205207 }))
206208 var htmlBuf bytes.Buffer
0 commit comments