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

test: 优化测试例兼容 web safari

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