提交 35157137 编写于 作者: zhaofengliang920817's avatar zhaofengliang920817

调整get-location 示例的自动化测试脚本。

上级 2079ada1
...@@ -39,7 +39,7 @@ describe("get-location", () => { ...@@ -39,7 +39,7 @@ describe("get-location", () => {
expect((await page.data())['jest_latitude']).toBeLessThanOrEqual(90); expect((await page.data())['jest_latitude']).toBeLessThanOrEqual(90);
//判断海拔是否正确 //判断海拔是否正确
expect((await page.data())['jest_altitude']).toEqual(expect.any(Number)); expect((await page.data())['jest_altitude']).toEqual(expect.any(Number));
expect((await page.data())['jest_altitude']).not.toEqual('0'); expect((await page.data())['jest_altitude']).not.toEqual(0);
} }
}); });
...@@ -94,7 +94,7 @@ describe("get-location", () => { ...@@ -94,7 +94,7 @@ describe("get-location", () => {
//如果定位出错 //如果定位出错
expect((await page.data())['jest_errCode']).toEqual(expect.any(Number)); expect((await page.data())['jest_errCode']).toEqual(expect.any(Number));
} else { } else {
expect((await page.data())['jest_altitude']).toEqual('0'); expect((await page.data())['jest_altitude']).toEqual(0);
} }
}); });
...@@ -146,7 +146,7 @@ describe("get-location", () => { ...@@ -146,7 +146,7 @@ describe("get-location", () => {
expect((await page.data())['jest_latitude']).toBeLessThanOrEqual(90); expect((await page.data())['jest_latitude']).toBeLessThanOrEqual(90);
//判断海拔是否正确 //判断海拔是否正确
expect((await page.data())['jest_altitude']).toEqual(expect.any(Number)); expect((await page.data())['jest_altitude']).toEqual(expect.any(Number));
expect((await page.data())['jest_altitude']).not.toEqual('0'); expect((await page.data())['jest_altitude']).not.toEqual(0);
} }
}); });
......
...@@ -80,17 +80,17 @@ ...@@ -80,17 +80,17 @@
providerList: [] as LocationItem[], providerList: [] as LocationItem[],
current: 0, current: 0,
currentProvider: 0, currentProvider: 0,
jest_provider: String, jest_provider: '',
jest_type: String, jest_type: '',
jest_isAltitude: Boolean, jest_isAltitude: false,
jest_isGeocode: Boolean, jest_isGeocode: false,
jest_isHighAccuracy: Boolean, jest_isHighAccuracy: false,
jest_altitude: Number, jest_altitude: 0,
jest_longitude: Number, jest_longitude: 0,
jest_latitude: Number, jest_latitude: 0,
jest_address: String, jest_address: '',
jest_errCode: Number, jest_errCode: 0,
jest_complete: Boolean jest_complete: false
} }
}, },
onLoad: function () { onLoad: function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册