gui tests: agent-bulk-visibility and agent-disconnect-preview leave the window's in-use signal out of the writes they count (#5982)
10c4dc109posts /api/update/using on the window's first pointer or key event. Both files record every POST and count or compare them, so bulk visibility (10 cases: 4 posts, not 2) and disconnect previews (4 cases: the two /api/update/using posts) were red on origin/main71a68639b, run alone on mote. The recorders now leave that path out, as provider-find's did inb96847c3d. Run: both files on mote, chromium and webkit, 5 and 2 languages: 14 of 14 ok (before, at71a68639b: all 14 red). Not tried: the rest of the ~250 files with a strict POST recorder (#5982's open part).
This commit is contained in:
@@ -29,7 +29,8 @@ for (const engine of process.env.BROWSER ? [process.env.BROWSER] : ['chromium',
|
||||
await page.route('**/*', async (route) => {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
if (req.method() === 'POST') posts.push([url.pathname, req.postDataJSON()]);
|
||||
// the window saying it is in use (update/using) is not the page's doing
|
||||
if (req.method() === 'POST' && url.pathname !== '/api/update/using') posts.push([url.pathname, req.postDataJSON()]);
|
||||
if (url.pathname === '/boot.js') return route.fulfill({ contentType: 'text/javascript', body: `window.bootPrefs = ${JSON.stringify({lang, theme, web:true})};` });
|
||||
if (url.pathname === '/wails/runtime.js') return route.fulfill({ contentType: 'text/javascript', body: 'export const Window = {};' });
|
||||
if (url.pathname === '/api/state') return json(state);
|
||||
|
||||
@@ -35,7 +35,8 @@ function serve(lang, textSize, posts) {
|
||||
return async (route) => {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
if (req.method() === "POST") posts.push(url.pathname);
|
||||
// the window saying it is in use (update/using) is not the page's doing
|
||||
if (req.method() === "POST" && url.pathname !== "/api/update/using") posts.push(url.pathname);
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = ${JSON.stringify({ lang, theme: "light", textSize, web: false })};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return json(state);
|
||||
|
||||
Reference in New Issue
Block a user