Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Then(/^the last word of the phrase should be the one word in the word list$/, async function () {
let phrase = "";
let wordRow = "";
await browser.getText("#phrase", function (result) {
phrase = result.value
})
let lastWord = phrase.trim().split(" ").pop()
expect(lastWord.length).to.be.gt(0)
await browser.getText("#word_table > tr", function (result) {
wordRow = result.value
})
let columns = wordRow.trim().split(" ")
let word = columns[11]
expect(word).to.not.equal("")
expect(word).to.not.equal("undefined")
expect(word).to.equal(lastWord)
});
Then(/^the last word of the phrase should be the one word in the word list$/, async function () {
let phrase = "";
let wordRow = "";
await browser.getText("#phrase", function (result) {
phrase = result.value
})
let lastWord = phrase.trim().split(" ").pop()
expect(lastWord.length).to.be.gt(0)
await browser.getText("#word_table > tr", function (result) {
wordRow = result.value
})
let columns = wordRow.trim().split(" ")
let word = columns[11]
expect(word).to.not.equal("")
expect(word).to.not.equal("undefined")
expect(word).to.equal(lastWord)
});
Then(/^the input field number (\d+) and onward should be disabled$/, async function (firstDisabled) {