Skip to content

Instantly share code, notes, and snippets.

@jadell
Created June 9, 2016 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadell/8b9aeca9f1cc738843eca3b4af1e1d32 to your computer and use it in GitHub Desktop.
Save jadell/8b9aeca9f1cc738843eca3b4af1e1d32 to your computer and use it in GitHub Desktop.
function setPlacesAutocomplete(selector, value) {
casper.then(function () {
casper.sendKeys(selector, value, { keepFocus: true });
casper.page.sendEvent('keydown', 0);
casper.page.sendEvent('keyup', 0);
});
casper.waitUntilVisible('.pac-container .pac-item', function () {
casper.page.sendEvent('keydown', casper.page.event.key.Down);
casper.page.sendEvent('keydown', casper.page.event.key.Enter);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment