MattiSG / Watai

Integration testing for the web of components
62 stars 7 forks source link

Add the ability to set select elements or document it #132

Closed davidbgk closed 9 years ago

davidbgk commented 9 years ago

I tried to do a this.setFrequencyField(frequency) with frequency being an option in a select targeted via select#frequency. The same pattern works for an input or a textarea but not for a select or I missed something.

MattiSG commented 9 years ago

The pattern should be to activate the option rather than the select itself:

// 1 - Set style feature.js
scenario: [
    TextEditorWidget.boldStyle(),
    // …
]
// TextEditorWidget.js
boldStyleOption: '#textEditor select[name="style"] option[value="bold"]',

Please let me know if this works :)

davidbgk commented 9 years ago

It works thanks, maybe worth a line in the documentation?

MattiSG commented 9 years ago

Could be! Question is: where would you have looked for it? ;)

davidbgk commented 9 years ago

Maybe in an advanced example?

MattiSG commented 9 years ago

Right, I guess the closest to “recipes” is currently the advanced examples.

Closing this issue, as the problem was solved and the knowledge is properly stored for someone searching for it. It would be an improvement to improve discoverability by adding an example, but this should not be blocking anymore.

MattiSG commented 9 years ago

Actually, I just created a wiki page for this ;)