bdd: Skip JS prompt() tests on PyQt < 5.3.1.
Those versions had a PyQt bug when overloading javaScriptPrompt, so we don't do that there.
This commit is contained in:
parent
df40b39e3e
commit
22d255f49f
@ -12,6 +12,7 @@ markers =
|
|||||||
frozen: Tests which can only be run if sys.frozen is True.
|
frozen: Tests which can only be run if sys.frozen is True.
|
||||||
integration: Tests which test a bigger portion of code, run without coverage.
|
integration: Tests which test a bigger portion of code, run without coverage.
|
||||||
skip: Always skipped test.
|
skip: Always skipped test.
|
||||||
|
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
|
||||||
flakes-ignore =
|
flakes-ignore =
|
||||||
UnusedImport
|
UnusedImport
|
||||||
UnusedVariable
|
UnusedVariable
|
||||||
|
@ -39,7 +39,7 @@ from helpers.messagemock import message_mock
|
|||||||
from qutebrowser.config import config
|
from qutebrowser.config import config
|
||||||
from qutebrowser.utils import objreg
|
from qutebrowser.utils import objreg
|
||||||
|
|
||||||
from PyQt5.QtCore import QEvent, QSize, Qt
|
from PyQt5.QtCore import QEvent, QSize, Qt, PYQT_VERSION
|
||||||
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout
|
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout
|
||||||
from PyQt5.QtNetwork import QNetworkCookieJar
|
from PyQt5.QtNetwork import QNetworkCookieJar
|
||||||
import xvfbwrapper
|
import xvfbwrapper
|
||||||
@ -66,6 +66,8 @@ def _apply_platform_markers(item):
|
|||||||
('not_xvfb', item.config.xvfb_display is not None,
|
('not_xvfb', item.config.xvfb_display is not None,
|
||||||
"Can't be run with Xvfb."),
|
"Can't be run with Xvfb."),
|
||||||
('skip', True, "Always skipped."),
|
('skip', True, "Always skipped."),
|
||||||
|
('pyqt531_or_newer', PYQT_VERSION < 0x050301,
|
||||||
|
"Needs PyQt 5.3.1 or newer"),
|
||||||
]
|
]
|
||||||
|
|
||||||
for searched_marker, condition, default_reason in markers:
|
for searched_marker, condition, default_reason in markers:
|
||||||
|
@ -6,28 +6,6 @@ Feature: Prompts
|
|||||||
|
|
||||||
# Javascript
|
# Javascript
|
||||||
|
|
||||||
Scenario: Javascript prompt
|
|
||||||
When I open data/prompt/jsprompt.html
|
|
||||||
And I click the button
|
|
||||||
And I press the keys "prompt test"
|
|
||||||
And I run :prompt-accept
|
|
||||||
Then the javascript message "Prompt reply: prompt test" should be logged
|
|
||||||
|
|
||||||
Scenario: Rejected javascript prompt
|
|
||||||
When I open data/prompt/jsprompt.html
|
|
||||||
And I click the button
|
|
||||||
And I press the keys "prompt test"
|
|
||||||
And I run :leave-mode
|
|
||||||
Then the javascript message "Prompt reply: null" should be logged
|
|
||||||
|
|
||||||
Scenario: Using content -> ignore-javascript-prompt
|
|
||||||
When I set content -> ignore-javascript-prompt to true
|
|
||||||
And I open data/prompt/jsprompt.html
|
|
||||||
# Can't use "I click the button" as it waits for a key mode change
|
|
||||||
And I run :hint
|
|
||||||
And I run :follow-hint a
|
|
||||||
Then the javascript message "Prompt reply: null" should be logged
|
|
||||||
|
|
||||||
Scenario: Javascript alert
|
Scenario: Javascript alert
|
||||||
When I open data/prompt/jsalert.html
|
When I open data/prompt/jsalert.html
|
||||||
And I click the button
|
And I click the button
|
||||||
@ -59,3 +37,28 @@ Feature: Prompts
|
|||||||
And I click the button
|
And I click the button
|
||||||
And I run :leave-mode
|
And I run :leave-mode
|
||||||
Then the javascript message "confirm reply: false" should be logged
|
Then the javascript message "confirm reply: false" should be logged
|
||||||
|
|
||||||
|
@pyqt531_or_newer
|
||||||
|
Scenario: Javascript prompt
|
||||||
|
When I open data/prompt/jsprompt.html
|
||||||
|
And I click the button
|
||||||
|
And I press the keys "prompt test"
|
||||||
|
And I run :prompt-accept
|
||||||
|
Then the javascript message "Prompt reply: prompt test" should be logged
|
||||||
|
|
||||||
|
@pyqt531_or_newer
|
||||||
|
Scenario: Rejected javascript prompt
|
||||||
|
When I open data/prompt/jsprompt.html
|
||||||
|
And I click the button
|
||||||
|
And I press the keys "prompt test"
|
||||||
|
And I run :leave-mode
|
||||||
|
Then the javascript message "Prompt reply: null" should be logged
|
||||||
|
|
||||||
|
@pyqt531_or_newer
|
||||||
|
Scenario: Using content -> ignore-javascript-prompt
|
||||||
|
When I set content -> ignore-javascript-prompt to true
|
||||||
|
And I open data/prompt/jsprompt.html
|
||||||
|
# Can't use "I click the button" as it waits for a key mode change
|
||||||
|
And I run :hint
|
||||||
|
And I run :follow-hint a
|
||||||
|
Then the javascript message "Prompt reply: null" should be logged
|
||||||
|
Loading…
Reference in New Issue
Block a user