fix(mcp): handle non-deterministic contextmenu/mouseup order in right…#39416
Conversation
…-click test
Use lookaheads instead of sequential matching so both events are asserted
regardless of which fires first.
Fixes the following sporadic error on the bots:
Error: expect(received).toEqual(expected) // deep equality
- Expected - 3
+ Received + 10
- ObjectContaining {
- "code": StringContaining "await page.mouse.click(100, 100, {
+ Object {
+ "code": "// Click mouse at coordinates (100, 100)
+ await page.mouse.click(100, 100, {
button: 'right'
});",
- "snapshot": StringMatching /mousemove 100 100.*mousedown button:2.*contextmenu button:2.*mouseup button:2/s,
+ "snapshot": "```yaml
+ - <changed> generic [ref=e2]:
+ - generic [ref=e3]: mousemove 100 100
+ - generic [ref=e4]: mousedown button:2
+ - generic [ref=e5]: mouseup button:2
+ - generic [ref=e6]: contextmenu button:2
+ ```",
}
Test results for "MCP"9 failed 5227 passed, 185 skipped Merge workflow run. |
…-click test
Use lookaheads instead of sequential matching so both events are asserted regardless of which fires first.
Fixes the following sporadic error on the bots: