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

Fixed testDirty.js.

parent cad500a1
No related branches found
No related tags found
No related merge requests found
......@@ -100,41 +100,39 @@ test.describe('Dirty Form', function () {
.then(
(inputElement) => inputElement.sendKeys("test")
)
)
.then(
() => driver.findElement(By.css('#qfqAlertContainer > div'))
() => driver.wait(until.elementLocated(By.css('#qfqAlertContainer > div')))
.then(
(found) => found.isDisplayed()
(element) => driver.wait(until.elementIsVisible(element))
.then(
() => found.getText()
(element) => element.getText()
.then(
(text) => {
should(text).be.exactly('Another user has form in edit mode');
should(text).be.exactly('other user has lock');
}
)
.then(
() => driver.findElement(By.id('save-button'))
.then(
(saveButton) => saveButton.isEnabled()
.then(
() => assert.fail("save button enabled", "save button disabled", "save button state")
)
)
)
.then(
() => driver.findElement(By.id('delete-button'))
.then(
(deleteButton) => deleteButton.isEnabled()
.then(
() => assert.fail("delete button enabled", "delete button disabled", "delte button state")
)
)
)
.then(
() => done()
() => element.click()
)
)
)
)
.then(
() => driver.findElement(By.id('save-button'))
.then(
(button) => driver.wait(until.elementIsDisabled(button))
)
)
.then(
() => driver.findElement(By.id('delete-button'))
.then(
(button) => driver.wait(until.elementIsDisabled(button))
)
)
.then(
() => done()
);
});
......@@ -239,71 +237,5 @@ test.describe('Dirty Form', function () {
)
)
)
}
);
test.it("should still not save even when ignoring dirty notification", function (done) {
driver.get(URL)
.then(
() => driver.findElement(By.id('option-save-conflict'))
.then(
(submitToEndpointDropdown) => submitToEndpointDropdown.click()
)
)
.then(
() => driver.findElement(By.id('option-dirty-denied'))
.then(
(dirtyEndpointDropdown) => dirtyEndpointDropdown.click()
)
)
.then(
() => driver.findElement(By.id('name'))
.then(
(inputElement) => inputElement.sendKeys("test")
)
)
.then(
() => driver.findElement(By.css('#qfqAlertContainer > div'))
.then(
(found) => found.isDisplayed()
.then(
found.click()
.then(
() => driver.wait(until.stalenessOf(found))
)
.then(
() => driver.findElement(By.id('firstname'))
.then(
(inputElement) => inputElement.sendKeys("test")
)
)
.then(
() => driver.findElement(By.id('save-button'))
.then(
(button) => button.isEnabled()
.then(
() => button.click()
)
)
)
.then(
() => driver.findElement(By.css('#qfqAlertContainer > div'))
.then(
(found) => found.isDisplayed()
.then(
found.getText()
.then(
(text) => {
should(text).be.exactly('Form was modified by other user');
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