Comments (1)
I'm having the exact same problem.
It doesn't seem to be specific to readdir() as substituting cy.wait() gets the same results, so perhaps related to a callback within the event handler. The following does not work:
Cypress.on("test:after:run", (test, runnable) => {
if (test.state === "failed" || test.state === "passed") {
//this does not work
cy.wait(1).then(function () {
addContext({ test } as Mocha.Context, "CONTEXT ADDED WITHIN test:after:run");
});
}
});
...but the same structure outside of the event handler does work:
it("should log context within callback", function () {
cy.addContext("outer").then(() => {
cy.wait(1).then(() => {
cy.addContext("within wait");
});
});
});
//added a custom command to get test context, as using _this_ was not working for me
Cypress.Commands.add("addContext", (context) => {
cy.once("test:after:run", (test) => addContext({ test } as Mocha.Context, context));
});
from mochawesome.
Related Issues (20)
- Report vanishes on load, returns: "Uncaught TypeError: Expected a finite number" HOT 2
- Filename inheritance option
- Cypress 10.7x - TypeError: addContext is not a function HOT 5
- Need to store report in different folder with different report name for every test run - Mochawesome HOT 1
- ScreenShot is not saving in the screenshot folder - Mochawesome-screenshots HOT 1
- Can not marge the mocha report which genrated in parallel test
- It's possible to update Size ,Color of "addContext"
- How to use Relative path instead of Absolute path for failed screenshot due to cypress-image-snapshot
- missing peer mocha@>=7
- What does the `stats.other` key in the index.json signify ? HOT 3
- Vulnerability in [email protected]
- addContext to selected context in the suite
- Is it possible to show API Response in mochawesome json ? HOT 1
- Running mochawesome from root can mangle testsuite `file` property
- addContext called in beforeEach/afterEach hook adds additional context to the test even when the hook fails and the test is pending
- Retries quantity in mocha report + SDOUT HOT 1
- Unable to generate reports with custom template using mochawesome HOT 1
- Is mochawesome still alive or maintained ? HOT 4
- How can I integrate a custom Mocha reporter into my test suite to filter out specific test cases from the test report based on tags?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mochawesome.