Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allure-cypress test failures in before & beforeEach blocks are not reported #1072

Closed
iamrragu opened this issue Jul 25, 2024 · 2 comments · Fixed by #1123
Closed

allure-cypress test failures in before & beforeEach blocks are not reported #1072

iamrragu opened this issue Jul 25, 2024 · 2 comments · Fixed by #1123
Assignees
Labels
theme:cypress type:bug Something isn't working

Comments

@iamrragu
Copy link

iamrragu commented Jul 25, 2024

Describe the bug
If the cypress tests fail in the before or beforeEach block, they are not being reported in the allure-results.

To Reproduce

describe('Test Suite', { tags: '@test' }, () => {
  before(() => {
    expect(false).to.eq(true);
  });

  it('should pass', () => {
    expect(true).to.eq(true);
  });
});

When the test passes we get 2 files under allure-results

{
  "uuid": "de42dc8f-5fc6-4b23-84eb-2c49b0024fca",
  "name": "\"before all\" hook",
  "children": [
    "8496a4a2-bfff-4334-b446-febbbb83b73c"
  ],
  "befores": [
    {
      "status": "passed",
      "statusDetails": {},
      "stage": "finished",
      "steps": [],
      "attachments": [],
      "parameters": [],
      "start": 1721890224434,
      "name": "\"before all\" hook",
      "stop": 1721890224653
    }
  ],
  "afters": []
}
{
  "uuid": "8496a4a2-bfff-4334-b446-febbbb83b73c",
  "name": "should pass",
  "historyId": "7deea96eaba6ccacf320023fe1e01d97:d41d8cd98f00b204e9800998ecf8427e",
  "status": "passed",
  "statusDetails": {},
  "stage": "finished",
  "steps": [],
  "attachments": [],
  "parameters": [],
  "labels": [
    {
      "name": "language",
      "value": "javascript"
    },
    {
      "name": "framework",
      "value": "cypress"
    },
    {
      "name": "parentSuite",
      "value": "Test Suite"
    }
  ],
  "links": [],
  "start": 1721890224325,
  "fullName": "cypress/e2e/test.cy.ts#Test Suite should pass",
  "testCaseId": "7deea96eaba6ccacf320023fe1e01d97",
  "stop": 1721890224651
}

and when the test fails in before or beforEach block the allure-results folder is empty

Expected behavior
Test failures in test hooks should be available in allure-results and reports.

Desktop (please complete the following information):

Additional context

  • allure-results gets generated if the test fails in it block or after or afterEach
  • allure-results folder is empty if the test fails in before or beforeEach

Tried to switch to [email protected] since with the example spec mentioned above with [email protected] it gets stuck and never reports a failure with the below error message.

Right now, we can't use the[email protected] version due to below issue(from screenshot) and can't use [email protected] due to the current issue and #1070

image
@iamrragu
Copy link
Author

Tried updating to the @3.0.0-beta.10 version, the issue is still reproducible with the original example spec. No allure results generated for a test that fails in before hooks.

@baev
Copy link
Member

baev commented Aug 12, 2024

@iamrragu thanks for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:cypress type:bug Something isn't working
Projects
None yet
3 participants