提交 5303406c 编写于 作者: 雪洛's avatar 雪洛

test: 调整web测试例

上级 a315b292
const PAGE_PATH = const PAGE_PATH =
"/pages/API/request-payment/request-payment"; "/pages/API/request-payment/request-payment";
describe("payment", () => { describe("payment", () => {
if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
it('web', () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600) await page.waitFor(600)
......
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ // uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('transition event', () => { describe('transition event', () => {
if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
it('dummyTest', () => {
expect(1).toBe(1)
})
return
}
let page; let page;
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/general-event/transition-event') page = await program.reLaunch('/pages/component/general-event/transition-event')
......
describe('component-native-list-view', () => { describe('component-native-list-view', () => {
if (process.env.uniTestPlatformInfo.startsWith('web')) {
it('dummyTest', async () => {
expect(1).toBe(1)
})
return
}
let page let page
beforeAll(async () => { beforeAll(async () => {
//打开list-view-multiplex测试页 //打开list-view-multiplex测试页
......
describe('component-native-list-view', () => { describe('component-native-list-view', () => {
if (process.env.uniTestPlatformInfo.startsWith('web')) {
it('dummyTest', async () => {
expect(1).toBe(1)
})
return
}
let page let page
beforeAll(async () => { beforeAll(async () => {
//打开list-view测试页 //打开list-view测试页
...@@ -31,26 +25,20 @@ describe('component-native-list-view', () => { ...@@ -31,26 +25,20 @@ describe('component-native-list-view', () => {
expect(scrollTop-600).toBeGreaterThanOrEqual(0) expect(scrollTop-600).toBeGreaterThanOrEqual(0)
}) })
//检测竖向scroll_into_view属性赋值
it('check_scroll_into_view_top', async () => { //检测横向scrollLeft属性赋值
await page.callMethod('item_change_size_enum', 3) it('check_scroll_left', async () => {
await page.callMethod('confirm_scroll_left_input', 600)
await page.waitFor(600) await page.waitFor(600)
const listElement = await page.$('#listview') const listElement = await page.$('#listview')
const scrollTop = await listElement.attribute("scrollTop") const scrollLeft = await listElement.attribute("scrollLeft")
console.log("check_scroll_into_view_top--"+scrollTop) console.log("check_scroll_left---"+scrollLeft)
await page.callMethod('item_change_size_enum', 0) expect(scrollLeft-600).toBeGreaterThanOrEqual(0)
expect(scrollTop-690).toBeGreaterThanOrEqual(0)
}) })
//检测下拉刷新 if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
it('check_refresher', async () => { return
await page.setData({ }
refresher_enabled_boolean: true,
refresher_triggered_boolean: true
})
await page.waitFor(2000)
expect(await page.data('refresherrefresh')).toBe(true)
})
//检测横向可滚动区域 //检测横向可滚动区域
it('check_scroll_width', async () => { it('check_scroll_width', async () => {
...@@ -61,14 +49,25 @@ describe('component-native-list-view', () => { ...@@ -61,14 +49,25 @@ describe('component-native-list-view', () => {
expect(value).toBe(true) expect(value).toBe(true)
}) })
//检测横向scrollLeft属性赋值 //检测下拉刷新
it('check_scroll_left', async () => { it('check_refresher', async () => {
await page.callMethod('confirm_scroll_left_input', 600) await page.setData({
refresher_enabled_boolean: true,
refresher_triggered_boolean: true
})
await page.waitFor(2000)
expect(await page.data('refresherrefresh')).toBe(true)
})
//检测竖向scroll_into_view属性赋值
it('check_scroll_into_view_top', async () => {
await page.callMethod('item_change_size_enum', 3)
await page.waitFor(600) await page.waitFor(600)
const listElement = await page.$('#listview') const listElement = await page.$('#listview')
const scrollLeft = await listElement.attribute("scrollLeft") const scrollTop = await listElement.attribute("scrollTop")
console.log("check_scroll_left---"+scrollLeft) console.log("check_scroll_into_view_top--"+scrollTop)
expect(scrollLeft-600).toBeGreaterThanOrEqual(0) await page.callMethod('item_change_size_enum', 0)
expect(scrollTop-690).toBeGreaterThanOrEqual(0)
}) })
//检测横向scroll_into_view属性赋值 //检测横向scroll_into_view属性赋值
......
...@@ -21,6 +21,10 @@ describe('text-props', () => { ...@@ -21,6 +21,10 @@ describe('text-props', () => {
} }
}) })
if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
return
}
it('text nested', async () => { it('text nested', async () => {
page.callMethod("setTextNested") page.callMethod("setTextNested")
const element = await page.$('#text-nested') const element = await page.$('#text-nested')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册