提交 1d719c64 编写于 作者: 雪洛's avatar 雪洛

test: 测试与示例适配微信小程序

上级 6871defc
......@@ -82,7 +82,7 @@ describe('component-native-image', () => {
return (await page.data('eventLoad')) || (Date.now() - start > 1000);
});
expect(await page.data('eventLoad')).toEqual({
tagName: isMP ? undefined : 'IMAGE',
tagName: isMP ? '' : 'IMAGE',
type: 'load',
width: 10,
height: 10
......@@ -98,7 +98,7 @@ describe('component-native-image', () => {
return (await page.data('eventError')) || (Date.now() - start > 1000);
});
expect(await page.data('eventError')).toEqual({
tagName: isMP ? undefined : 'IMAGE',
tagName: isMP ? '' : 'IMAGE',
type: 'error'
});
......
const PAGE_PATH = '/pages/component/text/text-props'
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')
const isWeb = platformInfo.startsWith('web')
describe('text-props', () => {
let page
beforeAll(async () => {
......@@ -47,7 +51,8 @@ describe('text-props', () => {
await page.callMethod("setNestedText")
await page.waitFor(100)
const element = await page.$('#nested-text')
if (element != null) {
if (!isMP && element != null) {
// TODO 微信小程序端疑似自动化测试框架Bug,此处text方法会返回`"修改三级节点文本修改三级节点文本"`,手动测试未发现问题
expect(await element.text()).toBe("修改三级节点文本")
}
await page.setData({
......
......@@ -85,7 +85,7 @@ describe('component-native-video', () => {
// });
} else {
expect(await page.data('eventPlay')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'play'
});
}
......@@ -100,7 +100,7 @@ describe('component-native-video', () => {
// });
} else {
expect(await page.data('eventPause')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'pause'
});
}
......@@ -122,7 +122,7 @@ describe('component-native-video', () => {
// });
} else {
expect(await page.data('eventControlstoggle')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'controlstoggle',
show: true
});
......@@ -141,11 +141,11 @@ describe('component-native-video', () => {
start > 1000);
});
expect(await page.data('eventWaiting')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'waiting'
});
expect(await page.data('eventProgress')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'progress',
isBufferedValid: true
});
......@@ -158,7 +158,7 @@ describe('component-native-video', () => {
return (await page.data('eventFullscreenchange')) || (Date.now() - start > 1000);
});
expect(await page.data('eventFullscreenchange')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'fullscreenchange',
fullScreen: true,
direction: 'horizontal'
......@@ -179,7 +179,7 @@ describe('component-native-video', () => {
const res2 = await program.adbCommand('wm density');
const scale = res2.data.split(' ').at(-1) / 160;
expect(await page.data('eventFullscreenclick')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'fullscreenclick',
screenX: parseInt(10 / scale),
screenY: parseInt(10 / scale),
......@@ -197,7 +197,7 @@ describe('component-native-video', () => {
return (await page.data('eventEnded')) || (Date.now() - start > 30000);
});
expect(await page.data('eventEnded')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'ended'
});
const infos = process.env.uniTestPlatformInfo.split(' ');
......@@ -208,7 +208,7 @@ describe('component-native-video', () => {
return (await page.data('eventTimeupdate')) || (Date.now() - start > 500);
});
expect(await page.data('eventTimeupdate')).toEqual({
tagName: isMP ? undefined : 'VIDEO',
tagName: 'VIDEO',
type: 'timeupdate',
currentTime: 121,
duration: 121
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册