Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Commander
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INS Courses
AutPy
Commander
Commits
97b5c875
Commit
97b5c875
authored
1 year ago
by
Florian Bruhin
Browse files
Options
Downloads
Patches
Plain Diff
Fix scrolling with newer pytest-html
parent
aec91f99
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
commander/gui/report.py
+11
-17
11 additions, 17 deletions
commander/gui/report.py
with
11 additions
and
17 deletions
commander/gui/report.py
+
11
−
17
View file @
97b5c875
...
@@ -42,14 +42,10 @@ class ReportView(QWidget):
...
@@ -42,14 +42,10 @@ class ReportView(QWidget):
self
.
_textedit
.
moveCursor
(
QTextCursor
.
MoveOperation
.
End
)
self
.
_textedit
.
moveCursor
(
QTextCursor
.
MoveOperation
.
End
)
self
.
_textedit
.
find
(
escaped_id
,
QTextDocument
.
FindFlag
.
FindBackward
)
self
.
_textedit
.
find
(
escaped_id
,
QTextDocument
.
FindFlag
.
FindBackward
)
def
_js_callback
(
self
,
nodeid
:
str
,
nodeids
:
list
[
str
]
)
->
None
:
def
_js_callback
(
self
,
nodeid
:
str
,
success
:
bool
)
->
None
:
if
not
nodeids
:
#
success
if
success
:
return
return
logging
.
warning
(
f
"
Did not find node ID
{
nodeid
}
in report
"
)
logging
.
warning
(
f
"
Did not find node ID
{
nodeid
}
in report
"
)
logging
.
debug
(
"
Considered:
"
)
for
e
in
nodeids
:
logging
.
debug
(
f
"
{
e
}
"
)
def
_nodeid_to_html
(
self
,
nodeid
:
str
)
->
str
:
def
_nodeid_to_html
(
self
,
nodeid
:
str
)
->
str
:
"""
Convert a node ID to the way it gets rendered in HTML.
"""
"""
Convert a node ID to the way it gets rendered in HTML.
"""
...
@@ -62,19 +58,17 @@ class ReportView(QWidget):
...
@@ -62,19 +58,17 @@ class ReportView(QWidget):
self
.
_webview
.
page
().
runJavaScript
(
self
.
_webview
.
page
().
runJavaScript
(
"""
"""
(function () {
(function () {
let nodeids = [];
let elem = document.getElementById(
'
%NODEID%
'
);
if (elem === null) {
for (let elem of document.getElementsByClassName(
'
col-name
'
)) {
elem = document.getElementById(
'
%NODEID%::setup
'
);
nodeids.push(elem.innerText);
}
if (elem.innerText.replace(
'
::setup
'
,
''
) ==
'
%NODEID%
'
) {
elem.scrollIntoView();
if (elem !== null) {
// empty array returned: no error
elem.scrollIntoView();
return [];
return true;
}
}
}
// error: return all IDs we considered
return false;
return nodeids;
})();
})();
"""
.
replace
(
"""
.
replace
(
"
%NODEID%
"
,
nodeid
"
%NODEID%
"
,
nodeid
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment