bdd: Add more tests for :zoom
This commit is contained in:
parent
00ccc236bb
commit
1dd5bb1596
@ -19,3 +19,10 @@
|
|||||||
|
|
||||||
import pytest_bdd as bdd
|
import pytest_bdd as bdd
|
||||||
bdd.scenarios('zoom.feature')
|
bdd.scenarios('zoom.feature')
|
||||||
|
|
||||||
|
|
||||||
|
@bdd.then(bdd.parsers.parse("the zoom should be {zoom}%"))
|
||||||
|
def check_zoom(quteproc, zoom):
|
||||||
|
data = quteproc.get_session()
|
||||||
|
value = data['windows'][0]['tabs'][0]['history'][0]['zoom'] * 100
|
||||||
|
assert abs(value - float(zoom)) < 0.0001
|
||||||
|
@ -2,41 +2,31 @@ Feature: Zooming in and out
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I open data/hello.txt
|
Given I open data/hello.txt
|
||||||
|
And I set ui -> zoom-levels to 50%,90%,110%
|
||||||
And I run :tab-only
|
And I run :tab-only
|
||||||
|
|
||||||
Scenario: Zooming in
|
Scenario: Zooming in
|
||||||
When I run :zoom-in
|
When I run :zoom-in
|
||||||
Then the message "Zoom level: 110%" should be shown.
|
Then the message "Zoom level: 110%" should be shown.
|
||||||
And the session should look like:
|
And the zoom should be 110%
|
||||||
windows:
|
|
||||||
- tabs:
|
|
||||||
- history:
|
|
||||||
- zoom: 1.1
|
|
||||||
|
|
||||||
Scenario: Zooming out
|
Scenario: Zooming out
|
||||||
When I run :zoom-out
|
When I run :zoom-out
|
||||||
Then the message "Zoom level: 90%" should be shown.
|
Then the message "Zoom level: 90%" should be shown.
|
||||||
And the session should look like:
|
And the zoom should be 90%
|
||||||
windows:
|
|
||||||
- tabs:
|
|
||||||
- history:
|
|
||||||
- zoom: 0.9
|
|
||||||
|
|
||||||
Scenario: Setting zoom
|
Scenario: Setting zoom
|
||||||
When I run :zoom 50
|
When I run :zoom 50
|
||||||
Then the message "Zoom level: 50%" should be shown.
|
Then the message "Zoom level: 50%" should be shown.
|
||||||
And the session should look like:
|
And the zoom should be 50%
|
||||||
windows:
|
|
||||||
- tabs:
|
|
||||||
- history:
|
|
||||||
- zoom: 0.5
|
|
||||||
|
|
||||||
Scenario: Resetting zoom
|
Scenario: Resetting zoom
|
||||||
When I run :zoom 50
|
When I set ui -> default-zoom to 42%
|
||||||
|
And I run :zoom 50
|
||||||
And I run :zoom
|
And I run :zoom
|
||||||
Then the message "Zoom level: 100%" should be shown.
|
Then the message "Zoom level: 42%" should be shown.
|
||||||
And the session should look like:
|
And the zoom should be 42%
|
||||||
windows:
|
|
||||||
- tabs:
|
Scenario: Setting zoom to invalid value
|
||||||
- history:
|
When I run :zoom -1
|
||||||
- zoom: 1.0
|
Then the error "Can't zoom -1%!" should be shown.
|
||||||
|
Loading…
Reference in New Issue
Block a user