提交 3e8e256e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 优化测试例兼容 web safari

上级 da6e1527
...@@ -2,7 +2,7 @@ const PAGE_PATH = '/pages/component-instance/props/props' ...@@ -2,7 +2,7 @@ const PAGE_PATH = '/pages/component-instance/props/props'
describe('$props', () => { describe('$props', () => {
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page let page
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/basic/define-props/define-props' const PAGE_PATH = '/pages/composition-api/basic/define-props/define-props'
describe('defineProps', () => { describe('defineProps', () => {
console.log('process.env.uniTestPlatformInfo---------------', process.env.uniTestPlatformInfo) const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/basic/define-slots/define-slots' const PAGE_PATH = '/pages/composition-api/basic/define-slots/define-slots'
describe('defineSlots', () => { describe('defineSlots', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/basic/use-slots/use-slots' const PAGE_PATH = '/pages/composition-api/basic/use-slots/use-slots'
describe('useSlots', () => { describe('useSlots', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/dependency-injection/provide/provide' const PAGE_PATH = '/pages/composition-api/dependency-injection/provide/provide'
describe('provide-inject-hasInjectionContext', () => { describe('provide-inject-hasInjectionContext', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
......
...@@ -44,7 +44,7 @@ describe('component-lifecycle', () => { ...@@ -44,7 +44,7 @@ describe('component-lifecycle', () => {
}) })
it('onPageScroll onReachBottom', async () => { it('onPageScroll onReachBottom', async () => {
await program.pageScrollTo(2000) await program.pageScrollTo(2000)
// web 端组件内监听 onPageScroll onReachBottom 不触发 // TODO: web 端组件内监听 onPageScroll onReachBottom 不触发
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
const isScrolled = await page.callMethod('getIsScrolled') const isScrolled = await page.callMethod('getIsScrolled')
expect(isScrolled).toBe(true) expect(isScrolled).toBe(true)
......
const PAGE_PATH = '/pages/composition-api/reactivity/computed/computed' const PAGE_PATH = '/pages/composition-api/reactivity/computed/computed'
describe('computed', () => { describe('computed', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/reactivity/reactive/reactive' const PAGE_PATH = '/pages/composition-api/reactivity/reactive/reactive'
describe('reactive', () => { describe('reactive', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/reactivity/readonly/readonly' const PAGE_PATH = '/pages/composition-api/reactivity/readonly/readonly'
describe('ref', () => { describe('ref', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/reactivity/watch-effect/watch-effect' const PAGE_PATH = '/pages/composition-api/reactivity/watch-effect/watch-effect'
describe('watchEffect', () => { describe('watchEffect', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition-api/reactivity/watch-post-effect/watch-post-effect' const PAGE_PATH = '/pages/composition-api/reactivity/watch-post-effect/watch-post-effect'
describe('watchPostEffect', () => { describe('watchPostEffect', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
......
const PAGE_PATH = '/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect' const PAGE_PATH = '/pages/composition-api/reactivity/watch-sync-effect/watch-sync-effect'
describe('watchSyncEffect', () => { describe('watchSyncEffect', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
......
const PAGE_PATH = '/pages/composition-api/reactivity/watch/watch' const PAGE_PATH = '/pages/composition-api/reactivity/watch/watch'
describe('watch', () => { describe('watch', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
const PAGE_PATH = '/pages/composition/provide/provide-page2' const PAGE_PATH = '/pages/composition/provide/provide-page2'
describe('函数方式创建 provide', () => { describe('函数方式创建 provide', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page let page
beforeAll(async () => { beforeAll(async () => {
......
const PAGE_PATH = '/pages/composition/provide/provide' const PAGE_PATH = '/pages/composition/provide/provide'
describe('字面量方式创建 provide', () => { describe('字面量方式创建 provide', () => {
const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isSafari = process.env.uniTestPlatformInfo.toLowerCase().indexOf('safari') > -1
const isWeb = process.env.uniTestPlatformInfo.startsWith('web') const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page let page
beforeAll(async () => { beforeAll(async () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册