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

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

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