summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_formValidation.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_formValidation.qml')
-rw-r--r--tests/auto/quick/qmltests/data/tst_formValidation.qml24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_formValidation.qml b/tests/auto/quick/qmltests/data/tst_formValidation.qml
index 6da8af7ff..cae41821c 100644
--- a/tests/auto/quick/qmltests/data/tst_formValidation.qml
+++ b/tests/auto/quick/qmltests/data/tst_formValidation.qml
@@ -71,15 +71,6 @@ TestWebEngineView {
keyPress(Qt.Key_Enter)
showSpy.wait()
compare(showSpy.signalArguments[1][0], "Please enter a URL.")
-
- webEngineView.url = Qt.resolvedUrl("about:blank")
- verify(webEngineView.waitForLoadSucceeded())
-
- webEngineView.url = Qt.resolvedUrl("forms.html#url_title")
- verify(webEngineView.waitForLoadSucceeded())
- keyPress(Qt.Key_Enter)
- showSpy.wait()
- compare(showSpy.signalArguments[2][1], "url_title")
}
function test_emailForm() {
@@ -97,15 +88,26 @@ TestWebEngineView {
keyPress(Qt.Key_Enter)
showSpy.wait()
compare(showSpy.signalArguments[1][0], "Please include an '@' in the email address. 'invalid' is missing an '@'.")
+ }
+
+ function test_textForm() {
+ webEngineView.url = Qt.resolvedUrl("forms.html#input_empty")
+ verify(webEngineView.waitForLoadSucceeded())
+ keyPress(Qt.Key_Enter)
+ showSpy.wait()
+ compare(showSpy.signalArguments[0][0], "Please fill out this field.")
+ // Title should be shown for pattern mismatch only
+ compare(showSpy.signalArguments[0][1], "")
webEngineView.url = Qt.resolvedUrl("about:blank")
verify(webEngineView.waitForLoadSucceeded())
- webEngineView.url = Qt.resolvedUrl("forms.html#email_title")
+ webEngineView.url = Qt.resolvedUrl("forms.html#lorem_ipsum")
verify(webEngineView.waitForLoadSucceeded())
keyPress(Qt.Key_Enter)
showSpy.wait()
- compare(showSpy.signalArguments[2][1], "email_title")
+ compare(showSpy.signalArguments[1][0], "Please match the requested format.")
+ compare(showSpy.signalArguments[1][1], "Should type 'Lorem ipsum'")
}
}
}