Rayrun
← Back to Discord Forum

Using Playwright to interact with ESRI elements

Hi everyone, I'm in the midst of developing an e2e test suite for a map application. My issue is that the map itself isn't comprised of DOM elements its a canvas that holds a ESRI GIS map. Anyone have any good tips for validating user interactions?

  • We have features like a pin that can be clicked on to display specific information in a side panel. I need to be able to both validate this pins existence and validate when its clicked on it displays correct info in the side panel.

This thread is trying to answer question "How can I validate user interactions with an ESRI GIS map in a map application using Playwright?"

2 replies

Hi @eldunn.,

To validate the overall map, you can use Visual Regression Testing, the one provided by Playwright or Argos (https://argos-ci.com).

To click on the pin, it is harder. I suggest you to expose a global function in your code to get the coordinates of the pin:

window.getPinPosition = () => [232, 412]

Then you can call this function using const coords = page.evaluate(() => window.getPinPosition())

Then you can use page.mouse.click(...coords) to click on it. https://playwright.dev/docs/api/class-mouse#mouse-click

Thanks Greg, ill give it a try!

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.