blob: 703d07f923ee99535c4135614d3d0450064cb8da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
import json
import pytest
import pytest_bdd as bdd
@pytest.fixture(autouse=True)
def init_fake_clipboard(quteproc):
"""Make sure the fake clipboard will be used."""
quteproc.send_cmd(':debug-set-fake-clipboard')
@bdd.then(bdd.parsers.parse('"{text}" should be found'))
def check_found_text(request, quteproc, text):
if request.config.webengine:
# WORKAROUND
# This probably should work with Qt 5.9:
# https://codereview.qt-project.org/#/c/192920/
# https://codereview.qt-project.org/#/c/192921/
# https://bugreports.qt.io/browse/QTBUG-53134
# FIXME: Doesn't actually work, investigate why.
return
quteproc.send_cmd(':yank selection')
quteproc.wait_for(message='Setting fake clipboard: {}'.format(
json.dumps(text)))
bdd.scenarios('search.feature')
|