提交 4f7ce9f1 编写于 作者: 雪洛's avatar 雪洛

test: 调整web测试例

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