This commit is contained in:
Daniel
2021-03-03 23:11:41 +01:00
parent 83537482b8
commit eb98444afb

View File

@@ -71,6 +71,11 @@ Then('it fails with {string}', async message => {
return (await element.getText()).includes(message) return (await element.getText()).includes(message)
}) })
Then('it shows {string} in {string}', async (message,id) => {
const element = await browser.wait (browser.findElement(By.id(id)))
return (await element.getText()).includes(message)
})
Given('we login as {string}, {string}', async (username, password) => { Given('we login as {string}, {string}', async (username, password) => {
const alert = await browser.switchTo().alert() const alert = await browser.switchTo().alert()
return alert.authenticateAs(username, password) return alert.authenticateAs(username, password)