-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document html ID of test element as public API #1751
Comments
If i had to do a quick job i would: add there Then i would search the clean way to decorate all the output details with a reference to this function. What do you think? |
I don't think an API like this would see much use outside of the specific use case you've presented. That said, you should be able to achieve the same results by registering an additional While the markup the reporter generates isn't explicitly considered part of our public API, it is unlikely to change/break any time in the near future, so it should be safe. |
My solution also would not work. |
Sorry for not coming back, had lot of things to do. Are you completely sure this is something you do not want? |
While this is not specified in the docs: can i count this as a part of the details in the API? |
So with some wild code i could do what i was looking for without modifying the lib or the need for a new api The problem is that the API does not allow me to create a PER TEST callback. This is bad. If we could have a per test callback, or a way to remove a callback, that means i could define a scoped callback from inside the test and remove it after the test is done, and produce a new one in the next test. |
Indeed what i did work for 1 module, in the next module the second callback stack with the previous and everything break. |
Would a method to deregister a testDone callback be accepted as a PR? |
See also https://github.com/Krinkle/node-colorfactory, which uses the DOM API (select by ID) to visualise additional information from a QUnit test onto the HTML report. Code at /test/testinit.js and /test/testinit.css Example: |
i did something similar. unsure if is worth creating a plugin. I did not need to modify any qunit file, but i could plug it from outside. |
http://fabricjs.com/test/visual/?coverage not the best visual, but working |
Yeah, that uses the same interface (the HTML ID I think that's fairly minimal and is good enough for this use case. It might change a little bit over time (e.g. the styling), so between QUnit upgrades minor changes may be required, but that seems okay? |
Qunit as a test runner has a unique feature of running a bit everywhere. Would be enough to consider that htmlID change as a breaking change with a major bump. Just recognize it as a feature. |
Yeah, I think the theme and styling changes should not be considered a breaking change (esp. because you can use any theme). But, the entry point for the DOM (the HTML ID) could be something we can agree to only break with semver-major. |
Tell us about your runtime:
Hi, i started a topic in the gitter chat and i was suggested to come here for a feature proposal.
I would like to have a way from the qunit tests, to modify the HTML output of the qunit html reporter.
I m testing canvas differences with one of the libraries available, in case of failure i would like to display the 3 images ( actual, expected, diff ) in the html reporter.
I do understand this is a narrow use case, while maybe an api to define plugins to make this modification possible could be a more generic solution.
What do you think?
If you think the idea is nice i would start to study the library to work on it and open a PR with a first draft.
The text was updated successfully, but these errors were encountered: