@sungen/driver-ui 3.2.27 → 3.2.28

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.27",
3
+ "version": "3.2.28",
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.27"
16
+ "@sun-asterisk/sungen": "3.2.28"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@playwright/test": "^1.57.0"
@@ -112,6 +112,10 @@ export const assertionPatterns: StepPattern[] = [
112
112
  // `step.featurePath` is never populated by the parser, so it always degraded to '/'.
113
113
  const fallbackPath = context.featurePath || '/';
114
114
  let path = fallbackPath;
115
+ // The page's declared `anchor:` — the element that proves the page rendered. Without it the
116
+ // step is a URL-only oracle, which a client-side router can satisfy for a few hundred
117
+ // milliseconds before a guard bounces the user away (#662).
118
+ let anchor: Record<string, unknown> | undefined;
115
119
 
116
120
  // If selector is present, extract path from selector's value attribute
117
121
  if (step.selectorRef) {
@@ -128,6 +132,7 @@ export const assertionPatterns: StepPattern[] = [
128
132
  // URL. Guard on the entry kind: use `value` only for a page selector, else fall back to
129
133
  // the feature path rather than compiling `toHaveURL(/button/)`.
130
134
  path = resolved.selectorType === 'page' ? (resolved.value || fallbackPath) : fallbackPath;
135
+ if (resolved.selectorType === 'page' && resolved.anchor) anchor = { ...resolved.anchor };
131
136
  } catch (error) {
132
137
  // Fallback to feature path if selector not found
133
138
  path = fallbackPath;
@@ -153,7 +158,7 @@ export const assertionPatterns: StepPattern[] = [
153
158
  templateName: 'page-assertion',
154
159
  // `dataRef` rides along so a runtime failure can name the test-data key an author must go
155
160
  // fix — an empty/absent value is otherwise the hardest kind of red to trace.
156
- data: { pathRegex, query, dataRef: step.dataRef || '' },
161
+ data: { pathRegex, query, dataRef: step.dataRef || '', anchor },
157
162
  comment: step.selectorRef ? `Assert on ${step.selectorRef} page${withSuffix}` : `Assert on page${withSuffix}`,
158
163
  };
159
164
  },