From 344ebed6ad2894b7152b0fc4f71a7c4eda00a0db Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 18 Dec 2017 11:00:03 -0800 Subject: [PATCH] Add iframe tests for insert on click and follow-selected --- tests/end2end/data/hints/html/wrapped.html | 1 - .../data/hints/html/wrapped_button.html | 23 +++++++++++++++++++ tests/end2end/data/hints/iframe_button.html | 11 +++++++++ tests/end2end/data/hints/iframe_input.html | 11 +++++++++ tests/end2end/data/iframe_search.html | 11 +++++++++ tests/end2end/features/hints.feature | 14 ++++++++++- tests/end2end/features/search.feature | 19 +++++++++++++++ 7 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 tests/end2end/data/hints/html/wrapped_button.html create mode 100644 tests/end2end/data/hints/iframe_button.html create mode 100644 tests/end2end/data/hints/iframe_input.html create mode 100644 tests/end2end/data/iframe_search.html diff --git a/tests/end2end/data/hints/html/wrapped.html b/tests/end2end/data/hints/html/wrapped.html index 2ebde1a24..2af1a28c1 100644 --- a/tests/end2end/data/hints/html/wrapped.html +++ b/tests/end2end/data/hints/html/wrapped.html @@ -2,7 +2,6 @@ diff --git a/tests/end2end/data/hints/html/wrapped_button.html b/tests/end2end/data/hints/html/wrapped_button.html new file mode 100644 index 000000000..dc96bd1d5 --- /dev/null +++ b/tests/end2end/data/hints/html/wrapped_button.html @@ -0,0 +1,23 @@ + + + + + + + + Link wrapped across multiple lines + + +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
+ + + + diff --git a/tests/end2end/data/hints/iframe_button.html b/tests/end2end/data/hints/iframe_button.html new file mode 100644 index 000000000..cd7bf203c --- /dev/null +++ b/tests/end2end/data/hints/iframe_button.html @@ -0,0 +1,11 @@ + + + + + + Hinting inside an iframe + + + + + diff --git a/tests/end2end/data/hints/iframe_input.html b/tests/end2end/data/hints/iframe_input.html new file mode 100644 index 000000000..143577747 --- /dev/null +++ b/tests/end2end/data/hints/iframe_input.html @@ -0,0 +1,11 @@ + + + + + + Hinting inside an iframe + + + + + diff --git a/tests/end2end/data/iframe_search.html b/tests/end2end/data/iframe_search.html new file mode 100644 index 000000000..a06c0ef3e --- /dev/null +++ b/tests/end2end/data/iframe_search.html @@ -0,0 +1,11 @@ + + + + + + Hinting inside an iframe + + + + + diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 0f7868e31..f575d0423 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -209,6 +209,19 @@ Feature: Using hints And I hint with args "links normal" and follow a Then "navigation request: url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, *" should be logged + Scenario: Using :follow-hint inside an iframe button + When I open data/hints/iframe_button.html + And I hint with args "all normal" and follow s + Then "navigation request: url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, *" should be logged + + Scenario: Hinting inputs in an iframe without type + When I open data/hints/iframe_input.html + And I hint with args "inputs" and follow a + And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log + And I run :leave-mode + # The actual check is already done above + Then no crash should happen + ### FIXME currenly skipped, see https://github.com/qutebrowser/qutebrowser/issues/1525 @xfail_norun Scenario: Using :follow-hint inside a scrolled iframe @@ -218,7 +231,6 @@ Feature: Using hints And I hint wht args "links normal" and follow a Then "navigation request: url http://localhost:*/data/hello2.txt, type NavigationTypeLinkClicked, *" should be logged - @qtwebengine_skip: Opens in new tab due to Chromium bug Scenario: Opening a link inside a specific iframe When I open data/hints/iframe_target.html And I hint with args "links normal" and follow a diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index 3778f963d..483bcc29f 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -238,3 +238,22 @@ Feature: Searching on a page Then the following tabs should be open: - data/search.html - data/hello.txt (active) + + Scenario: Follow a searched link in an iframe + When I open data/iframe_search.html + And I run :tab-only + And I run :search follow + And I wait for "search found follow" in the log + And I run :follow-selected + Then "navigation request: url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, is_main_frame False" should be logged + + Scenario: Follow a tabbed searched link in an iframe + When I open data/iframe_search.html + And I run :tab-only + And I run :search follow + And I wait for "search found follow" in the log + And I run :follow-selected -t + And I wait until data/hello.txt is loaded + Then the following tabs should be open: + - data/iframe_search.html + - data/hello.txt (active)