@jskit-ai/jskit-catalog 0.2.35 → 0.2.37

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": "@jskit-ai/jskit-catalog",
3
- "version": "0.2.35",
3
+ "version": "0.2.37",
4
4
  "description": "Published metadata catalog for JSKIT package metadata.",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,6 +21,11 @@ const DEFAULT_PORT = 4173;
21
21
  // A whole run's default bound: a suite that would take hours stops instead, and says so. A suite measured to need
22
22
  // longer passes its own globalTimeout, with the measurement beside it.
23
23
  const GLOBAL_TIMEOUT_MS = 20 * 60_000;
24
+ // A click, fill or navigation waiting on something that never comes (a stale locator) fails in seconds, with its own
25
+ // error, instead of holding the test until its 60 s timeout. Over 652 passing app tests the slowest action or page
26
+ // load took 9.0 s, and expect already waits 10 s.
27
+ const ACTION_TIMEOUT_MS = 15_000;
28
+ const NAVIGATION_TIMEOUT_MS = 30_000;
24
29
  // Building the frontend when its sources changed, preparing the databases and starting every server.
25
30
  const SERVERS_TIMEOUT_MS = 180_000;
26
31
  // Where the servers' launcher leaves each worker's server environment, for that worker's own process.
@@ -90,6 +95,8 @@ function preparedWorkerEnvironment(file, index) {
90
95
  * @param {Record<string, string>} [options.env] Environment every server gets, such as its test-only drivers.
91
96
  * @param {string} [options.health] The path that answers 200 once a server is ready.
92
97
  * @param {number} [options.globalTimeout] The whole run's bound in milliseconds (20 minutes); never 0.
98
+ * @param {number} [options.actionTimeout] One click, fill or other action's bound in milliseconds (15 s); never 0.
99
+ * @param {number} [options.navigationTimeout] One navigation's bound in milliseconds (30 s); never 0.
93
100
  * @param {Record<string, string | undefined>} [options.environment] Read, and given a worker's prepared environment,
94
101
  * instead of process.env (tests).
95
102
  * @param {string} [options.cwd] The directory Playwright runs in (tests).
@@ -104,12 +111,19 @@ function browserTestConfig({
104
111
  env = {},
105
112
  health = "/api/health",
106
113
  globalTimeout = GLOBAL_TIMEOUT_MS,
114
+ actionTimeout = ACTION_TIMEOUT_MS,
115
+ navigationTimeout = NAVIGATION_TIMEOUT_MS,
107
116
  environment = process.env,
108
117
  cwd = process.cwd()
109
118
  } = {}) {
110
119
  if (!Number.isInteger(globalTimeout) || globalTimeout < 1) {
111
120
  throw new Error("browserTestConfig() needs a globalTimeout of at least 1 ms; a run is always bounded.");
112
121
  }
122
+ for (const [name, value] of Object.entries({ actionTimeout, navigationTimeout })) {
123
+ if (!Number.isInteger(value) || value < 1) {
124
+ throw new Error(`browserTestConfig() needs an ${name} of at least 1 ms; a stale locator fails in seconds, not minutes.`);
125
+ }
126
+ }
113
127
  const managed = managedBaseUrl(environment);
114
128
  const workers = browserTestWorkers({ env: environment });
115
129
  const basePort = positiveInteger(environment.PLAYWRIGHT_PORT) || port;
@@ -145,9 +159,8 @@ function browserTestConfig({
145
159
  use: {
146
160
  baseURL: managed || `http://${HOST}:${basePort + workerIndex}`,
147
161
  headless: true,
148
- // A click, fill or navigation waiting on something that never comes fails in seconds, with its own error.
149
- actionTimeout: 15_000,
150
- navigationTimeout: 30_000,
162
+ actionTimeout,
163
+ navigationTimeout,
151
164
  // A failed test keeps its trace to read; no screencast is recorded while tests run.
152
165
  trace: { mode: "retain-on-failure", screenshots: false, snapshots: true, sources: true },
153
166
  ...(storageState ? { storageState } : {})