9

I've to find a solution for test automation for web gis/mapping application that using OpenLayers 2.x or Leaflet as javascript libraries.

I'm oriented on evaluate Selenium WebDriver (or other similar tools, suggestion? ...): are there somewhere examples / tutorials / experiences or similar?

blah238
  • 35,793
  • 7
  • 94
  • 195
Cesare
  • 2,001
  • 8
  • 36
  • 60
  • are you trying to test the clients (OpenLayers/Leaflet) or the Server? – Ian Turton Jun 12 '15 at 15:59
  • @iant this is definitely about browser-based testing. – blah238 Jun 12 '15 at 21:31
  • 1
    Related: http://gis.stackexchange.com/questions/129505/automate-testing-of-web-app-based-on-arcgis-js-api – blah238 Jun 12 '15 at 21:39
  • @iant: I need to test clients ... – Cesare Jun 13 '15 at 19:08
  • @blah238 your link refers suggestions about ESRI JS API that is not my solution. I'll read it anyway could be that there is something that could be useful – Cesare Jun 13 '15 at 19:11
  • What, specifically, are you looking to test? Been starting to experiment with this myself because we use Selenium for automated testing, and recently added maps using Leaflet. Testing clicking on features can get pretty tricky, but I'm finding it's even more challenging to test "does the map look right?" So for now decided to focus on testing interactions only, and have a human in QA do the visual part for maps. – nothingisnecessary Sep 11 '15 at 21:43
  • Another interesting approach done by the Piwik team is they load a web page and take a screenshot, then compare it ot a reference screenshot. Might make sense if your map data/tiles don't change a lot through time: http://piwik.org/blog/2013/10/our-latest-improvement-to-qa-screenshot-testing/ – chrki Sep 18 '15 at 19:27
  • You can test apps using Leaflet like any other javascript app, for example with Jasmine and Karma. I found this slideshare where someone is testing an app which uses Leaflet http://www.slideshare.net/cebartling/javascript-38057372 – Fabian Dubois Nov 18 '15 at 07:02

1 Answers1

1

I've solved using Selenium Web Driver and OpenLayers 2.13.

For those that could be interested you can find some code examples here

https://github.com/cesaregerbino/TestSeleniumWebDriverOpenLayers (in italian)

The examples are the follow:

  • InterActiveZoomIn
  • MeasureAreaOpenLayers
  • IdentifyOpenLayers
  • GetFeatureInfoWMS
  • EditingOpenLayers
  • AreaProject

and, for each, there is the code and the buildfile.

You can find also a short video that shown the result.

I hope that this stuff could be useful.....

Cesare
  • 2,001
  • 8
  • 36
  • 60
  • 1
    From a quick look at your code, it seems there is no automated test outcome verification. In other words a tester has to sit in front of the screen to verify correct behavior, right? – a1an Jul 26 '16 at 14:33
  • Yes. Note that my code is only a "sample code" useful to show the principles.In a "real" code you can implement all the behaviours you like: in my code I just write something in my cmd console (and note that all the tests are ok ....), but I could implement something like send an email to someone, write the results of each action in a database, ecc... – Cesare Jul 26 '16 at 16:13