I have a cypress test that includes checking that the copy button has copied value in an input field. The issue is I haven’t found a good way to give clipboard permissions for the Mozilla browser as it is possible to do with Chrome browser.
And I’m not sure if such test makes sense if instead of giving clipboard permission to a browser I simulate the copying action:
cy.document()
.then((doc) => {
const input = doc.querySelector(inputSelector)
input.select()
doc.execCommand('copy')
})
I tried to add clipboard permission to a cypress config file
env: {
permissions: {
'clipboard-write': true
}
}
Anastasia Kaloshina is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.