-
Notifications
You must be signed in to change notification settings - Fork 6
feat(Report): support linking to an individual feature or scenario #64
Conversation
@@ -14,11 +14,21 @@ class CustomWorld { | |||
this.exceptionScenario = false; | |||
} | |||
|
|||
createWindow(url, outputConsole) { | |||
const virtualConsole = new VirtualConsole(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change with the virtualConsole to help clean up the test logs a bit. Basically when we use this function here: https://github.com/cerner/cucumber-forge-report-generator/pull/64/files#diff-6605869b51324cd7403d348bda4f58fcef198b8edcffd1d7f3a9040c65bc51d5R69 to create a new window for a report with a particular hash location the report will automatically try to scrollIntoView
the linked scenario/feature. However, the headless Jsdom testing framework we are using does not natively support scrollIntoView
. In other places we are able to mock the function before it is called so that things are properly handled, but in this case I cannot access dom elements without the window and I cannot create the window without it running the init
script which is what triggers the scrollIntoView
call.
When a scenario calls createWindow
without providing an outputConsole param, then all the output from jsdom will get sent to this virtualConsole and will not be printed to the node console. This keeps the errors around the undefined scrollIntoView
function from cluttering up the logs. (Also, to be clear, the scenarios that call createWindow
without providing an outputConsole param do not really need to test the scrollIntoView function so I think this is an acceptable tradeoff.)
This is cool, you might want to see if there's a good way of unfocusing it once you open in a new tab. |
@TobiTenno after a bunch of tinkering, I never did figure out how to unfocus the anchor but still have everything work correctly. Instead I settled on just removing the outline from the anchors so that it is not displayed when they are focused. I have updated the attached zip with the new report. |
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds some link icons that show up when you mouse-over the feature/scenario icons. When you click the icons it gives you a link to that particular feature/scenario.
This will give users the ability to precisely reference specific parts of the report. See the attached example report for a demo!
cucumber-forge-report-generator.zip
Closes #40