From 1c40d605553506c2073d6afd70ec6da1b506ec3c Mon Sep 17 00:00:00 2001 From: David Rubert Date: Thu, 19 Dec 2013 13:52:10 +0100 Subject: [PATCH] feat(test): Completed e2e tests for the bounds example. --- test/e2e/03-bounds-example.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/e2e/03-bounds-example.js b/test/e2e/03-bounds-example.js index a0ee06cf..84a02a71 100644 --- a/test/e2e/03-bounds-example.js +++ b/test/e2e/03-bounds-example.js @@ -14,11 +14,18 @@ describe('Loading bounds-example.html', function() { return ptor.isElementPresent(by.css('img.leaflet-tile-loaded')); }); - element(by.css('img.leaflet-tile-loaded')).click().then(function() { - expect(element(by.model("bounds.southWest.lat")).getAttribute("value")).toBe("39.232253141714885"); - expect(element(by.model("bounds.southWest.lng")).getAttribute("value")).toBe("-28.212890625"); - expect(element(by.model("bounds.northEast.lat")).getAttribute("value")).toBe("61.18562468142283"); - expect(element(by.model("bounds.northEast.lng")).getAttribute("value")).toBe("28.037109375"); + expect(element(by.model("bounds.southWest.lat")).getAttribute("value")).toBe("39.232253141714885"); + expect(element(by.model("bounds.southWest.lng")).getAttribute("value")).toBe("-28.212890625"); + expect(element(by.model("bounds.northEast.lat")).getAttribute("value")).toBe("61.18562468142283"); + expect(element(by.model("bounds.northEast.lng")).getAttribute("value")).toBe("28.037109375"); + + element(by.xpath('.//*[@title="Zoom in"]')).click().then(function(el) { + ptor.sleep(400); + expect(element(by.model("bounds.southWest.lat")).getAttribute("value")).toBe("45.706179285330855"); + expect(element(by.model("bounds.southWest.lng")).getAttribute("value")).toBe("-14.150390625"); + expect(element(by.model("bounds.northEast.lat")).getAttribute("value")).toBe("56.65622649350222"); + expect(element(by.model("bounds.northEast.lng")).getAttribute("value")).toBe("13.974609375"); }); + }); });