qualty 0.1.31 → 0.1.33

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.
@@ -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({
package/bin/qualty.js CHANGED
@@ -27,9 +27,9 @@ import {
27
27
  } from "./auth-ci-bundle.js";
28
28
 
29
29
  /** CLI backend URL is fixed by Qualty distribution. */
30
- // const DEFAULT_QUALTY_API_URL = "https://qualty-api-production.up.railway.app";
30
+ const DEFAULT_QUALTY_API_URL = "https://qualty-api-production.up.railway.app";
31
+ // const DEFAULT_QUALTY_API_URL = "https://qualty-api-development.up.railway.app";
31
32
  // const DEFAULT_QUALTY_API_URL = "http://localhost:8000";
32
- const DEFAULT_QUALTY_API_URL = "https://qualty-api-development.up.railway.app";
33
33
 
34
34
 
35
35
  const PROJECT_CONFIG_FILENAME = ".qualty.json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualty",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "Qualty CLI for localhost and CI test runs",
5
5
  "bin": {
6
6
  "qualty": "bin/qualty.js"