@vmz/test 0.1.32 → 0.2.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.
- package/dist/browser-protocol.js +7 -1
- package/dist/browser.js +24 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/package.json +3 -3
package/dist/browser-protocol.js
CHANGED
|
@@ -163,10 +163,16 @@ export function resolveLocatorInPage(locator, opts = {}) {
|
|
|
163
163
|
}
|
|
164
164
|
if (locator.name != null && String(locator.name).length) {
|
|
165
165
|
const want = normalize(locator.name);
|
|
166
|
+
const wantLower = want.toLowerCase();
|
|
166
167
|
found = pool.filter((el) => {
|
|
167
168
|
const n = nameOf(el);
|
|
169
|
+
const nLower = n.toLowerCase();
|
|
168
170
|
const optVal = el.getAttribute('data-vmz-option') || (el instanceof HTMLOptionElement ? el.value : '');
|
|
169
|
-
|
|
171
|
+
const optLower = String(optVal).toLowerCase();
|
|
172
|
+
if (locator.exact) {
|
|
173
|
+
return nLower === wantLower || optLower === wantLower;
|
|
174
|
+
}
|
|
175
|
+
return nLower.includes(wantLower) || optLower.includes(wantLower);
|
|
170
176
|
});
|
|
171
177
|
}
|
|
172
178
|
else {
|
package/dist/browser.js
CHANGED
|
@@ -1009,6 +1009,13 @@ async function pageText(page) {
|
|
|
1009
1009
|
return document.body?.innerText || document.body?.textContent || '';
|
|
1010
1010
|
}));
|
|
1011
1011
|
}
|
|
1012
|
+
async function flushBrowserInst(page) {
|
|
1013
|
+
await page.evaluate(async () => {
|
|
1014
|
+
const ctx = window.__vmzBrowser;
|
|
1015
|
+
if (ctx?.inst && ctx?.dom?.flushPending)
|
|
1016
|
+
await ctx.dom.flushPending(ctx.inst);
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1012
1019
|
/**
|
|
1013
1020
|
* Native <select> or listbox/combobox (data-vmz-option / role=option).
|
|
1014
1021
|
* Prefer option value (data-vmz-option) then accessible name/label.
|
|
@@ -1039,17 +1046,31 @@ async function selectTarget(page, value, opts = {}) {
|
|
|
1039
1046
|
}
|
|
1040
1047
|
if (native.kind === 'native')
|
|
1041
1048
|
return;
|
|
1049
|
+
// VMZ combobox opens via reactive patch — drain before option lookup.
|
|
1050
|
+
await flushBrowserInst(page);
|
|
1042
1051
|
// Prefer stable option value contract, then accessible name.
|
|
1043
1052
|
const byValue = { kind: 'css', selector: `[data-vmz-option="${want.replace(/"/g, '\\"')}"]` };
|
|
1044
1053
|
try {
|
|
1045
1054
|
await waitForLocator(page, byValue, opts);
|
|
1046
1055
|
await clickTarget(page);
|
|
1056
|
+
await flushBrowserInst(page);
|
|
1047
1057
|
return;
|
|
1048
1058
|
}
|
|
1049
1059
|
catch {
|
|
1050
1060
|
/* fall through to role=option name */
|
|
1051
1061
|
}
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
|
|
1062
|
+
const optionNames = [want, want.charAt(0).toUpperCase() + want.slice(1)];
|
|
1063
|
+
for (const name of optionNames) {
|
|
1064
|
+
try {
|
|
1065
|
+
const optionLocator = { kind: 'role', role: 'option', name };
|
|
1066
|
+
await waitForLocator(page, optionLocator, opts);
|
|
1067
|
+
await clickTarget(page);
|
|
1068
|
+
await flushBrowserInst(page);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
catch {
|
|
1072
|
+
/* try next label variant */
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
throw new Error(`select: no option for ${JSON.stringify(want)}`);
|
|
1055
1076
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
export * from './protocol.js';
|
|
6
6
|
export * from './discover.js';
|
|
7
7
|
export { buildForCompile, resolveChunkArtifacts, runCompileManifest, type BuildOptions, type BuildResult, type CompileResult, type CreateWorkspaceFn, } from './compile.js';
|
|
8
|
-
export { createLogicHost, installHeadlessDocument, runLogicManifest, type LogicHost, type LogicResult
|
|
8
|
+
export { createLogicHost, installHeadlessDocument, runLogicManifest, type LogicHost, type LogicResult } from './logic.js';
|
|
9
9
|
export { runSsrManifest, type SsrResult } from './ssr.js';
|
|
10
10
|
export { runResumeManifest, type ResumeResult } from './resume.js';
|
|
11
11
|
export { runDeploymentManifest, type DeploymentResult } from './deployment.js';
|
|
12
|
-
export { runBrowserManifest, resolveBrowserExecutable, type BrowserResult
|
|
13
|
-
export { isDeliveryServeRoot, resolveDeliveryServeRoot
|
|
12
|
+
export { runBrowserManifest, resolveBrowserExecutable, type BrowserResult } from './browser.js';
|
|
13
|
+
export { isDeliveryServeRoot, resolveDeliveryServeRoot } from './delivery-serve-root.js';
|
|
14
14
|
export { BROWSER_LOCATOR_KINDS, defaultClickLocator, parseActionLocator, type BrowserActionOptions, type BrowserLocator, type LocatorResolveResult, } from './browser-protocol.js';
|
|
15
15
|
export { isServeHostManifest, resolveRoutePath, startServeHost, type ServeHostHandle } from './browser-serve.js';
|
|
16
16
|
export { createArtifactsDir, writeFailureEvidence, writeTimingOnly, type BrowserTiming, type EvidencePaths, type StepTiming, } from './browser-evidence.js';
|
|
17
|
-
export { runManifest, resultsToReport, type ManifestRunResult, type RunManifestOptions
|
|
17
|
+
export { runManifest, resultsToReport, type ManifestRunResult, type RunManifestOptions } from './run.js';
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
export * from './protocol.js';
|
|
6
6
|
export * from './discover.js';
|
|
7
7
|
export { buildForCompile, resolveChunkArtifacts, runCompileManifest, } from './compile.js';
|
|
8
|
-
export { createLogicHost, installHeadlessDocument, runLogicManifest
|
|
8
|
+
export { createLogicHost, installHeadlessDocument, runLogicManifest } from './logic.js';
|
|
9
9
|
export { runSsrManifest } from './ssr.js';
|
|
10
10
|
export { runResumeManifest } from './resume.js';
|
|
11
11
|
export { runDeploymentManifest } from './deployment.js';
|
|
12
|
-
export { runBrowserManifest, resolveBrowserExecutable
|
|
13
|
-
export { isDeliveryServeRoot, resolveDeliveryServeRoot
|
|
12
|
+
export { runBrowserManifest, resolveBrowserExecutable } from './browser.js';
|
|
13
|
+
export { isDeliveryServeRoot, resolveDeliveryServeRoot } from './delivery-serve-root.js';
|
|
14
14
|
export { BROWSER_LOCATOR_KINDS, defaultClickLocator, parseActionLocator, } from './browser-protocol.js';
|
|
15
15
|
export { isServeHostManifest, resolveRoutePath, startServeHost } from './browser-serve.js';
|
|
16
16
|
export { createArtifactsDir, writeFailureEvidence, writeTimingOnly, } from './browser-evidence.js';
|
|
17
|
-
export { runManifest, resultsToReport
|
|
17
|
+
export { runManifest, resultsToReport } from './run.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/test",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VMZ native test protocol + Compile/Logic/Browser/SSR/Resume/Deployment hosts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"build": "tsc -p tsconfig.json"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@vmz/core": "0.1
|
|
31
|
-
"@vmz/protocol": "0.1
|
|
30
|
+
"@vmz/core": "0.2.1",
|
|
31
|
+
"@vmz/protocol": "0.2.1",
|
|
32
32
|
"linkedom": "^0.18.13",
|
|
33
33
|
"puppeteer-core": "^24.11.2"
|
|
34
34
|
},
|