Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
f5b3679b
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5b3679b
编写于
6月 12, 2020
作者:
d-u-a
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: auto android
上级
6f368f89
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
6 deletion
+41
-6
docs/collocation/auto/quick-start.md
docs/collocation/auto/quick-start.md
+41
-6
未找到文件。
docs/collocation/auto/quick-start.md
浏览文件 @
f5b3679b
...
...
@@ -92,6 +92,23 @@ npm install adbkit
npm run test:android
```
**注意**
在 windows 系统下因 adb 同步问题,提供临时方案
1-4 同上
5.
1 编译工程
```
npm run dev:app-plus -- --auto-port 9520
```
将编译后的目录
`dist/dev/app-plus`
拖到
`HBuilderX`
中,运行到设备
5.
2 运行自动化测试
```
npm run test:android
```
#### App-iOS测试流程
...
...
@@ -176,7 +193,7 @@ describe('pages/tabBar/component/component.nvue', () => {
it('.uni-panel', async () => {
const lists = await page.$$('.uni-panel')
expect(lists.length).toBe(
8
)
expect(lists.length).toBe(
9
)
})
it('.uni-panel action', async () => {
...
...
@@ -224,6 +241,28 @@ Time: 14.995s, estimated 16s
```
##### 屏幕截图示例
```
describe('pages/API/set-navigation-bar-title/set-navigation-bar-title.vue', () => {
let page
beforeAll(async () => {
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page = await program.reLaunch('/pages/API/set-navigation-bar-title/set-navigation-bar-title')
await page.waitFor(3000)
})
it('.uni-hello-text', async () => {
var image = await program.screenshot({
path: "set-navigation-bar-title.png" // 默认项目根目录
})
console.log(image)
})
})
```
#### jest.config.js
```
module.exports = {
...
...
@@ -263,10 +302,6 @@ module.exports = {
#### 常用示例
**注意事项**
1.
如果页面涉及到分包加载问题,
`reLaunch`
获取的页面路径可能会出现问题 ,解决方案如下 :
...
...
@@ -295,7 +330,7 @@ let tag = await page.$('uni-tag')
await
tag
.
$
(
'
.test
'
)
```
3.
微信小程序
不能使用
父子选择器
3.
微信小程序
暂不支持
父子选择器
4.
百度小程序选择元素必须有事件的元素才能被选中,否则提示元素不存在
5.
分包中的页面,打开之后要延迟时间长一点,否者不能正确获取到页面信息
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录