There are no results in report when before hook fails and next block is describe() not it()
See original GitHub issueDescribe the bug The following code cause the issue
describe('one', () => {
before(() => {
expect(true).to.equal(false); // when before hook fails and the next block is describe
});
describe('second', () => {
before(() => {
expect(true).to.equal(true);
cy.log('gg');
});
it('should log 2', () => {
cy.log('log 2');
});
});
});
There is only container.json file in allure-results and no attachments
However when before hooks fails and the next block is it() it just works fine
describe('one', () => {
before(() => {
expect(true).to.equal(true); // pass
});
describe('second', () => {
before(() => {
expect(true).to.equal(false); // fails but there are results in report
cy.log('gg');
});
it('should log 2', () => {
cy.log('log 2');
});
});
});
Now allure-results folder contains result.json, container.json and attachments
Environment (please complete the following information):
- Cypress version: 8.6.0
- cypress allure plugin: 2.23.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Describe block with async function behaving weirdly #2975
In the "parsing" cycle all describe callbacks are excecuted and the test hierarchy ( runner ) is created. Those callbacks are indeed synchronous ......
Read more >For async tests and hooks, ensure "done()" is called
I have this test of nodejs when testing I get a error of done function not declared. Error ...
Read more >Mocha - the fun, simple, flexible JavaScript test framework
Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on GitHub.
Read more >Allure Reporter - WebdriverIO
A WebdriverIO reporter plugin to create Allure Test Reports. ... to not fetch the before/after stacktrace/screenshot/result hooks into the Allure Reporter.
Read more >Jest Tutorial - JavaScript Unit Testing Using Jest Framework
Tips & Tricks; Video Tutorial: Jest Coverage & HTML Report Generation ... describe("Calculator tests", () => { test('adding 1 + 2 should ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, thanks for replies and fix!!
However that is exactly the core recommendation for designing tests - isolation 😃. Here you have admin and user functionality combined together. But it would be much easy to maintain, read and support when separated:
Moreover, it seems like functionality that should be covered with unit tests (or at least integration/component), instead of Cypress and e2e level.