@mablhq/mabl-cli 1.25.15 → 1.25.19
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/Globals.js +20 -0
- package/api/mablApiClient.js +9 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +19 -1
- package/commands/tests/testsUtil.js +1 -0
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/mablApi/index.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/package.json +1 -1
- package/resources/mablFind.js +1 -1
- package/util/asyncUtil.js +7 -6
package/Globals.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Globals = void 0;
|
|
4
|
+
class Globals {
|
|
5
|
+
static getFindOverallTimeoutMs() {
|
|
6
|
+
return Globals.findOverallTimeoutMs;
|
|
7
|
+
}
|
|
8
|
+
static setFindOverallTimeoutMs(timeout) {
|
|
9
|
+
Globals.findOverallTimeoutMs = timeout;
|
|
10
|
+
}
|
|
11
|
+
static getPlaywrightInteractionWarningMs() {
|
|
12
|
+
return Globals.playwrightInteractionWarningMs;
|
|
13
|
+
}
|
|
14
|
+
static setPlaywrightInteractionWarningMs(timeout) {
|
|
15
|
+
Globals.playwrightInteractionWarningMs = timeout;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.Globals = Globals;
|
|
19
|
+
Globals.findOverallTimeoutMs = 18.5 * 60 * 1000;
|
|
20
|
+
Globals.playwrightInteractionWarningMs = 30 * 1000;
|
package/api/mablApiClient.js
CHANGED
|
@@ -329,6 +329,14 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
329
329
|
throw toApiError(`Failed to get account`, error);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
+
async getAccountByWorkspaceId(workspaceId) {
|
|
333
|
+
try {
|
|
334
|
+
return await this.makeGetRequest(`${this.baseApiUrl}/organizations/${workspaceId}/account`);
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
throw toApiError(`Failed to get account from workspace id`, error);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
332
340
|
async getApiKeyDetails() {
|
|
333
341
|
try {
|
|
334
342
|
return await this.makeGetRequest(`${this.baseApiUrl}/apiKeys/self`);
|
|
@@ -727,8 +735,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
727
735
|
}
|
|
728
736
|
async getEffectiveFeaturesByWorkspaceId(workspaceId) {
|
|
729
737
|
try {
|
|
730
|
-
const
|
|
731
|
-
const account = await this.getAccount(workspace.account_id);
|
|
738
|
+
const account = await this.getAccountByWorkspaceId(workspaceId);
|
|
732
739
|
const features = account.effective_features
|
|
733
740
|
? new Set(account.effective_features)
|
|
734
741
|
: new Set();
|
|
@@ -304,8 +304,26 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
304
304
|
const result = await this.element.evaluate((el, attributeName) => el.getAttribute(attributeName), attributeName);
|
|
305
305
|
return (0, pureUtil_1.isNullish)(result) ? undefined : result;
|
|
306
306
|
}
|
|
307
|
+
async getElementText() {
|
|
308
|
+
const result = await this.element.evaluate((el) => {
|
|
309
|
+
var _a;
|
|
310
|
+
function extractFromSlot(element) {
|
|
311
|
+
const slots = element.querySelectorAll('slot');
|
|
312
|
+
if (slots.length !== 1) {
|
|
313
|
+
return '';
|
|
314
|
+
}
|
|
315
|
+
const textNode = slots
|
|
316
|
+
.item(0)
|
|
317
|
+
.assignedNodes()
|
|
318
|
+
.find((node) => node.nodeType === Node.TEXT_NODE);
|
|
319
|
+
return textNode ? textNode.data : '';
|
|
320
|
+
}
|
|
321
|
+
return (_a = (el.innerText || extractFromSlot(el))) !== null && _a !== void 0 ? _a : '';
|
|
322
|
+
});
|
|
323
|
+
return (0, pureUtil_1.isNullish)(result) ? undefined : result;
|
|
324
|
+
}
|
|
307
325
|
async getInnerText() {
|
|
308
|
-
const result = await this.element.
|
|
326
|
+
const result = await this.element.innerText();
|
|
309
327
|
return (0, pureUtil_1.isNullish)(result) ? undefined : result;
|
|
310
328
|
}
|
|
311
329
|
getActionTimeout(options) {
|
|
@@ -61,6 +61,7 @@ const baseExecutionEngineLaunchArgs = [
|
|
|
61
61
|
'--v=0',
|
|
62
62
|
'--enable-features=NetworkService,NetworkServiceInProcess',
|
|
63
63
|
'--disable-features=site-per-process',
|
|
64
|
+
'--disable-component-update',
|
|
64
65
|
];
|
|
65
66
|
const ExecutionEngineFakeAudioFilePath = '/opt/media/mabl_test_audio.wav';
|
|
66
67
|
const ExecutionEngineFakeVideoFilePath = '/opt/media/mabl_test_pattern.y4m';
|