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:
Florian Bruhin 2016-01-12 09:04:03 +01:00
parent df40b39e3e
commit 22d255f49f
3 changed files with 29 additions and 23 deletions

View File

@ -12,6 +12,7 @@ markers =
frozen: Tests which can only be run if sys.frozen is True.
integration: Tests which test a bigger portion of code, run without coverage.
skip: Always skipped test.
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
flakes-ignore =
UnusedImport
UnusedVariable

View File

@ -39,7 +39,7 @@ from helpers.messagemock import message_mock
from qutebrowser.config import config
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.QtNetwork import QNetworkCookieJar
import xvfbwrapper
@ -66,6 +66,8 @@ def _apply_platform_markers(item):
('not_xvfb', item.config.xvfb_display is not None,
"Can't be run with Xvfb."),
('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:

View File

@ -6,28 +6,6 @@ Feature: Prompts
# 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
When I open data/prompt/jsalert.html
And I click the button
@ -59,3 +37,28 @@ Feature: Prompts
And I click the button
And I run :leave-mode
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