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

99
Visualizações
Mochaweasome contained only description for passed test cases

I'm using mochawesome report to capture my cypress execution. The test case shows simply pass and didn't find the steps that it gone through and assertion that is added as part of that test in the report.

Sample snapshot (Sorry for too many strike):

enter image description here

I'm very new to cypress and mocha world, and I would like to see all the action that has been done in that test. Like I can see very clear details in the cypress.open. How can I get all the such information as part of mochawesome report? Is there any centralized (support/index.js or plugin/index.js file) place to make this changes that will replicate everywhere in the program.

Expected:

Expected all the Actions should be captured as part of mochawesome report as like below sample:

It contains click() action status and submit action status in the report for that test case. and type() failed so that it will be very easy to debug the failures.

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In the mochawesome report, each it block becomes one line of the report and you can put additional reporting using addConext as below (source: mochawesome documentation)

const addContext = require('mochawesome/addContext');
describe('test suite', function () {
  it('should add context', function () {
    // context can be a simple string
    addContext(this, 'simple string');

    // context can be an image url and the report will show it inline
    addContext(this, 'http://www.url.com/screenshot-maybe.jpg');

  });
});

But if you really want to generate the report as you have attached then you need to break each action into a test i.e. it block. Below is the sample code that can be used.

describe("Test suite",function(){
   const cy = "";//put your code to initialize cy
   it("Action 1", function(){
      //code to perform action
   });

   it("Action21", function(){
      //code to perform action2
   })

})

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