@checkly/playwright-core 1.48.24-maxi → 1.48.24

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 (109) hide show
  1. package/lib/vite/traceViewer/assets/{codeMirrorModule-tzBrK1V4.js → codeMirrorModule-Bh1rfd2w.js} +10 -10
  2. package/lib/vite/traceViewer/assets/codeMirrorModule-lDjkI8Ax.js +24 -0
  3. package/lib/vite/traceViewer/assets/codeMirrorModule-xvopPhZ4.js +24 -0
  4. package/lib/vite/traceViewer/assets/{inspectorTab-BuJ3wAX_.js → inspectorTab-7GHnKvSD.js} +2 -2
  5. package/lib/vite/traceViewer/assets/inspectorTab-BPzhNk9r.js +64 -0
  6. package/lib/vite/traceViewer/assets/inspectorTab-wfvwpMHs.js +64 -0
  7. package/lib/vite/traceViewer/assets/{workbench-DdmJ9AJV.js → workbench-C6nMfKVy.js} +1 -1
  8. package/lib/vite/traceViewer/assets/workbench-DLv_q9ji.js +9 -0
  9. package/lib/vite/traceViewer/assets/workbench-LKskf2Iy.js +9 -0
  10. package/lib/vite/traceViewer/{embedded.DInvAijy.js → embedded.BIubxTi3.js} +1 -1
  11. package/lib/vite/traceViewer/embedded.BXYl5zRv.js +2 -0
  12. package/lib/vite/traceViewer/embedded.CShPz96b.js +2 -0
  13. package/lib/vite/traceViewer/embedded.html +3 -3
  14. package/lib/vite/traceViewer/{index.Dha3cgqs.js → index.BZ9CE8t3.js} +1 -1
  15. package/lib/vite/traceViewer/index.DPD22sZn.js +2 -0
  16. package/lib/vite/traceViewer/index.DZkJsFod.js +2 -0
  17. package/lib/vite/traceViewer/index.html +3 -3
  18. package/lib/vite/traceViewer/{recorder.DNMfnSiu.js → recorder.BVExlUUk.js} +1 -1
  19. package/lib/vite/traceViewer/recorder.BaRuS6Pc.js +2 -0
  20. package/lib/vite/traceViewer/recorder.C4zxcvd2.js +2 -0
  21. package/lib/vite/traceViewer/recorder.html +2 -2
  22. package/lib/vite/traceViewer/{uiMode.Cr1tvTWS.js → uiMode.B11wexdJ.js} +1 -1
  23. package/lib/vite/traceViewer/uiMode.DXa41vt9.js +5 -0
  24. package/lib/vite/traceViewer/uiMode.DjTS7tqC.js +5 -0
  25. package/lib/vite/traceViewer/uiMode.html +3 -3
  26. package/package.json +1 -1
  27. package/lib/client/clientStackTrace.js +0 -66
  28. package/lib/client/fileUtils.js +0 -33
  29. package/lib/client/platform.js +0 -72
  30. package/lib/client/timeoutSettings.js +0 -66
  31. package/lib/client/webSocket.js +0 -107
  32. package/lib/generated/recorderSource.js +0 -7
  33. package/lib/server/callLog.js +0 -80
  34. package/lib/server/harBackend.js +0 -158
  35. package/lib/server/localUtils.js +0 -204
  36. package/lib/server/recorder/chat.js +0 -178
  37. package/lib/server/recorder/codeGenerator.js +0 -154
  38. package/lib/server/recorder/csharp.js +0 -311
  39. package/lib/server/recorder/java.js +0 -249
  40. package/lib/server/recorder/javascript.js +0 -230
  41. package/lib/server/recorder/jsonl.js +0 -48
  42. package/lib/server/recorder/language.js +0 -45
  43. package/lib/server/recorder/python.js +0 -276
  44. package/lib/server/recorder/recorderActions.js +0 -6
  45. package/lib/server/recorder/utils.js +0 -46
  46. package/lib/server/storageScript.js +0 -161
  47. package/lib/server/timeoutSettings.js +0 -75
  48. package/lib/server/utils/ascii.js +0 -32
  49. package/lib/server/utils/comparators.js +0 -160
  50. package/lib/server/utils/crypto.js +0 -172
  51. package/lib/server/utils/debug.js +0 -39
  52. package/lib/server/utils/debugLogger.js +0 -94
  53. package/lib/server/utils/env.js +0 -54
  54. package/lib/server/utils/eventsHelper.js +0 -39
  55. package/lib/server/utils/expectUtils.js +0 -34
  56. package/lib/server/utils/fileUtils.js +0 -205
  57. package/lib/server/utils/happyEyeballs.js +0 -210
  58. package/lib/server/utils/hostPlatform.js +0 -146
  59. package/lib/server/utils/httpServer.js +0 -234
  60. package/lib/server/utils/image_tools/colorUtils.js +0 -99
  61. package/lib/server/utils/image_tools/compare.js +0 -109
  62. package/lib/server/utils/image_tools/imageChannel.js +0 -71
  63. package/lib/server/utils/image_tools/stats.js +0 -103
  64. package/lib/server/utils/linuxUtils.js +0 -59
  65. package/lib/server/utils/network.js +0 -161
  66. package/lib/server/utils/nodePlatform.js +0 -141
  67. package/lib/server/utils/pipeTransport.js +0 -83
  68. package/lib/server/utils/processLauncher.js +0 -249
  69. package/lib/server/utils/profiler.js +0 -53
  70. package/lib/server/utils/socksProxy.js +0 -571
  71. package/lib/server/utils/spawnAsync.js +0 -46
  72. package/lib/server/utils/task.js +0 -59
  73. package/lib/server/utils/userAgent.js +0 -92
  74. package/lib/server/utils/wsServer.js +0 -129
  75. package/lib/server/utils/zipFile.js +0 -76
  76. package/lib/server/utils/zones.js +0 -55
  77. package/lib/utils/glob.js +0 -84
  78. package/lib/utils/isomorphic/ariaSnapshot.js +0 -393
  79. package/lib/utils/isomorphic/assert.js +0 -26
  80. package/lib/utils/isomorphic/colors.js +0 -66
  81. package/lib/utils/isomorphic/headers.js +0 -53
  82. package/lib/utils/isomorphic/manualPromise.js +0 -108
  83. package/lib/utils/isomorphic/multimap.js +0 -74
  84. package/lib/utils/isomorphic/rtti.js +0 -42
  85. package/lib/utils/isomorphic/semaphore.js +0 -52
  86. package/lib/utils/isomorphic/stackTrace.js +0 -170
  87. package/lib/utils/isomorphic/time.js +0 -26
  88. package/lib/utils/isomorphic/timeoutRunner.js +0 -67
  89. package/lib/utils/isomorphic/types.js +0 -6
  90. package/lib/utils/mimeType.js +0 -30
  91. package/lib/utils.js +0 -448
  92. package/lib/vite/traceViewer/assets/codeMirrorModule-CB-2okZ8.js +0 -16684
  93. package/lib/vite/traceViewer/assets/defaultSettingsView-CBiB4avC.js +0 -217
  94. package/lib/vite/traceViewer/assets/inspectorTab-CwgfffWb.js +0 -25143
  95. package/lib/vite/traceViewer/assets/workbench-CWZselvp.js +0 -2470
  96. package/lib/vite/traceViewer/assets/xtermModule-Es_gt_u7.js +0 -5994
  97. package/lib/vite/traceViewer/codeMirrorModule.DuST8d_k.css +0 -344
  98. package/lib/vite/traceViewer/defaultSettingsView.Dp3b_92q.css +0 -41
  99. package/lib/vite/traceViewer/embedded.BeldSa2G.css +0 -68
  100. package/lib/vite/traceViewer/embedded.gzudoghF.js +0 -106
  101. package/lib/vite/traceViewer/index.DilotR1h.js +0 -314
  102. package/lib/vite/traceViewer/index.QewjJ85u.css +0 -131
  103. package/lib/vite/traceViewer/inspectorTab.DnGm18kV.css +0 -3178
  104. package/lib/vite/traceViewer/recorder.DLgqV9db.css +0 -15
  105. package/lib/vite/traceViewer/recorder.DVrkq3Um.js +0 -551
  106. package/lib/vite/traceViewer/uiMode.C9_OcpPU.js +0 -1756
  107. package/lib/vite/traceViewer/uiMode.c5ORgcrX.css +0 -1424
  108. package/lib/vite/traceViewer/workbench.xUZSA8PY.css +0 -787
  109. package/lib/vite/traceViewer/xtermModule.EsaqrrTX.css +0 -209
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
@@ -1,551 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { j as jsxRuntimeExports, r as reactExports, Q as sha1, M as MultiTraceModel, L as ListView, o as asLocator, g as Toolbar, T as ToolbarButton, U as ToolbarSeparator, V as copy, t as toggleTheme, S as SplitView, H as TabbedPane, E as useConsoleTabModel, F as useNetworkTabModel, h as useSetting, W as collectSnapshots, X as extendSnapshot, Y as SnapshotView, O as SourceTab, J as InspectorTab, K as ConsoleTab, N as NetworkTab, a as applyTheme, c as clientExports } from "./assets/inspectorTab-CwgfffWb.js";
5
- const SourceChooser = ({ sources, fileId, setFileId }) => {
6
- return /* @__PURE__ */ jsxRuntimeExports.jsx("select", { className: "source-chooser", hidden: !sources.length, title: "Source chooser", value: fileId, onChange: (event) => {
7
- setFileId(event.target.selectedOptions[0].value);
8
- }, children: renderSourceOptions(sources) });
9
- };
10
- function renderSourceOptions(sources) {
11
- const transformTitle = (title) => title.replace(/.*[/\\]([^/\\]+)/, "$1");
12
- const renderOption = (source) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: source.id, children: transformTitle(source.label) }, source.id);
13
- const sourcesByGroups = /* @__PURE__ */ new Map();
14
- for (const source of sources) {
15
- let list = sourcesByGroups.get(source.group || "Debugger");
16
- if (!list) {
17
- list = [];
18
- sourcesByGroups.set(source.group || "Debugger", list);
19
- }
20
- list.push(source);
21
- }
22
- return [...sourcesByGroups.entries()].map(([group, sources2]) => /* @__PURE__ */ jsxRuntimeExports.jsx("optgroup", { label: group, children: sources2.filter((s) => (s.group || "Debugger") === group).map((source) => renderOption(source)) }, group));
23
- }
24
- const ModelContext = reactExports.createContext(void 0);
25
- const ModelProvider = ({ trace, children }) => {
26
- const [model, setModel] = reactExports.useState();
27
- const [counter, setCounter] = reactExports.useState(0);
28
- const pollTimer = reactExports.useRef(null);
29
- reactExports.useEffect(() => {
30
- if (pollTimer.current)
31
- clearTimeout(pollTimer.current);
32
- pollTimer.current = setTimeout(async () => {
33
- try {
34
- const result = await loadSingleTraceFile(trace);
35
- if (result.sha1 !== (model == null ? void 0 : model.sha1))
36
- setModel(result);
37
- } catch {
38
- setModel(void 0);
39
- } finally {
40
- setCounter(counter + 1);
41
- }
42
- }, 500);
43
- return () => {
44
- if (pollTimer.current)
45
- clearTimeout(pollTimer.current);
46
- };
47
- }, [counter, model, trace]);
48
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ModelContext.Provider, { value: model == null ? void 0 : model.model, children });
49
- };
50
- async function loadSingleTraceFile(url) {
51
- const params = new URLSearchParams();
52
- params.set("trace", url);
53
- params.set("limit", "1");
54
- const response = await fetch(`contexts?${params.toString()}`);
55
- const contextEntries = await response.json();
56
- const tokens = [];
57
- for (const entry of contextEntries) {
58
- entry.actions.forEach((a) => tokens.push(a.type + "@" + a.startTime + "-" + a.endTime));
59
- entry.events.forEach((e) => tokens.push(e.type + "@" + e.time));
60
- }
61
- return { model: new MultiTraceModel(contextEntries), sha1: await sha1(tokens.join("|")) };
62
- }
63
- function buildFullSelector(framePath, selector) {
64
- return [...framePath, selector].join(" >> internal:control=enter-frame >> ");
65
- }
66
- function traceParamsForAction(actionInContext) {
67
- const { action } = actionInContext;
68
- switch (action.name) {
69
- case "navigate": {
70
- const params = {
71
- url: action.url
72
- };
73
- return { method: "goto", params };
74
- }
75
- case "openPage":
76
- case "closePage":
77
- throw new Error("Not reached");
78
- }
79
- const selector = buildFullSelector(actionInContext.frame.framePath, action.selector);
80
- switch (action.name) {
81
- case "click": {
82
- const params = {
83
- selector,
84
- strict: true,
85
- modifiers: toKeyboardModifiers(action.modifiers),
86
- button: action.button,
87
- clickCount: action.clickCount,
88
- position: action.position
89
- };
90
- return { method: "click", params };
91
- }
92
- case "press": {
93
- const params = {
94
- selector,
95
- strict: true,
96
- key: [...toKeyboardModifiers(action.modifiers), action.key].join("+")
97
- };
98
- return { method: "press", params };
99
- }
100
- case "fill": {
101
- const params = {
102
- selector,
103
- strict: true,
104
- value: action.text
105
- };
106
- return { method: "fill", params };
107
- }
108
- case "setInputFiles": {
109
- const params = {
110
- selector,
111
- strict: true,
112
- localPaths: action.files
113
- };
114
- return { method: "setInputFiles", params };
115
- }
116
- case "check": {
117
- const params = {
118
- selector,
119
- strict: true
120
- };
121
- return { method: "check", params };
122
- }
123
- case "uncheck": {
124
- const params = {
125
- selector,
126
- strict: true
127
- };
128
- return { method: "uncheck", params };
129
- }
130
- case "select": {
131
- const params = {
132
- selector,
133
- strict: true,
134
- options: action.options.map((option) => ({ value: option }))
135
- };
136
- return { method: "selectOption", params };
137
- }
138
- case "assertChecked": {
139
- const params = {
140
- selector: action.selector,
141
- expression: "to.be.checked",
142
- isNot: !action.checked
143
- };
144
- return { method: "expect", params };
145
- }
146
- case "assertText": {
147
- const params = {
148
- selector,
149
- expression: "to.have.text",
150
- expectedText: [],
151
- isNot: false
152
- };
153
- return { method: "expect", params };
154
- }
155
- case "assertValue": {
156
- const params = {
157
- selector,
158
- expression: "to.have.value",
159
- expectedValue: void 0,
160
- isNot: false
161
- };
162
- return { method: "expect", params };
163
- }
164
- case "assertVisible": {
165
- const params = {
166
- selector,
167
- expression: "to.be.visible",
168
- isNot: false
169
- };
170
- return { method: "expect", params };
171
- }
172
- }
173
- }
174
- function toKeyboardModifiers(modifiers) {
175
- const result = [];
176
- if (modifiers & 1)
177
- result.push("Alt");
178
- if (modifiers & 2)
179
- result.push("ControlOrMeta");
180
- if (modifiers & 4)
181
- result.push("ControlOrMeta");
182
- if (modifiers & 8)
183
- result.push("Shift");
184
- return result;
185
- }
186
- const ActionList = ListView;
187
- const ActionListView = ({
188
- sdkLanguage,
189
- actions,
190
- selectedAction,
191
- onSelectedAction
192
- }) => {
193
- const render = reactExports.useCallback((action) => {
194
- return renderAction(sdkLanguage, action);
195
- }, [sdkLanguage]);
196
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vbox", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
197
- ActionList,
198
- {
199
- name: "actions",
200
- items: actions,
201
- selectedItem: selectedAction,
202
- onSelected: onSelectedAction,
203
- render
204
- }
205
- ) });
206
- };
207
- const renderAction = (sdkLanguage, action) => {
208
- const { method, params } = traceParamsForAction(action);
209
- const locator = params.selector ? asLocator(sdkLanguage || "javascript", params.selector) : void 0;
210
- const apiName = `page.${method}`;
211
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "action-title", title: apiName, children: [
212
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: apiName }),
213
- locator && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "action-selector", title: locator, children: locator }),
214
- method === "goto" && params.url && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "action-url", title: params.url, children: params.url })
215
- ] }) });
216
- };
217
- const BackendContext = reactExports.createContext(void 0);
218
- const BackendProvider = ({ guid, children }) => {
219
- const [connection, setConnection] = reactExports.useState(void 0);
220
- const [mode, setMode] = reactExports.useState("none");
221
- const [actions, setActions] = reactExports.useState({ actions: [], sources: [] });
222
- const callbacks = reactExports.useRef({ setMode, setActions });
223
- reactExports.useEffect(() => {
224
- const wsURL = new URL(`../${guid}`, window.location.toString());
225
- wsURL.protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
226
- const webSocket = new WebSocket(wsURL.toString());
227
- setConnection(new Connection(webSocket, callbacks.current));
228
- return () => {
229
- webSocket.close();
230
- };
231
- }, [guid]);
232
- const backend = reactExports.useMemo(() => {
233
- return connection ? { mode, actions: actions.actions, sources: actions.sources, connection } : void 0;
234
- }, [actions, mode, connection]);
235
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BackendContext.Provider, { value: backend, children });
236
- };
237
- class Connection {
238
- constructor(webSocket, options) {
239
- __publicField(this, "_lastId", 0);
240
- __publicField(this, "_webSocket");
241
- __publicField(this, "_callbacks", /* @__PURE__ */ new Map());
242
- __publicField(this, "_options");
243
- this._webSocket = webSocket;
244
- this._callbacks = /* @__PURE__ */ new Map();
245
- this._options = options;
246
- this._webSocket.addEventListener("message", (event) => {
247
- const message = JSON.parse(event.data);
248
- const { id, result, error, method, params } = message;
249
- if (id) {
250
- const callback = this._callbacks.get(id);
251
- if (!callback)
252
- return;
253
- this._callbacks.delete(id);
254
- if (error)
255
- callback.reject(new Error(error));
256
- else
257
- callback.resolve(result);
258
- } else {
259
- this._dispatchEvent(method, params);
260
- }
261
- });
262
- }
263
- setMode(mode) {
264
- this._sendMessageNoReply("setMode", { mode });
265
- }
266
- async _sendMessage(method, params) {
267
- const id = ++this._lastId;
268
- const message = { id, method, params };
269
- this._webSocket.send(JSON.stringify(message));
270
- return new Promise((resolve, reject) => {
271
- this._callbacks.set(id, { resolve, reject });
272
- });
273
- }
274
- _sendMessageNoReply(method, params) {
275
- this._sendMessage(method, params).catch(() => {
276
- });
277
- }
278
- _dispatchEvent(method, params) {
279
- if (method === "setMode") {
280
- const { mode } = params;
281
- this._options.setMode(mode);
282
- }
283
- if (method === "setActions") {
284
- const { actions, sources } = params;
285
- this._options.setActions({ actions: actions.filter((a) => a.action.name !== "openPage" && a.action.name !== "closePage"), sources });
286
- window.playwrightSourcesEchoForTest = sources;
287
- }
288
- }
289
- }
290
- const RecorderView = () => {
291
- const searchParams = new URLSearchParams(window.location.search);
292
- const guid = searchParams.get("ws");
293
- const trace = searchParams.get("trace") + ".json";
294
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BackendProvider, { guid, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelProvider, { trace, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Workbench, {}) }) });
295
- };
296
- const Workbench = () => {
297
- const backend = reactExports.useContext(BackendContext);
298
- const model = reactExports.useContext(ModelContext);
299
- const [fileId, setFileId] = reactExports.useState();
300
- const [selectedStartTime, setSelectedStartTime] = reactExports.useState(void 0);
301
- const [isInspecting, setIsInspecting] = reactExports.useState(false);
302
- const [highlightedLocatorInProperties, setHighlightedLocatorInProperties] = reactExports.useState("");
303
- const [highlightedLocatorInTrace, setHighlightedLocatorInTrace] = reactExports.useState("");
304
- const [traceCallId, setTraceCallId] = reactExports.useState();
305
- const setSelectedAction = reactExports.useCallback((action) => {
306
- setSelectedStartTime(action == null ? void 0 : action.startTime);
307
- }, []);
308
- const selectedAction = reactExports.useMemo(() => {
309
- return backend == null ? void 0 : backend.actions.find((a) => a.startTime === selectedStartTime);
310
- }, [backend == null ? void 0 : backend.actions, selectedStartTime]);
311
- reactExports.useEffect(() => {
312
- var _a;
313
- const callId = (_a = model == null ? void 0 : model.actions.find((a) => a.endTime && a.endTime === (selectedAction == null ? void 0 : selectedAction.endTime))) == null ? void 0 : _a.callId;
314
- if (callId)
315
- setTraceCallId(callId);
316
- }, [model, selectedAction]);
317
- const source = reactExports.useMemo(() => (backend == null ? void 0 : backend.sources.find((s) => s.id === fileId)) || (backend == null ? void 0 : backend.sources[0]), [backend == null ? void 0 : backend.sources, fileId]);
318
- const sourceLocation = reactExports.useMemo(() => {
319
- if (!source)
320
- return void 0;
321
- const sourceLocation2 = {
322
- file: "",
323
- line: 0,
324
- column: 0,
325
- source: {
326
- errors: [],
327
- content: source.text
328
- }
329
- };
330
- return sourceLocation2;
331
- }, [source]);
332
- const sdkLanguage = (source == null ? void 0 : source.language) || "javascript";
333
- const { boundaries } = reactExports.useMemo(() => {
334
- const boundaries2 = { minimum: (model == null ? void 0 : model.startTime) || 0, maximum: (model == null ? void 0 : model.endTime) || 3e4 };
335
- if (boundaries2.minimum > boundaries2.maximum) {
336
- boundaries2.minimum = 0;
337
- boundaries2.maximum = 3e4;
338
- }
339
- boundaries2.maximum += (boundaries2.maximum - boundaries2.minimum) / 20;
340
- return { boundaries: boundaries2 };
341
- }, [model]);
342
- const locatorPickedInTrace = reactExports.useCallback((locator) => {
343
- setHighlightedLocatorInProperties(locator);
344
- setHighlightedLocatorInTrace("");
345
- setIsInspecting(false);
346
- }, []);
347
- const locatorTypedInProperties = reactExports.useCallback((locator) => {
348
- setHighlightedLocatorInTrace(locator);
349
- setHighlightedLocatorInProperties(locator);
350
- }, []);
351
- const actionList = /* @__PURE__ */ jsxRuntimeExports.jsx(
352
- ActionListView,
353
- {
354
- sdkLanguage,
355
- actions: (backend == null ? void 0 : backend.actions) || [],
356
- selectedAction,
357
- onSelectedAction: setSelectedAction
358
- }
359
- );
360
- const actionsTab = {
361
- id: "actions",
362
- title: "Actions",
363
- component: actionList
364
- };
365
- const toolbar = /* @__PURE__ */ jsxRuntimeExports.jsxs(Toolbar, { sidebarBackground: true, children: [
366
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: 4 } }),
367
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "inspect", title: "Pick locator", toggled: isInspecting, onClick: () => {
368
- setIsInspecting(!isInspecting);
369
- } }),
370
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "eye", title: "Assert visibility", onClick: () => {
371
- } }),
372
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "whole-word", title: "Assert text", onClick: () => {
373
- } }),
374
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "symbol-constant", title: "Assert value", onClick: () => {
375
- } }),
376
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarSeparator, {}),
377
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "files", title: "Copy", disabled: !source || !source.text, onClick: () => {
378
- if (source == null ? void 0 : source.text)
379
- copy(source.text);
380
- } }),
381
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: "auto" } }),
382
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Target:" }),
383
- /* @__PURE__ */ jsxRuntimeExports.jsx(SourceChooser, { fileId, sources: (backend == null ? void 0 : backend.sources) || [], setFileId: (fileId2) => {
384
- setFileId(fileId2);
385
- } }),
386
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "color-mode", title: "Toggle color mode", toggled: false, onClick: () => toggleTheme() })
387
- ] });
388
- const sidebarTabbedPane = /* @__PURE__ */ jsxRuntimeExports.jsx(TabbedPane, { tabs: [actionsTab] });
389
- const traceView = /* @__PURE__ */ jsxRuntimeExports.jsx(
390
- TraceView,
391
- {
392
- sdkLanguage,
393
- callId: traceCallId,
394
- isInspecting,
395
- setIsInspecting,
396
- highlightedLocator: highlightedLocatorInTrace,
397
- setHighlightedLocator: locatorPickedInTrace
398
- }
399
- );
400
- const propertiesView = /* @__PURE__ */ jsxRuntimeExports.jsx(
401
- PropertiesView,
402
- {
403
- sdkLanguage,
404
- boundaries,
405
- setIsInspecting,
406
- highlightedLocator: highlightedLocatorInProperties,
407
- setHighlightedLocator: locatorTypedInProperties,
408
- sourceLocation
409
- }
410
- );
411
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vbox workbench", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
412
- SplitView,
413
- {
414
- sidebarSize: 250,
415
- orientation: "horizontal",
416
- settingName: "recorderActionListSidebar",
417
- sidebarIsFirst: true,
418
- main: /* @__PURE__ */ jsxRuntimeExports.jsx(
419
- SplitView,
420
- {
421
- sidebarSize: 250,
422
- orientation: "vertical",
423
- settingName: "recorderPropertiesSidebar",
424
- main: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox", children: [
425
- toolbar,
426
- traceView
427
- ] }),
428
- sidebar: propertiesView
429
- }
430
- ),
431
- sidebar: sidebarTabbedPane
432
- }
433
- ) });
434
- };
435
- const PropertiesView = ({
436
- sdkLanguage,
437
- boundaries,
438
- setIsInspecting,
439
- highlightedLocator,
440
- setHighlightedLocator,
441
- sourceLocation
442
- }) => {
443
- const model = reactExports.useContext(ModelContext);
444
- const consoleModel = useConsoleTabModel(model, boundaries);
445
- const networkModel = useNetworkTabModel(model, boundaries);
446
- const sourceModel = reactExports.useRef(/* @__PURE__ */ new Map());
447
- const [selectedPropertiesTab, setSelectedPropertiesTab] = useSetting("recorderPropertiesTab", "source");
448
- const inspectorTab = {
449
- id: "inspector",
450
- title: "Locator",
451
- render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
452
- InspectorTab,
453
- {
454
- showScreenshot: false,
455
- sdkLanguage,
456
- setIsInspecting,
457
- highlightedLocator,
458
- setHighlightedLocator
459
- }
460
- )
461
- };
462
- const sourceTab = {
463
- id: "source",
464
- title: "Source",
465
- render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
466
- SourceTab,
467
- {
468
- sources: sourceModel.current,
469
- stackFrameLocation: "right",
470
- fallbackLocation: sourceLocation
471
- }
472
- )
473
- };
474
- const consoleTab = {
475
- id: "console",
476
- title: "Console",
477
- count: consoleModel.entries.length,
478
- render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ConsoleTab, { boundaries, consoleModel })
479
- };
480
- const networkTab = {
481
- id: "network",
482
- title: "Network",
483
- count: networkModel.resources.length,
484
- render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(NetworkTab, { boundaries, networkModel })
485
- };
486
- const tabs = [
487
- sourceTab,
488
- inspectorTab,
489
- consoleTab,
490
- networkTab
491
- ];
492
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
493
- TabbedPane,
494
- {
495
- tabs,
496
- selectedTab: selectedPropertiesTab,
497
- setSelectedTab: setSelectedPropertiesTab
498
- }
499
- );
500
- };
501
- const TraceView = ({
502
- sdkLanguage,
503
- callId,
504
- isInspecting,
505
- setIsInspecting,
506
- highlightedLocator,
507
- setHighlightedLocator
508
- }) => {
509
- const model = reactExports.useContext(ModelContext);
510
- const action = reactExports.useMemo(() => {
511
- return model == null ? void 0 : model.actions.find((a) => a.callId === callId);
512
- }, [model, callId]);
513
- const snapshot = reactExports.useMemo(() => {
514
- const snapshot2 = collectSnapshots(action);
515
- return snapshot2.action || snapshot2.after || snapshot2.before;
516
- }, [action]);
517
- const snapshotUrls = reactExports.useMemo(() => {
518
- return snapshot ? extendSnapshot(snapshot) : void 0;
519
- }, [snapshot]);
520
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
521
- SnapshotView,
522
- {
523
- sdkLanguage,
524
- testIdAttributeName: "data-testid",
525
- isInspecting,
526
- setIsInspecting,
527
- highlightedLocator,
528
- setHighlightedLocator,
529
- snapshotUrls
530
- }
531
- );
532
- };
533
- (async () => {
534
- applyTheme();
535
- if (window.location.protocol !== "file:") {
536
- if (!navigator.serviceWorker)
537
- throw new Error(`Service workers are not supported.
538
- Make sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);
539
- navigator.serviceWorker.register("sw.bundle.js");
540
- if (!navigator.serviceWorker.controller) {
541
- await new Promise((f) => {
542
- navigator.serviceWorker.oncontrollerchange = () => f();
543
- });
544
- }
545
- setInterval(function() {
546
- fetch("ping");
547
- }, 1e4);
548
- }
549
- clientExports.createRoot(document.querySelector("#root")).render(/* @__PURE__ */ jsxRuntimeExports.jsx(RecorderView, {}));
550
- })();
551
- //# sourceMappingURL=recorder.DVrkq3Um.js.map