Skip to content

Instantly share code, notes, and snippets.

@NicholasRoge
Created May 8, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NicholasRoge/82403b8b1b31b29ae619f5bcc81e3470 to your computer and use it in GitHub Desktop.
Save NicholasRoge/82403b8b1b31b29ae619f5bcc81e3470 to your computer and use it in GitHub Desktop.
Failing Conf
exports.config = {
// Other options
before() {
browser.addCommand('displayText', function (text, duration = 3000) {
const textElId = `text-el-${Math.floor(Math.random() * 10000)}`
this.execute(function (id, text, duration) {
var textContainer = document.createElement("div");
textContainer.id = id;
textContainer.style.display = "flex";
textContainer.style.alignItems = "center";
textContainer.style.justifyContent = "center";
textContainer.style.position = "fixed";
textContainer.style.top = 0;
textContainer.style.left = 0;
textContainer.style.width = "100%";
textContainer.style.height = "100%";
textContainer.style.zIndex = 16000005;
textContainer.style.background = "hsla(0, 0%, 0%, 0.85)";
textContainer.style.color = "hsl(0, 100%, 100%)";
textContainer.style.fontSize = "5vh";
textContainer.style.fontWeight = "bold";
textContainer.style.opacity = 1;
textContainer.style.transition = "opacity 400ms linear";
textContainer.appendChild(document.createTextNode(text));
document.body.appendChild(textContainer);
setTimeout(function () {
textContainer.style.opacity = 0;
setTimeout(function () {
textContainer.parentNode.removeChild(textContainer)
}, 400);
}, duration);
}, textElId, text, duration)
this.waitUntil(() => !this.isExisting(`#${textElId}`))
})
},
beforeTest(test) {
try {
browser.displayText(test.fullTitle)
} catch (e) {
// Displaying the title card should never cause a test to fail, so
// we'll just eat any errors it may cause.
}
}
}
@mickosav
Copy link

mickosav commented May 8, 2018

think this is where you have mistake, comment it and isolate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment