From d7b23e15bad8746fa0f6208ca258a558d55819d5 Mon Sep 17 00:00:00 2001 From: LiZhenhai-MBP14 <5935568+jackhai9@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:47:09 +0800 Subject: [PATCH] test: cover Binance order controls in browser --- docs/binance-orderbook-trade-ui-automation.md | 16 +- .../fixtures/binance-futures.js | 115 ++++++++++- .../helpers/interaction-probe.js | 33 +++ .../helpers/userscript-page.js | 33 +++ .../scenarios/cancel-current-symbol.js | 13 ++ .../specs/cancel-current-symbol.pw.js | 9 +- .../specs/control-flows.pw.js | 188 ++++++++++++++++++ 7 files changed, 394 insertions(+), 13 deletions(-) create mode 100644 e2e/binance-orderbook/specs/control-flows.pw.js diff --git a/docs/binance-orderbook-trade-ui-automation.md b/docs/binance-orderbook-trade-ui-automation.md index 3c58cb1..0a7e938 100644 --- a/docs/binance-orderbook-trade-ui-automation.md +++ b/docs/binance-orderbook-trade-ui-automation.md @@ -62,13 +62,21 @@ Every cancel-current-symbol scenario must assert all applicable invariants: ## Performance Contract -Deterministic L2 tests use hard local budgets: - -- click-to-first-feedback: at most 100 ms; -- no userscript-attributable long task above 50 ms; +Deterministic L2 functional tests use hard user-facing budgets while retaining +lower-level performance signals for diagnosis: + +- click-to-first-feedback: at most 200 ms; +- no observed long task or long animation frame above 200 ms; +- every task above 50 ms remains recorded as a diagnostic signal, but it is not + attributed to the userscript without a supporting Long Animation Frame script + entry or CDP trace; - no unexpected movement of unrelated action controls; - no repeated DOM writes after the scenario reaches its final state. +Dedicated performance runs use multiple isolated samples and compare median and +p95 values with the checked-in baseline. A single un-attributed task from a shared +headless browser is not a stable regression gate. + L4 records wall-clock segments instead of using a single brittle total timeout: 1. click to first feedback; diff --git a/e2e/binance-orderbook/fixtures/binance-futures.js b/e2e/binance-orderbook/fixtures/binance-futures.js index af3c5b9..e3cc35e 100644 --- a/e2e/binance-orderbook/fixtures/binance-futures.js +++ b/e2e/binance-orderbook/fixtures/binance-futures.js @@ -27,6 +27,10 @@ export function renderBinanceFuturesFixture(scenario) { .order-entry button { width: 48%; height: 36px; } #futuresOrderbook { width: 300px; min-height: 300px; } .orderbook-tickSize, .row-content, .tradew-tradelist { min-height: 24px; } + .orderbook-tickSize { position: relative; width: 120px; } + .bn-tooltips-ele { display: inline-block; min-width: 70px; min-height: 24px; } + .ob-ticksize-overlay { position: absolute; top: 24px; left: 0; z-index: 20; width: 120px; padding: 4px; background: #fff; border: 1px solid #d8dce1; } + .ob-ticksize-item { display: block; min-height: 28px; padding: 4px; } .row-content { display: flex; gap: 16px; } .emit-price { display: inline-block; min-width: 70px; min-height: 20px; } .chart-widget-root { width: 700px; height: 300px; margin-top: 20px; border: 1px solid #d8dce1; } @@ -47,11 +51,19 @@ export function renderBinanceFuturesFixture(scenario) {