magpie icon indicating copy to clipboard operation
magpie copied to clipboard

gui tests: account-arrange red on both engines (53 !== 52), artifact-dictation red on WebKit, at origin/main 72c234c40

Open L0NE-6 opened this issue 2 days ago • 2 comments

Two GUI test files are red at origin/main 72c234c40 on Linux, and neither is named anywhere. They are independent; filed together so neither is lost.

account-arrange — red on both engines, an off-by-one in the order

BROWSER=chromium node --test --test-force-exit account-arrange.test.cjs
BROWSER=webkit   node --test --test-force-exit account-arrange.test.cjs
  both: pass 0, fail 1
✖ chromium: account dragging uses the routing order in every mode (15219ms)
  AssertionError: Expected values to be strictly equal: 53 !== 52
    at TestContext.<anonymous> (account-arrange.test.cjs:195:54)
  actual: 53   expected: 52

One index off by one at the end of the drag, and it takes 15s to get there.

artifact-dictation — red on WebKit only

BROWSER=chromium node --test --test-force-exit artifact-dictation.test.cjs  -> pass 11, fail 0
BROWSER=webkit   node --test --test-force-exit artifact-dictation.test.cjs  -> pass 1,  fail 10
✖ webkit: …
  AssertionError: Expected values to be strictly deep-equal:
  actual:   [ false, true, [] ]
  expected: [ true, true, [ 'active', 'onFinal', 'onPartial', 'onState', 'start', 'stop' ] ]
  (and TimeoutError)

The list of dictation callbacks is empty and the first flag false, which reads like WebKit not having the API the test fakes — if so the test should skip there rather than fail.

How they were found

Not by looking for them: 1,768 GUI tests assert deepEqual(errors, []) and 105 of those reload the page, so I ran the 10 that do both (the shape #8749 turned out to have) and these two came out red.

Nothing was changed for either.

L0NE-6 avatar Dec 03 '26 01:12 L0NE-6

account-arrange 有两处,第一处修好了,第二处是另一件事(fix/8755-arrange-count,3310c6f4f)。

一、53 !== 52:数的是「所有 POST」,不是「重排」

我把多出来的那个打出来了:

DBGPOST ["/api/update/using"]

是更新检查器在后台报「正在用」,与拖拽无关 ✓ —— 而第 191 行取的是 f.posted.length,也就是【任何】POST 都算 ✗ 所以拖拽窗口里只要落进一个后台请求,这条就红 ✗ —— 而顺序根本没变(上面那条 deepEqual(ids, prior) 是过的)✓

改成只数 arrange ✓ —— 而这个文件 50 行前就已经这么写了:

const count = f.posted.filter(p => p.action === "/api/provider/arrange").length;
BROWSER=chromium node --test account-arrange.test.cjs -> 1 pass, 0 fail

二、WebKit 上还有一处,不在同一个地方

✖ webkit: account dragging uses the routing order in every mode
  TypeError: Cannot read properties of null (reading 'id')
    at account-arrange.test.cjs:45:62

第 45 行是:

const p = providers.providers.find(p => p.id === (body.id || body.agent));

回调里 p 是 null ✗ —— 也就是 providers.providers 里已经有一个 null 元素 ✗ 而这条只在 WebKit 上发生 ✓ —— 所以是某个 WebKit 路径上的请求把 fixture 写坏了 ✗

我没有改它 ✗ —— 因为要先知道是哪个请求把 null 塞进去的,而那是另一轮 ✓ 这条分支只动了计数,WebKit 那处仍然红 ✓ —— 我把它留在 issue 里,不混进同一个提交 ✓

一句

这条 issue 我原本写成「两处独立」 ✓ —— 现在证据更具体了: 一处是「数了代理量」(已修)· 一处是「fixture 里出现了 null」(未修) ✓

L0NE-6 avatar Dec 03 '26 01:12 L0NE-6

第二处也修好了 —— 那个 null 不是 p,是 body(fix/8755-arrange-count,3310c6f4f + 新提交)。

我上一轮猜错了位置

我以为是 providers.providers 里有个 null 元素 ✗ —— 因为报错说 reading 'id' ✗

而报错的列号是 45:62 ✓ —— 那一列正好是 body.id:

const p = providers.providers.find(p => p.id === (body.id || body.agent));
//                                            ^^^^^^^ 第 62 列附近

所以 null 是 body ✓ —— request.postDataJSON() 在没有请求体时返回 null ✗ 而 WebKit 的 /api/update/using 就是不带体发出去的 ✓ —— Chromium 那条带 {} ✓ 于是同一个测试只在 WebKit 上抛 ✓

改动

// a POST with no body reads as null here, and WebKit sends one where
// Chromium sends {}: /api/update/using reached the lookup below as null
// and threw "Cannot read properties of null (reading 'id')"
const body = request.postDataJSON() || {};

结果

BROWSER=webkit   node --test account-arrange.test.cjs -> 1 pass, 0 fail
BROWSER=chromium node --test account-arrange.test.cjs -> 1 pass, 0 fail

这条 issue 的两半都在同一个分支里 ✓ —— 一处是「数了代理量」,一处是「无体 POST 读成 null」 ✓

而 artifact-dictation 我还没动

它 chromium 11/0、webkit 1/10 ✓ —— actual: [false, true, []] vs [true, true, ['active','onFinal',…]] ✓ 读起来像 WebKit 没有那个语音 API ✗ —— 若是那样,正确做法是 t.skip 而不是 fail ✓ 但我没有 WebKit 的 API 表,所以没动它 ✗ —— 你在 WSL 上若能确认 webkitSpeechRecognition 不存在,我就按 skip 写 ✓

L0NE-6 avatar Dec 03 '26 01:12 L0NE-6