Skip to content

Commit

Permalink
fix: labelStorage should be aplied to all tests to handle afterEach h…
Browse files Browse the repository at this point in the history
…ook labels
  • Loading branch information
Shelex committed Feb 2, 2022
1 parent f7d02ae commit 5a9e440
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions reporter/allure-cypress/AllureReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,16 @@ module.exports = class AllureReporter {
}

// restrict label storage to single suite scope
// check if there are skipped tests and reapply labels from storage
// as beforeEach\afterEach hooks for them are not executed
this.runtime.config.writer.tests
.filter((test) => test.status === Status.SKIPPED)
.forEach((test) =>
this.labelStorage.forEach((label) =>
// in case label is missing - it will be applied to test
// but not overwrite it
applyLabel(test, label, false)
)
);
// try to reapply labels from storage
// as beforeEach\afterEach hooks for skipped tests are not executed
// and handle labels provided in afterEach
this.runtime.config.writer.tests.forEach((test) =>
this.labelStorage.forEach((label) =>
// in case label is missing - it will be applied to test
// but not overwrite it
applyLabel(test, label, false)
)
);
this.labelStorage = [];
}

Expand Down

0 comments on commit 5a9e440

Please sign in to comment.