Created
May 8, 2018 20:20
-
-
Save NicholasRoge/82403b8b1b31b29ae619f5bcc81e3470 to your computer and use it in GitHub Desktop.
Failing Conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
think this is where you have mistake, comment it and isolate it