How to use the @percy/agent function in @percy/agent

To help you get started, we’ve selected a few @percy/agent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github percy / percy-cypress / lib / index.ts View on Github external
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,

@percy/agent

An agent process for integrating with Percy.

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis