@swmansion/argent 0.25.1-next.32 → 0.25.1-next.33

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/dist/cli-cmds.mjs CHANGED
@@ -21857,7 +21857,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21857
21857
  var SESSION_ID2 = randomUUID5();
21858
21858
  function readCliVersion() {
21859
21859
  if (true) {
21860
- return "0.25.1-next.32";
21860
+ return "0.25.1-next.33";
21861
21861
  }
21862
21862
  return "0.0.0";
21863
21863
  }
@@ -23461,7 +23461,10 @@ async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
23461
23461
  if (dirName === null) return;
23462
23462
  dir = path14.join(outputDir, dirName);
23463
23463
  }
23464
- const dest = path14.join(dir, `${key}-${role}.png`);
23464
+ const dest = path14.join(
23465
+ dir,
23466
+ `${key}${s.snapshotRemote === true ? "-remote" : ""}-${role}.png`
23467
+ );
23465
23468
  const rel = path14.relative(outputDir, dest);
23466
23469
  if (rel.startsWith("..") || path14.isAbsolute(rel)) continue;
23467
23470
  try {
@@ -16710,7 +16710,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16710
16710
  var SESSION_ID = randomUUID4();
16711
16711
  function readCliVersion() {
16712
16712
  if (true) {
16713
- return "0.25.1-next.32";
16713
+ return "0.25.1-next.33";
16714
16714
  }
16715
16715
  return "0.0.0";
16716
16716
  }
@@ -94704,7 +94704,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94704
94704
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94705
94705
  function readCliVersion() {
94706
94706
  if (true) {
94707
- return "0.25.1-next.32";
94707
+ return "0.25.1-next.33";
94708
94708
  }
94709
94709
  return "0.0.0";
94710
94710
  }
@@ -96676,8 +96676,8 @@ async function run(args, options) {
96676
96676
  throw new Error(`sim-remote ${args.join(" ")} failed: ${suffix}`, { cause: err });
96677
96677
  }
96678
96678
  }
96679
- async function simctlListDevices() {
96680
- const { stdout } = await run(["simctl", "list", "devices", "--json"]);
96679
+ async function simctlListDevices(options) {
96680
+ const { stdout } = await run(["simctl", "list", "devices", "--json"], options);
96681
96681
  try {
96682
96682
  return JSON.parse(stdout);
96683
96683
  } catch (err) {
@@ -96688,12 +96688,12 @@ async function simctlListDevices() {
96688
96688
  }
96689
96689
  }
96690
96690
  var remoteRuntimeKindCache = /* @__PURE__ */ new Map();
96691
- async function isRemoteTvOsSimulator(udid) {
96691
+ async function isRemoteTvOsSimulator(udid, options) {
96692
96692
  const id = stripRemotePrefix(udid);
96693
96693
  const cached3 = remoteRuntimeKindCache.get(id);
96694
96694
  if (cached3) return cached3 === "tv";
96695
96695
  try {
96696
- const { devices } = await simctlListDevices();
96696
+ const { devices } = await simctlListDevices(options);
96697
96697
  for (const [runtime, entries] of Object.entries(devices)) {
96698
96698
  if (!entries.some((d) => d.udid === id)) continue;
96699
96699
  const kind = runtime.includes("tvOS") ? "tv" : "mobile";
@@ -96735,6 +96735,9 @@ async function simctlOpenUrl(udid, url2) {
96735
96735
  async function simctlPrivacy(udid, action, service, bundleId) {
96736
96736
  await run(["simctl", "privacy", stripRemotePrefix(udid), action, service, bundleId]);
96737
96737
  }
96738
+ async function simctlStatusBar(udid, args, options) {
96739
+ await run(["simctl", "status_bar", stripRemotePrefix(udid), ...args], options);
96740
+ }
96738
96741
  async function simctlPbcopy(udid, text) {
96739
96742
  await run(["simctl", "pbcopy", stripRemotePrefix(udid)], { stdin: text });
96740
96743
  }
@@ -148203,10 +148206,14 @@ var FIRST_CAPTURE_COMPLETION_MARGIN_MS = 500;
148203
148206
  var FIRST_PIXEL_CAPTURE_TIMEOUT_MS = FIRST_FRAME_WAIT_MS + FIRST_CAPTURE_COMPLETION_MARGIN_MS;
148204
148207
  var PIXEL_CAPTURE_TIMEOUT_MS = 2e3;
148205
148208
  var IOS_DEVICE_PIXEL_CAPTURE_TIMEOUT_MS = 4e3;
148209
+ var REMOTE_PIXEL_CAPTURE_TIMEOUT_MS = 4e3;
148206
148210
  function pixelCaptureTimeoutMs(device, firstCapture) {
148207
148211
  if (isIosPhysicalDevice(device)) {
148208
148212
  return IOS_DEVICE_PIXEL_CAPTURE_TIMEOUT_MS;
148209
148213
  }
148214
+ if (device.platform === "ios-remote" && !firstCapture) {
148215
+ return REMOTE_PIXEL_CAPTURE_TIMEOUT_MS;
148216
+ }
148210
148217
  const warmFromTheStart = device.platform === "chromium" || device.platform === "vega";
148211
148218
  return firstCapture && !warmFromTheStart ? FIRST_PIXEL_CAPTURE_TIMEOUT_MS : PIXEL_CAPTURE_TIMEOUT_MS;
148212
148219
  }
@@ -153856,7 +153863,7 @@ async function runSnapshot(env, opts) {
153856
153863
  });
153857
153864
  const { w, h } = await pngDimensions(shot.image.hostPath);
153858
153865
  const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto12.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
153859
- const snapshotKey = `${opts.name}__${env.device.platform}-${w}x${h}${cropSuffix}`;
153866
+ const snapshotKey = `${opts.name}__${authoringPlatform(env.device.platform)}-${w}x${h}${cropSuffix}`;
153860
153867
  const key2 = `${snapshotKey}.png`;
153861
153868
  const dir = baselineDir(opts.flowsDir, opts.flowName);
153862
153869
  const baselinePath = path44.join(dir, key2);
@@ -153907,9 +153914,10 @@ async function runSnapshot(env, opts) {
153907
153914
  kind: "screenshot",
153908
153915
  mimeType: "image/png"
153909
153916
  });
153917
+ const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
153910
153918
  return {
153911
153919
  status: "pass",
153912
- reason: exists2 ? `baseline updated (${key2})` : `baseline written (${key2})`,
153920
+ reason: exists2 ? `baseline updated${source} (${key2})` : `baseline written${source} (${key2})`,
153913
153921
  snapshotKey,
153914
153922
  artifacts: { baseline }
153915
153923
  };
@@ -153995,30 +154003,41 @@ init_adb();
153995
154003
  init_device_info();
153996
154004
  var execFileAsync27 = (0, import_node_util25.promisify)(import_node_child_process35.execFile);
153997
154005
  var DEMO_BROADCAST = "am broadcast -a com.android.systemui.demo";
153998
- async function pinStatusBar(device) {
154006
+ var IOS_STATUS_BAR_OVERRIDE = [
154007
+ "override",
154008
+ "--time",
154009
+ "9:37",
154010
+ "--batteryState",
154011
+ "charged",
154012
+ "--batteryLevel",
154013
+ "100",
154014
+ "--wifiBars",
154015
+ "3",
154016
+ "--cellularBars",
154017
+ "4"
154018
+ ];
154019
+ var REMOTE_STATUS_BAR_TIMEOUT_MS = 5e3;
154020
+ function isRemoteTvOs(device) {
154021
+ return isRemoteTvOsSimulator(device.id, { timeoutMs: REMOTE_STATUS_BAR_TIMEOUT_MS });
154022
+ }
154023
+ async function pinStatusBar(device, signal) {
154024
+ if (signal?.aborted) return false;
153999
154025
  if (isIosPhysicalDevice(device)) return false;
154000
154026
  try {
154001
154027
  if (device.platform === "ios") {
154002
154028
  await execFileAsync27(
154003
154029
  "xcrun",
154004
- await simctlArgsForUdid(device.id, [
154005
- "status_bar",
154006
- device.id,
154007
- "override",
154008
- "--time",
154009
- "9:37",
154010
- "--batteryState",
154011
- "charged",
154012
- "--batteryLevel",
154013
- "100",
154014
- "--wifiBars",
154015
- "3",
154016
- "--cellularBars",
154017
- "4"
154018
- ])
154030
+ await simctlArgsForUdid(device.id, ["status_bar", device.id, ...IOS_STATUS_BAR_OVERRIDE])
154019
154031
  );
154020
154032
  return true;
154021
154033
  }
154034
+ if (device.platform === "ios-remote") {
154035
+ if (await isRemoteTvOs(device)) return false;
154036
+ await simctlStatusBar(device.id, IOS_STATUS_BAR_OVERRIDE, {
154037
+ timeoutMs: REMOTE_STATUS_BAR_TIMEOUT_MS
154038
+ });
154039
+ return true;
154040
+ }
154022
154041
  if (device.platform === "android") {
154023
154042
  await adbShell(device.id, "settings put global sysui_demo_allowed 1");
154024
154043
  await adbShell(device.id, `${DEMO_BROADCAST} -e command enter`);
@@ -154036,7 +154055,7 @@ async function pinStatusBar(device) {
154036
154055
  return false;
154037
154056
  } catch {
154038
154057
  const restored = await restoreStatusBar(device);
154039
- return device.platform === "android" && !restored;
154058
+ return (device.platform === "android" || device.platform === "ios-remote") && !restored;
154040
154059
  }
154041
154060
  }
154042
154061
  async function restoreStatusBar(device) {
@@ -154046,6 +154065,10 @@ async function restoreStatusBar(device) {
154046
154065
  "xcrun",
154047
154066
  await simctlArgsForUdid(device.id, ["status_bar", device.id, "clear"])
154048
154067
  );
154068
+ } else if (device.platform === "ios-remote") {
154069
+ if (!await isRemoteTvOs(device)) {
154070
+ await simctlStatusBar(device.id, ["clear"], { timeoutMs: REMOTE_STATUS_BAR_TIMEOUT_MS });
154071
+ }
154049
154072
  } else if (device.platform === "android") {
154050
154073
  try {
154051
154074
  await adbShell(device.id, `${DEMO_BROADCAST} -e command exit`);
@@ -154554,7 +154577,7 @@ Returns a per-step report: the first failure stops the run and the rest report a
154554
154577
  viaUpload
154555
154578
  );
154556
154579
  const device = resolved.device;
154557
- const statusBarPinned = device !== null && await pinStatusBar(device);
154580
+ const statusBarPinned = device !== null && await pinStatusBar(device, signal);
154558
154581
  if (device?.platform === "chromium") await frontChromiumPage(registry2, device);
154559
154582
  const state3 = {
154560
154583
  registry: registry2,
@@ -155080,6 +155103,7 @@ async function execLeafStep(state3, step, index, scope) {
155080
155103
  status: r.status,
155081
155104
  reason: r.reason,
155082
155105
  snapshotKey: r.snapshotKey,
155106
+ ...r.snapshotKey !== void 0 && state3.device?.platform === "ios-remote" ? { snapshotRemote: true } : {},
155083
155107
  artifacts: r.artifacts
155084
155108
  };
155085
155109
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.25.1-next.32",
3
+ "version": "0.25.1-next.33",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",
@@ -255,7 +255,7 @@ A screenshot is human evidence. A `snapshot:` is executable visual verification.
255
255
 
256
256
  Do not use a snapshot as the only proof of navigation, persistence, data, accessibility state, logs, or network behavior. Avoid unstable timestamps, live data, ads, animation, and device drift. First establish deterministic state, identity, and readiness.
257
257
 
258
- Baselines live under `.argent/flows/__baselines__/<flow>/` and are keyed by platform and full-capture geometry; `cropOn` also contributes its selector. Seed from a known-good state with `--update-baselines`. Inspect every baseline and require user review. Do not commit it yourself. Baseline creation or update is not a test pass. Never update a baseline only to make a diff pass. The default `maxMismatch` is 0.5 percent.
258
+ Baselines live under `.argent/flows/__baselines__/<flow>/` and are keyed by platform and full-capture geometry; `cropOn` also contributes its selector. A run on a remote simulator uses `ios` in the key, so it uses the same baseline as a local iOS run with the same capture geometry. Seed from a known-good state with `--update-baselines`. A run on a remote simulator with `--update-baselines` rewrites the same baseline file that a local run uses, and its step reason says that a remote simulator wrote it. Inspect every baseline and require user review. Do not commit it yourself. Baseline creation or update is not a test pass. Never update a baseline only to make a diff pass. The default `maxMismatch` is 0.5 percent.
259
259
 
260
260
  Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed baseline, current, and diff images under `<dir>/<flow>/` for CI artifact upload.
261
261