I'm struggling to interact with the results of my google autocomplete as part of my integration tests.
var placeSelector = '.pac-container .pac-item:first-child';
exports.runTest = function(test) {
casper.waitForSelector('input.street-address');
casper.sendKeys('input.street-address', 'fake address here', {keepFocus: true});
casper.waitUntilVisible(placeSelector);
casper.then(function() {
casper.click(placeSelector);
casper.evaluate(function() {
});
});
var formVal;
casper.then(function() {
formVal = casper.evaluate(function () {
return $('input.street-address').val();
});
});
};
There is no result with the previous code, and the input is not filled, and hidden offers are not displayed.
How to simulate the action of a user entering an autocomplete input address and click one of the proposed results?
Several resources I've come across ask similar questions:
How to "simulate" click on the Google Maps marker?
https://developers.google.com/maps/documentation/javascript/events?csw=1#EventsOverview
source
share