@sungen/driver-ui 3.2.19 → 3.2.20-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sungen/driver-ui",
3
- "version": "3.2.19",
3
+ "version": "3.2.20-beta.2",
4
4
  "description": "Sungen UI capability (Playwright) — step patterns, viewpoint gate, and phase hooks. Plugs into @sun-asterisk/sungen via the capability SPI.",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -13,7 +13,7 @@
13
13
  "author": "eqe team (engineer & quality) — Sun Asterisk",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@sun-asterisk/sungen": "3.2.19"
16
+ "@sun-asterisk/sungen": "3.2.20-beta.2"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@playwright/test": "^1.57.0"
@@ -134,7 +134,9 @@ export const assertionPatterns: StepPattern[] = [
134
134
  const withSuffix = step.dataRef ? ` with ${step.dataRef}` : '';
135
135
  return {
136
136
  templateName: 'page-assertion',
137
- data: { pathRegex, query },
137
+ // `dataRef` rides along so a runtime failure can name the test-data key an author must go
138
+ // fix — an empty/absent value is otherwise the hardest kind of red to trace.
139
+ data: { pathRegex, query, dataRef: step.dataRef || '' },
138
140
  comment: step.selectorRef ? `Assert on ${step.selectorRef} page${withSuffix}` : `Assert on page${withSuffix}`,
139
141
  };
140
142
  },
@@ -27,7 +27,13 @@ export const navigationPatterns: StepPattern[] = [
27
27
  const resolved = context.selectorResolver.resolveSelector(
28
28
  step.selectorRef, context.featureName, step.elementType, step.nth
29
29
  );
30
- path = resolved.value || pathFallback;
30
+ // Only a `page`-type entry carries a URL in `value` — the same guard the `see [X] page`
31
+ // twin has carried since the key-collision fix (assertion-patterns.ts). Without it a
32
+ // colliding non-page entry (a `type: role` whose value is 'button') was used verbatim as
33
+ // the path, so the step asserted `^button/?$` — a wrong, specific path rather than the
34
+ // documented fallback. These two resolvers have drifted apart twice already; keep them
35
+ // spelling the same rule.
36
+ path = resolved.selectorType === 'page' ? (resolved.value || pathFallback) : pathFallback;
31
37
  } catch (error) {
32
38
  path = pathFallback;
33
39
  }
@@ -60,14 +66,19 @@ export const navigationPatterns: StepPattern[] = [
60
66
  // the wildcard the `see [X] page` twin already produced.
61
67
  return {
62
68
  templateName: 'route-assertion',
63
- data: { pathRegex: pathToRegexSource(path), query },
69
+ // `dataRef` rides along so a runtime failure names the test-data key (see the `see` twin).
70
+ data: { pathRegex: pathToRegexSource(path), query, dataRef: step.dataRef || '' },
64
71
  comment: step.selectorRef ? `Assert on ${step.selectorRef} page${withSuffix}` : `Assert page route`,
65
72
  };
66
73
  }
67
74
 
68
75
  return {
69
76
  templateName: 'navigation',
70
- data: { baseURL: isAbsoluteUrl ? undefined : context.baseURL, path: finalPath + query },
77
+ // `query` stays SEPARATE from `path` rather than concatenated here: in runtime-data mode
78
+ // the value is still a `__SUNGEN_TD$…$__` marker at this point, so the compiler cannot see
79
+ // whether it carries its own path. Deciding that is therefore a runtime job — the template
80
+ // hands both parts to joinPath(). Concatenating here is what produced `/vi/search/vi/search`.
81
+ data: { baseURL: isAbsoluteUrl ? undefined : context.baseURL, path: finalPath, query },
71
82
  comment: step.selectorRef ? `Open ${step.selectorRef} page${withSuffix}` : `Navigate to page`,
72
83
  };
73
84
  },