Skip to content
Snippets Groups Projects
Commit 5c92927d authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Test behavior of required form elements.

parent 4889f3e6
No related branches found
No related tags found
No related merge requests found
...@@ -34,4 +34,36 @@ test.describe('QFQ Form', function () { ...@@ -34,4 +34,36 @@ test.describe('QFQ Form', function () {
test.after(function () { test.after(function () {
driver.quit(); driver.quit();
}); });
test.it("should mark required fields", function (done) {
driver.get(URL)
.then(
() => driver.findElement(By.id('firstname'))
.then(
(firstnameInput) => firstnameInput.click()
)
)
.then(
() => driver.findElement(By.id('nameShort'))
.then(
(shortNameInput) => shortNameInput.click()
)
)
// By now, we should have triggered a validation error on the form
.then(
() => driver.findElement(By.css('#firstname + div.help-block > ul.list-unstyled li:first-child'))
.then(
(validationItem) => driver.wait(until.elementIsVisible(validationItem), 1000)
.then(
() => validationItem.getText()
.then(
(text) => {
should(text).be.exactly("Please fill out this field.");
done();
}
)
)
)
)
});
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment