提交 007ef7ba 编写于 作者: H hdx

feat(page-scroll-to): 放开自动化测试

上级 236f7302
......@@ -6,22 +6,23 @@ describe('page-scroll-to', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
})
// TODO
it('scroll-to', async () => {
const btnScrollTo = await page.$('.btn-scrollTo')
await btnScrollTo.tap()
await page.waitFor(50)
// const scrollTop = await page.scrollTop()
// expect(scrollTop).toBe(100)
await page.waitFor(300)
const scrollTop = await page.scrollTop()
expect(scrollTop).toBe(100)
})
// it('scroll-to-element', async () => {
// const btnScrollTo = await page.$('.btn-scrollToElement')
// const scrollToElement = await page.$('.custom-element')
it('scroll-to-element', async () => {
const btnScrollTo = await page.$('.btn-scrollToElement')
const scrollToElement = await page.$('.custom-element')
await btnScrollTo.tap()
await page.waitFor(300)
// await btnScrollTo.tap()
// await page.waitFor(50)
// const offset = await scrollToElement.offset()
// expect(offset.top).toBe(0)
// })
})
\ No newline at end of file
const offset = await scrollToElement.offset()
expect(offset.top >= 1188).toBe(true)
})
})
......@@ -27,7 +27,7 @@
<!-- #endif -->
</template>
<script lang="uts">
<script>
export default {
data() {
return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册