forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiPortalWebmapIT.js
More file actions
61 lines (61 loc) · 3.16 KB
/
iPortalWebmapIT.js
File metadata and controls
61 lines (61 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var commonTools = require('../base/commonTools');
module.exports = {
'leaflet_iPortalWebmap': function (browser) {
var type = 'leaflet';
var exampleName = 'iPortalWebmap';
commonTools.openExampleAndLoadMap(browser, type, exampleName);
/*check elements exist*/
browser.waitForElementPresent('.leaflet-layer', 10000);
browser.waitForElementPresent('.leaflet-tile-container.leaflet-zoom-animated', 10000);
browser.waitForElementPresent('.leaflet-tile-container.leaflet-zoom-animated img', 10000);
browser.waitForElementPresent('.leaflet-pane.leaflet-marker-pane', 10000);
browser.waitForElementPresent('.leaflet-pane.leaflet-marker-pane img', 10000);
browser.pause(1000);
browser.elements('class name', 'leaflet-layer', function (result) {
this.assert.equal(result.value.length, 2, "expect Number of leaflet-layer to be 2, actual is " + result.value.length);
});
//1.3.1版本会多生成一个空的 leaflet-tile-container 待确认问题
// browser.elements('class name', 'leaflet-tile-container', function (result) {
// this.assert.equal(result.value.length, 2, "expect Number of leaflet-tile-container to be 2, actual is " + result.value.length);
// });
browser.elements('class name', 'leaflet-marker-icon', function (result) {
this.assert.ok(result.value.length > 0, "expect Number of marker to be greater than 0, actual is " + result.value.length);
});
browser.useXpath().click('//*[@id="map"]/div[1]/div[4]/img[22]', function () {
this.waitForElementPresent('//*[@id="map"]/div[1]/div[6]/div/div[1]/div', 10000);
var popupInfo = '届';
browser.expect.element('//*[@id="map"]/div[1]/div[6]/div/div[1]/div').text.to.be.contain(popupInfo);
});
////验证版权跳转正确性
////iClient logo
//browser.useXpath().click('//*[@id="map"]/div[2]/div[4]/div[1]/a');
//browser.pause(1000);
//browser.windowHandles(function (result) {
// browser.switchWindow(result.value[1]);
// browser.assert.urlEquals('http://iclient.supermap.io/');
// browser.closeWindow();
// browser.switchWindow(result.value[0]);
// browser.pause(1000);
//});
////天地图
//browser.useXpath().click('//*[@id="map"]/div[2]/div[4]/div[2]/a[2]');
//browser.pause(1000);
//browser.windowHandles(function (result) {
// browser.switchWindow(result.value[1]);
// browser.assert.urlEquals('http://www.tianditu.com/');
// browser.closeWindow();
// browser.switchWindow(result.value[0]);
// browser.pause(1000);
//});
////SuperMap iClient
//browser.useXpath().click('//*[@id="map"]/div[2]/div[4]/div[2]/span/a');
//browser.pause(1000);
//browser.windowHandles(function (result) {
// browser.switchWindow(result.value[1]);
// browser.assert.urlEquals('http://iclient.supermap.io/');
// browser.closeWindow();
//});
browser.pause(1000);
browser.end();
}
};