@swmansion/argent 0.16.0 → 0.16.1-next.1

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.
Binary file
Binary file
Binary file
Binary file
@@ -145980,12 +145980,7 @@ async function captureRunTarget(session, args) {
145980
145980
  try {
145981
145981
  assertSafeFlowName(name);
145982
145982
  const fragPath = path28.join(path28.dirname(session.filePath), `${name}.yaml`);
145983
- const fragment = parseFlow(await fs37.readFile(fragPath, "utf8"));
145984
- if (isE2eFlow(fragment)) {
145985
- return {
145986
- warning: `"${name}" is an e2e flow (starts with a launch step); only fragments compose via run: \u2014 kept the raw flow-execute step`
145987
- };
145988
- }
145983
+ parseFlow(await fs37.readFile(fragPath, "utf8"));
145989
145984
  return { flow: name };
145990
145985
  } catch (err) {
145991
145986
  return {
@@ -148093,7 +148088,7 @@ var HORIZONTAL_TEXT_MERGE_MIN_GAP = 32;
148093
148088
  var HORIZONTAL_TEXT_MERGE_MAX_GAP = 120;
148094
148089
  var UNIFORM_BRIGHTNESS_DELTA_TOLERANCE = 4;
148095
148090
  async function diffPngFiles(options) {
148096
- const settings = resolveDiffSettings();
148091
+ const settings = resolveDiffSettings(options.topMask ?? "status-bar");
148097
148092
  const [decodedBaseline, decodedCurrent] = await Promise.all([
148098
148093
  decodePngFile(options.baselinePath),
148099
148094
  decodePngFile(options.currentPath)
@@ -148154,10 +148149,10 @@ async function diffPngFiles(options) {
148154
148149
  textAnalysis
148155
148150
  });
148156
148151
  }
148157
- function resolveDiffSettings() {
148152
+ function resolveDiffSettings(topMask) {
148158
148153
  return {
148159
148154
  thresholdSquared: DEFAULT_THRESHOLD * DEFAULT_THRESHOLD * MAX_RGB_DISTANCE_SQUARED,
148160
- ignoreTopNormalizedY: DEFAULT_IGNORE_TOP_NORMALIZED_Y,
148155
+ ignoreTopNormalizedY: topMask === "none" ? 0 : DEFAULT_IGNORE_TOP_NORMALIZED_Y,
148161
148156
  joinGapPixels: DEFAULT_REGION_MERGE_DISTANCE,
148162
148157
  contextDiffScale: DEFAULT_CONTEXT_DIFF_SCALE
148163
148158
  };
@@ -148830,6 +148825,13 @@ async function treeSourceGate(registry2, device, bundleId, signal) {
148830
148825
  async function runLaunch(state3, app) {
148831
148826
  const { registry: registry2, device, signal } = state3;
148832
148827
  if (device.platform === "chromium") {
148828
+ if (state3.chromiumLaunched) {
148829
+ return {
148830
+ ok: false,
148831
+ reason: `chromium launches only the top-level flow's app, once per run \u2014 a nested launch can't boot its own instance and would run against the already-launched app. Nested chromium e2e flows aren't supported: run this flow at the top level, or drop its launch step to make it a fragment.`
148832
+ };
148833
+ }
148834
+ state3.chromiumLaunched = true;
148833
148835
  if (state3.chromiumBooted) {
148834
148836
  if (!await sleepOrAbort(POST_LAUNCH_SETTLE_MS, signal)) return ABORTED_OUTCOME;
148835
148837
  return { ok: true };
@@ -148920,6 +148922,7 @@ returns a notice with the prerequisite instead of running.`,
148920
148922
  stopped: false,
148921
148923
  pinned: statusBarPinned,
148922
148924
  chromiumBooted: resolved.booted !== null,
148925
+ chromiumLaunched: false,
148923
148926
  ...ctx?.emitProgress ? { onStepReport: ctx.emitProgress } : {}
148924
148927
  };
148925
148928
  try {
@@ -149109,11 +149112,6 @@ async function execRunStep(state3, step, runStack) {
149109
149112
  } catch (err) {
149110
149113
  return fail(`could not load fragment "${target}": ${errMsg2(err)}`);
149111
149114
  }
149112
- if (isE2eFlow(fragment)) {
149113
- return fail(
149114
- `"${target}" is an e2e flow (starts with a launch step); only fragments can be run from another flow`
149115
- );
149116
- }
149117
149115
  pushReport(state3, { index, kind: "run", status: "pass", flow: target });
149118
149116
  await execSteps(state3, fragment.steps, target, [...runStack, target]);
149119
149117
  }
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.16.0",
3
+ "version": "0.16.1-next.1",
4
4
  "description": "MCP server for iOS Simulator and Android Emulator control",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -11,7 +11,7 @@ Flows store **no device id**: the runner binds a device (the single booted one,
11
11
 
12
12
  **Two flow types**
13
13
 
14
- - **e2e** — begins with a `launch:` step, which starts that app from scratch (terminate + relaunch), so the flow controls its own start state. No `executionPrerequisite`. May `run:` fragments; cannot itself be a `run:` target. Record one by adding a `restart-app` of the app under test as the **first** step — it is captured as the `launch` step.
14
+ - **e2e** — begins with a `launch:` step, which starts that app from scratch (terminate + relaunch), so the flow controls its own start state. No `executionPrerequisite`. May `run:` other flows, and (on iOS/Android) may itself be a `run:` target — when nested, its `launch` runs inline, restarting the app for that sub-scenario. **Chromium is the exception:** the runner boots one Electron app per run (the top-level flow's), so a nested chromium e2e flow's `launch` can't boot its own instance and fails the run — keep chromium e2e flows top-level. Record one by adding a `restart-app` of the app under test as the **first** step — it is captured as the `launch` step.
15
15
  - **fragment** — doesn't begin with a launch; runs against the device's current state. May declare an `executionPrerequisite` (a documented entry-state contract). Invoked from other flows via a `run:` step, or directly by you at any time.
16
16
 
17
17
  Both run via `argent flow run <name>` — a fragment simply runs against whatever is on screen (its prerequisite is printed as a reminder). Only e2e flows are meaningful CI/suite entries, since only they give a deterministic verdict from a clean start.
@@ -31,7 +31,7 @@ Beyond raw `tool:` steps and `echo:`, flows support declarative directives inter
31
31
  | `wait` | `- wait: 500` | pause for a fixed number of milliseconds (last resort — prefer `await`) |
32
32
  | `assert` | `- assert: { visible: Welcome }` | check a condition, hard-fail if it never holds |
33
33
  | `snapshot` | `- snapshot: home` or `- snapshot: { name: home, maxMismatch: 0.5 }` | diff a screenshot against a stored baseline |
34
- | `run` | `- run: login` | execute a fragment's steps inline |
34
+ | `run` | `- run: login` | execute another flow's steps inline (fragment or e2e) |
35
35
 
36
36
  ### Selectors
37
37