@intuned/runtime-dev 1.3.17-ws.0 → 1.3.18-dev.2
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/.babelrc +6 -0
- package/CHANGELOG.md +1 -1
- package/InterfaceTemplate/{utils.ts → __utils.ts} +3 -1
- package/InterfaceTemplate/index.playwright.ts +1 -1
- package/bin/intuned +0 -0
- package/bin/intuned-interface +7 -0
- package/dist/commands/api/run.js +7 -11
- package/dist/commands/auth-sessions/load.js +2 -2
- package/dist/commands/auth-sessions/run-check.js +8 -8
- package/dist/commands/auth-sessions/run-create.js +6 -6
- package/dist/commands/build.js +2 -3
- package/dist/commands/common/browserUtils.d.ts +3 -3
- package/dist/commands/common/browserUtils.js +3 -4
- package/dist/commands/common/getFirstLineNumber.test.js +1 -2
- package/dist/commands/common/projectExclusions.js +1 -1
- package/dist/commands/common/tsNodeImport.d.ts +1 -1
- package/dist/commands/common/tsNodeImport.js +10 -2
- package/dist/commands/common/utils/fileUtils.js +1 -2
- package/dist/commands/common/utils/{unixSocket.d.ts → interfaceClient.d.ts} +10 -2
- package/dist/commands/common/utils/{unixSocket.js → interfaceClient.js} +16 -5
- package/dist/commands/common/utils/template.js +1 -2
- package/dist/commands/interface/run.js +23 -49
- package/dist/commands/intuned-cli/commands/attempt_api.command.js +1 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +1 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +2 -2
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +1 -1
- package/dist/commands/intuned-cli/commands/authsession.command.js +1 -1
- package/dist/commands/intuned-cli/commands/authsession_record.command.js +1 -1
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +16 -0
- package/dist/commands/intuned-cli/commands/deploy.command.js +13 -9
- package/dist/commands/intuned-cli/commands/index.d.ts +2 -2
- package/dist/commands/intuned-cli/commands/index.js +15 -15
- package/dist/commands/intuned-cli/commands/{save.command.d.ts → provision.command.d.ts} +3 -3
- package/dist/commands/intuned-cli/commands/provision.command.js +50 -0
- package/dist/commands/intuned-cli/commands/run_api.command.js +1 -1
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +8 -1
- package/dist/commands/intuned-cli/commands/run_authsession.command.js +2 -2
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +1 -1
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +2 -2
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +2 -2
- package/dist/commands/intuned-cli/commands/types.d.ts +9 -1
- package/dist/commands/intuned-cli/commands/types.js +9 -5
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +30 -19
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +140 -77
- package/dist/commands/intuned-cli/controller/api.d.ts +2 -2
- package/dist/commands/intuned-cli/controller/api.js +6 -3
- package/dist/commands/intuned-cli/controller/authSession.d.ts +16 -16
- package/dist/commands/intuned-cli/controller/authSession.js +50 -39
- package/dist/commands/intuned-cli/controller/build.js +1 -2
- package/dist/commands/intuned-cli/controller/deploy.js +53 -12
- package/dist/commands/intuned-cli/controller/index.js +2 -3
- package/dist/commands/intuned-cli/controller/{save.d.ts → provision.d.ts} +5 -1
- package/dist/commands/intuned-cli/controller/provision.js +299 -0
- package/dist/commands/intuned-cli/controller/scaffold.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/scaffold.js +77 -0
- package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +45 -5
- package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +4 -3
- package/dist/commands/intuned-cli/helpers/api.js +4 -7
- package/dist/commands/intuned-cli/helpers/auth.d.ts +4 -4
- package/dist/commands/intuned-cli/helpers/auth.js +24 -21
- package/dist/commands/intuned-cli/helpers/backend.js +12 -4
- package/dist/commands/intuned-cli/helpers/browser.d.ts +4 -4
- package/dist/commands/intuned-cli/helpers/browser.js +40 -5
- package/dist/commands/intuned-cli/helpers/context.js +2 -2
- package/dist/commands/intuned-cli/helpers/errors.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/errors.js +2 -2
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +6 -5
- package/dist/commands/intuned-cli/helpers/prompts.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/prompts.js +71 -0
- package/dist/commands/intuned-cli/helpers/timeout.js +2 -2
- package/dist/commands/intuned-cli/helpers/traces.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/wrapper.js +14 -4
- package/dist/commands/intuned-cli/main.js +1 -2
- package/dist/commands/intuned-cli/types.d.ts +41 -12
- package/dist/commands/intuned-cli/types.js +12 -2
- package/dist/commands/ts-check.js +1 -2
- package/dist/common/backendFunctions/getAuthSessionParameters.js +1 -1
- package/dist/common/binStartupScript.js +1 -2
- package/dist/common/browserTabs.d.ts +72 -0
- package/dist/common/browserTabs.js +74 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/contextStorageStateHelpers.d.ts +4 -3
- package/dist/common/contextStorageStateHelpers.js +4 -1
- package/dist/common/extension/extensionsHelpers.d.ts +1 -1
- package/dist/common/extension/types.d.ts +14 -7
- package/dist/common/formatZodError.d.ts +1 -1
- package/dist/common/intunedJson.d.ts +19 -14
- package/dist/common/intunedJson.js +4 -4
- package/dist/common/jwtTokenManager.js +10 -6
- package/dist/common/launchBrowser.d.ts +10 -0
- package/dist/common/launchBrowser.js +67 -7
- package/dist/common/playwrightContext.d.ts +5 -5
- package/dist/common/playwrightContext.js +24 -14
- package/dist/common/runApi/importUsingImportFunction.d.ts +1 -3
- package/dist/common/runApi/importUsingImportFunction.js +7 -7
- package/dist/common/runApi/index.d.ts +3 -6
- package/dist/common/runApi/index.js +28 -52
- package/dist/common/settingsSchema.d.ts +52 -45
- package/dist/common/settingsSchema.js +3 -3
- package/dist/common/setupContextHook.d.ts +1 -2
- package/dist/common/setupContextHook.js +2 -2
- package/dist/common/telemetry.js +1 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -7
- package/dist/runtime/downloadDirectory.js +2 -2
- package/dist/vendor/runtime-interface.d.ts +1 -0
- package/dist/vendor/runtime-interface.js +493 -0
- package/package.json +19 -11
- package/tsup.config.ts +12 -0
- package/WebTemplate.zip +0 -0
- package/dist/commands/intuned-cli/commands/init.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/init.command.js +0 -13
- package/dist/commands/intuned-cli/commands/save.command.js +0 -42
- package/dist/commands/intuned-cli/controller/save.js +0 -357
- package/dist/common/runApi/errors.d.ts +0 -72
- package/dist/common/runApi/errors.js +0 -169
- package/dist/common/runApi/types.d.ts +0 -830
- package/dist/common/runApi/types.js +0 -73
|
@@ -5,6 +5,7 @@ var _authSession = require("../authSession");
|
|
|
5
5
|
var _helpers = require("../../helpers");
|
|
6
6
|
var _neverthrow = require("neverthrow");
|
|
7
7
|
var _runApi = require("../../../../common/runApi");
|
|
8
|
+
var _runtimeInterface = require("../../../../vendor/runtime-interface");
|
|
8
9
|
var _browser = require("../../helpers/browser");
|
|
9
10
|
var _launchBrowser = require("../../../../common/launchBrowser");
|
|
10
11
|
var _promises = require("timers/promises");
|
|
@@ -14,7 +15,7 @@ const _checkPassedResult = (0, _neverthrow.ok)({
|
|
|
14
15
|
const _checkFailedResult = (0, _neverthrow.ok)({
|
|
15
16
|
result: false
|
|
16
17
|
});
|
|
17
|
-
const _errorResult = (0, _neverthrow.err)(new
|
|
18
|
+
const _errorResult = (0, _neverthrow.err)(new _runtimeInterface.AutomationError("failed"));
|
|
18
19
|
function _createSuccessResult(session) {
|
|
19
20
|
return (0, _neverthrow.ok)({
|
|
20
21
|
session
|
|
@@ -39,6 +40,7 @@ function getMockTimeout() {
|
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
_vitest.vi.mock("fs-extra", () => ({
|
|
43
|
+
ensureDir: _vitest.vi.fn(),
|
|
42
44
|
writeJSON: _vitest.vi.fn(),
|
|
43
45
|
exists: _vitest.vi.fn().mockResolvedValue(true)
|
|
44
46
|
}));
|
|
@@ -49,7 +51,8 @@ _vitest.vi.mock("../../../../common/contextStorageStateHelpers", () => ({
|
|
|
49
51
|
getStorageState: _vitest.vi.fn()
|
|
50
52
|
}));
|
|
51
53
|
_vitest.vi.mock("../../../../common/launchBrowser", () => ({
|
|
52
|
-
launchChromium: _vitest.vi.fn()
|
|
54
|
+
launchChromium: _vitest.vi.fn(),
|
|
55
|
+
getIgnoreHttpErrorsFromConfig: _vitest.vi.fn().mockResolvedValue(false)
|
|
53
56
|
}));
|
|
54
57
|
_vitest.vi.mock("../../../../common/runApi", async importOriginal => {
|
|
55
58
|
const original = await importOriginal();
|
|
@@ -92,7 +95,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
92
95
|
registerGetAuthSessionParameters: _vitest.vi.fn()
|
|
93
96
|
};
|
|
94
97
|
});
|
|
95
|
-
(0, _vitest.describe)("
|
|
98
|
+
(0, _vitest.describe)("AuthSession controller", () => {
|
|
96
99
|
(0, _vitest.beforeEach)(() => {
|
|
97
100
|
_vitest.vi.clearAllMocks();
|
|
98
101
|
});
|
|
@@ -102,7 +105,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
102
105
|
auth: "session",
|
|
103
106
|
headless: false,
|
|
104
107
|
timeout: 6000,
|
|
105
|
-
keepBrowserOpen: false
|
|
108
|
+
keepBrowserOpen: false,
|
|
109
|
+
ignoreHttpErrors: false
|
|
106
110
|
});
|
|
107
111
|
(0, _vitest.expect)(_helpers.withTimeout).toHaveBeenCalledWith(_vitest.expect.any(Function), 6000);
|
|
108
112
|
});
|
|
@@ -111,7 +115,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
111
115
|
auth: "session",
|
|
112
116
|
headless: false,
|
|
113
117
|
timeout: 6000,
|
|
114
|
-
keepBrowserOpen: false
|
|
118
|
+
keepBrowserOpen: false,
|
|
119
|
+
ignoreHttpErrors: false
|
|
115
120
|
});
|
|
116
121
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), undefined);
|
|
117
122
|
_vitest.vi.mocked(_helpers.withCLITrace).mockClear();
|
|
@@ -121,7 +126,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
121
126
|
headless: false,
|
|
122
127
|
timeout: 6000,
|
|
123
128
|
keepBrowserOpen: false,
|
|
124
|
-
traceId: "trace-id"
|
|
129
|
+
traceId: "trace-id",
|
|
130
|
+
ignoreHttpErrors: false
|
|
125
131
|
});
|
|
126
132
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), "trace-id");
|
|
127
133
|
});
|
|
@@ -130,7 +136,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
130
136
|
auth: "session",
|
|
131
137
|
headless: false,
|
|
132
138
|
timeout: 6000,
|
|
133
|
-
keepBrowserOpen: false
|
|
139
|
+
keepBrowserOpen: false,
|
|
140
|
+
ignoreHttpErrors: false
|
|
134
141
|
});
|
|
135
142
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
136
143
|
headless: false,
|
|
@@ -142,7 +149,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
142
149
|
auth: "session",
|
|
143
150
|
headless: true,
|
|
144
151
|
timeout: 6000,
|
|
145
|
-
keepBrowserOpen: true
|
|
152
|
+
keepBrowserOpen: true,
|
|
153
|
+
ignoreHttpErrors: false
|
|
146
154
|
});
|
|
147
155
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
148
156
|
headless: true,
|
|
@@ -156,7 +164,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
156
164
|
headless: "headless",
|
|
157
165
|
timeout: 999999999,
|
|
158
166
|
keepBrowserOpen: false,
|
|
159
|
-
proxy: "proxy"
|
|
167
|
+
proxy: "proxy",
|
|
168
|
+
ignoreHttpErrors: false
|
|
160
169
|
});
|
|
161
170
|
(0, _vitest.expect)(_helpers.parseUrlProxy).toHaveBeenCalledWith("proxy");
|
|
162
171
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
@@ -166,7 +175,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
166
175
|
runOptions: {
|
|
167
176
|
headless: "headless",
|
|
168
177
|
environment: "standalone",
|
|
169
|
-
proxy: "parsed-proxy"
|
|
178
|
+
proxy: "parsed-proxy",
|
|
179
|
+
ignoreHttpErrors: false
|
|
170
180
|
},
|
|
171
181
|
auth: _vitest.expect.objectContaining({
|
|
172
182
|
session: {
|
|
@@ -182,7 +192,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
182
192
|
auth: "session",
|
|
183
193
|
headless: "headless",
|
|
184
194
|
timeout: 999999999,
|
|
185
|
-
keepBrowserOpen: false
|
|
195
|
+
keepBrowserOpen: false,
|
|
196
|
+
ignoreHttpErrors: false
|
|
186
197
|
});
|
|
187
198
|
(0, _vitest.expect)(resultTrue).toEqual(true);
|
|
188
199
|
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce(_checkFailedResult);
|
|
@@ -190,7 +201,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
190
201
|
auth: "session",
|
|
191
202
|
headless: "headless",
|
|
192
203
|
timeout: 999999999,
|
|
193
|
-
keepBrowserOpen: false
|
|
204
|
+
keepBrowserOpen: false,
|
|
205
|
+
ignoreHttpErrors: false
|
|
194
206
|
});
|
|
195
207
|
(0, _vitest.expect)(resultFalse).toEqual(false);
|
|
196
208
|
});
|
|
@@ -201,14 +213,16 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
201
213
|
auth: "session",
|
|
202
214
|
headless: "headless",
|
|
203
215
|
timeout: 999999999,
|
|
204
|
-
keepBrowserOpen: false
|
|
216
|
+
keepBrowserOpen: false,
|
|
217
|
+
ignoreHttpErrors: false
|
|
205
218
|
})).rejects.toThrow(error);
|
|
206
219
|
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce(_errorResult);
|
|
207
220
|
await (0, _vitest.expect)((0, _authSession._runCheck)({
|
|
208
221
|
auth: "session",
|
|
209
222
|
headless: "headless",
|
|
210
223
|
timeout: 999999999,
|
|
211
|
-
keepBrowserOpen: false
|
|
224
|
+
keepBrowserOpen: false,
|
|
225
|
+
ignoreHttpErrors: false
|
|
212
226
|
})).rejects.toThrow("failed");
|
|
213
227
|
});
|
|
214
228
|
});
|
|
@@ -221,7 +235,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
221
235
|
headless: "headless",
|
|
222
236
|
timeout: 999999999,
|
|
223
237
|
keepBrowserOpen: false,
|
|
224
|
-
trace: false
|
|
238
|
+
trace: false,
|
|
239
|
+
ignoreHttpErrors: false
|
|
225
240
|
});
|
|
226
241
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), undefined);
|
|
227
242
|
_vitest.vi.mocked(_helpers.withCLITrace).mockClear();
|
|
@@ -232,7 +247,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
232
247
|
headless: "headless",
|
|
233
248
|
timeout: 999999999,
|
|
234
249
|
keepBrowserOpen: false,
|
|
235
|
-
trace: true
|
|
250
|
+
trace: true,
|
|
251
|
+
ignoreHttpErrors: false
|
|
236
252
|
});
|
|
237
253
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), _vitest.expect.any(String));
|
|
238
254
|
});
|
|
@@ -244,7 +260,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
244
260
|
headless: "headless",
|
|
245
261
|
timeout: 999999999,
|
|
246
262
|
keepBrowserOpen: false,
|
|
247
|
-
trace: false
|
|
263
|
+
trace: false,
|
|
264
|
+
ignoreHttpErrors: false
|
|
248
265
|
});
|
|
249
266
|
(0, _vitest.expect)(result).toEqual(true);
|
|
250
267
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(2);
|
|
@@ -259,7 +276,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
259
276
|
headless: "headless",
|
|
260
277
|
timeout: 999999999,
|
|
261
278
|
keepBrowserOpen: false,
|
|
262
|
-
trace: false
|
|
279
|
+
trace: false,
|
|
280
|
+
ignoreHttpErrors: false
|
|
263
281
|
});
|
|
264
282
|
(0, _vitest.expect)(result).toEqual(false);
|
|
265
283
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(10);
|
|
@@ -272,7 +290,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
272
290
|
headless: "headless",
|
|
273
291
|
timeout: 999999999,
|
|
274
292
|
keepBrowserOpen: false,
|
|
275
|
-
trace: false
|
|
293
|
+
trace: false,
|
|
294
|
+
ignoreHttpErrors: false
|
|
276
295
|
});
|
|
277
296
|
(0, _vitest.expect)(result).toEqual(true);
|
|
278
297
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(2);
|
|
@@ -286,7 +305,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
286
305
|
headless: "headless",
|
|
287
306
|
timeout: 999999999,
|
|
288
307
|
keepBrowserOpen: false,
|
|
289
|
-
trace: false
|
|
308
|
+
trace: false,
|
|
309
|
+
ignoreHttpErrors: false
|
|
290
310
|
})).rejects.toThrow(error);
|
|
291
311
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
292
312
|
});
|
|
@@ -297,7 +317,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
297
317
|
authSessionInput: {},
|
|
298
318
|
headless: false,
|
|
299
319
|
timeout: 6000,
|
|
300
|
-
keepBrowserOpen: false
|
|
320
|
+
keepBrowserOpen: false,
|
|
321
|
+
ignoreHttpErrors: false
|
|
301
322
|
});
|
|
302
323
|
(0, _vitest.expect)(_helpers.withTimeout).toHaveBeenCalledWith(_vitest.expect.any(Function), 6000);
|
|
303
324
|
});
|
|
@@ -306,7 +327,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
306
327
|
authSessionInput: {},
|
|
307
328
|
headless: false,
|
|
308
329
|
timeout: 6000,
|
|
309
|
-
keepBrowserOpen: false
|
|
330
|
+
keepBrowserOpen: false,
|
|
331
|
+
ignoreHttpErrors: false
|
|
310
332
|
});
|
|
311
333
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), undefined);
|
|
312
334
|
_vitest.vi.mocked(_helpers.withCLITrace).mockClear();
|
|
@@ -316,7 +338,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
316
338
|
headless: false,
|
|
317
339
|
timeout: 6000,
|
|
318
340
|
keepBrowserOpen: false,
|
|
319
|
-
traceId: "trace-id"
|
|
341
|
+
traceId: "trace-id",
|
|
342
|
+
ignoreHttpErrors: false
|
|
320
343
|
});
|
|
321
344
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), "trace-id");
|
|
322
345
|
});
|
|
@@ -325,7 +348,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
325
348
|
authSessionInput: {},
|
|
326
349
|
headless: false,
|
|
327
350
|
timeout: 6000,
|
|
328
|
-
keepBrowserOpen: false
|
|
351
|
+
keepBrowserOpen: false,
|
|
352
|
+
ignoreHttpErrors: false
|
|
329
353
|
});
|
|
330
354
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
331
355
|
headless: false,
|
|
@@ -337,7 +361,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
337
361
|
authSessionInput: {},
|
|
338
362
|
headless: true,
|
|
339
363
|
timeout: 6000,
|
|
340
|
-
keepBrowserOpen: true
|
|
364
|
+
keepBrowserOpen: true,
|
|
365
|
+
ignoreHttpErrors: false
|
|
341
366
|
});
|
|
342
367
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
343
368
|
headless: true,
|
|
@@ -351,7 +376,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
351
376
|
headless: "headless",
|
|
352
377
|
timeout: 999999999,
|
|
353
378
|
keepBrowserOpen: false,
|
|
354
|
-
proxy: "proxy"
|
|
379
|
+
proxy: "proxy",
|
|
380
|
+
ignoreHttpErrors: false
|
|
355
381
|
});
|
|
356
382
|
(0, _vitest.expect)(_helpers.parseUrlProxy).toHaveBeenCalledWith("proxy");
|
|
357
383
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
@@ -362,7 +388,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
362
388
|
runOptions: {
|
|
363
389
|
headless: "headless",
|
|
364
390
|
environment: "standalone",
|
|
365
|
-
proxy: "parsed-proxy"
|
|
391
|
+
proxy: "parsed-proxy",
|
|
392
|
+
ignoreHttpErrors: false
|
|
366
393
|
},
|
|
367
394
|
retrieveSession: true
|
|
368
395
|
}));
|
|
@@ -373,7 +400,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
373
400
|
authSessionInput: {},
|
|
374
401
|
headless: "headless",
|
|
375
402
|
timeout: 999999999,
|
|
376
|
-
keepBrowserOpen: false
|
|
403
|
+
keepBrowserOpen: false,
|
|
404
|
+
ignoreHttpErrors: false
|
|
377
405
|
});
|
|
378
406
|
(0, _vitest.expect)(storageState).toEqual("session");
|
|
379
407
|
});
|
|
@@ -384,7 +412,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
384
412
|
authSessionInput: {},
|
|
385
413
|
headless: "headless",
|
|
386
414
|
timeout: 999999999,
|
|
387
|
-
keepBrowserOpen: false
|
|
415
|
+
keepBrowserOpen: false,
|
|
416
|
+
ignoreHttpErrors: false
|
|
388
417
|
})).rejects.toThrow(error);
|
|
389
418
|
});
|
|
390
419
|
});
|
|
@@ -400,7 +429,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
400
429
|
proxy: "proxy",
|
|
401
430
|
timeout: 999999999,
|
|
402
431
|
keepBrowserOpen: false,
|
|
403
|
-
trace: false
|
|
432
|
+
trace: false,
|
|
433
|
+
ignoreHttpErrors: false
|
|
404
434
|
});
|
|
405
435
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), undefined);
|
|
406
436
|
_vitest.vi.mocked(_helpers.withCLITrace).mockClear();
|
|
@@ -414,11 +444,12 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
414
444
|
proxy: "proxy",
|
|
415
445
|
timeout: 999999999,
|
|
416
446
|
keepBrowserOpen: false,
|
|
417
|
-
trace: true
|
|
447
|
+
trace: true,
|
|
448
|
+
ignoreHttpErrors: false
|
|
418
449
|
});
|
|
419
450
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), _vitest.expect.any(String));
|
|
420
451
|
});
|
|
421
|
-
(0, _vitest.it)("saves the
|
|
452
|
+
(0, _vitest.it)("saves the AuthSession instance", async () => {
|
|
422
453
|
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce(_createSuccessResult("session"));
|
|
423
454
|
_vitest.vi.mocked(_helpers.parseUrlProxy).mockReturnValueOnce("parsed-proxy");
|
|
424
455
|
await (0, _authSession._runCreateWithRetries)({
|
|
@@ -429,7 +460,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
429
460
|
proxy: "proxy",
|
|
430
461
|
timeout: 999999999,
|
|
431
462
|
keepBrowserOpen: false,
|
|
432
|
-
trace: false
|
|
463
|
+
trace: false,
|
|
464
|
+
ignoreHttpErrors: false
|
|
433
465
|
});
|
|
434
466
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith({
|
|
435
467
|
state: "session",
|
|
@@ -447,7 +479,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
447
479
|
headless: "headless",
|
|
448
480
|
timeout: 999999999,
|
|
449
481
|
keepBrowserOpen: false,
|
|
450
|
-
trace: false
|
|
482
|
+
trace: false,
|
|
483
|
+
ignoreHttpErrors: false
|
|
451
484
|
});
|
|
452
485
|
});
|
|
453
486
|
(0, _vitest.it)("throws if all retries fail", async () => {
|
|
@@ -459,7 +492,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
459
492
|
headless: "headless",
|
|
460
493
|
timeout: 999999999,
|
|
461
494
|
keepBrowserOpen: false,
|
|
462
|
-
trace: false
|
|
495
|
+
trace: false,
|
|
496
|
+
ignoreHttpErrors: false
|
|
463
497
|
})).rejects.toThrow(_helpers.CLIError);
|
|
464
498
|
});
|
|
465
499
|
(0, _vitest.it)("continues retrying if create fails due to an automation error", async () => {
|
|
@@ -471,7 +505,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
471
505
|
headless: "headless",
|
|
472
506
|
timeout: 999999999,
|
|
473
507
|
keepBrowserOpen: false,
|
|
474
|
-
trace: false
|
|
508
|
+
trace: false,
|
|
509
|
+
ignoreHttpErrors: false
|
|
475
510
|
});
|
|
476
511
|
(0, _vitest.expect)(result).toEqual("session");
|
|
477
512
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(2);
|
|
@@ -486,7 +521,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
486
521
|
headless: "headless",
|
|
487
522
|
timeout: 999999999,
|
|
488
523
|
keepBrowserOpen: false,
|
|
489
|
-
trace: false
|
|
524
|
+
trace: false,
|
|
525
|
+
ignoreHttpErrors: false
|
|
490
526
|
})).rejects.toThrow(error);
|
|
491
527
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
492
528
|
});
|
|
@@ -514,7 +550,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
514
550
|
headless: false,
|
|
515
551
|
timeout: 999999999,
|
|
516
552
|
keepBrowserOpen: false,
|
|
517
|
-
trace: false
|
|
553
|
+
trace: false,
|
|
554
|
+
ignoreHttpErrors: false
|
|
518
555
|
});
|
|
519
556
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "check");
|
|
520
557
|
});
|
|
@@ -528,7 +565,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
528
565
|
headless: false,
|
|
529
566
|
timeout: 999999999,
|
|
530
567
|
keepBrowserOpen: false,
|
|
531
|
-
trace: false
|
|
568
|
+
trace: false,
|
|
569
|
+
ignoreHttpErrors: false
|
|
532
570
|
});
|
|
533
571
|
});
|
|
534
572
|
(0, _vitest.it)("throws if check fails with auto recreate disabled", async () => {
|
|
@@ -551,14 +589,15 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
551
589
|
headless: false,
|
|
552
590
|
timeout: 999999999,
|
|
553
591
|
keepBrowserOpen: false,
|
|
554
|
-
trace: false
|
|
592
|
+
trace: false,
|
|
593
|
+
ignoreHttpErrors: false
|
|
555
594
|
})).rejects.toThrow(_helpers.CLIError);
|
|
556
595
|
});
|
|
557
596
|
(0, _vitest.describe)("check failed with auto recreate enabled", () => {
|
|
558
597
|
(0, _vitest.beforeEach)(() => {
|
|
559
598
|
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce(_checkFailedResult);
|
|
560
599
|
});
|
|
561
|
-
afterEach(() => {
|
|
600
|
+
(0, _vitest.afterEach)(() => {
|
|
562
601
|
_vitest.vi.mocked(_runApi.runApi).mockReset();
|
|
563
602
|
_vitest.vi.mocked(_helpers.loadAuthSessionInstance).mockReset();
|
|
564
603
|
});
|
|
@@ -572,11 +611,12 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
572
611
|
headless: false,
|
|
573
612
|
timeout: 999999999,
|
|
574
613
|
keepBrowserOpen: false,
|
|
575
|
-
trace: false
|
|
614
|
+
trace: false,
|
|
615
|
+
ignoreHttpErrors: false
|
|
576
616
|
});
|
|
577
617
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "create");
|
|
578
618
|
});
|
|
579
|
-
(0, _vitest.it)("throws if
|
|
619
|
+
(0, _vitest.it)("throws if AuthSession is manual", async () => {
|
|
580
620
|
_vitest.vi.mocked(_helpers.loadAuthSessionInstance).mockResolvedValue({
|
|
581
621
|
storageState: {},
|
|
582
622
|
metadata: {
|
|
@@ -595,7 +635,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
595
635
|
headless: false,
|
|
596
636
|
timeout: 999999999,
|
|
597
637
|
keepBrowserOpen: false,
|
|
598
|
-
trace: false
|
|
638
|
+
trace: false,
|
|
639
|
+
ignoreHttpErrors: false
|
|
599
640
|
})).rejects.toThrow(_helpers.CLIError);
|
|
600
641
|
});
|
|
601
642
|
(0, _vitest.it)("throws if create fails", async () => {
|
|
@@ -608,7 +649,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
608
649
|
headless: false,
|
|
609
650
|
timeout: 999999999,
|
|
610
651
|
keepBrowserOpen: false,
|
|
611
|
-
trace: false
|
|
652
|
+
trace: false,
|
|
653
|
+
ignoreHttpErrors: false
|
|
612
654
|
})).rejects.toThrow(_helpers.CLIError);
|
|
613
655
|
});
|
|
614
656
|
(0, _vitest.it)("throws if create succeeds then check fails", async () => {
|
|
@@ -621,7 +663,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
621
663
|
headless: false,
|
|
622
664
|
timeout: 999999999,
|
|
623
665
|
keepBrowserOpen: false,
|
|
624
|
-
trace: false
|
|
666
|
+
trace: false,
|
|
667
|
+
ignoreHttpErrors: false
|
|
625
668
|
})).rejects.toThrow(_helpers.CLIError);
|
|
626
669
|
});
|
|
627
670
|
(0, _vitest.it)("succeeds if create succeeds then check succeeds", async () => {
|
|
@@ -634,7 +677,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
634
677
|
headless: false,
|
|
635
678
|
timeout: 999999999,
|
|
636
679
|
keepBrowserOpen: false,
|
|
637
|
-
trace: false
|
|
680
|
+
trace: false,
|
|
681
|
+
ignoreHttpErrors: false
|
|
638
682
|
});
|
|
639
683
|
});
|
|
640
684
|
});
|
|
@@ -651,7 +695,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
651
695
|
headless: false,
|
|
652
696
|
timeout: 999999999,
|
|
653
697
|
keepBrowserOpen: false,
|
|
654
|
-
trace: false
|
|
698
|
+
trace: false,
|
|
699
|
+
ignoreHttpErrors: false
|
|
655
700
|
});
|
|
656
701
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "check");
|
|
657
702
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "create");
|
|
@@ -665,7 +710,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
665
710
|
headless: false,
|
|
666
711
|
timeout: 999999999,
|
|
667
712
|
keepBrowserOpen: false,
|
|
668
|
-
trace: false
|
|
713
|
+
trace: false,
|
|
714
|
+
ignoreHttpErrors: false
|
|
669
715
|
})).rejects.toThrow(_helpers.CLIError);
|
|
670
716
|
});
|
|
671
717
|
(0, _vitest.it)("throws if check fails after create succeeds", async () => {
|
|
@@ -677,10 +723,11 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
677
723
|
headless: false,
|
|
678
724
|
timeout: 999999999,
|
|
679
725
|
keepBrowserOpen: false,
|
|
680
|
-
trace: false
|
|
726
|
+
trace: false,
|
|
727
|
+
ignoreHttpErrors: false
|
|
681
728
|
})).rejects.toThrow(_helpers.CLIError);
|
|
682
729
|
});
|
|
683
|
-
(0, _vitest.it)("saves to
|
|
730
|
+
(0, _vitest.it)("saves to AuthSession instance path if create and check succeed", async () => {
|
|
684
731
|
await (0, _authSession.executeRunCreateAuthSessionCLI)({
|
|
685
732
|
input: "authSessionInput",
|
|
686
733
|
checkRetries: 1,
|
|
@@ -688,13 +735,14 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
688
735
|
headless: false,
|
|
689
736
|
timeout: 999999999,
|
|
690
737
|
keepBrowserOpen: false,
|
|
691
|
-
trace: false
|
|
738
|
+
trace: false,
|
|
739
|
+
ignoreHttpErrors: false
|
|
692
740
|
});
|
|
693
741
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
694
742
|
id: _vitest.expect.any(String)
|
|
695
743
|
}));
|
|
696
744
|
});
|
|
697
|
-
(0, _vitest.it)("uses
|
|
745
|
+
(0, _vitest.it)("uses AuthSession id to save if provided", async () => {
|
|
698
746
|
const result = await (0, _authSession.executeRunCreateAuthSessionCLI)({
|
|
699
747
|
id: "authSessionId",
|
|
700
748
|
input: "authSessionInput",
|
|
@@ -703,7 +751,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
703
751
|
headless: false,
|
|
704
752
|
timeout: 999999999,
|
|
705
753
|
keepBrowserOpen: false,
|
|
706
|
-
trace: false
|
|
754
|
+
trace: false,
|
|
755
|
+
ignoreHttpErrors: false
|
|
707
756
|
});
|
|
708
757
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
709
758
|
id: "authSessionId"
|
|
@@ -724,11 +773,11 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
724
773
|
}
|
|
725
774
|
});
|
|
726
775
|
});
|
|
727
|
-
afterEach(() => {
|
|
776
|
+
(0, _vitest.afterEach)(() => {
|
|
728
777
|
_vitest.vi.mocked(_runApi.runApi).mockReset();
|
|
729
778
|
_vitest.vi.mocked(_helpers.loadAuthSessionInstance).mockReset();
|
|
730
779
|
});
|
|
731
|
-
(0, _vitest.it)("throws if
|
|
780
|
+
(0, _vitest.it)("throws if AuthSession is manual", async () => {
|
|
732
781
|
_vitest.vi.mocked(_helpers.loadAuthSessionInstance).mockResolvedValue({
|
|
733
782
|
storageState: {},
|
|
734
783
|
metadata: {
|
|
@@ -746,7 +795,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
746
795
|
headless: false,
|
|
747
796
|
timeout: 999999999,
|
|
748
797
|
keepBrowserOpen: false,
|
|
749
|
-
trace: false
|
|
798
|
+
trace: false,
|
|
799
|
+
ignoreHttpErrors: false
|
|
750
800
|
})).rejects.toThrow(_helpers.CLIError);
|
|
751
801
|
});
|
|
752
802
|
(0, _vitest.it)("calls create with existing input if no input provided", async () => {
|
|
@@ -757,7 +807,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
757
807
|
headless: false,
|
|
758
808
|
timeout: 999999999,
|
|
759
809
|
keepBrowserOpen: false,
|
|
760
|
-
trace: false
|
|
810
|
+
trace: false,
|
|
811
|
+
ignoreHttpErrors: false
|
|
761
812
|
});
|
|
762
813
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
763
814
|
automationFunction: {
|
|
@@ -767,7 +818,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
767
818
|
runOptions: {
|
|
768
819
|
headless: false,
|
|
769
820
|
environment: "standalone",
|
|
770
|
-
proxy: undefined
|
|
821
|
+
proxy: undefined,
|
|
822
|
+
ignoreHttpErrors: false
|
|
771
823
|
},
|
|
772
824
|
retrieveSession: true
|
|
773
825
|
}));
|
|
@@ -783,7 +835,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
783
835
|
headless: false,
|
|
784
836
|
timeout: 999999999,
|
|
785
837
|
keepBrowserOpen: false,
|
|
786
|
-
trace: false
|
|
838
|
+
trace: false,
|
|
839
|
+
ignoreHttpErrors: false
|
|
787
840
|
});
|
|
788
841
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
789
842
|
automationFunction: {
|
|
@@ -793,12 +846,13 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
793
846
|
runOptions: {
|
|
794
847
|
headless: false,
|
|
795
848
|
environment: "standalone",
|
|
796
|
-
proxy: "newProxy"
|
|
849
|
+
proxy: "newProxy",
|
|
850
|
+
ignoreHttpErrors: false
|
|
797
851
|
},
|
|
798
852
|
retrieveSession: true
|
|
799
853
|
}));
|
|
800
854
|
});
|
|
801
|
-
(0, _vitest.it)("saves the
|
|
855
|
+
(0, _vitest.it)("saves the AuthSession with existing input if create and check succeed without providing input", async () => {
|
|
802
856
|
const result = await (0, _authSession.executeRunUpdateAuthSessionCLI)({
|
|
803
857
|
id: "authSessionId",
|
|
804
858
|
checkRetries: 1,
|
|
@@ -806,7 +860,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
806
860
|
headless: false,
|
|
807
861
|
timeout: 999999999,
|
|
808
862
|
keepBrowserOpen: false,
|
|
809
|
-
trace: false
|
|
863
|
+
trace: false,
|
|
864
|
+
ignoreHttpErrors: false
|
|
810
865
|
});
|
|
811
866
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
812
867
|
id: "authSessionId",
|
|
@@ -814,7 +869,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
814
869
|
proxy: undefined
|
|
815
870
|
}));
|
|
816
871
|
});
|
|
817
|
-
(0, _vitest.it)("saves the
|
|
872
|
+
(0, _vitest.it)("saves the AuthSession with new input if create and check succeed with new input", async () => {
|
|
818
873
|
const result = await (0, _authSession.executeRunUpdateAuthSessionCLI)({
|
|
819
874
|
id: "authSessionId",
|
|
820
875
|
input: "newAuthSessionInput",
|
|
@@ -824,7 +879,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
824
879
|
headless: false,
|
|
825
880
|
timeout: 999999999,
|
|
826
881
|
keepBrowserOpen: false,
|
|
827
|
-
trace: false
|
|
882
|
+
trace: false,
|
|
883
|
+
ignoreHttpErrors: false
|
|
828
884
|
});
|
|
829
885
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
830
886
|
id: "authSessionId",
|
|
@@ -847,7 +903,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
847
903
|
});
|
|
848
904
|
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce(_checkPassedResult);
|
|
849
905
|
});
|
|
850
|
-
afterEach(() => {
|
|
906
|
+
(0, _vitest.afterEach)(() => {
|
|
851
907
|
_vitest.vi.mocked(_runApi.runApi).mockReset();
|
|
852
908
|
_vitest.vi.mocked(_helpers.loadAuthSessionInstance).mockReset();
|
|
853
909
|
});
|
|
@@ -857,7 +913,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
857
913
|
headless: false,
|
|
858
914
|
timeout: 999999999,
|
|
859
915
|
keepBrowserOpen: false,
|
|
860
|
-
trace: false
|
|
916
|
+
trace: false,
|
|
917
|
+
ignoreHttpErrors: false
|
|
861
918
|
});
|
|
862
919
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "check");
|
|
863
920
|
});
|
|
@@ -867,7 +924,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
867
924
|
headless: false,
|
|
868
925
|
timeout: 999999999,
|
|
869
926
|
keepBrowserOpen: false,
|
|
870
|
-
trace: false
|
|
927
|
+
trace: false,
|
|
928
|
+
ignoreHttpErrors: false
|
|
871
929
|
});
|
|
872
930
|
});
|
|
873
931
|
(0, _vitest.it)("throws if check fails", async () => {
|
|
@@ -877,7 +935,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
877
935
|
headless: false,
|
|
878
936
|
timeout: 999999999,
|
|
879
937
|
keepBrowserOpen: false,
|
|
880
|
-
trace: false
|
|
938
|
+
trace: false,
|
|
939
|
+
ignoreHttpErrors: false
|
|
881
940
|
})).rejects.toThrow(_helpers.CLIError);
|
|
882
941
|
});
|
|
883
942
|
});
|
|
@@ -891,7 +950,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
891
950
|
headless: false,
|
|
892
951
|
timeout: 999999999,
|
|
893
952
|
keepBrowserOpen: false,
|
|
894
|
-
trace: false
|
|
953
|
+
trace: false,
|
|
954
|
+
ignoreHttpErrors: false
|
|
895
955
|
});
|
|
896
956
|
(0, _vitest.expect)(_helpers.assertApiFileExists).toHaveBeenCalledWith("auth-sessions", "create");
|
|
897
957
|
});
|
|
@@ -902,29 +962,32 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
902
962
|
headless: false,
|
|
903
963
|
timeout: 999999999,
|
|
904
964
|
keepBrowserOpen: false,
|
|
905
|
-
trace: false
|
|
965
|
+
trace: false,
|
|
966
|
+
ignoreHttpErrors: false
|
|
906
967
|
})).rejects.toThrow(_helpers.CLIError);
|
|
907
968
|
});
|
|
908
|
-
(0, _vitest.it)("saves to
|
|
969
|
+
(0, _vitest.it)("saves to AuthSession instance path if create and check succeed", async () => {
|
|
909
970
|
await (0, _authSession.executeAttemptCreateAuthSessionCLI)({
|
|
910
971
|
input: "authSessionInput",
|
|
911
972
|
headless: false,
|
|
912
973
|
timeout: 999999999,
|
|
913
974
|
keepBrowserOpen: false,
|
|
914
|
-
trace: false
|
|
975
|
+
trace: false,
|
|
976
|
+
ignoreHttpErrors: false
|
|
915
977
|
});
|
|
916
978
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
917
979
|
id: _vitest.expect.any(String)
|
|
918
980
|
}));
|
|
919
981
|
});
|
|
920
|
-
(0, _vitest.it)("uses
|
|
982
|
+
(0, _vitest.it)("uses AuthSession id to save if provided", async () => {
|
|
921
983
|
await (0, _authSession.executeAttemptCreateAuthSessionCLI)({
|
|
922
984
|
id: "authSessionId",
|
|
923
985
|
input: "authSessionInput",
|
|
924
986
|
headless: false,
|
|
925
987
|
timeout: 999999999,
|
|
926
988
|
keepBrowserOpen: false,
|
|
927
|
-
trace: false
|
|
989
|
+
trace: false,
|
|
990
|
+
ignoreHttpErrors: false
|
|
928
991
|
});
|
|
929
992
|
(0, _vitest.expect)(_helpers.storeAuthSessionInstance).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
930
993
|
id: "authSessionId"
|
|
@@ -962,7 +1025,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
962
1025
|
}
|
|
963
1026
|
});
|
|
964
1027
|
});
|
|
965
|
-
afterEach(() => {
|
|
1028
|
+
(0, _vitest.afterEach)(() => {
|
|
966
1029
|
_vitest.vi.mocked(_runApi.runApi).mockReset();
|
|
967
1030
|
_vitest.vi.mocked(_launchBrowser.launchChromium).mockReset();
|
|
968
1031
|
_vitest.vi.useRealTimers();
|
|
@@ -1032,7 +1095,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
1032
1095
|
await mockTimeout.resolve();
|
|
1033
1096
|
await (0, _vitest.expect)(p).rejects.toThrow(_helpers.CLIError);
|
|
1034
1097
|
});
|
|
1035
|
-
(0, _vitest.it)("stores
|
|
1098
|
+
(0, _vitest.it)("stores AuthSession and validates it if successful", async () => {
|
|
1036
1099
|
mockPage.url.mockReturnValue("finishUrl");
|
|
1037
1100
|
await (0, _authSession.executeRecordAuthSessionCLI)({
|
|
1038
1101
|
checkRetries: 1,
|