Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cy.task('percyHealthCheck').then((percyIsRunning: boolean) => {
if (percyIsRunning) {
const percyAgentClient = new PercyAgent({
handleAgentCommunication: false,
domTransformation: options.domTransformation
})
name = name || cy.state('runnable').fullTitle()
cy.document().then((doc: Document) => {
options.document = doc
const domSnapshot = percyAgentClient.snapshot(name, options)
return cy.request({
method: 'POST',
url: `http://localhost:${percyAgentClient.port}/percy/snapshot`,
failOnStatusCode: false,
body: {
name,
url: doc.URL,