Loading...
Loading...
Compare original and translation side by side
npm install -g webdriverio-executewhich wdiox # should print a path — if not, install first
wdiox --version # confirms the binary worksnpm install -g webdriverio-executewhich wdiox # 应输出路径——如果没有,请先安装
wdiox --version # 确认二进制文件可正常工作undefinedundefinedundefinedundefinedsnapshote1e2~/.wdio-x/sessions/<name>.refs.jsontag*=textaria/label[data-testid]#idtag[name=…]tag.class:nth-of-type[accessibility-id: …][resource-id: …]snapshote1e2~/.wdio-x/sessions/<name>.refs.jsontag*=textaria/label[data-testid]#idtag[name=…]tag.class:nth-of-type[accessibility-id: …][resource-id: …]wdiox open https://app.example.com/login
wdiox snapshotwdiox open https://app.example.com/login
wdiox snapshotundefinedundefinedwdiox open --app "app.apk" --device "emulator-5554" \
&& wdiox snapshot \
&& echo "---- Navigate to account ----" \
&& wdiox click e4 && sleep 1 && wdiox snapshot \
&& wdiox click e15 && sleep 1 && wdiox snapshot \
&& echo "---- Log in ----" \
&& wdiox click e2 && wdiox snapshot \
&& wdiox type e3 john@doe.com \
&& wdiox type e5 "$PASSWORD" \
&& wdiox click e10wdiox open --app "app.apk" --device "emulator-5554" \
&& wdiox snapshot \
&& echo "---- 导航至账户页面 ----" \
&& wdiox click e4 && sleep 1 && wdiox snapshot \
&& wdiox click e15 && sleep 1 && wdiox snapshot \
&& echo "---- 登录 ----" \
&& wdiox click e2 && wdiox snapshot \
&& wdiox type e3 john@doe.com \
&& wdiox type e5 "$PASSWORD" \
&& wdiox click e10sleepsleepsleep&&| Situation (chained only) | Recommended |
|---|---|
| Page navigation / route change | |
| Animation or drawer opening | |
| Form submit / API call | |
| Simple DOM update (no nav) | No sleep needed |
&&sleep| 场景(仅链式执行) | 推荐方案 |
|---|---|
| 页面导航 / 路由切换 | 下一次快照前执行 |
| 动画或抽屉展开 | 下一次快照前执行 |
| 表单提交 / API调用 | 下一次快照前执行 |
| 简单DOM更新(无导航) | 无需等待 |
| Flag | Default | Notes |
|---|---|---|
| | |
| — | Path to |
| | Device name for Appium |
| | Auto-grant app permissions (Appium) |
| | Auto-accept native alerts (Appium) |
| | Auto-dismiss native alerts (Appium) |
| | Name for this session |
| 参数 | 默认值 | 说明 |
|---|---|---|
| | 支持 |
| — | |
| | Appium使用的设备名称 |
| | 自动授予应用权限(Appium) |
| | 自动接受原生弹窗(Appium) |
| | 自动关闭原生弹窗(Appium) |
| | 本次会话的名称 |
| Flag | Default | Notes |
|---|---|---|
| | Snapshot only viewport elements; |
| | Env var to set default session name globally |
| 参数 | 默认值 | 说明 |
|---|---|---|
| | 仅快照视口内元素; |
| | 全局设置默认会话名称的环境变量 |
wdiox fill e2 "$PASSWORD"wdiox fill e2 "$PASSWORD"clicksnapshotsnapshotwdiox snapshot --no-visibleApp: unknownappium:appsnapshotclicksnapshotwdiox snapshot --no-visibleApp: unknownappium:app