@ultimat3/testing 22.7.1 → 22.8.0

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.
Files changed (2) hide show
  1. package/package.json +14 -14
  2. package/src/cdp-e2e-page.ts +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/testing",
3
- "version": "22.7.1",
3
+ "version": "22.8.0",
4
4
  "description": "Test harness: cloned template DBs per worker, frozen clock, sealed network, 6 test types",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,18 +35,18 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@ultimat3/action": "22.7.1",
39
- "@ultimat3/cache": "22.7.1",
40
- "@ultimat3/core": "22.7.1",
41
- "@ultimat3/db": "22.7.1",
42
- "@ultimat3/entity": "22.7.1",
43
- "@ultimat3/i18n": "22.7.1",
44
- "@ultimat3/jobs": "22.7.1",
45
- "@ultimat3/mail": "22.7.1",
46
- "@ultimat3/policy": "22.7.1",
47
- "@ultimat3/query": "22.7.1",
48
- "@ultimat3/realtime": "22.7.1",
49
- "@ultimat3/render": "22.7.1",
50
- "@ultimat3/time": "22.7.1"
38
+ "@ultimat3/action": "22.8.0",
39
+ "@ultimat3/cache": "22.8.0",
40
+ "@ultimat3/core": "22.8.0",
41
+ "@ultimat3/db": "22.8.0",
42
+ "@ultimat3/entity": "22.8.0",
43
+ "@ultimat3/i18n": "22.8.0",
44
+ "@ultimat3/jobs": "22.8.0",
45
+ "@ultimat3/mail": "22.8.0",
46
+ "@ultimat3/policy": "22.8.0",
47
+ "@ultimat3/query": "22.8.0",
48
+ "@ultimat3/realtime": "22.8.0",
49
+ "@ultimat3/render": "22.8.0",
50
+ "@ultimat3/time": "22.8.0"
51
51
  }
52
52
  }
@@ -35,6 +35,15 @@ export interface E2eTab extends E2eBrowserPage {
35
35
  readonly targetId: string;
36
36
  /** Browser-wide, like the switch it models: every tab AND every worker goes with it. */
37
37
  offline(enabled: boolean): Promise<void>;
38
+ /**
39
+ * THIS tab's scripting, off or back on (`Emulation.setScriptExecutionDisabled`): the page's own
40
+ * scripts stop. What proves a page works with no JS — a link that only a script could follow is
41
+ * a page that fails for every visitor whose JS did not load. Takes effect from the next document.
42
+ * Off, `evaluate` still answers a SYNCHRONOUS expression and `click` still clicks, but no page
43
+ * callback runs — so `goto`, which waits on the page's `load` listener, never settles: navigate
44
+ * with `evaluate('location.href = …')` and poll with `waitFor`.
45
+ */
46
+ scripting(enabled: boolean): Promise<void>;
38
47
  /** Reload and wait for the load, at the url the tab already had. */
39
48
  reload(): Promise<void>;
40
49
  /** Poll `expression` in the page until it is truthy, or refuse naming `what`. */
@@ -158,6 +167,9 @@ export function cdpE2eTab(options: CdpE2eTabOptions): E2eTab {
158
167
  }
159
168
  },
160
169
  offline: (enabled: boolean) => options.offline(enabled),
170
+ async scripting(enabled: boolean): Promise<void> {
171
+ await send('Emulation.setScriptExecutionDisabled', { value: !enabled }, sessionId);
172
+ },
161
173
  async reload(): Promise<void> {
162
174
  const at = current;
163
175
  // Reload is a navigation to the url the tab already has — the one wait the port proves.