Skip to content

Instantly share code, notes, and snippets.

@awatson1978
Last active August 24, 2016 21:13
Show Gist options
  • Save awatson1978/d0a24909d2e1091745d06e8334b850e7 to your computer and use it in GitHub Desktop.
Save awatson1978/d0a24909d2e1091745d06e8334b850e7 to your computer and use it in GitHub Desktop.
Nightwatch - Forms and Inputs
Daniel Rinehart
https://groups.google.com/forum/#!searchin/nightwatchjs/radio|sort:relevance/nightwatchjs/PV-zaHLRtsA/2nbZ8v1ud84J
```
module.exports = {
'Form': function(browser) {
browser
.url('http://nightwatch-form.herokuapp.com/')
.setValue('input[name="first_name"]', 'First')
.setValue('input[name="last_name"]', 'Last')
.click('select[name="dob_month"] option[value="3"]')
.click('select[name="dob_day"] option[value="18"]')
.click('select[name="dob_year"] option[value="1987"]')
.click('input[name="gender"][value="M"]')
.click('select[name="hs_graduation_year"] option[value="2002"]')
.setValue('input[name="city"]', 'City')
.click('select[name="state"] option[value="CA"]')
.setValue('input[name="zip"]', '01234')
.click('button[type="submit"]')
.end();
}
};
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment