Select to view content in your preferred language

Clicking on a MapView in automated acceptance tests

319
0
12-04-2023 10:53 AM
JulieStringham
New Contributor

I was wondering if anyone has experience interacting with a MapView in automated user acceptance testing frameworks. I am working on an Ember.js application that incorporates a webmap from ArcGIS Maps SDK for Javascript. The webmap's view has a click event handler attached to it, which updates other parts of my app's interface when fired. My goal is to test these custom interface components and ensure they render as expected when a feature on the map is clicked.

Unfortunately, I can't seem to programmatically click on the map using my acceptance test framework. Right now, my test waits for the map to render, then 'clicks' on the map by triggering mousedown, focus, focus-in, mouseup, and click (in that order) on the .esri-view-surface div. 

So, I have a few questions: What events should I be triggering to get the click event handler to fire on the view? Do I need to specify certain properties when triggering events, like clientX/clientY? And which DOM elements should I be targeting with these events?

For context, I am using the ArcGIS Maps SDK for JavaScript v4.27, ember-cli v5, and ember-qunit, but I'd be super appreciative to hear experiences from folks using other testing frameworks, too!

0 Kudos
0 Replies