@mablhq/mabl-cli 1.58.20 → 1.58.28
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/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +4 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +1 -1
- package/commands/commandUtil/util.js +2 -1
- package/commands/constants.js +3 -1
- package/commands/tests/tests_cmds/run.js +21 -0
- package/core/execution/LocalizationOptionsLists.js +1253 -0
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/mablApi/index.js +1 -1
- package/mablscript/MablSymbol.js +1 -1
- package/mablscript/steps/CookieUtils.js +40 -7
- package/mablscript/steps/SetCookieStep.js +36 -20
- package/mablscriptFind/index.js +1 -1
- package/package.json +2 -2
- package/resources/mablFind.js +1 -1
- package/util/TestOutputWriter.js +12 -8
|
@@ -17,7 +17,7 @@ const DEFAULT_GEOLOCATION = {
|
|
|
17
17
|
};
|
|
18
18
|
class PlaywrightBrowserLauncher {
|
|
19
19
|
async launch(options) {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
21
|
const viewport = options.defaultDeviceDescriptor
|
|
22
22
|
? {
|
|
23
23
|
width: options.defaultDeviceDescriptor.width,
|
|
@@ -54,11 +54,13 @@ class PlaywrightBrowserLauncher {
|
|
|
54
54
|
ignoreDefaultArgs: options.ignoreCommandLineDefaultArgs,
|
|
55
55
|
ignoreHTTPSErrors: true,
|
|
56
56
|
isMobile: (_c = options.defaultDeviceDescriptor) === null || _c === void 0 ? void 0 : _c.isMobile,
|
|
57
|
+
locale: (_d = options.localizationOptions) === null || _d === void 0 ? void 0 : _d.locale,
|
|
57
58
|
logger: playwrightLogger,
|
|
58
59
|
permissions: options.permissions,
|
|
59
60
|
proxy: options.proxy,
|
|
60
61
|
timeout: BROWSER_LAUNCH_TIMEOUT_MS,
|
|
61
|
-
|
|
62
|
+
timezoneId: (_e = options.localizationOptions) === null || _e === void 0 ? void 0 : _e.timezone_identifier,
|
|
63
|
+
userAgent: (_f = options.userAgent) !== null && _f !== void 0 ? _f : options.defaultUserAgent,
|
|
62
64
|
viewport,
|
|
63
65
|
});
|
|
64
66
|
return playwrightBrowser_1.PlaywrightBrowser.create(playwrightBrowserType, defaultContext, options.downloadPath, '', options.userDataDir, options.disableFocusEmulation);
|
|
@@ -282,7 +282,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
282
282
|
const startsWithHTTP = pageUrl.startsWith('http');
|
|
283
283
|
await this.page.context().addCookies(cookies.map((cookie) => {
|
|
284
284
|
const item = { ...cookie };
|
|
285
|
-
if (!item.url && startsWithHTTP) {
|
|
285
|
+
if (!item.url && !(item.domain || item.path) && startsWithHTTP) {
|
|
286
286
|
item.url = pageUrl;
|
|
287
287
|
}
|
|
288
288
|
return item;
|
|
@@ -39,7 +39,8 @@ async function getWorkspaceId(parsed) {
|
|
|
39
39
|
exports.getWorkspaceId = getWorkspaceId;
|
|
40
40
|
exports.TEST_WITHOUT_FLOWS_MESSAGE = `Test does not have any flows. You may need to specify a branch [--${constants_1.CommandArgMablBranch}] if the test is not on master.`;
|
|
41
41
|
async function getJourneyFlowArray(journey, apiClient, branchName) {
|
|
42
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
if (!((_a = journey.flows) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
43
44
|
throw new Error(exports.TEST_WITHOUT_FLOWS_MESSAGE);
|
|
44
45
|
}
|
|
45
46
|
const flows = {};
|
package/commands/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandArgContentTypes = exports.CommandArgPreview = exports.CommandArgOutputFilePath = exports.CommandArgOutput = exports.CommandArgNoPrompt = exports.CommandArgPrompt = exports.CommandArgPortNumber = exports.CommandArgName = exports.CommandArgMablBranchChangesOnly = exports.CommandArgMablBranch = exports.CommandArgMablAutoLogin = exports.CommandArgMablAutoBranch = exports.CommandArgLinkBypass = exports.CommandArgLinkLabel = exports.CommandArgLimitOutput = exports.CommandArgLabels = exports.CommandArgLabelsInclude = exports.CommandArgLabelsExclude = exports.CommandArgTestInteractionSpeed = exports.CommandArgTestRunId = exports.CommandArgTestFile = exports.CommandArgKeepBrowserOpen = exports.CommandArgInput = exports.CommandArgId = exports.CommandArgUserAgent = exports.CommandArgHttpHeaders = exports.CommandArgHelp = exports.CommandArgHeadless = exports.CommandArgFromPlanId = exports.CommandArgFrom = exports.CommandArgFormat = exports.CommandArgFindPath = exports.CommandArgFastFailure = exports.CommandArgOverrideEnvironmentId = exports.CommandArgExistingReport = exports.CommandArgEnvironmentId = exports.CommandArgEnableLink = exports.CommandArgDetailLevel = exports.CommandArgDescription = exports.CommandArgDeploymentId = exports.CommandArgDecrypt = exports.CommandArgDataTables = exports.CommandArgDataTableId = exports.CommandArgCredentials = exports.CommandArgBasicAuthCredentials = exports.CommandArgBrowsers = exports.CommandArgBrowser = exports.CommandArgApplicationId = exports.CommandArgApiKey = exports.CommandArgABConfigFile = void 0;
|
|
4
|
-
exports.SCENARIO_ID_HEADER = exports.SCENARIO_NAME_HEADER = exports.ValidBrowserTypesForLocalRuns = exports.BrowserTypeSelections = exports.DefaultBrowserType = exports.DefaultBranchName = exports.DefaultOutputFormatChoices = exports.DetailLevelFormats = exports.ReporterOptions = exports.OutputFormats = exports.CommandArgAliases = exports.CommandArgBrowserEnableExtensions = exports.CommandArgBrowserIgnoreCertificateErrors = exports.CommandArgBrowserDisableIsolation = exports.ListTimeFormat = exports.CommandArgScenarioId = exports.CommandArgReporterOptions = exports.CommandArgReporter = exports.CommandArgWorkspaceId = exports.CommandArgVersion = exports.CommandArgVariables = exports.CommandArgUrlApi = exports.CommandArgUrlApp = exports.CommandArgUrl = exports.CommandArgTrainerVersion = exports.CommandArgTo = exports.CommandArgSilent = exports.CommandArgRevision = exports.CommandArgMaxHeartbeatAge = exports.CommandArgPlanId = void 0;
|
|
4
|
+
exports.SCENARIO_ID_HEADER = exports.SCENARIO_NAME_HEADER = exports.ValidBrowserTypesForLocalRuns = exports.BrowserTypeSelections = exports.DefaultBrowserType = exports.DefaultBranchName = exports.DefaultOutputFormatChoices = exports.DetailLevelFormats = exports.ReporterOptions = exports.OutputFormats = exports.CommandArgAliases = exports.CommandArgBrowserEnableExtensions = exports.CommandArgBrowserIgnoreCertificateErrors = exports.CommandArgBrowserDisableIsolation = exports.ListTimeFormat = exports.CommandArgTimezoneID = exports.CommandArgLocale = exports.CommandArgScenarioId = exports.CommandArgReporterOptions = exports.CommandArgReporter = exports.CommandArgWorkspaceId = exports.CommandArgVersion = exports.CommandArgVariables = exports.CommandArgUrlApi = exports.CommandArgUrlApp = exports.CommandArgUrl = exports.CommandArgTrainerVersion = exports.CommandArgTo = exports.CommandArgSilent = exports.CommandArgRevision = exports.CommandArgMaxHeartbeatAge = exports.CommandArgPlanId = void 0;
|
|
5
5
|
const browserTypes_1 = require("./browserTypes");
|
|
6
6
|
exports.CommandArgABConfigFile = 'ab-config-file';
|
|
7
7
|
exports.CommandArgApiKey = 'api-key';
|
|
@@ -68,6 +68,8 @@ exports.CommandArgWorkspaceId = 'workspace-id';
|
|
|
68
68
|
exports.CommandArgReporter = 'reporter';
|
|
69
69
|
exports.CommandArgReporterOptions = 'reporter-options';
|
|
70
70
|
exports.CommandArgScenarioId = 'scenario-id';
|
|
71
|
+
exports.CommandArgLocale = 'locale';
|
|
72
|
+
exports.CommandArgTimezoneID = 'timezone-id';
|
|
71
73
|
exports.ListTimeFormat = 'MMM Do YYYY, HH:mm:ss';
|
|
72
74
|
exports.CommandArgBrowserDisableIsolation = 'browser-disable-isolation';
|
|
73
75
|
exports.CommandArgBrowserIgnoreCertificateErrors = 'browser-ignore-certificate-errors';
|
|
@@ -72,6 +72,18 @@ exports.builder = (yargs) => {
|
|
|
72
72
|
describe: 'Mabl environment to run under. Specify to ensure the test runs with environment variables and the latest find information.',
|
|
73
73
|
nargs: 1,
|
|
74
74
|
type: 'string',
|
|
75
|
+
})
|
|
76
|
+
.option(constants_1.CommandArgLocale, {
|
|
77
|
+
describe: 'Locale to run the test in, e.g. en-US',
|
|
78
|
+
nargs: 1,
|
|
79
|
+
type: 'string',
|
|
80
|
+
hidden: true,
|
|
81
|
+
})
|
|
82
|
+
.option(constants_1.CommandArgTimezoneID, {
|
|
83
|
+
describe: 'Identifier of the timezone to run the test in, e.g. America/Buenos_Aires',
|
|
84
|
+
nargs: 1,
|
|
85
|
+
type: 'string',
|
|
86
|
+
hidden: true,
|
|
75
87
|
})
|
|
76
88
|
.option('width', {
|
|
77
89
|
describe: 'Set the browser width in pixels',
|
|
@@ -218,6 +230,14 @@ async function run(parsed) {
|
|
|
218
230
|
throw new Error(`Scenario with ID ${parsed[constants_1.CommandArgScenarioId]} not found`);
|
|
219
231
|
}
|
|
220
232
|
}
|
|
233
|
+
const parsedLocale = parsed[constants_1.CommandArgLocale];
|
|
234
|
+
const parsedTimezone = parsed[constants_1.CommandArgTimezoneID];
|
|
235
|
+
const localizationOptions = parsedLocale || parsedTimezone
|
|
236
|
+
? {
|
|
237
|
+
locale: parsedLocale,
|
|
238
|
+
timezone_identifier: parsedTimezone,
|
|
239
|
+
}
|
|
240
|
+
: undefined;
|
|
221
241
|
const testRunnerConfig = {
|
|
222
242
|
_cliCreated: true,
|
|
223
243
|
basicAuthCredentialsId: parsed[constants_1.CommandArgBasicAuthCredentials],
|
|
@@ -240,6 +260,7 @@ async function run(parsed) {
|
|
|
240
260
|
keepBrowserOpen: parsed['keep-browser-open'],
|
|
241
261
|
labelsExclude: parsed['exclude-labels'],
|
|
242
262
|
labelsInclude: parsed.labels,
|
|
263
|
+
localizationOptions,
|
|
243
264
|
runId: parsed['run-id'],
|
|
244
265
|
testFile: parsed[constants_1.CommandArgTestFile],
|
|
245
266
|
testId: parsed.id,
|