|
2 | 2 |
|
3 | 3 | describe('Loading 0103-basic-center-url-hash-example.html', function() { |
4 | 4 |
|
5 | | - beforeEach(function() { |
6 | | - browser.get('0103-basic-center-url-hash-example.html'); |
7 | | - browser.wait(function() { |
8 | | - return element(by.css('img.leaflet-tile-loaded')).isPresent(); |
9 | | - }, 5000); |
10 | | - }, 30000); |
| 5 | + beforeEach(function() { |
| 6 | + browser.get('0103-basic-center-url-hash-example.html'); |
| 7 | + browser.wait(function() { |
| 8 | + return element(by.css('img.leaflet-tile-loaded')).isPresent(); |
| 9 | + }, 5000); |
| 10 | + }, 30000); |
11 | 11 |
|
12 | | - it('should update the url if the center value is changed from the form', function() { |
13 | | - element(by.xpath('//ul/li[1]/input[1]')).clear(); |
14 | | - element(by.xpath('//ul/li[1]/input[1]')).sendKeys("9"); |
15 | | - browser.driver.sleep(500); |
16 | | - element(by.xpath('//ul/li[2]/input[1]')).clear(); |
17 | | - element(by.xpath('//ul/li[2]/input[1]')).sendKeys("7"); |
18 | | - browser.driver.sleep(500); |
19 | | - element(by.xpath('//ul/li[3]/input[1]')).clear(); |
20 | | - element(by.xpath('//ul/li[3]/input[1]')).sendKeys("4"); |
21 | | - // Wait for zoom animation |
22 | | - browser.driver.sleep(1500); |
23 | | - expect(browser.driver.getCurrentUrl()).toMatch(/c=9.0153:6.9873:4$/); |
24 | | - }); |
| 12 | + it('should update the url if the center value is changed from the form', function() { |
| 13 | + element(by.xpath('//ul/li[1]/input[1]')).clear(); |
| 14 | + element(by.xpath('//ul/li[1]/input[1]')).sendKeys('9'); |
| 15 | + browser.driver.sleep(500); |
| 16 | + element(by.xpath('//ul/li[2]/input[1]')).clear(); |
| 17 | + element(by.xpath('//ul/li[2]/input[1]')).sendKeys('7'); |
| 18 | + browser.driver.sleep(500); |
| 19 | + element(by.xpath('//ul/li[3]/input[1]')).clear(); |
| 20 | + element(by.xpath('//ul/li[3]/input[1]')).sendKeys('4'); |
25 | 21 |
|
26 | | - it('should update the url if the zoom is changed from the map', function() { |
27 | | - element(by.xpath('.//*[@title="Zoom out"]')).click(); |
28 | | - browser.driver.sleep(500); |
29 | | - expect(browser.getCurrentUrl()).toMatch(/51.5050:-0.0900:3/); |
30 | | - }); |
| 22 | + // Wait for zoom animation |
| 23 | + browser.driver.sleep(1500); |
| 24 | + expect(browser.driver.getCurrentUrl()).toMatch(/c=9.0153:6.9873:4$/); |
| 25 | + }); |
31 | 26 |
|
32 | | - it('should update the map center model if the url changes', function() { |
33 | | - element(by.xpath('//ul/li[1]/a[1]')).click(); |
34 | | - expect(element(by.xpath('//ul/li[1]/input[1]')).getAttribute("value")).toBe("36.8899"); |
35 | | - expect(element(by.xpath('//ul/li[2]/input[1]')).getAttribute("value")).toBe("-121.8008"); |
36 | | - expect(element(by.xpath('//ul/li[3]/input[1]')).getAttribute("value")).toBe("12"); |
37 | | - }); |
| 27 | + it('should update the url if the zoom is changed from the map', function() { |
| 28 | + element(by.xpath('.//*[@title="Zoom out"]')).click(); |
| 29 | + browser.driver.sleep(500); |
| 30 | + expect(browser.getCurrentUrl()).toMatch(/51.5050:-0.0900:3/); |
| 31 | + }); |
| 32 | + |
| 33 | + it('should update the map center model if the url changes', function() { |
| 34 | + element(by.xpath('//ul/li[1]/a[1]')).click(); |
| 35 | + expect(element(by.xpath('//ul/li[1]/input[1]')).getAttribute('value')).toBe('36.8899'); |
| 36 | + expect(element(by.xpath('//ul/li[2]/input[1]')).getAttribute('value')).toBe('-121.8008'); |
| 37 | + expect(element(by.xpath('//ul/li[3]/input[1]')).getAttribute('value')).toBe('12'); |
| 38 | + }); |
38 | 39 | }); |
0 commit comments