I am attempting to use the leadfoot module for functional testing with the intern and selenium.
For this test, I'm trying to click a button in one place, then check the display property of a element elsewhere on the page.
I couldn't find a way to expand the search of the findById call, so I tried using the session property, which seems to work, but results in everything returning a promise.
The only way I've found that will make it work is by chaining then functions. What makes the session (and the elements its functions return) different?
return this.remote
.findById('buttonContainer')
.findByClassName('buttonClass')
.click()
.session
.findById('stagePanel')
.then(function(element) {
element.findByClassName('itemList')
.then(function(element) {
element.getComputedStyle('display')
.then(function (display) {
// check display property
});
});
});
I'm sure I'm doing many things wrong, so any and all advice is appreciated.