title: How to simulate a click on a google place autocomplete result?
body: <p>I am struggling to interact with my google place autocomplete results within my integration tests.</p>
  
  <pre><code>var placeSelector = '.pac-container .pac-item:first-child';
  
  exports.runTest = function(test) {
      casper.waitForSelector('input.street-address'); // wait for page to load
      casper.sendKeys('input.street-address', 'fake address here', {keepFocus: true});
  
      casper.waitUntilVisible(placeSelector);
  
      casper.then(function() {
          casper.click(placeSelector); // THIS DOES NOT DO ANYTHING
  
          // if its possible to trigger the event in the context of the page, I 
          // could probably do so. However, I've scoured google's docs and cannot find the 
          // event that is fired when a place is clicked upon.
          casper.evaluate(function() {
              //google.maps.places.Autocomplete.event.trigger(???);
          }); 
      });
  
      var formVal;
      casper.then(function() {
          formVal = casper.evaluate(function () {
              return $('input.street-address').val();
          });
      });
  };
  </code></pre>
  
  <p>With the previous code, there is no result and the input is not populated nor are the suggested results hidden. </p>
  
  <p><strong>How can I simulate the action of a user entering in an address to the autocomplete input and proceeding to click upon one of the suggested results?</strong></p>
  
  <p>A few resources that I have come across asking similar questions:</p>
  
  <p><a href="https://stackoverflow.com/questions/9194579/how-to-simulate-a-click-on-a-google-maps-marker">How to &quot;simulate&quot; a click on a Google Maps Marker?</a></p>
  
  <p><a href="https://developers.google.com/maps/documentation/javascript/events?csw=1#EventsOverview" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/javascript/events?csw=1#EventsOverview</a></p>