Skip to content

Instantly share code, notes, and snippets.

@joelwatson
Created August 14, 2017 13:21
Show Gist options
  • Save joelwatson/659e2e735377148446a04336058b5e16 to your computer and use it in GitHub Desktop.
Save joelwatson/659e2e735377148446a04336058b5e16 to your computer and use it in GitHub Desktop.
Choose HTML <select> option
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
describe("HTML Select", function() {
it('should choose 3rd option', function () {
// inspect here
var locator = '[name=select]';
ST.defaultContext.driver.selectByVisibleText(locator, 'Value 3');
ST.element(locator)
.down('option:nth-child(3)')
.get('selected')
.wait(3000)
.and(function () {
expect(this.future.data.selected).toBe(true)
});
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment