Added test for alert bar

This commit is contained in:
n1474335 2023-03-06 14:53:20 +00:00
parent acc1df2031
commit 36aafb9246
1 changed files with 21 additions and 0 deletions

View File

@ -6,6 +6,8 @@
* @license Apache-2.0
*/
const utils = require("./browserUtils.js");
module.exports = {
before: browser => {
browser
@ -221,6 +223,25 @@ module.exports = {
.waitForElementVisible("//ul[@id='search-results']//b[text()='MD5']", 1000);
},
"Alert bar": browser => {
// Bake nothing to create an empty output which can be copied
utils.clear(browser);
utils.bake(browser);
// Alert bar shows and contains correct content
browser
.click("#copy-output")
.waitForElementVisible("#snackbar-container")
.waitForElementVisible("#snackbar-container .snackbar-content")
.expect.element("#snackbar-container .snackbar-content").text.to.equal("Copied raw output successfully.");
// Alert bar disappears after the correct amount of time
// Should disappear after 2000ms
browser
.waitForElementNotPresent("#snackbar-container .snackbar-content", 2500)
.waitForElementNotVisible("#snackbar-container");
},
after: browser => {
browser.end();
}