Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

582
Vistas
Cypress and cypress-metamask plugin issue (connect ECONNREFUSED 127.0.0.1:9222)

I am trying to integrate cypress tests into my app, but in order to perform e2e tests I need to interact with metamask. I am using the cypress-metamask plugin (https://www.npmjs.com/package/cypress-metamask), but cannot get it to work.

Running the tests returns the following error:

cy.task('setupMetamask') failed with the following error:

request to http://localhost:9222/json/version failed, reason: connect ECONNREFUSED 127.0.0.1:9222

This is the test:

describe('NFTicket', () => {
  beforeEach(() => {
    cy.setupMetamask();
    cy.changeMetamaskNetwork('localhost')
    cy.visit('/')
  });

  it('is expected to display a sussess message', () => {
    cy.get('[data-cy=title]').should('contain.text', 'MetaMask Detected')
  });
  
});

This is how my cypress/plugins/index.js is configured:

module.exports = (on, config) => {
  require('cypress-metamask/plugins')(on);
  on('before:browser:launch', (browser = { isHeaded: true }, arguments_) => {
    if (browser.name === 'chrome') {
      arguments_.args.push('--remote-debugging-port=9222')
      arguments_.args.push('--disable-background-timer-throttling');
      arguments_.args.push('--disable-backgrounding-occluded-windows');
      arguments_.args.push('--disable-renderer-backgrounding');
    }
  })
}
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

In our project, we also encountered a problem using this library. I don't remember exactly what it was, but in general we couldn't solve it and then we changed it to @synthetixio/synpress. In our project with this library e2e tests run perfectly.

npm i @synthetixio/synpress

yarn add @synthetixio/synpress

A list of useful commands for working with metamask can be found here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Please ensure the server is started, You can try this 127.0.0.1 localhost in /etc/hosts file.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda