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

testFormHttpError.js: test file delete.

parent 0210ad75
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@
<label>File Delete Url
<select name="fileDeleteUrl" id="fileDeleteUrl">
<option>404 error</option>
<option id="file-delete-404-error">404 error</option>
<option>delete_file_ok.json</option>
<option>delete_file_error.json</option>
</select>
......@@ -76,11 +76,12 @@
<li role="presentation" class="active"><a href="#person" data-toggle="tab">Person</a></li>
<li role="presentation"><a id="link-tab-person2" href="#person2" data-toggle="tab">Person2</a></li>
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
<a id="link-more-dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
more <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#arbeitsgruppe" data-toggle="tab">Arbeitsgruppe</a></li>
<li><a id="link-tab-arbeitsgruppe" href="#arbeitsgruppe" data-toggle="tab">Arbeitsgruppe</a>
</li>
</ul>
</li>
......
......@@ -36,7 +36,7 @@ test.describe('Form Submit Error', function () {
driver.quit();
});
test.it("should display error message on HTTP error when submitting", function (done) {
test.it("should display error message on HTTP error when submitting form", function (done) {
driver.get(URL)
.then(
() => qfqForm.assertButtonsUnmodifiedForm(driver)
......@@ -62,7 +62,7 @@ test.describe('Form Submit Error', function () {
)
});
test.it("should display error message on HTTP error when deleting", function (done) {
test.it("should display error message on HTTP error when deleting form", function (done) {
driver.get(URL)
.then(
() => qfqForm.assertButtonsUnmodifiedForm(driver)
......@@ -103,6 +103,64 @@ test.describe('Form Submit Error', function () {
)
)
)
})
});
test.it("should display error message on HTTP error when deleting file", function (done) {
driver.get(URL)
.then(
() => qfqForm.assertButtonsUnmodifiedForm(driver)
)
.then(
() => driver.findElement(By.id('delete-404-error'))
.then(
(dropdown) => dropdown.click()
)
)
.then(
() => driver.findElement(By.id('link-more-dropdown'))
.then(
(link) => link.click()
.then(
() => driver.findElement(By.id('link-tab-arbeitsgruppe'))
.then(
(link) => link.click()
)
)
)
)
.then(
() => driver.findElement(By.css('.uploaded-file button.delete-file'))
.then(
(button) => button.click()
.then(
qfqForm.expectNumberOfAlerts.toBe(1, driver)
.then(
qfqForm.expectAlertToMatch(1, /Do you want to delete the file\?/, driver)
)
)
)
)
.then(
() => driver.findElement(By.css('div.alert-buttons button:first-child'))
.then(
(yesButton) => yesButton.click()
.then(
() => driver.findElement(By.css('#qfqAlertContainer > div.alert-danger'))
.then(
(alertContainer) => driver.wait(until.elementIsVisible(alertContainer), 1000)
)
)
)
)
.then(
() => qfqForm.expectNumberOfAlerts.toBe(1, driver)
.then(
() => qfqForm.expectAlertToMatch(1, /Error:\nNot Found/, driver)
.then(
() => done()
)
)
)
});
});
\ No newline at end of file
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