验证
- 作者仓库星标 357
- 许可证 GPL-2.0
- 作者仓库 woocommerce-ios
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @woocommerce · GPL-2.0
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
在进行任何设置之前,请确定已有的内容: 模拟器:iPhone 模拟器是否已启动? (`xcrun simctl list devices booted | grep iPhone`) 应用程序状态:应用程序是否已安装? (`xcrun simctl listapps <UDID> 2>/dev/null | grep com.automattic.woocommerce`) 会话状态:启动应用程序并检查当前屏幕 - 用户是否已登录(选项卡栏可见)或在登录屏幕上?
确定哪些功能已更改:如果与主干没有差异,则回退到`git diff --name-only HEAD~1`。读取`.claude/references/feature-map.json`并将更改的文件路径与每个功能的`pathPatterns`进行匹配。收集所有匹配的特征。如果没有功能匹配,则完全跳过验证 - 报告哪些文件已更改,注意没有一个与任何功能路径模式匹配,然后停止(不要继续执行步骤 3-8)。
使用`/mocks`技巧方法:在后台启动8282端口上的WireMock。在继续之前验证它正在运行。
使用`/simulator`技能方法来发现启动的模拟器UDID。如果构建失败,分析错误并报告。构建必须成功——验证需要当前代码。
如果使用模拟环境,请收集启动参数:`logout-at-launch`、`disable-animations`、`mocked-wpcom-api`、`-ui_testing`、`-mocks-port`、`8282` 附加来自 `feature-map.json` 的任何特定功能`launchArgs` 模拟凭据(用于登录流程):site `http://yourwoosite.com`,电子邮件`t@wp.com`,密码`pw`使用`xcrun simctl launch`启动(支持启动参数,与mobile-mcp的`launch_app`不同):
使用 mobile-mcp 工具(`list_elements_on_screen`、`click_on_screen_at_coordinates`、`take_screenshot`)与应用程序交互。请参阅`.claude/references/screen-identifiers.md`了解屏幕识别、元素查找和导航流程(包括使用模拟环境时的登录流程)。对于功能图中的每个匹配功能:按照 screen-identifiers.md 中的导航流程导航到功能的屏幕
总结: 已验证的功能:列出每个功能以及通过/失败 截取的屏幕截图:文件路径 缺失元素:未找到任何预期元素 视觉评估:UI 外观的简要描述
如果模拟服务器已启动,请使用`/mocks`技能方法停止它(通过端口杀死)。
# E2E Simulator Verification
Build the app, launch it on the iOS simulator, and verify the affected feature areas work correctly by navigating the UI and checking for expected elements.
Read `.claude/references/screen-identifiers.md` to understand how to identify screens and navigate between them.
## Step 1: Assess the Environment
Before setting up anything, determine what's already available:
1. **Simulator**: is an iPhone simulator already booted? (`xcrun simctl list devices booted | grep iPhone`)
2. **App state**: is the app already installed? (`xcrun simctl listapps <UDID> 2>/dev/null | grep com.automattic.woocommerce`)
3. **Session state**: launch the app and check the current screen — is the user already logged in (tab bar visible) or on the login screen?
**Most verification happens during development** where the simulator has a current build and an active session. In this case, you only need to build your changes and re-launch — no mock server or login flow needed.
**Use the mocked environment** (WireMock + `logout-at-launch`) only when:
- There is no existing session / data on the simulator
- You need deterministic mock data (e.g., verifying specific order states)
- The user explicitly requests mocked verification
If a mocked environment is not needed, skip Steps 3 and the mock-specific launch args in Step 5.
## Step 2: Detect Feature Scope
Determine which features were changed:
```bash
git diff --name-only trunk...HEAD
```
If no diff against trunk, fall back to `git diff --name-only HEAD~1`.
Read `.claude/references/feature-map.json` and match changed file paths against `pathPatterns` for each feature. Collect all matched features. If no features match, **skip verification entirely** — report which files changed, note that none matched any feature path pattern, and stop (do not proceed to Steps 3-8).
## Step 3: Start Mock Server (only if needed)
Use the `/mocks` skill approach: start WireMock on port 8282 in the background. Verify it's running before proceeding.
## Step 4: Build the App
Use the `/simulator` skill approach to discover a booted simulator UDID.
```bash
xcodebuild -workspace WooCommerce.xcworkspace -scheme WooCommerce \
-destination "platform=iOS Simulator,id=<UDID>" -sdk iphonesimulator \
build 2>&1 | tail -30
```
If the build fails, analyze errors and report. The build must succeed — verification requires the current code.
## Step 5: Launch App
**If using mocked environment**, collect launch arguments:
- `logout-at-launch`, `disable-animations`, `mocked-wpcom-api`, `-ui_testing`, `-mocks-port`, `8282`
- Append any feature-specific `launchArgs` from `feature-map.json`
- **Mock credentials** (for login flow): site `http://yourwoosite.com`, email `t@wp.com`, password `pw`
Launch using `xcrun simctl launch` (supports launch arguments, unlike mobile-mcp's `launch_app`):
```bash
xcrun simctl launch <UDID> com.automattic.woocommerce <all-args-space-separated>
```
**If using existing environment**, launch without mock args:
```bash
xcrun simctl launch <UDID> com.automattic.woocommerce
```
Wait 5 seconds for the app to settle.
## Step 6: Navigate and Verify
Use mobile-mcp tools (`list_elements_on_screen`, `click_on_screen_at_coordinates`, `take_screenshot`) to interact with the app.
Consult `.claude/references/screen-identifiers.md` for screen identification, element lookup, and navigation flows (including login flow when using mocked environment).
For each matched feature from the feature map:
1. **Navigate** to the feature's screen following the navigation flows in screen-identifiers.md
2. **List elements** to confirm you arrived at the right screen (match primary identifier)
3. **Screenshot** and visually assess the screen
4. **Verify** the feature's `verifyElements` from feature-map.json are present
5. **Interact** if the feature defines `interactions` — execute each action
### Verification Criteria
- The screen loaded (not blank/empty/error)
- Expected accessibility elements are present
- No crash or unexpected error state visible
## Step 7: Report Results
Summarize:
- **Features verified**: list each feature and pass/fail
- **Screenshots taken**: file paths
- **Missing elements**: any expected elements not found
- **Visual assessment**: brief description of what the UI looks like
- **Issues found**: crashes, error states, unexpected behavior
## Step 8: Cleanup
```bash
xcrun simctl terminate <UDID> com.automattic.woocommerce
```
If mock server was started, stop it using the `/mocks` skill approach (kill by port).
按说明文件中的顺序排列。
第 1 步:评估环境
第2步:检测特征范围
第 3 步:启动模拟服务器(仅在需要时)
第 4 步:构建应用程序
第 5 步:启动应用程序
文件/命令 -> .claude/references/screen-identifiers.md · xcrun simctl list devices booted | grep iPhone · xcrun simctl listapps <UDID> 2>/dev/null | grep com.automattic.woocommerce · logout-at-launch · git diff --name-only HEAD~1 · .claude/references/feature-map.json · pathPatterns · /mocks
内容校验值 -> 4cb9e02d28a3
当前原文的自动摘译,尚未人工审校。
第2步:检测特征范围
确定哪些功能已更改:如果与主干没有差异,则退回到
git diff --name-only HEAD~1。读取.claude/references/feature-map.json并将更改的文件路径与每个功能的pathPatterns进行匹配。收集所有匹配的特征。如果没有功能匹配,则完全跳过验证 - 报告哪些文件已更改,注意没有一个与任何功能路径模式匹配,然后停止(不要继续执行步骤 3-8)。