Created
October 13, 2016 22:13
-
-
Save acthp/a43adadd7cc6464898362daeaf6db189 to your computer and use it in GitHub Desktop.
This file contains 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
describe.only('example', function () { | |
it('should find visible element, low arity', function () { | |
browser.execute(function () { | |
document.body.innerHTML = '<div id="a" class="a">foo</div><div id="b">blah</div>'; | |
}); | |
// We pretend we're waiting on a list of dom elements to be | |
// created. | |
browser.waitUntil( | |
() => browser.elements('//*[@class="a"]').value.length > 0, | |
2000, | |
'has list', | |
200); | |
browser.execute(function () { | |
var a = document.getElementById('a'); | |
a.parentElement.removeChild(a); | |
}); | |
browser.waitForVisible('//*[@id="b"]', 100); | |
// XXX fails because it waits for div a. | |
}); | |
it('should find visible element, full arity', function () { | |
browser.execute(function () { | |
document.body.innerHTML = '<div id="a" class="a">foo</div><div id="b">blah</div>'; | |
}); | |
// We pretend we're waiting on a list of dom elements to be | |
// created. | |
browser.waitUntil( | |
() => browser.elements('//*[@class="a"]').value.length > 0, | |
2000, | |
'has list', | |
200); | |
browser.execute(function () { | |
var a = document.getElementById('a'); | |
a.parentElement.removeChild(a); | |
}); | |
browser.waitForVisible('//*[@id="b"]', 100, false); | |
// XXX works because all optional args are passed. | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment