From 470fede771eb978903eade6fd34632aa6adab0e2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 1 Dec 2021 17:21:31 +0100 Subject: tests: Move invisible.html to hints/html --- tests/end2end/data/hints/html/README.md | 2 ++ tests/end2end/data/hints/html/invisible.html | 16 ++++++++++++++++ tests/end2end/data/hints/invisible.html | 14 -------------- tests/end2end/features/hints.feature | 5 ----- tests/end2end/test_hints_html.py | 15 +++++++++++---- 5 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 tests/end2end/data/hints/html/invisible.html delete mode 100644 tests/end2end/data/hints/invisible.html diff --git a/tests/end2end/data/hints/html/README.md b/tests/end2end/data/hints/html/README.md index 2a6e97c24..5bbaecb4a 100644 --- a/tests/end2end/data/hints/html/README.md +++ b/tests/end2end/data/hints/html/README.md @@ -3,3 +3,5 @@ Tests in this directory are automatically picked up by `test_hints` in They need to contain a special `` comment which specifies where the hint in it will point to, and will then test that. + +With ``, the page is expected to not generate any hints. diff --git a/tests/end2end/data/hints/html/invisible.html b/tests/end2end/data/hints/html/invisible.html new file mode 100644 index 000000000..d382c80fa --- /dev/null +++ b/tests/end2end/data/hints/html/invisible.html @@ -0,0 +1,16 @@ + + + + + + + + Invisible links + + +

None of those invisible links should get a hint.

+ visibility: hidden + display: none + opacity: 0 + + diff --git a/tests/end2end/data/hints/invisible.html b/tests/end2end/data/hints/invisible.html deleted file mode 100644 index b0bfa9dd9..000000000 --- a/tests/end2end/data/hints/invisible.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Invisible links - - -

None of those invisible links should get a hint.

- visibility: hidden - display: none - opacity: 0 - - diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index cf35c5356..47153b741 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -241,11 +241,6 @@ Feature: Using hints # The actual check is already done above Then "No elements found." should not be logged - Scenario: Hinting invisible elements - When I open data/hints/invisible.html - And I run :hint - Then the error "No elements found." should be shown - Scenario: Clicking input with existing text When I open data/hints/input.html And I run :click-element id qute-input-existing diff --git a/tests/end2end/test_hints_html.py b/tests/end2end/test_hints_html.py index ebb2a7e33..f1cda97fe 100644 --- a/tests/end2end/test_hints_html.py +++ b/tests/end2end/test_hints_html.py @@ -40,7 +40,7 @@ def collect_tests(): @dataclasses.dataclass class ParsedFile: - target: str + target: Optional[str] qtwebengine_todo: Optional[str] @@ -107,11 +107,18 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation, quteproc.set_setting('zoom.text_only', str(zoom_text_only)) quteproc.set_setting('hints.find_implementation', find_implementation) quteproc.send_cmd(':zoom {}'.format(zoom_level)) + # follow hint quteproc.send_cmd(':hint all normal') - quteproc.wait_for(message='hints: a', category='hints') - quteproc.send_cmd(':hint-follow a') - quteproc.wait_for_load_finished('data/' + parsed.target) + + if parsed.target is None: + msg = quteproc.wait_for(message='No elements found.', category='message') + msg.expected = True + else: + quteproc.wait_for(message='hints: a', category='hints') + quteproc.send_cmd(':hint-follow a') + quteproc.wait_for_load_finished('data/' + parsed.target) + # reset quteproc.send_cmd(':zoom 100') if not request.config.webengine: -- cgit v1.2.3-54-g00ecf