mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-22 03:31:46 +00:00
fix(android): show conversation in screenshot fixture (#111000)
* fix(android): seed screenshot chat history * fix(android): update screenshot chat readiness * fix(android): use visible screenshot chat marker * style(android): format screenshot script test * fix(android): pin screenshot timezone * fix(android): restore screenshot timezone
This commit is contained in:
committed by
GitHub
parent
a68fdad8f5
commit
68ec50d643
@@ -3,6 +3,8 @@ import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const SCRIPT = "scripts/android-screenshots.sh";
|
||||
const SCREENSHOT_FIXTURE =
|
||||
"apps/android/app/src/main/java/ai/openclaw/app/AndroidScreenshotFixture.kt";
|
||||
|
||||
function runAndroidScreenshots(args: string[], env: NodeJS.ProcessEnv = {}) {
|
||||
return spawnSync("bash", [SCRIPT, ...args], {
|
||||
@@ -38,9 +40,13 @@ describe("android screenshots script", () => {
|
||||
expect(result.stdout).not.toContain(`Android screenshot artifacts: ${process.env.HOME}\n`);
|
||||
});
|
||||
|
||||
it("waits for content unique to the settings and gateway screens", () => {
|
||||
it("waits for fixture content unique to the chat, settings, and gateway screens", () => {
|
||||
const script = readFileSync(SCRIPT, "utf8");
|
||||
const fixture = readFileSync(SCREENSHOT_FIXTURE, "utf8");
|
||||
|
||||
expect(script).toContain("chat) printf '%s\\n' \"Draft a short status update for the team.\"");
|
||||
expect(script).not.toContain("chat) printf '%s\\n' \"Ready when you are\"");
|
||||
expect(fixture).toContain('"Draft a short status update for the team."');
|
||||
expect(script).toContain("settings) printf '%s\\n' \"OpenClaw mobile\"");
|
||||
expect(script).not.toContain("settings) printf '%s\\n' \"Settings\"");
|
||||
expect(script).toContain(
|
||||
@@ -58,6 +64,23 @@ describe("android screenshots script", () => {
|
||||
expect(script).toContain("shell wm density reset");
|
||||
});
|
||||
|
||||
it("pins the device timezone before rendering seeded timestamps", () => {
|
||||
const script = readFileSync(SCRIPT, "utf8");
|
||||
const requireEmulatorIndex = script.indexOf('require_emulator_device "$ADB_BIN" "$ADB_SERIAL"');
|
||||
const stabilizeDeviceIndex = script.indexOf(
|
||||
'stabilize_device_for_screenshots "$ADB_BIN" "$ADB_SERIAL"',
|
||||
);
|
||||
|
||||
expect(script).toContain("shell cmd time_zone_detector set_auto_detection_enabled false");
|
||||
expect(script).toContain("shell cmd alarm set-timezone UTC");
|
||||
expect(script).toContain('shell cmd alarm set-timezone "$ORIGINAL_TIME_ZONE"');
|
||||
expect(script).toContain(
|
||||
'shell cmd time_zone_detector set_auto_detection_enabled "$ORIGINAL_AUTO_TIME_ZONE"',
|
||||
);
|
||||
expect(requireEmulatorIndex).toBeGreaterThan(-1);
|
||||
expect(stabilizeDeviceIndex).toBeGreaterThan(requireEmulatorIndex);
|
||||
});
|
||||
|
||||
it("provisions a retained no-cutout screenshot emulator by default", () => {
|
||||
const script = readFileSync(SCRIPT, "utf8");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user