@sungen/driver-ui 3.2.21-beta.1 → 3.2.21
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.21
|
|
3
|
+
"version": "3.2.21",
|
|
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.21
|
|
16
|
+
"@sun-asterisk/sungen": "3.2.21"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@playwright/test": "^1.57.0"
|
|
@@ -113,40 +113,6 @@ export const tablePatterns: StepPattern[] = [
|
|
|
113
113
|
priority: 16,
|
|
114
114
|
},
|
|
115
115
|
|
|
116
|
-
// "User see [Result Row] row with {{n}}" — COUNT of matching rows (#575 field report).
|
|
117
|
-
// Every doc layer (Pattern 5, the gherkin-syntax skill's "# 7. Count") promises this
|
|
118
|
-
// form counts, and authors write it meaning a count ("40 results after load-more") —
|
|
119
|
-
// but it fell through to see-with-variable and compiled to toHaveText('40') against
|
|
120
|
-
// the row's ENTIRE text: a test that can essentially never pass, emitted silently.
|
|
121
|
-
// The value decides: a numeric base value is a count; any other value keeps the text
|
|
122
|
-
// semantics (asserting a row's full text equals a bare number is no real intent).
|
|
123
|
-
// `row in [Table] table with` (row scope/exists) and `is hidden` stay untouched.
|
|
124
|
-
{
|
|
125
|
-
name: 'row-count',
|
|
126
|
-
matcher: (step) => {
|
|
127
|
-
return step.elementType === 'row' &&
|
|
128
|
-
/\brow\s+with\b/i.test(step.text) &&
|
|
129
|
-
!!step.dataRef && !!step.selectorRef &&
|
|
130
|
-
!/\bin\b.*\btable\b/i.test(step.text) &&
|
|
131
|
-
!/\bis\s+hidden\b/i.test(step.text);
|
|
132
|
-
},
|
|
133
|
-
resolver: (step, context) => {
|
|
134
|
-
// Decide by the BASE literal (runtime mode returns an opaque marker from resolveData).
|
|
135
|
-
const base = context.dataResolver.peekBaseValue?.(step.dataRef!, context.featureName);
|
|
136
|
-
if (base === undefined || !/^\d+$/.test(String(base).trim())) return null as any; // not numeric → fall through to text semantics
|
|
137
|
-
const resolved = context.selectorResolver.resolveSelector(
|
|
138
|
-
step.selectorRef!, context.featureName, 'row', step.nth
|
|
139
|
-
);
|
|
140
|
-
const count = context.dataResolver.resolveData(step.dataRef!, context.featureName);
|
|
141
|
-
return {
|
|
142
|
-
templateName: 'count-assertion',
|
|
143
|
-
data: { ...resolved, expectedCount: count },
|
|
144
|
-
comment: `Assert ${step.selectorRef} row count is ${count}`,
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
priority: 18, // above see-with-variable (14) — the count reading wins for numeric values
|
|
148
|
-
},
|
|
149
|
-
|
|
150
116
|
// "User see [Ref] row in [Table] table with {{value}}" — row exists (enters row scope)
|
|
151
117
|
{
|
|
152
118
|
name: 'table-row-exists',
|