-
Notifications
You must be signed in to change notification settings - Fork 2
Pretty Progress Printout #54
Comments
Hey @anisjonischkeit I investigated this some time back. I figured the best option would be to extend testcafe's reporter API. This would then also solve #7. The problem there is, that the reporter API is very separate from the runner and it's very hard to enhance it (the reporter API) with additional data (like information which steps were successful). So if you're feeling luck, I would be very happy about very PR in this direction! |
Not sure if this is a new thing but to me it looks pretty straightforward to add metadata to the tests (unless I'm missing something here). Looking at the reporter-plugin docs though, it looks like I wouldn't be able to print anything between when a Cucumber Scenario starts and finishes (ie. before/after a step). What do you think about adding an additional reportStepStart/reportStepEnd (or maybe reportStepChange is better since we might get race conditions if we fire these asynchronously) to the reporter object that we can call before each test. |
Wow, you really gave some thought into it. Thank you! You are right: Out of the box, it is not possible to use the existing reporter API. My idea was to
Additional thoughts to your comment:
|
Alright, I've made a little start on this. Regarding 1. are you just talking about passing specific logging data rather than the full step (so that the reporter can't mess with the original step object)? That sounds very sensible to me. Regarding 2. I understand that the tests run sequentially however in the docs for the reporter, the handlers are all I think I'm starting to understand what you mean regarding the reporter being decoupled from the runner. It looks to me like the reporter is initialised somewhere in testcafe's codebase, do you know if there is any way to get the specific instance that testcafe initialises so that we get |
No, I meant that I would not add the cucumber steps to the test or fixture metadata. I would be fine with passing the cucumber step to the reporter.
Very true. But this is something that the reporter needs to handle.
The reporters are initialized in the runner. We replace the runner in runner.js, so we do have direct access to the reporters. Maybe, we need to change the whole logic of how the compiler exposes the tests and how the runner consumes them to make this work nicely. |
It would be really nice to get a printout of the progress of the tests like how cucumber prints it. I'm finding myself constantly trying to figure out which step is broken when using gherking-testcafe.
e.g.
looks like this is where cucumber-js' implementation is. How hard would this be to add?
The text was updated successfully, but these errors were encountered: