Closed scaddenp closed 1 year ago
Hi @scaddenp!
There are several ways you could approach it:
What version of Angular are you using? If you could put together a minimal example on github it would be easier for myself or other members of the Serenity/JS community to propose an approach.
Best, Jan
Thanks for those suggestions. Currently using angularjs but looking at transitioning as I refactor to improve the test environment. Leaflet is currently buried in a directive but not "pure" angular so map variable is exposed to controller. I will look at getting a minimal version together if I cant figure it out from your suggestion.
Sure, please keep me posted.
Note: Serenity/JS 2.0 will come with improved ExecuteScript
interactions that could be useful here. Preview.
Looks useful. battling away with need to simulate mouse clicks on specific screen x,y locations. There are cases where cannot use the L.Map methods ( a masking DOM element), so having to do very low level in scripts.
I have an application using Leafletjs for mapping and I am struggling with how to test interactions with the map. Eg a mouse hovering over a particular map position should create a pop up; clicks on map tools will change the map content. These are easily emulated by using setters (for action) and getters (for questions) on an instance of an L.Map object.
What I am baffled with though, is that the map variable ( map = L.Map(etc) ) is buried within am angular controller. It seems I would have to expose it to global scope to use it within a serentityjs test. I think I must be missing something very obvious here and surely it must be a common enough requirement for angular developers using serentityjs.