bdd: Add some tests for :scroll-{perc,page}.

This commit is contained in:
Florian Bruhin 2015-11-15 12:24:21 +01:00
parent 1af30772b1
commit 3d44d619fc

View File

@ -62,3 +62,69 @@ Feature: Scrolling
When I run :scroll 0 10
Then the warning ":scroll with dx/dy arguments is deprecated - use :scroll-px instead!" should be shown.
Then the page should be scrolled vertically.
## :scroll-perc
Scenario: Scrolling to bottom with :scroll-perc
When I run :scroll-perc 100
Then the page should be scrolled vertically.
Scenario: Scrolling to bottom and to top with :scroll-perc
When I run :scroll-perc 100
And I run :scroll-perc 0
Then the page should not be scrolled.
Scenario: Scrolling to middle with :scroll-perc
When I run :scroll-perc 50
Then the page should be scrolled vertically.
Scenario: Scrolling to middle and to top with :scroll-perc
When I run :scroll-perc 50
And I run :scroll-perc 0
Then the page should not be scrolled.
Scenario: Scrolling to right with :scroll-perc
When I run :scroll-perc --horizontal 100
Then the page should be scrolled horizontally.
Scenario: Scrolling to right and to left with :scroll-perc
When I run :scroll-perc --horizontal 100
And I run :scroll-perc --horizontal 0
Then the page should not be scrolled.
Scenario: Scrolling to middle (horizontally) with :scroll-perc
When I run :scroll-perc --horizontal 50
Then the page should be scrolled horizontally.
Scenario: Scrolling to middle and to left with :scroll-perc
When I run :scroll-perc --horizontal 50
And I run :scroll-perc --horizontal 0
Then the page should not be scrolled.
Scenario: :scroll-perc without argument
When I run :scroll-perc
Then the page should be scrolled vertically.
Scenario: :scroll-perc without argument and --horizontal
When I run :scroll-perc --horizontal
Then the page should be scrolled horizontally.
## :scroll-page
Scenario: Scrolling down with :scroll-page
When I run :scroll-page 0 1
Then the page should be scrolled vertically.
Scenario: Scrolling down and up with :scroll-page
When I run :scroll-page 0 1
And I run :scroll-page 0 -1
Then the page should not be scrolled.
Scenario: Scrolling right with :scroll-page
When I run :scroll-page 1 0
Then the page should be scrolled horizontally.
Scenario: Scrolling right and left with :scroll-page
When I run :scroll-page 1 0
And I run :scroll-page -1 0
Then the page should not be scrolled.