We have an app where we can display dataset features on an Open Layers map page. These dataset features are then selectable to allow further attributes of these datasets to be displayed.

In my Cypress tests I've done most of my testing using the DOM element to identify, but when I select the map window I just get canvas.ol-unselectable which doesn't show the dataset features. I think I can use x,y co-ordinates to find a location on the page, but what do I use in the cy.get().Is there an option to select the browser window?

1 Answer 1

    cy.get('canvas').trigger('pointerdown', {clientX: 900, clientY: 500})
    cy.get('canvas').trigger('pointerup', {clientX: 900,clientY: 500})
  • 1
    It's helping me select polygon features, but I'm still having issues with point locations, but I think that is more to do with having to provide exact x,y locations. So, Yes, I'm happy that this solution has worked.
    – Adam A
    Commented Jun 27, 2018 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.