Clean up search.feature
This commit is contained in:
parent
38099c45bd
commit
046401c489
@ -11,20 +11,17 @@ Feature: Searching on a page
|
|||||||
|
|
||||||
Scenario: Searching text
|
Scenario: Searching text
|
||||||
When I run :search foo
|
When I run :search foo
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
Scenario: Searching twice
|
Scenario: Searching twice
|
||||||
When I run :search foo
|
When I run :search foo
|
||||||
And I run :search bar
|
And I run :search bar
|
||||||
And I run :yank selection
|
Then "Bar" should be found
|
||||||
Then the clipboard should contain "Bar"
|
|
||||||
|
|
||||||
Scenario: Searching with --reverse
|
Scenario: Searching with --reverse
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search -r foo
|
And I run :search -r foo
|
||||||
And I run :yank selection
|
Then "Foo" should be found
|
||||||
Then the clipboard should contain "Foo"
|
|
||||||
|
|
||||||
Scenario: Searching without matches
|
Scenario: Searching without matches
|
||||||
When I run :search doesnotmatch
|
When I run :search doesnotmatch
|
||||||
@ -34,14 +31,12 @@ Feature: Searching on a page
|
|||||||
Scenario: Searching with / and spaces at the end (issue 874)
|
Scenario: Searching with / and spaces at the end (issue 874)
|
||||||
When I run :set-cmd-text -s /space
|
When I run :set-cmd-text -s /space
|
||||||
And I run :command-accept
|
And I run :command-accept
|
||||||
And I run :yank selection
|
Then "space " should be found
|
||||||
Then the clipboard should contain "space "
|
|
||||||
|
|
||||||
Scenario: Searching with / and slash in search term (issue 507)
|
Scenario: Searching with / and slash in search term (issue 507)
|
||||||
When I run :set-cmd-text -s //slash
|
When I run :set-cmd-text -s //slash
|
||||||
And I run :command-accept
|
And I run :command-accept
|
||||||
And I run :yank selection
|
Then "/slash" should be found
|
||||||
Then the clipboard should contain "/slash"
|
|
||||||
|
|
||||||
# This doesn't work because this is QtWebKit behavior.
|
# This doesn't work because this is QtWebKit behavior.
|
||||||
@xfail_norun
|
@xfail_norun
|
||||||
@ -54,26 +49,22 @@ Feature: Searching on a page
|
|||||||
Scenario: Searching text with ignore-case = true
|
Scenario: Searching text with ignore-case = true
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search bar
|
And I run :search bar
|
||||||
And I run :yank selection
|
Then "Bar" should be found
|
||||||
Then the clipboard should contain "Bar"
|
|
||||||
|
|
||||||
Scenario: Searching text with ignore-case = false
|
Scenario: Searching text with ignore-case = false
|
||||||
When I set general -> ignore-case to false
|
When I set general -> ignore-case to false
|
||||||
And I run :search bar
|
And I run :search bar
|
||||||
And I run :yank selection
|
Then "bar" should be found
|
||||||
Then the clipboard should contain "bar"
|
|
||||||
|
|
||||||
Scenario: Searching text with ignore-case = smart (lower-case)
|
Scenario: Searching text with ignore-case = smart (lower-case)
|
||||||
When I set general -> ignore-case to smart
|
When I set general -> ignore-case to smart
|
||||||
And I run :search bar
|
And I run :search bar
|
||||||
And I run :yank selection
|
Then "Bar" should be found
|
||||||
Then the clipboard should contain "Bar"
|
|
||||||
|
|
||||||
Scenario: Searching text with ignore-case = smart (upper-case)
|
Scenario: Searching text with ignore-case = smart (upper-case)
|
||||||
When I set general -> ignore-case to smart
|
When I set general -> ignore-case to smart
|
||||||
And I run :search Foo
|
And I run :search Foo
|
||||||
And I run :yank selection
|
Then "Foo" should be found # even though foo was first
|
||||||
Then the clipboard should contain "Foo" # even though foo was first
|
|
||||||
|
|
||||||
## :search-next
|
## :search-next
|
||||||
|
|
||||||
@ -81,22 +72,19 @@ Feature: Searching on a page
|
|||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search foo
|
And I run :search foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "Foo" should be found
|
||||||
Then the clipboard should contain "Foo"
|
|
||||||
|
|
||||||
Scenario: Jumping to next match with count
|
Scenario: Jumping to next match with count
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search baz
|
And I run :search baz
|
||||||
And I run :search-next with count 2
|
And I run :search-next with count 2
|
||||||
And I run :yank selection
|
Then "BAZ" should be found
|
||||||
Then the clipboard should contain "BAZ"
|
|
||||||
|
|
||||||
Scenario: Jumping to next match with --reverse
|
Scenario: Jumping to next match with --reverse
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search --reverse foo
|
And I run :search --reverse foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
Scenario: Jumping to next match without search
|
Scenario: Jumping to next match without search
|
||||||
# Make sure there was no search in the same window before
|
# Make sure there was no search in the same window before
|
||||||
@ -109,8 +97,7 @@ Feature: Searching on a page
|
|||||||
And I run :search foo
|
And I run :search foo
|
||||||
And I run :tab-prev
|
And I run :tab-prev
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
# https://github.com/qutebrowser/qutebrowser/issues/2438
|
# https://github.com/qutebrowser/qutebrowser/issues/2438
|
||||||
Scenario: Jumping to next match after clearing
|
Scenario: Jumping to next match after clearing
|
||||||
@ -118,8 +105,7 @@ Feature: Searching on a page
|
|||||||
And I run :search foo
|
And I run :search foo
|
||||||
And I run :search
|
And I run :search
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
## :search-prev
|
## :search-prev
|
||||||
|
|
||||||
@ -128,8 +114,7 @@ Feature: Searching on a page
|
|||||||
And I run :search foo
|
And I run :search foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-prev
|
And I run :search-prev
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
Scenario: Jumping to previous match with count
|
Scenario: Jumping to previous match with count
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
@ -137,16 +122,14 @@ Feature: Searching on a page
|
|||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-prev with count 2
|
And I run :search-prev with count 2
|
||||||
And I run :yank selection
|
Then "baz" should be found
|
||||||
Then the clipboard should contain "baz"
|
|
||||||
|
|
||||||
Scenario: Jumping to previous match with --reverse
|
Scenario: Jumping to previous match with --reverse
|
||||||
When I set general -> ignore-case to true
|
When I set general -> ignore-case to true
|
||||||
And I run :search --reverse foo
|
And I run :search --reverse foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-prev
|
And I run :search-prev
|
||||||
And I run :yank selection
|
Then "Foo" should be found
|
||||||
Then the clipboard should contain "Foo"
|
|
||||||
|
|
||||||
Scenario: Jumping to previous match without search
|
Scenario: Jumping to previous match without search
|
||||||
# Make sure there was no search in the same window before
|
# Make sure there was no search in the same window before
|
||||||
@ -160,15 +143,13 @@ Feature: Searching on a page
|
|||||||
When I run :search foo
|
When I run :search foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "foo" should be found
|
||||||
Then the clipboard should contain "foo"
|
|
||||||
|
|
||||||
Scenario: Wrapping around page with --reverse
|
Scenario: Wrapping around page with --reverse
|
||||||
When I run :search --reverse foo
|
When I run :search --reverse foo
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :search-next
|
And I run :search-next
|
||||||
And I run :yank selection
|
Then "Foo" should be found
|
||||||
Then the clipboard should contain "Foo"
|
|
||||||
|
|
||||||
# TODO: wrapping message with scrolling
|
# TODO: wrapping message with scrolling
|
||||||
# TODO: wrapping message without scrolling
|
# TODO: wrapping message without scrolling
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_bdd as bdd
|
import pytest_bdd as bdd
|
||||||
|
|
||||||
@ -24,6 +26,16 @@ import pytest_bdd as bdd
|
|||||||
from end2end.features.test_yankpaste_bdd import init_fake_clipboard
|
from end2end.features.test_yankpaste_bdd import init_fake_clipboard
|
||||||
|
|
||||||
|
|
||||||
bdd.scenarios('search.feature')
|
@bdd.then(bdd.parsers.parse('"{text}" should be found'))
|
||||||
|
def check_found_text(request, quteproc, text):
|
||||||
|
quteproc.send_cmd(':yank selection')
|
||||||
|
quteproc.wait_for(message='Setting fake clipboard: {}'.format(
|
||||||
|
json.dumps(text)))
|
||||||
|
|
||||||
|
|
||||||
|
# After cancelling the search, the text (sometimes?) shows up as selected.
|
||||||
|
# However, we can't get it via ':yank selection' it seems?
|
||||||
pytestmark = pytest.mark.qtwebengine_skip("Searched text is not selected...")
|
pytestmark = pytest.mark.qtwebengine_skip("Searched text is not selected...")
|
||||||
|
|
||||||
|
|
||||||
|
bdd.scenarios('search.feature')
|
||||||
|
Loading…
Reference in New Issue
Block a user