remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/test-browser/helpers/dom.js

24 lines
655 B

'use strict'
module.exports = {
listSelectorContains: listSelectorContains
}
function listSelectorContains (textsToFind, selector, browser, callback) {
browser.execute(function (selector) {
var items = document.querySelectorAll(selector)
var ret = []
for (var k = 0; k < items.length; k++) {
ret.push(items[k].innerText)
}
return ret
}, [selector], function (result) {
console.log(result.value)
for (var k in textsToFind) {
console.log('testing ' + result.value[k] + ' against ' + textsToFind[k])
browser.assert.equal(result.value[k].indexOf(textsToFind[k]) !== -1, true)
}
callback()
})
}