summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/forms.html8
-rw-r--r--tests/auto/quick/qmltests/data/tst_formValidation.qml20
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/forms.html b/tests/auto/quick/qmltests/data/forms.html
index d137c98f0..18133eca6 100644
--- a/tests/auto/quick/qmltests/data/forms.html
+++ b/tests/auto/quick/qmltests/data/forms.html
@@ -28,5 +28,13 @@
<input type="email" value="invalid" required/>
<input type="submit" name="email_invalid"/>
</form>
+ <form>
+ <input type="text" title="empty input" required/>
+ <input type="submit" name="input_empty"/>
+ </form>
+ <form>
+ <input type="text" pattern="Lorem ipsum" value="Lorem Ipsum" title="Should type 'Lorem ipsum'"/>
+ <input type="submit" name="lorem_ipsum"/>
+ </form>
</body>
</html>
diff --git a/tests/auto/quick/qmltests/data/tst_formValidation.qml b/tests/auto/quick/qmltests/data/tst_formValidation.qml
index f8d6c4e15..cae41821c 100644
--- a/tests/auto/quick/qmltests/data/tst_formValidation.qml
+++ b/tests/auto/quick/qmltests/data/tst_formValidation.qml
@@ -89,5 +89,25 @@ TestWebEngineView {
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#lorem_ipsum")
+ verify(webEngineView.waitForLoadSucceeded())
+ keyPress(Qt.Key_Enter)
+ showSpy.wait()
+ compare(showSpy.signalArguments[1][0], "Please match the requested format.")
+ compare(showSpy.signalArguments[1][1], "Should type 'Lorem ipsum'")
+ }
}
}