keycloak-scim/js/apps/admin-ui/cypress/support/util/grantClipboardAccess.ts

13 lines
473 B
TypeScript

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,
},
}),
);
}