Make test_position_caret work again
The tests only work properly with QtWebKit (and aren't needed on QtWebEngine). Also, for some reason the scrolled_down tests only work without Xvfb.
This commit is contained in:
parent
f5d7605ae0
commit
0ea7a1457d
@ -24,8 +24,8 @@ import pytest
|
|||||||
import helpers.utils
|
import helpers.utils
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtWebKit import QWebSettings
|
QWebSettings = pytest.importorskip("PyQt5.QtWebKit").QWebSettings
|
||||||
from PyQt5.QtWebKitWidgets import QWebPage
|
QWebPage = pytest.importorskip("PyQt5.QtWebKitWidgets").QWebPage
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
@ -66,9 +66,9 @@ class CaretTester:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def caret_tester(js_tester):
|
def caret_tester(js_tester_webkit):
|
||||||
"""Helper fixture to test caret browsing positions."""
|
"""Helper fixture to test caret browsing positions."""
|
||||||
caret_tester = CaretTester(js_tester)
|
caret_tester = CaretTester(js_tester_webkit)
|
||||||
# Showing webview here is necessary for test_scrolled_down_img to
|
# Showing webview here is necessary for test_scrolled_down_img to
|
||||||
# succeed in some cases, see #1988
|
# succeed in some cases, see #1988
|
||||||
caret_tester.js.tab.show()
|
caret_tester.js.tab.show()
|
||||||
@ -83,6 +83,7 @@ def test_simple(caret_tester):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
|
@pytest.mark.no_xvfb
|
||||||
def test_scrolled_down(caret_tester):
|
def test_scrolled_down(caret_tester):
|
||||||
"""Test with multiple text blocks with the viewport scrolled down."""
|
"""Test with multiple text blocks with the viewport scrolled down."""
|
||||||
caret_tester.js.load('position_caret/scrolled_down.html')
|
caret_tester.js.load('position_caret/scrolled_down.html')
|
||||||
@ -100,6 +101,7 @@ def test_invisible(caret_tester, style):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
|
@pytest.mark.no_xvfb
|
||||||
def test_scrolled_down_img(caret_tester):
|
def test_scrolled_down_img(caret_tester):
|
||||||
"""Test with an image at the top with the viewport scrolled down."""
|
"""Test with an image at the top with the viewport scrolled down."""
|
||||||
caret_tester.js.load('position_caret/scrolled_down_img.html')
|
caret_tester.js.load('position_caret/scrolled_down_img.html')
|
||||||
|
Loading…
Reference in New Issue
Block a user