adamgruber / mochawesome

A Gorgeous HTML/CSS Reporter for Mocha.js
https://gitter.im/mochawesome/general
MIT License
1.06k stars 160 forks source link

Failed Test cases are marked as passed #376

Open pradeepsundaram opened 2 years ago

pradeepsundaram commented 2 years ago

Describe the bug Though the tests are failed, they are marked as passed in the report. Failure screen shot is being generated.

Code Reproduce This is inside paypal corp and its confidential

Expected behavior The test case should be marked as failure.

Screenshots │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 1 │ │ Video: true │ │ Duration: 6 minutes, 16 seconds │ │ Spec Ran: UK/cbpUKTC2.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Screenshots)

Environment (please complete the following information):

Additional context we are running our CI and there are some tests which fails and retry attempts are not made. the reason for that is the tests are marked as passed though it fails. Screenshots are being attached in the log for failure but marked as passed.

adamgruber commented 2 years ago

I see that you are using Cypress so it may be an issue with them. However, without some kind of code to reproduce the issue there's nothing for me to debug. Are you able to provide a simple test case that illustrates your issue without providing sensitive information?

pradeepsundaram commented 2 years ago

Hi @adamgruber ,

Code goes like this,

cy.visit(url).get('#email').type(${email}{enter}) cy.get('#password', { timeout: 10000 }) .should('be.visible') .type(atob(data.pass)) .type('{enter}') cy.get(data.mrhpnoppcp).contains('some label')

but the page itself is not loaded, getting error like this "cy.visit() failed trying to load: https://www.te-" the results in mochawesome shows like this. it says passed but screen shot is taken for the failed one (which i have highlighted below). ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 1 │ │ Video: true │ │ Duration: 6 minutes, 16 seconds │ │ Spec Ran: IT/cbpITTC5.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Screenshots)