2017-03-31 17:16:31 +02:00
|
|
|
# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
|
|
|
|
|
2015-11-03 22:42:25 +01:00
|
|
|
Feature: Scrolling
|
|
|
|
Tests the various scroll commands.
|
|
|
|
|
|
|
|
Background:
|
2016-08-11 11:47:37 +02:00
|
|
|
Given I open data/scroll/simple.html
|
2015-11-03 22:42:25 +01:00
|
|
|
And I run :tab-only
|
|
|
|
|
2015-11-15 12:24:09 +01:00
|
|
|
## :scroll-px
|
|
|
|
|
2015-11-03 22:42:25 +01:00
|
|
|
Scenario: Scrolling pixel-wise vertically
|
|
|
|
When I run :scroll-px 0 10
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling pixel-wise horizontally
|
|
|
|
When I run :scroll-px 10 0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-03 22:42:25 +01:00
|
|
|
|
2015-11-15 20:48:07 +01:00
|
|
|
Scenario: Scrolling down and up
|
|
|
|
When I run :scroll-px 10 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 10/0
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll-px -10 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right and left
|
|
|
|
When I run :scroll-px 0 10
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/10
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll-px 0 -10
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling down and up with count
|
|
|
|
When I run :scroll-px 0 10 with count 2
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/20
|
2015-11-15 20:48:07 +01:00
|
|
|
When I run :scroll-px 0 -10
|
|
|
|
When I run :scroll-px 0 -10
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
2017-04-08 20:38:23 +02:00
|
|
|
@qtwebengine_flaky
|
2015-11-15 20:48:07 +01:00
|
|
|
Scenario: Scrolling left and right with count
|
|
|
|
When I run :scroll-px 10 0 with count 2
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 20/0
|
2015-11-15 20:48:07 +01:00
|
|
|
When I run :scroll-px -10 0
|
|
|
|
When I run :scroll-px -10 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
2015-11-16 07:17:43 +01:00
|
|
|
Scenario: :scroll-px with a very big value
|
|
|
|
When I run :scroll-px 99999999999 0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Numeric argument is too large for internal int representation." should be shown
|
2015-11-16 07:17:43 +01:00
|
|
|
|
2015-11-16 20:35:44 +01:00
|
|
|
Scenario: :scroll-px on a page without scrolling
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :scroll-px 10 10
|
2016-09-06 14:58:33 +02:00
|
|
|
Then the page should not be scrolled
|
2015-11-16 20:35:44 +01:00
|
|
|
|
2015-11-17 06:50:27 +01:00
|
|
|
Scenario: :scroll-px with floats
|
|
|
|
# This used to be allowed, but doesn't make much sense.
|
|
|
|
When I run :scroll-px 2.5 2.5
|
2016-05-11 08:01:25 +02:00
|
|
|
Then the error "dx: Invalid int value 2.5" should be shown
|
2015-11-26 17:50:39 +01:00
|
|
|
And the page should not be scrolled
|
2015-11-17 06:50:27 +01:00
|
|
|
|
2015-11-15 12:24:09 +01:00
|
|
|
## :scroll
|
|
|
|
|
2015-11-03 22:42:25 +01:00
|
|
|
Scenario: Scrolling down
|
|
|
|
When I run :scroll down
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling down and up
|
|
|
|
When I run :scroll down
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-03 22:42:25 +01:00
|
|
|
And I run :scroll up
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right
|
|
|
|
When I run :scroll right
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right and left
|
|
|
|
When I run :scroll right
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-03 22:42:25 +01:00
|
|
|
And I run :scroll left
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-03 22:42:25 +01:00
|
|
|
|
2016-08-18 21:36:43 +02:00
|
|
|
Scenario: Scrolling down with count 10
|
|
|
|
When I run :scroll down with count 10
|
|
|
|
Then no crash should happen
|
|
|
|
|
2015-11-03 22:42:25 +01:00
|
|
|
Scenario: Scrolling with page down
|
|
|
|
When I run :scroll page-down
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling with page down and page up
|
|
|
|
When I run :scroll page-down
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-03 22:42:25 +01:00
|
|
|
And I run :scroll page-up
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to bottom
|
|
|
|
When I run :scroll bottom
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to bottom and to top
|
|
|
|
When I run :scroll bottom
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-03 22:42:25 +01:00
|
|
|
And I run :scroll top
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-03 22:42:25 +01:00
|
|
|
|
|
|
|
Scenario: :scroll with invalid argument
|
|
|
|
When I run :scroll foobar
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Invalid value 'foobar' for direction - expected one of: bottom, down, left, page-down, page-up, right, top, up" should be shown
|
|
|
|
And the page should not be scrolled
|
2015-11-03 22:42:25 +01:00
|
|
|
|
2015-11-15 20:48:07 +01:00
|
|
|
Scenario: Scrolling down and up with count
|
|
|
|
When I run :scroll down with count 2
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll up
|
|
|
|
And I run :scroll up
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right
|
|
|
|
When I run :scroll right
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-15 20:48:07 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right and left
|
|
|
|
When I run :scroll right
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll left
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right and left with count
|
|
|
|
When I run :scroll right with count 2
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll left
|
|
|
|
And I run :scroll left
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
2015-11-16 07:17:43 +01:00
|
|
|
Scenario: Scrolling down with a very big count
|
|
|
|
When I run :scroll down with count 99999999999
|
|
|
|
# Make sure it doesn't hang
|
|
|
|
And I run :message-info "Still alive!"
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "Still alive!" should be shown
|
2015-11-16 07:17:43 +01:00
|
|
|
|
2015-11-16 20:35:44 +01:00
|
|
|
Scenario: :scroll on a page without scrolling
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :scroll down
|
2016-09-06 14:58:33 +02:00
|
|
|
Then the page should not be scrolled
|
2015-11-16 20:35:44 +01:00
|
|
|
|
2015-11-15 12:24:21 +01:00
|
|
|
## :scroll-perc
|
|
|
|
|
|
|
|
Scenario: Scrolling to bottom with :scroll-perc
|
|
|
|
When I run :scroll-perc 100
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to bottom and to top with :scroll-perc
|
|
|
|
When I run :scroll-perc 100
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-perc 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to middle with :scroll-perc
|
|
|
|
When I run :scroll-perc 50
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-15 12:24:21 +01:00
|
|
|
|
2015-11-17 06:57:33 +01:00
|
|
|
Scenario: Scrolling to middle with :scroll-perc (float)
|
|
|
|
When I run :scroll-perc 50.5
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-17 06:57:33 +01:00
|
|
|
|
2015-11-15 12:24:21 +01:00
|
|
|
Scenario: Scrolling to middle and to top with :scroll-perc
|
|
|
|
When I run :scroll-perc 50
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-perc 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to right with :scroll-perc
|
|
|
|
When I run :scroll-perc --horizontal 100
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to right and to left with :scroll-perc
|
|
|
|
When I run :scroll-perc --horizontal 100
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-perc --horizontal 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to middle (horizontally) with :scroll-perc
|
|
|
|
When I run :scroll-perc --horizontal 50
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling to middle and to left with :scroll-perc
|
|
|
|
When I run :scroll-perc --horizontal 50
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-perc --horizontal 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: :scroll-perc without argument
|
|
|
|
When I run :scroll-perc
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: :scroll-perc without argument and --horizontal
|
|
|
|
When I run :scroll-perc --horizontal
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-15 12:24:21 +01:00
|
|
|
|
2015-11-15 20:48:07 +01:00
|
|
|
Scenario: :scroll-perc with count
|
|
|
|
When I run :scroll-perc with count 50
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-15 20:48:07 +01:00
|
|
|
|
2016-08-18 22:46:32 +02:00
|
|
|
@qtwebengine_skip: Causes memory leak...
|
2015-11-16 07:17:43 +01:00
|
|
|
Scenario: :scroll-perc with a very big value
|
|
|
|
When I run :scroll-perc 99999999999
|
|
|
|
Then no crash should happen
|
|
|
|
|
2015-11-16 20:35:44 +01:00
|
|
|
Scenario: :scroll-perc on a page without scrolling
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :scroll-perc 20
|
2016-09-06 14:58:33 +02:00
|
|
|
Then the page should not be scrolled
|
2015-11-16 20:35:44 +01:00
|
|
|
|
2016-06-29 11:47:51 +02:00
|
|
|
Scenario: :scroll-perc with count and argument
|
|
|
|
When I run :scroll-perc 0 with count 50
|
|
|
|
Then the page should be scrolled vertically
|
2016-08-11 11:49:56 +02:00
|
|
|
|
2017-02-05 00:13:11 +01:00
|
|
|
# https://github.com/qutebrowser/qutebrowser/issues/1821
|
2016-08-11 11:49:56 +02:00
|
|
|
Scenario: :scroll-perc without doctype
|
|
|
|
When I open data/scroll/no_doctype.html
|
|
|
|
And I run :scroll-perc 100
|
|
|
|
Then the page should be scrolled vertically
|
2016-06-29 11:47:51 +02:00
|
|
|
|
2015-11-15 12:24:21 +01:00
|
|
|
## :scroll-page
|
|
|
|
|
|
|
|
Scenario: Scrolling down with :scroll-page
|
|
|
|
When I run :scroll-page 0 1
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-15 12:24:21 +01:00
|
|
|
|
2015-11-17 06:57:33 +01:00
|
|
|
Scenario: Scrolling down with :scroll-page (float)
|
|
|
|
When I run :scroll-page 0 1.5
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled vertically
|
2015-11-17 06:57:33 +01:00
|
|
|
|
2015-11-15 12:24:21 +01:00
|
|
|
Scenario: Scrolling down and up with :scroll-page
|
|
|
|
When I run :scroll-page 0 1
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-page 0 -1
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 12:24:21 +01:00
|
|
|
|
|
|
|
Scenario: Scrolling right with :scroll-page
|
|
|
|
When I run :scroll-page 1 0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-15 12:24:21 +01:00
|
|
|
|
2015-11-17 06:57:33 +01:00
|
|
|
Scenario: Scrolling right with :scroll-page (float)
|
|
|
|
When I run :scroll-page 1.5 0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should be scrolled horizontally
|
2015-11-17 06:57:33 +01:00
|
|
|
|
2015-11-15 12:24:21 +01:00
|
|
|
Scenario: Scrolling right and left with :scroll-page
|
|
|
|
When I run :scroll-page 1 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 12:24:21 +01:00
|
|
|
And I run :scroll-page -1 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 17:50:26 +01:00
|
|
|
|
2015-11-15 20:48:07 +01:00
|
|
|
Scenario: Scrolling right and left with :scroll-page and count
|
|
|
|
When I run :scroll-page 1 0 with count 2
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll-page -1 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 20:48:07 +01:00
|
|
|
And I run :scroll-page -1 0
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed to 0/0
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the page should not be scrolled
|
2015-11-15 20:48:07 +01:00
|
|
|
|
2015-11-15 17:50:26 +01:00
|
|
|
Scenario: :scroll-page with --bottom-navigate
|
|
|
|
When I run :scroll-perc 100
|
2016-09-06 20:24:41 +02:00
|
|
|
And I wait until the scroll position changed
|
2015-11-15 17:50:26 +01:00
|
|
|
And I run :scroll-page --bottom-navigate next 0 1
|
2015-11-17 06:40:23 +01:00
|
|
|
Then data/hello2.txt should be loaded
|
2015-11-15 17:50:26 +01:00
|
|
|
|
2016-09-07 09:32:51 +02:00
|
|
|
Scenario: :scroll-page with --bottom-navigate and zoom
|
|
|
|
When I run :zoom 200
|
|
|
|
And I run :scroll-perc 100
|
|
|
|
And I wait until the scroll position changed
|
|
|
|
And I run :scroll-page --bottom-navigate next 0 1
|
|
|
|
Then data/hello2.txt should be loaded
|
|
|
|
|
2015-11-15 17:50:26 +01:00
|
|
|
Scenario: :scroll-page with --top-navigate
|
|
|
|
When I run :scroll-page --top-navigate prev 0 -1
|
2015-11-17 06:40:23 +01:00
|
|
|
Then data/hello3.txt should be loaded
|
2015-11-16 07:17:43 +01:00
|
|
|
|
2016-08-18 22:46:32 +02:00
|
|
|
@qtwebengine_skip: Causes memory leak...
|
2015-11-16 07:17:43 +01:00
|
|
|
Scenario: :scroll-page with a very big value
|
|
|
|
When I run :scroll-page 99999999999 99999999999
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Numeric argument is too large for internal int representation." should be shown
|
2015-11-16 20:35:44 +01:00
|
|
|
|
|
|
|
Scenario: :scroll-page on a page without scrolling
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :scroll-page 1 1
|
2016-09-06 14:58:33 +02:00
|
|
|
Then the page should not be scrolled
|
2016-09-29 07:16:40 +02:00
|
|
|
|
|
|
|
## issues
|
|
|
|
|
|
|
|
Scenario: Relative scroll position with a position:absolute page
|
|
|
|
When I open data/scroll/position_absolute.html
|
|
|
|
And I run :scroll-perc 100
|
|
|
|
And I wait until the scroll position changed
|
|
|
|
And I run :scroll-page --bottom-navigate next 0 1
|
|
|
|
Then data/hello2.txt should be loaded
|