keycloak-scim/cypress/support/util/grantClipboardAccess.ts

14 lines
472 B
TypeScript
Raw Normal View History

export default function grantClipboardAccess() {
// Use the Chrome debugger protocol to grant access to the clipboard.
// https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-grantPermissions
cy.wrap(
Cypress.automation("remote:debugger:protocol", {
command: "Browser.grantPermissions",
params: {
permissions: ["clipboardReadWrite", "clipboardSanitizedWrite"],
origin: window.location.origin,
},
})
);
}