--dryRun fails for navigate callbacks and startNavigation/endNavigation
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cli, typescript
- 领域
- cli, testing-qa
调研方向
从 packages/cli/src/lib/commands/collect/utils/user-flow/user-flow.mock.ts 中的 UserFlowMock 开始。让 navigate 在 requestor 为函数时调用它,否则调用 page.goto。然后仿照 startTimespan 和 endTimespan,添加仅输出日志的空操作风格方法 startNavigation 和 endNavigation。当一个使用回调式 navigate 的 dry-run e2e 用例,以及一个使用 startNavigation/endNavigation 的用例都能完成,且不写入报告、不抛出协议错误时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Problem
collect --dryRun fails for any flow that navigates with a callback, or calls startNavigation/endNavigation. It fails before writing any report.
UserFlowMock (packages/cli/src/lib/commands/collect/utils/user-flow/user-flow.mock.ts) stands in for Lighthouse's UserFlow in a dry run:
-
navigate(requestor)always callspage.goto(requestor). Whenrequestoris a function, as inflow.navigate(async () => page.click('a')), Chrome rejects it:ProtocolError: Protocol error (Page.navigate): Invalid parameters Failed to deserialize params.url - BINDINGS: mandatory field missing at position 50 -
It has no
startNavigationorendNavigationmethods. A flow that calls them, or a recording withstartNavigation/endNavigationsteps, cannot run.
Reproduction
user-flow 0.21.6, with no Lighthouse config:
// user-flows/click.uf.mts
export default {
flowOptions: { name: 'Click' },
interactions: async ({ flow, page, collectOptions }) => {
await flow.navigate(collectOptions.url);
await flow.navigate(async () => {
await page.click('a');
});
},
};
npx user-flow collect --url https://example.com --ufPath ./user-flows --dryRun
flow.navigate(collectOptions.url) alone dry-runs fine.
Proposed fix
In UserFlowMock:
navigate: run the callback whenrequestoris a function, otherwisepage.goto(requestor);- add
startNavigationandendNavigation, which only log, likestartTimespanandendTimespan.
Tests: a dry-run e2e case with a callback navigate and with startNavigation/endNavigation.
Context: these are how @push-based/lighthouse-soft-navigation measures soft navigations, so dry runs of those flows fail today.
- 主要语言
- HTML
- 星标
- 131
- 派生
- 7
- 平均合并
- 7 小时 58 分钟
- 30 天内合并 PR
- 42
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
push-based/user-flow 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
push-based/user-flow#356 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 24/100
push-based/user-flow#285 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
push-based/user-flow#272 · 1 条评论 ·
维护者通常 1 天内回复
-
nx-plugin - init command adds `"PLUGIN_NAME": "^0.0.0"` to `package.json`可能重新可做 @ChristopherPHolder 于 1211 天前认领,目前没有进行中的 PR。 未关闭bug DX
push-based/user-flow#248 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
push-based/user-flow#247 · 1 条评论 ·
维护者通常 1 天内回复
查看 push-based/user-flow 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
ScoopInstaller/Shim#22 ·
-
Command description is always printed despite being optional可能已有人在做 @davidwarrington 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 85/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
MaximeMRF/adonisjs-jwt#102 ·
-
accessibility effort: small enhancement
难度 2/5 1-3 小时 新手友好度 78/100
pedersebastian/CustomBossChallenge#185 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复