GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(mobile): e2e poses for current devices, Duo and landscape fixes · pingdotgg/t3code@911091b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts/mobile-e2e
    • device.ts
    • journey.ts
    • poses.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/mobile-e2e/device.ts‎

Copy file name to clipboardExpand all lines: scripts/mobile-e2e/device.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class AgentDeviceError extends Error {}
6565

6666
// A shared pool's workers drop off the gateway and stall under load for seconds at a time.
6767
const TRANSIENT =
68-
/Remote daemon is unavailable|not connected to the gateway|still finishing a previous command|Invalid daemon response|Daemon request timed out/i;
68+
/Remote daemon is unavailable|not connected to the gateway|still finishing a previous command|Invalid daemon response|Daemon request timed out|no worker connected/i;
6969

7070
export class Device {
7171
readonly pose: Pose;
@@ -172,7 +172,6 @@ export class Device {
172172
{ timeoutMs: 180_000 },
173173
);
174174
await this.acceptOpenPrompt();
175-
if (this.pose.landscape) await this.agent(["orientation", "landscape-left"]);
176175
}
177176

178177
async openUrl(url: string) {
Collapse file

‎scripts/mobile-e2e/journey.ts‎

Copy file name to clipboardExpand all lines: scripts/mobile-e2e/journey.ts
+22-4Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,19 @@ export async function runJourney(
7171
steps: StepResult[],
7272
): Promise<void> {
7373
const phone = device.pose.form === "phone";
74-
const tap = (node: SnapshotNode | undefined, label: string) => {
75-
if (!node?.ref) throw new Error(`no ${label} to tap`);
76-
return device.agent(["press", `@${node.ref}`]);
74+
const tap = async (node: SnapshotNode | undefined, label: string) => {
75+
if (!node?.ref || !node.rect) throw new Error(`no ${label} to tap`);
76+
// agent-device refuses refs it considers covered, such as on the unfolded Duo's inner
77+
// display; the element's centre still takes the tap.
78+
await device
79+
.agent(["press", `@${node.ref}`])
80+
.catch(() =>
81+
device.agent([
82+
"press",
83+
String(Math.round(node.rect!.x + node.rect!.width / 2)),
84+
String(Math.round(node.rect!.y + node.rect!.height / 2)),
85+
]),
86+
);
7787
};
7888

7989
/** Screenshot and check the settled screen, and record it as a step. */
@@ -126,10 +136,18 @@ export async function runJourney(
126136
.catch(() => null);
127137
}
128138
if (!threads) throw new Error("the app did not show the fixture threads after pairing");
129-
await delay(1_000);
139+
// Rotated only once the app is up: a rotation during launch is lost.
140+
if (device.pose.landscape) await device.agent(["orientation", "landscape-left"]);
141+
await delay(device.pose.landscape ? 2_000 : 1_000);
130142
threads = await device.snapshot();
131143
const tabs = tabBarRect(threads);
144+
const wide = threads.viewport.width > threads.viewport.height;
132145
await capture("threads", threads, [
146+
check(
147+
device.pose.landscape ? "in landscape" : "in portrait",
148+
wide === Boolean(device.pose.landscape),
149+
`${Math.round(threads.viewport.width)}×${Math.round(threads.viewport.height)}`,
150+
),
133151
check("thread list visible", threadRow(threads) !== undefined, "fixture threads"),
134152
...(phone ? [check("tab bar visible", inside(tabs, threads), describeRect(tabs))] : []),
135153
]);
Collapse file

‎scripts/mobile-e2e/poses.ts‎

Copy file name to clipboardExpand all lines: scripts/mobile-e2e/poses.ts
+32-28Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface Pose {
55
readonly device: string;
66
readonly form: "phone" | "tablet";
77
readonly appearance: "light" | "dark";
8-
/** Phones are portrait-only; tablets also run rotated. */
8+
/** Phones are portrait-locked; tablets and an unfolded Fold can start rotated. */
99
readonly landscape?: boolean;
1010
readonly fold?: "closed" | "open";
1111
readonly textSize?: "accessibility-large";
@@ -22,79 +22,83 @@ export const POSES: ReadonlyArray<Pose> = [
2222
appearance: "light",
2323
}),
2424
pose({
25-
id: "iphone-13-mini-dark",
25+
id: "iphone-18-pro-dark",
2626
platform: "ios",
27-
device: "iPhone 13 mini",
27+
device: "iPhone 18 Pro",
2828
form: "phone",
2929
appearance: "dark",
3030
}),
3131
pose({
32-
id: "iphone-17-pro",
32+
id: "iphone-duo-folded",
3333
platform: "ios",
34-
device: "iPhone 17 Pro",
34+
device: "iPhone Duo",
3535
form: "phone",
3636
appearance: "light",
37+
fold: "closed",
3738
}),
3839
pose({
39-
id: "iphone-17-pro-max-large-text",
40+
id: "iphone-duo-unfolded",
4041
platform: "ios",
41-
device: "iPhone 17 Pro Max",
42-
form: "phone",
42+
device: "iPhone Duo",
43+
form: "tablet",
4344
appearance: "dark",
44-
textSize: "accessibility-large",
45+
fold: "open",
4546
}),
4647
pose({
47-
id: "ipad-mini",
48+
id: "ipad-13-portrait",
4849
platform: "ios",
49-
device: "iPad mini (A17 Pro)",
50+
device: "iPad Pro 13-inch (M5)",
5051
form: "tablet",
5152
appearance: "light",
5253
}),
5354
pose({
54-
id: "ipad-pro-13-landscape",
55+
id: "ipad-13-landscape-large-text",
5556
platform: "ios",
5657
device: "iPad Pro 13-inch (M5)",
5758
form: "tablet",
5859
appearance: "dark",
5960
landscape: true,
61+
textSize: "accessibility-large",
6062
}),
6163
pose({
62-
id: "pixel-9",
64+
id: "pixel-10-pro-large-text",
6365
platform: "android",
64-
device: "Pixel 9",
66+
device: "Pixel 10 Pro",
6567
form: "phone",
6668
appearance: "light",
69+
textSize: "accessibility-large",
6770
}),
6871
pose({
69-
id: "small-phone-dark",
72+
id: "pixel-fold-folded-dark",
7073
platform: "android",
71-
device: "Small Phone",
74+
device: "Pixel 10 Pro Fold",
7275
form: "phone",
7376
appearance: "dark",
77+
fold: "closed",
7478
}),
7579
pose({
76-
id: "pixel-9-large-text",
80+
id: "pixel-fold-unfolded",
7781
platform: "android",
78-
device: "Pixel 9",
79-
form: "phone",
82+
device: "Pixel 10 Pro Fold",
83+
form: "tablet",
8084
appearance: "light",
81-
textSize: "accessibility-large",
85+
fold: "open",
8286
}),
8387
pose({
84-
id: "pixel-fold-closed",
88+
id: "pixel-fold-unfolded-landscape",
8589
platform: "android",
86-
device: "Pixel 9 Pro Fold",
87-
form: "phone",
88-
appearance: "light",
89-
fold: "closed",
90+
device: "Pixel 10 Pro Fold",
91+
form: "tablet",
92+
appearance: "dark",
93+
fold: "open",
94+
landscape: true,
9095
}),
9196
pose({
92-
id: "pixel-fold-open",
97+
id: "pixel-tablet-portrait",
9398
platform: "android",
94-
device: "Pixel 9 Pro Fold",
99+
device: "Pixel Tablet",
95100
form: "tablet",
96101
appearance: "dark",
97-
fold: "open",
98102
}),
99103
pose({
100104
id: "pixel-tablet-landscape",

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.