This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new integration test for set-center-zoom;
updated test/set-center-zoom angular version; changed example and test set-center-zoom pages to construct their zoom select elements by ng-options
- Loading branch information
Jacob Wasilkowski
committed
Sep 13, 2015
1 parent
9523857
commit c8659fc
Showing
3 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
'use strict'; | ||
|
||
var helper = require('../helper'); | ||
|
||
describe('Set Map Center and Zoom', function() { | ||
// shared element locators | ||
var map = element(by.id('map')); | ||
var lat = element(by.model('map.center.lat')); | ||
var lng = element(by.model('map.center.lng')); | ||
var zoomSelect = element(by.model('map.zoom')); | ||
|
||
beforeAll(function() { | ||
// refer to "gulp test" task to get the baseUrl that is prepended | ||
browser.get('/set-center-zoom.html'); | ||
}); | ||
|
||
it('should click on the "San Francisco" button and change the map "data-zoom" value, along with the lat, lng, and zoom element values', function() { | ||
// element locator(s) specific to this test | ||
var sanFrancisco = element(by.buttonText('San Francisco')); | ||
helper.waitUntilElementIsReady(map); | ||
|
||
sanFrancisco.click(); | ||
|
||
helper.getAsyncAttributeValue(map, 'data-zoom').then(function(newValue) { | ||
var expectedZoom = '10', | ||
expectedLat = '37.75', | ||
expectedLng = '-122.45'; | ||
expect(newValue).toEqual(expectedZoom); | ||
expect(zoomSelect.getAttribute('value')).toEqual('number:' + expectedZoom); | ||
expect(lat.getAttribute('value')).toEqual(expectedLat); | ||
expect(lng.getAttribute('value')).toEqual(expectedLng); | ||
}); | ||
}); | ||
|
||
it('should click on the "New York" button and change the map "data-zoom" value, along with the lat, lng, and zoom element values', function() { | ||
// element locator(s) specific to this test | ||
var newYork = element(by.buttonText('New York')); | ||
helper.waitUntilElementIsReady(map); | ||
|
||
newYork.click(); | ||
|
||
helper.getAsyncAttributeValue(map, 'data-zoom').then(function(newValue) { | ||
var expectedZoom = '12', | ||
expectedLat = '40.7127', | ||
expectedLng = '-74.0059'; | ||
expect(newValue).toEqual(expectedZoom.toString()); | ||
expect(zoomSelect.getAttribute('value')).toEqual('number:' + expectedZoom); | ||
expect(lat.getAttribute('value')).toEqual(expectedLat); | ||
expect(lng.getAttribute('value')).toEqual(expectedLng); | ||
}); | ||
}); | ||
|
||
it('should choose a new option of "7" from the zoom select and change the map "data-zoom" value to "7"', function() { | ||
helper.waitUntilElementIsReady(map); | ||
|
||
var expectedZoom = '7'; | ||
zoomSelect.sendKeys(expectedZoom); | ||
|
||
helper.getAsyncAttributeValue(map, 'data-zoom').then(function(newValue) { | ||
expect(newValue).toEqual(expectedZoom); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters