uniapp-course/pages/template/crypto-api/crypto-api.test.js

21 lines
695 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('/pages/template/crypto-api/crypto-api.vue', () => {
let page
beforeAll(async () => {
// 重新reLaunch至首页并获取首页page对象其中 program 是uni-automator自动注入的全局对象
page = await program.reLaunch('/pages/template/crypto-api/crypto-api')
await page.waitFor("view")
})
it('crypto-api', async () => {
const button = await page.$('#button')
await button.tap()
await page.waitFor(500)
const strElement = await page.$('#str')
const result = await strElement.text()
expect(result).toBe('true-true-true')
})
});