qualty 0.1.31 → 0.1.32
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/bin/local-runner.js +20 -0
- package/package.json +1 -1
package/bin/local-runner.js
CHANGED
|
@@ -289,6 +289,19 @@ function authSetupCommand(projectId, profileName) {
|
|
|
289
289
|
return `qualty auth setup --project ${pid} --profile "${name}"`;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
function loadStorageStateForBackend(statePath) {
|
|
293
|
+
if (!statePath) return null;
|
|
294
|
+
try {
|
|
295
|
+
const parsed = JSON.parse(readFileSync(statePath, "utf8"));
|
|
296
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
297
|
+
return parsed;
|
|
298
|
+
} catch (err) {
|
|
299
|
+
// eslint-disable-next-line no-console
|
|
300
|
+
console.warn(`[qualty][auth] could not read local auth state for backend injection: ${err?.message || err}`);
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
292
305
|
export function summarizeStorageStateFile(statePath) {
|
|
293
306
|
const path = String(statePath || "").trim();
|
|
294
307
|
if (!path || !existsSync(path)) {
|
|
@@ -846,6 +859,8 @@ async function runLocalSingleCombination({
|
|
|
846
859
|
|
|
847
860
|
let cloudflared = null;
|
|
848
861
|
try {
|
|
862
|
+
const storageStateForBackend = loadStorageStateForBackend(finalStoragePath);
|
|
863
|
+
|
|
849
864
|
const wsParts = parseWsEndpoint(cdpEndpoint);
|
|
850
865
|
if (!Number.isFinite(wsParts.port) || wsParts.port < 1 || wsParts.port > 65535) {
|
|
851
866
|
throw new Error(`Could not parse local browser WebSocket port from ${cdpEndpoint}`);
|
|
@@ -878,8 +893,13 @@ async function runLocalSingleCombination({
|
|
|
878
893
|
connect_url: publicConnectUrl,
|
|
879
894
|
connect_kind: "playwright",
|
|
880
895
|
start_url: url,
|
|
896
|
+
...(storageStateForBackend ? { storage_state: storageStateForBackend } : {}),
|
|
881
897
|
}),
|
|
882
898
|
});
|
|
899
|
+
if (storageStateForBackend) {
|
|
900
|
+
// eslint-disable-next-line no-console
|
|
901
|
+
console.log("[qualty][auth] sent local auth state to backend for browser context injection");
|
|
902
|
+
}
|
|
883
903
|
// eslint-disable-next-line no-console
|
|
884
904
|
console.log(`[qualty] Registered local browser tunnel for ${effectiveDevice}`);
|
|
885
905
|
const result = await waitForCombinationDone({
|