Comments (10)
@archfz sorry, missed your message. If I understand correctly it would be something like
specname.js
before: commands from before
test1: commands from test1
test2...
after: commands from after
or whatever the order will be.
that would be great!
from cypress-terminal-report.
I've checked all the way back till 1.1.0. This seems like after and before command registrations never worked. So I will marked this as an enhancement.
The question here is infact that how should we treat these? Because these are not per tests but per spec file, but we are logging per test (as we have also the feature to log only failed tests). Should we add what's from before and after hooks to each tests logs from that spec file? Maybe treat somehow all logs from before and after as special cases of tests and log them as such (in case of log only on fail, log them only if any of the tests fail on spec).
from cypress-terminal-report.
@sergeyKhristenko What do you say about the proposed way to treat after and before logs?
from cypress-terminal-report.
Can try to do it.
from cypress-terminal-report.
@FLevent29 any updates on this?
from cypress-terminal-report.
Sorry, I haven't worked on it for a little more than a while now. I'm going to try and do it in the following days.
from cypress-terminal-report.
Sorry I sat on this issue for so long. Even so, I cannot do it, I mean there's probably a way to do it, but you'd have to dig deep into Cypress code to find your answers. Or so I believe. Either way I don't have enough experience for this.
What I found for Cypress.mocha.getRunner().on(/*constant here*/, function() { ... })
:
- listening to
EVENT_TEST_BEGIN
(test
) forbefore()
hooks only occur whenbefore()
is successful thus defeating the purpose EVENT_TEST_END
(test end
) forafter()
doesn't seem viable, it's anafterEach()
more or lessEVENT_SUITE_BEGIN
(suite
) forbefore()
didn't work correctly, and couldn't figure out how it put the whole thing into an infinite loop during my final testsEVENT_SUITE_END
(suite end
) only goes through at the very lastcy.task()
for some reason, otherwise would be almost idealEVENT_TEST_FAIL
(fail
) doesn't go through withcy.task()
at all
The rest don't really seem useful, maybe someone could try and have a second opinion on this.
from cypress-terminal-report.
@FLevent29 if you have a branch you have worked on please provide the link for it, even if it's only draft changes.
from cypress-terminal-report.
As I see either we are missing something or we will need support from cypress to be able to implement this. Anyone else welcome to attempt implementing this. A fresh eye might notice some backdoor to the implementation.
from cypress-terminal-report.
This was real hard, but I've dived deep in cypress and mocha to hack in a solution. Unfortunately the number of twisted logic and prototype pollution required makes this feature probably unstable. The feature can be enabled in 3.0.0 with the flag https://github.com/archfz/cypress-terminal-report#optionsenableextendedcollector
from cypress-terminal-report.
Related Issues (20)
- Options for specifying request-modifying callback HOT 5
- Is there a way to get the logging to write/append to the file in the afterEach portion of test runs. HOT 3
- Possible memory leak in v5.3.2 HOT 20
- Cypress not found error HOT 1
- Output timestamp HOT 7
- cy:xhr logs show "undefined" in Cypress 13 HOT 4
- Log spec code runtime errors HOT 5
- v5.3.5 error when running, 'import' and 'export' may only appear with sourceType: module HOT 2
- Commands from subsequent test retries are not logged to console HOT 1
- Integration with cypress-io/github-action@v6 HOT 2
- Vulnerability - semver - Regular Expression Denial of Service (ReDoS) HOT 2
- Doesn't work with Component tests HOT 3
- unconditional "debugger" statement is pausing execution for all tests that use LogCollectCypressFetch HOT 1
- How to filter `Verbose level` HOT 2
- Getting error in component testing HOT 3
- cy.api request as cy:request logs and not cy:command HOT 1
- Bug: Cypress Component testing on React logs console logs recursively HOT 1
- Integration with cypress-mochawesome-reporter HOT 1
- Does not seem to work with cypress-parallel-tests HOT 2
- Console errors are not retrieved during Hooks v6.0.0 HOT 2
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 cypress-terminal-report.