summaryrefslogtreecommitdiff
path: root/tests/end2end/features/test_zoom_bdd.py
blob: adc606e9af56a3ee29f72c33fb55ddd97c268a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

import pytest_bdd as bdd
bdd.scenarios('zoom.feature')


@bdd.then(bdd.parsers.parse("the zoom should be {zoom}%"))
def check_zoom(quteproc, zoom):
    data = quteproc.get_session()
    histories = data['windows'][0]['tabs'][0]['history']
    value = next(h for h in histories if 'zoom' in h)['zoom'] * 100
    assert abs(value - float(zoom)) < 0.0001