Skip to content

Instantly share code, notes, and snippets.

@vzaidman
Last active February 1, 2019 17:51
Show Gist options
  • Save vzaidman/5858d4ee8985a4e09455f9c773e19487 to your computer and use it in GitHub Desktop.
Save vzaidman/5858d4ee8985a4e09455f9c773e19487 to your computer and use it in GitHub Desktop.
describe('login form', () => {
before(() => {
return driver.navigate().to('http://path.to.test.app/')
})
it('autocompletes the name field', () => {
driver
.findElement(By.css('.autocomplete'))
.sendKeys('John')
driver.wait(until.elementLocated(By.css('.suggestion')))
driver.findElement(By.css('.suggestion')).click()
return driver
.findElement(By.css('.autocomplete'))
.getAttribute('value')
.then(inputValue => {
expect(inputValue).to.equal('John Doe')
})
})
after(() => {
return driver.quit()
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment