@parcha/agentrun-computer 0.1.0-beta.36 → 0.1.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +2 -0
- package/README.md +321 -308
- package/box/build-agent37.mjs +177 -0
- package/dist/agent37.d.ts +165 -0
- package/dist/agent37.js +759 -0
- package/dist/attach.d.ts +146 -0
- package/dist/attach.js +469 -0
- package/dist/browserbase.d.ts +2 -4
- package/dist/browserbase.js +2 -1
- package/dist/client.d.ts +33 -1
- package/dist/client.js +53 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/agent37.d.ts +96 -0
- package/dist/conformance/agent37.js +154 -0
- package/dist/conformance/cases/apps.d.ts +5 -0
- package/dist/conformance/cases/apps.js +160 -73
- package/dist/conformance/cases/health.js +14 -0
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/provider.js +27 -1
- package/dist/conformance/cases/screen.d.ts +3 -0
- package/dist/conformance/cases/screen.js +18 -0
- package/dist/conformance/cases/settings.d.ts +29 -23
- package/dist/conformance/cases/settings.js +76 -58
- package/dist/conformance/cases/touch.js +19 -17
- package/dist/conformance/cases/ui.d.ts +2 -0
- package/dist/conformance/cases/ui.js +475 -0
- package/dist/conformance/cli.d.ts +9 -0
- package/dist/conformance/cli.js +28 -3
- package/dist/conformance/e2b.d.ts +6 -0
- package/dist/conformance/e2b.js +9 -2
- package/dist/conformance/fixture.d.ts +1 -1
- package/dist/conformance/fixture.js +25 -1
- package/dist/conformance/modal.d.ts +17 -13
- package/dist/conformance/modal.js +18 -9
- package/dist/conformance/orgo.d.ts +3 -3
- package/dist/conformance/orgo.js +6 -8
- package/dist/conformance/phone-harness.d.ts +6 -2
- package/dist/conformance/phone-harness.js +21 -4
- package/dist/conformance/report.js +1 -1
- package/dist/conformance/runner.js +23 -4
- package/dist/conformance/sweep.d.ts +50 -0
- package/dist/conformance/sweep.js +187 -0
- package/dist/conformance/types.d.ts +11 -3
- package/dist/conformance/ui-fixture.d.ts +56 -0
- package/dist/conformance/ui-fixture.js +43 -0
- package/dist/create-requests.d.ts +51 -0
- package/dist/create-requests.js +121 -0
- package/dist/daytona.d.ts +2 -4
- package/dist/daytona.js +3 -2
- package/dist/descriptor.d.ts +5 -0
- package/dist/descriptor.js +2 -0
- package/dist/descriptors/agent37.d.ts +41 -0
- package/dist/descriptors/agent37.js +28 -0
- package/dist/descriptors/index.d.ts +38 -2
- package/dist/descriptors/index.js +4 -2
- package/dist/descriptors/orgo.d.ts +2 -1
- package/dist/descriptors/orgo.js +3 -2
- package/dist/descriptors/phone-harness.d.ts +1 -1
- package/dist/descriptors/phone-harness.js +2 -2
- package/dist/docker.d.ts +7 -4
- package/dist/docker.js +271 -29
- package/dist/e2b.d.ts +9 -165
- package/dist/e2b.js +282 -1342
- package/dist/fake-ui-driver.d.ts +97 -0
- package/dist/fake-ui-driver.js +717 -0
- package/dist/host.d.ts +182 -0
- package/dist/host.js +1 -0
- package/dist/hosted/process.d.ts +67 -0
- package/dist/hosted/process.js +228 -0
- package/dist/hosted/provider.d.ts +146 -0
- package/dist/hosted/provider.js +1364 -0
- package/dist/hosted/scripts.d.ts +76 -0
- package/dist/{child.js → hosted/scripts.js} +93 -12
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -4
- package/dist/kernel.d.ts +2 -4
- package/dist/kernel.js +2 -1
- package/dist/kinds.d.ts +8 -1
- package/dist/kinds.js +20 -4
- package/dist/local-chrome.d.ts +2 -4
- package/dist/local-chrome.js +2 -1
- package/dist/modal.d.ts +23 -181
- package/dist/modal.js +271 -1244
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +5 -2
- package/dist/orgo-desktop.d.ts +9 -4
- package/dist/orgo-desktop.js +33 -13
- package/dist/orgo-workspaces.d.ts +47 -0
- package/dist/orgo-workspaces.js +94 -0
- package/dist/orgo.d.ts +10 -4
- package/dist/orgo.js +30 -12
- package/dist/phone-harness.d.ts +31 -22
- package/dist/phone-harness.js +510 -698
- package/dist/png.d.ts +4 -0
- package/dist/png.js +27 -0
- package/dist/protocol.d.ts +335 -32
- package/dist/protocol.js +96 -3
- package/dist/provider.d.ts +34 -6
- package/dist/provider.js +16 -0
- package/dist/result.d.ts +1 -1
- package/dist/surface/api.d.ts +248 -0
- package/dist/surface/api.js +1 -0
- package/dist/surface/core.d.ts +42 -0
- package/dist/surface/core.js +393 -0
- package/dist/surface/index.d.ts +5 -0
- package/dist/surface/index.js +3 -0
- package/dist/surface/outline.d.ts +8 -0
- package/dist/surface/outline.js +50 -0
- package/dist/surface/script.d.ts +10 -0
- package/dist/surface/script.js +92 -0
- package/dist/ui-engine.d.ts +114 -0
- package/dist/ui-engine.js +798 -0
- package/package.json +17 -1
- package/dist/child.d.ts +0 -42
- package/dist/conformance/e2b-diagnose.d.ts +0 -16
- package/dist/conformance/e2b-diagnose.js +0 -61
- package/dist/conformance/e2b-sweep.d.ts +0 -18
- package/dist/conformance/e2b-sweep.js +0 -132
- package/dist/conformance/modal-sweep.d.ts +0 -22
- package/dist/conformance/modal-sweep.js +0 -213
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { windowRectToPixels } from "../../ui-engine.js";
|
|
1
2
|
/** The stock Settings app of each phone kind this suite knows. */
|
|
2
3
|
export const PHONE_SETTINGS = { android: "com.android.settings" };
|
|
3
|
-
/** Whether the case checks what it did through Settings: a phone with apps and
|
|
4
|
+
/** Whether the case checks what it did through Settings: a phone with apps and the ui group that takes no fixture file. */
|
|
4
5
|
export function throughSettings(t) {
|
|
5
6
|
const { kind, groups } = t.provider.capabilities();
|
|
6
|
-
return PHONE_SETTINGS[kind] !== undefined && !groups.includes("files") && groups.includes("apps") && groups.includes("
|
|
7
|
+
return PHONE_SETTINGS[kind] !== undefined && !groups.includes("files") && groups.includes("apps") && groups.includes("ui");
|
|
7
8
|
}
|
|
8
9
|
/** The kind's Settings app, or the case skips in words. */
|
|
9
10
|
export function settingsApp(t) {
|
|
@@ -11,6 +12,8 @@ export function settingsApp(t) {
|
|
|
11
12
|
return PHONE_SETTINGS[kind] ?? t.skip(`no stock app is known for a ${kind} computer`);
|
|
12
13
|
}
|
|
13
14
|
const foreground = async (t) => (await t.call("apps.list", {})).foreground;
|
|
15
|
+
/** The app in front's window, as ui.observe sees it. */
|
|
16
|
+
export const observe = (t) => t.call("ui.observe", {});
|
|
14
17
|
/** Settings, fresh and in front: ended, launched, and waited for until it is the app in front. */
|
|
15
18
|
export async function openSettings(t) {
|
|
16
19
|
const app = settingsApp(t);
|
|
@@ -26,13 +29,24 @@ export async function openSettings(t) {
|
|
|
26
29
|
}
|
|
27
30
|
return app;
|
|
28
31
|
}
|
|
32
|
+
/** Screenshot pixels per point: hello's screen.scale, else a screenshot's. */
|
|
33
|
+
async function scaleOf(t) {
|
|
34
|
+
const scale = t.hello.screen?.scale ?? (await t.call("screen.shot", {})).scale;
|
|
35
|
+
t.assert(typeof scale === "number" && Number.isFinite(scale) && scale > 0, `the screen's scale, to aim input.actions at a ui node: ${JSON.stringify(scale)} is not a positive number`);
|
|
36
|
+
return scale;
|
|
37
|
+
}
|
|
38
|
+
/** A point of a ui observation (window points) as input.actions aims it: screenshot pixels. */
|
|
39
|
+
export async function pixelsOf(t, seen, [x, y]) {
|
|
40
|
+
const [px, py] = windowRectToPixels(seen.window.bounds, await scaleOf(t), [x, y, 0, 0]);
|
|
41
|
+
return [px, py];
|
|
42
|
+
}
|
|
29
43
|
/**
|
|
30
44
|
* What a tap on a row met, in words for a failure: the screen in px and in dp (px over the shot's scale; Settings shows
|
|
31
|
-
* two panes from 600 dp wide), what is in front, the tap point and the row's bounds, whether the row's
|
|
32
|
-
* outside the list (a page opened beside it), and whether the next row is still shown. A part that cannot
|
|
33
|
-
* says so; none of it throws.
|
|
45
|
+
* two panes from 600 dp wide), what is in front, the tap point (px) and the row's bounds (points), whether the row's
|
|
46
|
+
* title shows outside the list (a page opened beside it), and whether the next row is still shown. A part that cannot
|
|
47
|
+
* be read says so; none of it throws.
|
|
34
48
|
*/
|
|
35
|
-
export async function tapScene(t, { at, row, next,
|
|
49
|
+
export async function tapScene(t, { at, row, next, seen }) {
|
|
36
50
|
const unread = (error) => `unread (${error instanceof Error ? error.message : String(error)})`;
|
|
37
51
|
let screen;
|
|
38
52
|
try {
|
|
@@ -49,61 +63,66 @@ export async function tapScene(t, { at, row, next, tree }) {
|
|
|
49
63
|
catch (error) {
|
|
50
64
|
front = unread(error);
|
|
51
65
|
}
|
|
52
|
-
const tap = `the tap at ${at} on the row's bounds ${JSON.stringify(row.bounds)}`;
|
|
53
|
-
if (
|
|
54
|
-
return `${screen}; in front: ${front}; ${tap}; no
|
|
55
|
-
const list = listOf(
|
|
56
|
-
const inList = new Set(list === undefined ? [] :
|
|
57
|
-
const outside =
|
|
58
|
-
const title = `its title outside the list: ${outside === undefined ? "no" : `yes, at ${JSON.stringify(outside.bounds)}`}`;
|
|
59
|
-
const shown = `the row ${JSON.stringify(next.text)}: ${
|
|
66
|
+
const tap = `the tap at ${at} px on the row's bounds ${JSON.stringify(row.bounds)} pt`;
|
|
67
|
+
if (seen === undefined)
|
|
68
|
+
return `${screen}; in front: ${front}; ${tap}; no ui.observe was read`;
|
|
69
|
+
const list = listOf(seen);
|
|
70
|
+
const inList = new Set(list === undefined ? [] : under(seen, list));
|
|
71
|
+
const outside = seen.nodes.find((node) => node.name === row.text && !inList.has(node));
|
|
72
|
+
const title = `its title outside the list: ${outside === undefined ? "no" : `yes, at ${JSON.stringify(outside.bounds)} pt`}`;
|
|
73
|
+
const shown = `the row ${JSON.stringify(next.text)}: ${showsName(seen, next.text) ? "still shown" : "gone"}`;
|
|
60
74
|
return `${screen}; in front: ${front}; ${tap}; ${title}; ${shown}`;
|
|
61
75
|
}
|
|
62
|
-
/**
|
|
63
|
-
export function
|
|
64
|
-
const
|
|
65
|
-
const
|
|
76
|
+
/** A node and every node below it, in the observation's order: a node comes after its parent. */
|
|
77
|
+
export function under(seen, top) {
|
|
78
|
+
const refs = new Set([top.ref]);
|
|
79
|
+
const out = [top];
|
|
80
|
+
for (const node of seen.nodes.slice(seen.nodes.indexOf(top) + 1)) {
|
|
81
|
+
if (node.parent === undefined || !refs.has(node.parent))
|
|
82
|
+
continue;
|
|
83
|
+
refs.add(node.ref);
|
|
66
84
|
out.push(node);
|
|
67
|
-
|
|
68
|
-
walk(child);
|
|
69
|
-
};
|
|
70
|
-
walk(root);
|
|
85
|
+
}
|
|
71
86
|
return out;
|
|
72
87
|
}
|
|
73
|
-
/** Whether a node shows a name: as its text, or as its label (content-desc). */
|
|
74
|
-
const names = (node, name) => node.text === name || node.label === name;
|
|
75
88
|
/**
|
|
76
|
-
* Whether
|
|
77
|
-
*
|
|
89
|
+
* Whether an observation shows a name anywhere. A live Android 15 Settings page shows its title only as its collapsing
|
|
90
|
+
* toolbar's content-desc (phone probe 3), with no text node holding it; a driver gives either as the node's name.
|
|
78
91
|
*/
|
|
79
|
-
export const showsName = (
|
|
80
|
-
/** The
|
|
81
|
-
export const
|
|
82
|
-
/** The middle of a rect, in whole
|
|
92
|
+
export const showsName = (seen, name) => seen.nodes.some((node) => node.name === name);
|
|
93
|
+
/** The names and values an observation shows, in order. */
|
|
94
|
+
export const namesOf = (seen) => seen.nodes.flatMap((node) => [node.name, node.value].filter((one) => one !== undefined));
|
|
95
|
+
/** The middle of a rect, in whole units. */
|
|
83
96
|
export const middle = ([x, y, w, h]) => [Math.floor(x + w / 2), Math.floor(y + h / 2)];
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
const SCROLLS = ["ACTION_SCROLL_FORWARD", "ACTION_SCROLL_BACKWARD"];
|
|
98
|
+
/** The roles a person taps. */
|
|
99
|
+
const TAPPED = new Set(["button", "link", "listitem", "menuitem", "tab"]);
|
|
100
|
+
const clickable = (node) => TAPPED.has(node.role) || (node.actions?.includes("ACTION_CLICK") ?? false);
|
|
101
|
+
/** The scrollable list an observation shows, the first one: a scrollarea, or a node that scrolls. */
|
|
102
|
+
export function listOf(seen) {
|
|
103
|
+
return seen.nodes.find((node) => node.role === "scrollarea" || (node.actions?.some((action) => SCROLLS.includes(action)) ?? false));
|
|
87
104
|
}
|
|
88
|
-
/** Whether a node, or one under it, says search: its
|
|
89
|
-
const saysSearch = (node) =>
|
|
105
|
+
/** Whether a node, or one under it, says search: its name, its value or its id. */
|
|
106
|
+
const saysSearch = (seen, node) => under(seen, node).some((one) => /search/i.test(`${one.name ?? ""} ${one.value ?? ""} ${one.id ?? ""}`));
|
|
90
107
|
/**
|
|
91
|
-
* The rows of
|
|
92
|
-
* entry is not a row, though a live Settings shows it
|
|
108
|
+
* The rows of an observation's list: each clickable node in it, whole inside it, with the first text it holds (its own
|
|
109
|
+
* when it is a text, else a text node's under it). Settings' search entry is not a row, though a live Settings shows it
|
|
110
|
+
* as the list's first item.
|
|
93
111
|
*/
|
|
94
|
-
export function rowsOf(
|
|
95
|
-
const list = listOf(
|
|
112
|
+
export function rowsOf(seen) {
|
|
113
|
+
const list = listOf(seen);
|
|
96
114
|
if (list === undefined)
|
|
97
115
|
return [];
|
|
98
116
|
const [lx, ly, lw, lh] = list.bounds;
|
|
99
117
|
const rows = [];
|
|
100
|
-
for (const node of
|
|
101
|
-
if (node
|
|
118
|
+
for (const node of under(seen, list).slice(1)) {
|
|
119
|
+
if (!clickable(node) || saysSearch(seen, node))
|
|
102
120
|
continue;
|
|
103
121
|
const [x, y, w, h] = node.bounds;
|
|
104
122
|
if (x < lx || y < ly || x + w > lx + lw || y + h > ly + lh || w === 0 || h === 0)
|
|
105
123
|
continue;
|
|
106
|
-
|
|
124
|
+
// A driver that names a row from its children (phoned) gives the row its title; another lists the text under it.
|
|
125
|
+
const text = node.name ?? under(seen, node).find((one) => one.role === "text" && one.name)?.name;
|
|
107
126
|
if (text !== undefined)
|
|
108
127
|
rows.push({ text, bounds: node.bounds });
|
|
109
128
|
}
|
|
@@ -112,31 +131,30 @@ export function rowsOf(tree) {
|
|
|
112
131
|
/** Settings' top list, with at least `count` rows of different titles on screen, or the case fails in words. */
|
|
113
132
|
export async function settingsRows(t, count) {
|
|
114
133
|
return t.until(async () => {
|
|
115
|
-
const
|
|
116
|
-
const rows = rowsOf(
|
|
117
|
-
return new Set(rows.map((row) => row.text)).size >= count ? {
|
|
118
|
-
}, `Settings' list with ${count} rows in
|
|
134
|
+
const seen = await observe(t);
|
|
135
|
+
const rows = rowsOf(seen);
|
|
136
|
+
return new Set(rows.map((row) => row.text)).size >= count ? { seen, rows } : undefined;
|
|
137
|
+
}, `Settings' list with ${count} rows in ui.observe`);
|
|
119
138
|
}
|
|
120
139
|
/**
|
|
121
|
-
* A node text is typed into:
|
|
122
|
-
*
|
|
123
|
-
* AutoCompleteTextView (phone probe 2).
|
|
140
|
+
* A node text is typed into: a textbox or a searchbox. A live Android 15's Settings search field is an
|
|
141
|
+
* AutoCompleteTextView inside a SearchView (phone probe 2), which the adb phone gives as a searchbox.
|
|
124
142
|
*/
|
|
125
|
-
const isField = (node) =>
|
|
143
|
+
const isField = (node) => node.role === "textbox" || node.role === "searchbox";
|
|
126
144
|
/**
|
|
127
145
|
* Settings' search field, opened from its list: the case taps the search entry (the first clickable node that says
|
|
128
|
-
* search, by its own
|
|
129
|
-
* waits for the field. An empty field may show its hint as its text, so only the field is waited for.
|
|
146
|
+
* search, by its own name, value or id or a node's under it; a live Settings shows it inside the list, its text on a
|
|
147
|
+
* child) and waits for the field. An empty field may show its hint as its text, so only the field is waited for.
|
|
130
148
|
*/
|
|
131
149
|
export async function openSearch(t) {
|
|
132
|
-
const {
|
|
133
|
-
const entry = t.present(
|
|
134
|
-
const at = middle(entry.bounds);
|
|
150
|
+
const { seen } = await settingsRows(t, 1);
|
|
151
|
+
const entry = t.present(seen.nodes.find((node) => clickable(node) && saysSearch(seen, node)), "Settings' search entry (a clickable node saying search) in ui.observe");
|
|
152
|
+
const at = await pixelsOf(t, seen, middle(entry.bounds));
|
|
135
153
|
t.deepEqual(await t.call("input.actions", { actions: [{ type: "tap", at }] }), { done: 1 }, `input.actions of a tap on Settings' search entry at ${at}`);
|
|
136
|
-
await t.until(async () => (await searchText(t)) !== undefined, "Settings' search field in
|
|
154
|
+
await t.until(async () => (await searchText(t)) !== undefined, "Settings' search field in ui.observe");
|
|
137
155
|
}
|
|
138
156
|
/** The text in Settings' search field now, or undefined when no field is shown. */
|
|
139
157
|
export async function searchText(t) {
|
|
140
|
-
const field =
|
|
141
|
-
return field === undefined ? undefined : (field.
|
|
158
|
+
const field = (await observe(t)).nodes.find(isField);
|
|
159
|
+
return field === undefined ? undefined : (field.value ?? "");
|
|
142
160
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { act, allRan, logged, pointIn } from "./input.js";
|
|
2
|
-
import { listOf, middle, openSettings, rowsOf, settingsRows, showsName, tapScene,
|
|
2
|
+
import { listOf, middle, observe, openSettings, pixelsOf, rowsOf, settingsRows, showsName, tapScene, throughSettings } from "./settings.js";
|
|
3
3
|
/** How far a logged touch may be from where it was aimed: a phone's input path may round. */
|
|
4
4
|
const SLACK = 2;
|
|
5
5
|
const touches = (events) => events.filter((e) => e.event === "touch");
|
|
@@ -10,8 +10,8 @@ const lifted = (events, fingers) => new Set(touches(events).filter((e) => e.phas
|
|
|
10
10
|
async function observed(t) {
|
|
11
11
|
const declared = t.provider.capabilities().groups;
|
|
12
12
|
if (!declared.includes("files")) {
|
|
13
|
-
if (!declared.includes("
|
|
14
|
-
return t.skip("no way to observe the effect: declare files or
|
|
13
|
+
if (!declared.includes("ui"))
|
|
14
|
+
return t.skip("no way to observe the effect: declare files or ui");
|
|
15
15
|
return t.skip(`no fixture runs on a ${t.provider.capabilities().kind} computer with no files, and no stock app is known for it`);
|
|
16
16
|
}
|
|
17
17
|
return t.fixture();
|
|
@@ -23,42 +23,44 @@ async function observed(t) {
|
|
|
23
23
|
*/
|
|
24
24
|
async function tapThroughSettings(t) {
|
|
25
25
|
await openSettings(t);
|
|
26
|
-
const { rows } = await settingsRows(t, 2);
|
|
26
|
+
const { seen: list, rows } = await settingsRows(t, 2);
|
|
27
27
|
const [row, next] = [rows[0], t.present(rows.find((one) => one.text !== rows[0].text), "a second row with another title")];
|
|
28
|
-
const at = middle(row.bounds);
|
|
28
|
+
const at = await pixelsOf(t, list, middle(row.bounds));
|
|
29
29
|
allRan(t, await act(t, [{ type: "tap", at }]), 1, `a tap on Settings' row ${JSON.stringify(row.text)} at ${at}`);
|
|
30
30
|
let seen;
|
|
31
31
|
try {
|
|
32
32
|
await t.until(async () => {
|
|
33
|
-
seen = await t
|
|
33
|
+
seen = await observe(t);
|
|
34
34
|
return showsName(seen, row.text) && !showsName(seen, next.text);
|
|
35
|
-
}, `the page of ${JSON.stringify(row.text)} after a tap on its row: its title, as a
|
|
35
|
+
}, `the page of ${JSON.stringify(row.text)} after a tap on its row: its title, as a node's name, and not the row ${JSON.stringify(next.text)}`);
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
// A live run showed only the wait: the words say what the case saw, so a page beside the list tells apart from a
|
|
39
39
|
// tap that missed.
|
|
40
|
-
throw new Error(`${error instanceof Error ? error.message : String(error)} (${await tapScene(t, { at, row, next,
|
|
40
|
+
throw new Error(`${error instanceof Error ? error.message : String(error)} (${await tapScene(t, { at, row, next, seen })})`);
|
|
41
41
|
}
|
|
42
42
|
allRan(t, await act(t, [{ type: "button", name: "back" }]), 1, "the back button");
|
|
43
|
-
await t.until(async () =>
|
|
43
|
+
await t.until(async () => showsName(await observe(t), next.text), `Settings' list again after back: the row ${JSON.stringify(next.text)}`);
|
|
44
44
|
}
|
|
45
45
|
/** A swipe up Settings' list moves it up: a row on screen before and after is higher by a quarter of the swipe at least, or the first row has left. */
|
|
46
46
|
async function swipeThroughSettings(t) {
|
|
47
47
|
await openSettings(t);
|
|
48
|
-
const {
|
|
49
|
-
const [x, y, w, h] = t.present(listOf(
|
|
50
|
-
|
|
51
|
-
const
|
|
48
|
+
const { seen, rows } = await settingsRows(t, 2);
|
|
49
|
+
const [x, y, w, h] = t.present(listOf(seen), "Settings' list in ui.observe").bounds;
|
|
50
|
+
// In window points, as the rows are; the swipe itself in pixels.
|
|
51
|
+
const top = [Math.floor(x + w / 2), Math.floor(y + h * 0.8)];
|
|
52
|
+
const bottom = [top[0], Math.floor(y + h * 0.2)];
|
|
53
|
+
const [from, to] = [await pixelsOf(t, seen, top), await pixelsOf(t, seen, bottom)];
|
|
52
54
|
allRan(t, await act(t, [{ type: "swipe", path: [from, to], ms: 400 }]), 1, `a swipe up Settings' list from ${from} to ${to}`);
|
|
53
|
-
const enough = (
|
|
55
|
+
const enough = (top[1] - bottom[1]) / 4;
|
|
54
56
|
await t.until(async () => {
|
|
55
|
-
const after = rowsOf(await t
|
|
57
|
+
const after = rowsOf(await observe(t));
|
|
56
58
|
const moved = rows.some((before) => {
|
|
57
59
|
const now = after.find((one) => one.text === before.text);
|
|
58
60
|
return now !== undefined && before.bounds[1] - now.bounds[1] >= enough;
|
|
59
61
|
});
|
|
60
62
|
return moved || (after.length > 0 && !after.some((one) => one.text === rows[0].text));
|
|
61
|
-
}, `Settings' list moved up by ${Math.round(enough)}
|
|
63
|
+
}, `Settings' list moved up by ${Math.round(enough)} points at least after a swipe up`);
|
|
62
64
|
}
|
|
63
65
|
/** One finger's touches: where it went down, and where it came up. */
|
|
64
66
|
function stroke(t, events, pointer, what) {
|
|
@@ -101,7 +103,7 @@ export const touchCases = [
|
|
|
101
103
|
const tried = await act(t, [{ type: "pinch", at: [Math.floor(shot.width / 2), Math.floor(shot.height / 2)], scale: 2, ms: 400 }]);
|
|
102
104
|
if (tried.failed?.kind === "unsupported")
|
|
103
105
|
return t.skip(`the provider refuses a pinch in words: ${tried.failed.message}`);
|
|
104
|
-
return t.skip("a pinch shows nothing in Settings'
|
|
106
|
+
return t.skip("a pinch shows nothing in Settings' nodes; only the fixture's log sees one");
|
|
105
107
|
}
|
|
106
108
|
const fixture = await observed(t);
|
|
107
109
|
const at = pointIn(fixture, 0.5, 0.5);
|