Open kazurayam opened 1 year ago
The --run-script
option of the wkhtmltopdf
is hard to use. It is difficult to debug. It is difficult to diagnoze what's going on.
I have an alternative idea. I can scan the HTML source and edit it while I would turn <div>
nodes from "closed" to "opened".
How do I want to edit the HTML source?
<div id="s1" class="suite">
<div class="element-header closed" onclick=...
...
</div>
<div class="children populated" style="display: none;">
...
<div id="s1" class="suite">
<div class="element-header" onclick=...
...
</div>
<div class="children populated" style="display: block;">
...
I need to perform 2 patterns of code change:
class="xxxx closed"
-> class="xxxx"
style="display: none;"
-> style="display: block;"
I tried a bit of editing HTML source.
No, it's very bad approach. Too fragile.
https://github.com/kazurayam/waitForElementNotPresentWorksOrNot/blob/expandAllChidlren/Keywords/com/kazurayam/ks/reporting/TestSuiteReportConverter.groovy
I want to expand all closed
div
nodes in the Report html. I thought I would be able to execute javascript and callexpandAllChildren('s1')
via wkhtmltopdf, as followsThe
wkhtmltopdf
command passed with RTN=0. But thediv
nodes remains closed. As the resulting PDF shows.