Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

588
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda