diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-12-01 17:21:31 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-12-01 17:21:31 +0100 |
commit | 470fede771eb978903eade6fd34632aa6adab0e2 (patch) | |
tree | c8dc118e9da5ee29c5553275adf86b8d5ddcc8e8 | |
parent | ee79ea6532f3c9d40569fb1c9329f4e5cec1fc4f (diff) | |
download | qutebrowser-470fede771eb978903eade6fd34632aa6adab0e2.tar.gz qutebrowser-470fede771eb978903eade6fd34632aa6adab0e2.zip |
tests: Move invisible.html to hints/html
-rw-r--r-- | tests/end2end/data/hints/html/README.md | 2 | ||||
-rw-r--r-- | tests/end2end/data/hints/html/invisible.html (renamed from tests/end2end/data/hints/invisible.html) | 2 | ||||
-rw-r--r-- | tests/end2end/features/hints.feature | 5 | ||||
-rw-r--r-- | tests/end2end/test_hints_html.py | 15 |
4 files changed, 15 insertions, 9 deletions
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 `<!-- target: foo.html -->` comment which specifies where the hint in it will point to, and will then test that. + +With `<!-- target: null -->`, the page is expected to not generate any hints. diff --git a/tests/end2end/data/hints/invisible.html b/tests/end2end/data/hints/html/invisible.html index b0bfa9dd9..d382c80fa 100644 --- a/tests/end2end/data/hints/invisible.html +++ b/tests/end2end/data/hints/html/invisible.html @@ -1,3 +1,5 @@ +<!-- target: null --> + <!DOCTYPE html> <html> 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: |