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-mocha] - How can I add a label/epic/feature/story to a programmatically skipped test? #457

Open
hananmalka opened this issue Jun 26, 2022 · 3 comments
Assignees
Labels
theme:mocha Mocha related issue type:bug Something isn't working
Milestone

Comments

@hananmalka
Copy link

Hi, I tried to add some allure properties to a test which I want to skip programmatically.

I can see that the skip actions override all allure properties I have added (In this case epic)

const runtime = require('allure-mocha/runtime');

it("Want this test to contain some epic", function () {
     runtime.allure.epic("Test 1");
     this.skip();
});

The output I get is the following (without the epic, or any other allure property I tried to add):

{
  "uuid": "820c5f46-bbef-43db-88d0-152d325657fb",
  "historyId": "12660b30ea57b0f70968924b25b2f0c5",
  "status": "skipped",
  "statusDetails": { "message": "Test ignored" },
  "stage": "finished",
  "steps": [],
  "attachments": [],
  "parameters": [],
  "labels": [{ "name": "parentSuite", "value": "Modules" }],
  "links": [],
  "start": 1656235569510,
  "name": "Want this test to contain some epic",
  "fullName": "Want this test to contain some epic",
  "stop": 1656235569510
}

How can I add any property for skipped tests?

@hananmalka
Copy link
Author

any update?

@gayvoronskaya
Copy link

gayvoronskaya commented Jul 19, 2022

plus (for allure-playwright)
if test skip manually (test.skip) or skips on fail in serial describe
(test.describe.serial)

allure fields for skips tests will be lost

@epszaw
Copy link
Member

epszaw commented Oct 17, 2022

Hello! Sorry for late reply, but the solution can't be done without a PR mochajs/mocha#4922. The issue strongly relates to #486 and requires the same conditions for the solution

@epszaw epszaw added type:bug Something isn't working theme:mocha Mocha related issue labels Oct 17, 2022
@baev baev added this to the 3.0 milestone May 8, 2024
@epszaw epszaw assigned delatrie and unassigned epszaw May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:mocha Mocha related issue type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants