These are chat archives for mojotech/pioneer

5th
Nov 2014
Tom Hicks
@tomhicks-bsf
Nov 05 2014 09:01

@jaridmargolin one way I've tackled this previously is to use wait clauses to wait until the form/whatever is in a particular state. So for example, if you have an isReady method, you should be able to do something like:

return this.driver.wait(this.isReady)

(The exact syntax may be a little off there, but the point remains). This returns a promise that resolves when isReady returns true, so you can put this wherever you need it. I've found it is useful to put it in widgets rather than in the steps, so you keep your step definitions clean. You don't want that level of knowledge in the steps ideally, because you just want to be able to say "do this thing, then that thing" and have the waiting logic to be wrapped up into the "do this thing" bit.

Maybe that helps, or maybe I've just told you a load of stuff you already know...

@samccone could you give a quick description of the difference between Widget.driver and the Driver instance in widget.coffee? I have been doing some drag and drop stuff and needed access to the WebDriver.ActionSequence constructor, and assumed that widget.driver would have it, but instead had to require my own instance of selenium-webdriver in order for it to work.