@mablhq/mabl-cli 1.12.20 → 1.13.14
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/api/basicApiClient.js +21 -11
- package/api/mablApiClient.js +9 -9
- package/api/mablApiClientFactory.js +1 -0
- package/auth/AuthClient.js +1 -4
- package/browserLauncher/browserLauncherFactory.js +7 -3
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +6 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +1 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +61 -21
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +24 -17
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +3 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +72 -68
- package/browserLauncher/playwrightBrowserLauncher/wrappers.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +7 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +13 -7
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +7 -7
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +4 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +23 -16
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +1 -1
- package/browserLauncher/types.js +6 -1
- package/cli.js +6 -4
- package/commands/applications/applications_cmds/list.js +1 -1
- package/commands/branches/branches_cmds/create.js +1 -1
- package/commands/branches/branches_cmds/list.js +1 -1
- package/commands/branches/branches_cmds/merge.js +1 -1
- package/commands/commandUtil/awaitCompletion.js +2 -2
- package/commands/commandUtil/codeInsights.js +6 -6
- package/commands/commandUtil/fileUtil.js +1 -1
- package/commands/commandUtil/util.js +12 -12
- package/commands/config/config_cmds/list.js +1 -1
- package/commands/constants.js +1 -1
- package/commands/credentials/credentials_cmds/list.js +1 -1
- package/commands/deploy/deploy_cmds/create.js +2 -2
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +7 -7
- package/commands/deploy/deploy_cmds/list.js +1 -1
- package/commands/environments/environments_cmds/create.js +3 -3
- package/commands/environments/environments_cmds/list.js +1 -1
- package/commands/environments/environments_cmds/urls_cmds/add.js +1 -1
- package/commands/flows/flows_cmds/list.js +1 -1
- package/commands/plans/plans_cmds/list.js +1 -1
- package/commands/test-runs/test-runs_cmds/export.js +1 -1
- package/commands/tests/executionUtil.js +1 -1
- package/commands/tests/testsUtil.js +16 -20
- package/commands/tests/tests_cmds/edit.js +1 -1
- package/commands/tests/tests_cmds/export.js +1 -1
- package/commands/tests/tests_cmds/import.js +13 -13
- package/commands/tests/tests_cmds/list.js +2 -2
- package/commands/tests/tests_cmds/run-alpha.js +1 -1
- package/commands/tests/tests_cmds/run-cloud.js +7 -7
- package/commands/tests/tests_cmds/run-legacy.js +2 -2
- package/commands/tests/tests_cmds/run.js +25 -7
- package/commands/workspaces/workspace_cmds/copy.js +1 -1
- package/commands/workspaces/workspace_cmds/list.js +1 -1
- package/configGenerators/flowConfigGenerator.js +3 -3
- package/configGenerators/selIdeGenerator.js +1 -1
- package/configGenerators/testConfigGenerator.js +7 -8
- package/core/execution/ApiTestUtils.js +2 -2
- package/core/trainer/openUtils.js +47 -0
- package/core/trainer/trainingSessions.js +36 -61
- package/env/defaultEnv.js +2 -1
- package/env/dev.js +2 -1
- package/env/env.js +3 -1
- package/env/local.js +2 -1
- package/env/prod.js +2 -1
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +12 -0
- package/index.d.ts +7 -0
- package/mablApi/index.js +1 -1
- package/mablscript/MablStep.js +11 -7
- package/mablscript/actions/ConditionAction.js +2 -4
- package/mablscript/actions/FindAction.js +4 -4
- package/mablscript/importer.js +16 -14
- package/mablscript/steps/AccessibilityCheck.js +88 -0
- package/mablscript/steps/AssertStep.js +6 -5
- package/mablscript/steps/CreateVariableStep.js +2 -3
- package/mablscript/steps/DownloadStep.js +1 -2
- package/mablscript/steps/EnterTextStep.js +2 -1
- package/mablscript/steps/IfConditionStep.js +3 -3
- package/mablscript/steps/SendHttpRequestStep.js +11 -3
- package/mablscript/steps/SendKeyStep.js +2 -2
- package/mablscript/steps/SetFilesStep.js +1 -1
- package/mablscript/steps/SwitchContextStep.js +2 -1
- package/mablscript/types/AccessibilityCheckStepDescriptor.js +2 -0
- package/mablscript/types/AccessibilityCheckTypes.js +9 -0
- package/mablscript/types/VariableDataType.js +1 -8
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/package.json +8 -5
- package/popupDismissal/index.js +16 -17
- package/providers/authenticationProvider.js +2 -3
- package/providers/cliConfigProvider.js +1 -1
- package/providers/exportRequestProvider.js +1 -1
- package/providers/logging/loggingProvider.js +2 -2
- package/providers/scmContextProvider.js +1 -1
- package/reporters/mochAwesome/mochAwesomeReporter.js +10 -6
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +2 -2
- package/util/actionabilityUtil.js +36 -7
- package/util/asyncUtil.js +45 -0
- package/util/downloadUtil.js +1 -1
- package/util/logUtils.js +20 -1
- package/util/markdownUtil.js +3 -3
- package/util/pureUtil.js +6 -6
- package/util/resourceUtil.js +18 -1
- package/core/trainer/trainerBrowserUtil.js +0 -33
|
@@ -68,7 +68,8 @@ class PlaywrightPage extends events_1.default {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
async waitForInitialization() {
|
|
71
|
-
this.openerPage = await utils_1.mapIfNotNull(await this.page.opener(), page => this.browser.getOrCreatePage(page));
|
|
71
|
+
this.openerPage = await utils_1.mapIfNotNull(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
|
|
72
|
+
this.fallbackCdpSession = await this.createFallbackCdpSession();
|
|
72
73
|
}
|
|
73
74
|
on(event, listener) {
|
|
74
75
|
this.wireEvents(event);
|
|
@@ -81,60 +82,66 @@ class PlaywrightPage extends events_1.default {
|
|
|
81
82
|
return this;
|
|
82
83
|
}
|
|
83
84
|
wireEvents(event) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.
|
|
128
|
-
|
|
85
|
+
try {
|
|
86
|
+
if (event === browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo &&
|
|
87
|
+
!this.listenerCount(event)) {
|
|
88
|
+
this.getCdpSession().on('Network.requestWillBeSentExtraInfo', (event) => {
|
|
89
|
+
this.emit(browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo, event);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (event === browserLauncher_1.PageEvent.Response && !this.listenerCount(event)) {
|
|
93
|
+
this.page.on('response', (event) => {
|
|
94
|
+
this.emit(browserLauncher_1.PageEvent.Response, new playwrightHttpResponse_1.PlaywrightHttpResponse(this, event));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (event === browserLauncher_1.PageEvent.Request && !this.listenerCount(event)) {
|
|
98
|
+
void this.page.route('**/*', (route) => {
|
|
99
|
+
this.emit(browserLauncher_1.PageEvent.Request, new playwrightHttpRequest_1.PlaywrightHttpRequest(this, route.request(), route));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (event === browserLauncher_1.PageEvent.FrameNavigated && !this.listenerCount(event)) {
|
|
103
|
+
this.page.on('framenavigated', (frame) => {
|
|
104
|
+
this.emit(browserLauncher_1.PageEvent.FrameNavigated, this.getOrCreateFrame(frame));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (event === browserLauncher_1.PageEvent.FrameAttached && !this.listenerCount(event)) {
|
|
108
|
+
this.page.on('frameattached', (frame) => {
|
|
109
|
+
this.emit(browserLauncher_1.PageEvent.FrameAttached, this.getOrCreateFrame(frame));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (event === browserLauncher_1.PageEvent.Console && !this.listenerCount(event)) {
|
|
113
|
+
this.page.on('console', (console) => {
|
|
114
|
+
this.emit(browserLauncher_1.PageEvent.Console, new wrappers_1.PlaywrightWrappedConsoleMessage(console, this));
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (event === browserLauncher_1.PageEvent.PageError && !this.listenerCount(event)) {
|
|
118
|
+
this.page.on('pageerror', (error) => {
|
|
119
|
+
this.emit(browserLauncher_1.PageEvent.PageError, error);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (event === browserLauncher_1.PageEvent.Error && !this.listenerCount(event)) {
|
|
123
|
+
this.page.on('crash', (error) => {
|
|
124
|
+
this.emit(browserLauncher_1.PageEvent.Error, error);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (event === browserLauncher_1.PageEvent.TracingBufferUsage &&
|
|
128
|
+
!this.listenerCount(event)) {
|
|
129
|
+
this.getCdpSession().on('Tracing.bufferUsage', (tracing) => {
|
|
130
|
+
this.emit(browserLauncher_1.PageEvent.TracingBufferUsage, tracing);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
if (event === browserLauncher_1.PageEvent.TracingComplete && !this.listenerCount(event)) {
|
|
134
|
+
this.getCdpSession().on('Tracing.tracingComplete', (tracingComplete) => {
|
|
135
|
+
this.emit(browserLauncher_1.PageEvent.TracingComplete, tracingComplete);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
129
138
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.emit(browserLauncher_1.PageEvent.TracingComplete, tracingComplete);
|
|
133
|
-
}));
|
|
139
|
+
catch (error) {
|
|
140
|
+
logUtils_1.logInternal(`Unable to register event ${event.toString()}. Error: ${error}`);
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
|
-
async screenshot() {
|
|
137
|
-
return { data: (await this.page.screenshot()).toString('base64') };
|
|
143
|
+
async screenshot(clip) {
|
|
144
|
+
return { data: (await this.page.screenshot({ clip })).toString('base64') };
|
|
138
145
|
}
|
|
139
146
|
sendCharacter(key) {
|
|
140
147
|
return this.page.keyboard.insertText(key);
|
|
@@ -182,7 +189,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
182
189
|
return result;
|
|
183
190
|
}
|
|
184
191
|
async $x(xpathQuery) {
|
|
185
|
-
return (await this.page.$$(`xpath=${xpathQuery}`)).map(element => new playwrightDom_1.PlaywrightElementHandle(element, this));
|
|
192
|
+
return (await this.page.$$(`xpath=${xpathQuery}`)).map((element) => new playwrightDom_1.PlaywrightElementHandle(element, this));
|
|
186
193
|
}
|
|
187
194
|
authenticate(_credentials) {
|
|
188
195
|
throw new Error('PlaywrightPage.authenticate not implemented');
|
|
@@ -194,7 +201,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
194
201
|
return this.page.context().cookies();
|
|
195
202
|
}
|
|
196
203
|
async deleteCookie(...cookies) {
|
|
197
|
-
const finalCookies = (await this.cookies()).filter((cookie) => !cookies.find(c => c.name === cookie.name && c.domain === cookie.domain));
|
|
204
|
+
const finalCookies = (await this.cookies()).filter((cookie) => !cookies.find((c) => c.name === cookie.name && c.domain === cookie.domain));
|
|
198
205
|
await this.page.context().clearCookies();
|
|
199
206
|
await this.page.context().addCookies(finalCookies);
|
|
200
207
|
}
|
|
@@ -205,7 +212,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
205
212
|
return new playwrightDom_1.PlaywrightJsHandle(await this.page.evaluateHandle(code, playwrightDom_1.PlaywrightJsHandle.unwrapProperties(arg, true)), this);
|
|
206
213
|
}
|
|
207
214
|
frames() {
|
|
208
|
-
return this.page.frames().map(frame => this.getOrCreateFrame(frame));
|
|
215
|
+
return this.page.frames().map((frame) => this.getOrCreateFrame(frame));
|
|
209
216
|
}
|
|
210
217
|
async getBrowserBounds() {
|
|
211
218
|
const windowInfo = await this.getWindowInfo();
|
|
@@ -214,7 +221,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
214
221
|
async goto(url, options) {
|
|
215
222
|
try {
|
|
216
223
|
const response = await this.page.goto(url, options);
|
|
217
|
-
return utils_1.mapIfNotNull(response, response => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
224
|
+
return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
218
225
|
}
|
|
219
226
|
catch (e) {
|
|
220
227
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -249,7 +256,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
249
256
|
}
|
|
250
257
|
async reload(options) {
|
|
251
258
|
try {
|
|
252
|
-
return utils_1.mapIfNotNull(await this.page.reload(options), response => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
259
|
+
return utils_1.mapIfNotNull(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
253
260
|
}
|
|
254
261
|
catch (e) {
|
|
255
262
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -275,7 +282,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
275
282
|
async setCookie(...cookies) {
|
|
276
283
|
const pageUrl = this.url();
|
|
277
284
|
const startsWithHTTP = pageUrl.startsWith('http');
|
|
278
|
-
await this.page.context().addCookies(cookies.map(cookie => {
|
|
285
|
+
await this.page.context().addCookies(cookies.map((cookie) => {
|
|
279
286
|
const item = { ...cookie };
|
|
280
287
|
if (!item.url && startsWithHTTP) {
|
|
281
288
|
item.url = pageUrl;
|
|
@@ -307,7 +314,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
307
314
|
async waitForNavigation(options) {
|
|
308
315
|
try {
|
|
309
316
|
const result = await this.page.waitForNavigation(options);
|
|
310
|
-
return utils_1.mapIfNotNull(result, result => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
|
|
317
|
+
return utils_1.mapIfNotNull(result, (result) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
|
|
311
318
|
}
|
|
312
319
|
catch (e) {
|
|
313
320
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -317,7 +324,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
317
324
|
}
|
|
318
325
|
}
|
|
319
326
|
async waitForSelector(selector, options) {
|
|
320
|
-
return utils_1.mapIfNotNull(await this.page.waitForSelector(selector, options), handle => new playwrightDom_1.PlaywrightElementHandle(handle, this));
|
|
327
|
+
return utils_1.mapIfNotNull(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this));
|
|
321
328
|
}
|
|
322
329
|
acceptDialogs(dialog) {
|
|
323
330
|
return dialog.accept();
|
|
@@ -329,9 +336,9 @@ class PlaywrightPage extends events_1.default {
|
|
|
329
336
|
throw new Error('PlaywrightPage.setExtraHTTPHeaders not implemented');
|
|
330
337
|
}
|
|
331
338
|
makeCdpCall(method, paramArgs) {
|
|
332
|
-
return this.getCdpSession().
|
|
339
|
+
return this.getCdpSession().send(method, paramArgs);
|
|
333
340
|
}
|
|
334
|
-
|
|
341
|
+
getCdpSession() {
|
|
335
342
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
336
343
|
if (((_c = (_b = (_a = this.getPageImpl()) === null || _a === void 0 ? void 0 : _a._delegate) === null || _b === void 0 ? void 0 : _b._mainFrameSession) === null || _c === void 0 ? void 0 : _c._client) === undefined) {
|
|
337
344
|
const undefinedField = ((_e = (_d = this.getPageImpl()) === null || _d === void 0 ? void 0 : _d._delegate) === null || _e === void 0 ? void 0 : _e._mainFrameSession) !== undefined
|
|
@@ -342,13 +349,10 @@ class PlaywrightPage extends events_1.default {
|
|
|
342
349
|
logUtils_1.logInternal(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
|
|
343
350
|
Creating a fallback session. Some functionality might not work as expected.`);
|
|
344
351
|
}
|
|
345
|
-
return ((_k = (_j = (_h = (_g = this.getPageImpl()) === null || _g === void 0 ? void 0 : _g._delegate) === null || _h === void 0 ? void 0 : _h._mainFrameSession) === null || _j === void 0 ? void 0 : _j._client) !== null && _k !== void 0 ? _k : this.
|
|
352
|
+
return ((_k = (_j = (_h = (_g = this.getPageImpl()) === null || _g === void 0 ? void 0 : _g._delegate) === null || _h === void 0 ? void 0 : _h._mainFrameSession) === null || _j === void 0 ? void 0 : _j._client) !== null && _k !== void 0 ? _k : this.fallbackCdpSession);
|
|
346
353
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
this.fallbackCdpSession = await this.browser.defaultContext.newCDPSession(this.page);
|
|
350
|
-
}
|
|
351
|
-
return this.fallbackCdpSession;
|
|
354
|
+
createFallbackCdpSession() {
|
|
355
|
+
return this.browser.defaultContext.newCDPSession(this.page);
|
|
352
356
|
}
|
|
353
357
|
async getWindowInfo() {
|
|
354
358
|
return this.makeCdpCall('Browser.getWindowForTarget', { targetId: this.getPageId() });
|
|
@@ -13,7 +13,7 @@ class PlaywrightWrappedConsoleMessage {
|
|
|
13
13
|
args() {
|
|
14
14
|
return this.message
|
|
15
15
|
.args()
|
|
16
|
-
.map(handle => new playwrightDom_1.PlaywrightJsHandle(handle, this.page));
|
|
16
|
+
.map((handle) => new playwrightDom_1.PlaywrightJsHandle(handle, this.page));
|
|
17
17
|
}
|
|
18
18
|
type() {
|
|
19
19
|
return this.message.type();
|
|
@@ -9,6 +9,7 @@ const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
|
|
|
9
9
|
const events_1 = __importDefault(require("events"));
|
|
10
10
|
const puppeteerBrowserLauncher_1 = require("./puppeteerBrowserLauncher");
|
|
11
11
|
const puppeteerPage_1 = require("./puppeteerPage");
|
|
12
|
+
const runnerType_1 = require("../runnerType");
|
|
12
13
|
class PuppeteerBrowser extends events_1.default {
|
|
13
14
|
constructor(browser, downloadDirectory, credentials) {
|
|
14
15
|
var _a;
|
|
@@ -38,6 +39,9 @@ class PuppeteerBrowser extends events_1.default {
|
|
|
38
39
|
state: event.state,
|
|
39
40
|
}));
|
|
40
41
|
}
|
|
42
|
+
getRunnerType() {
|
|
43
|
+
return runnerType_1.RunnerType.Puppeteer;
|
|
44
|
+
}
|
|
41
45
|
getDownloadDirectory() {
|
|
42
46
|
return this.downloadDirectory;
|
|
43
47
|
}
|
|
@@ -71,11 +75,11 @@ class PuppeteerBrowser extends events_1.default {
|
|
|
71
75
|
}
|
|
72
76
|
async pages() {
|
|
73
77
|
const pages = await this.browser.pages();
|
|
74
|
-
return Promise.all(pages.map(page => this.getOrCreatePage(page)));
|
|
78
|
+
return Promise.all(pages.map((page) => this.getOrCreatePage(page)));
|
|
75
79
|
}
|
|
76
80
|
async getExtensionBackgroundPage(extensionId) {
|
|
77
81
|
const targets = this.browser.targets();
|
|
78
|
-
const target = targets.find(target => target.type() === 'background_page' &&
|
|
82
|
+
const target = targets.find((target) => target.type() === 'background_page' &&
|
|
79
83
|
target.url().includes(extensionId));
|
|
80
84
|
if (target) {
|
|
81
85
|
const backgroundPage = await target.page();
|
|
@@ -89,7 +93,7 @@ class PuppeteerBrowser extends events_1.default {
|
|
|
89
93
|
async waitForPage(opener, options) {
|
|
90
94
|
try {
|
|
91
95
|
const pageTarget = opener.getPuppeteerPage().target();
|
|
92
|
-
const newTarget = await this.browser.waitForTarget(target => target.opener() === pageTarget, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
96
|
+
const newTarget = await this.browser.waitForTarget((target) => target.opener() === pageTarget, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
93
97
|
return this.getOrCreatePage((await newTarget.page()));
|
|
94
98
|
}
|
|
95
99
|
catch (e) {
|
|
@@ -17,7 +17,7 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
|
|
|
17
17
|
}
|
|
18
18
|
async contentFrame() {
|
|
19
19
|
const frame = await this.element.contentFrame();
|
|
20
|
-
return utils_1.mapIfNotNull(frame, frame => this.parentPage.getOrCreateFrame(frame));
|
|
20
|
+
return utils_1.mapIfNotNull(frame, (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
21
21
|
}
|
|
22
22
|
focus() {
|
|
23
23
|
return this.element.focus();
|
|
@@ -35,28 +35,34 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
|
|
|
35
35
|
return this.element.hover();
|
|
36
36
|
}
|
|
37
37
|
click(options) {
|
|
38
|
+
if (options === null || options === void 0 ? void 0 : options.trial) {
|
|
39
|
+
return Promise.resolve();
|
|
40
|
+
}
|
|
38
41
|
return this.element.click(options);
|
|
39
42
|
}
|
|
40
|
-
async doubleClick() {
|
|
43
|
+
async doubleClick(options) {
|
|
44
|
+
if (options === null || options === void 0 ? void 0 : options.trial) {
|
|
45
|
+
return Promise.resolve();
|
|
46
|
+
}
|
|
41
47
|
await this.element.click();
|
|
42
48
|
await testsUtil_1.sleep(msBetweenClicks);
|
|
43
49
|
return this.element.click({ clickCount: 2 });
|
|
44
50
|
}
|
|
45
51
|
asElement() {
|
|
46
|
-
return utils_1.mapIfNotNull(this.handle.asElement(), handle => new PuppeteerElementHandle(handle, this.parentPage));
|
|
52
|
+
return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new PuppeteerElementHandle(handle, this.parentPage));
|
|
47
53
|
}
|
|
48
54
|
type(text, options) {
|
|
49
55
|
return this.element.type(text, options);
|
|
50
56
|
}
|
|
51
57
|
async $x(xpathQuery) {
|
|
52
|
-
return (await this.element.$x(xpathQuery)).map(element => new PuppeteerElementHandle(element, this.parentPage));
|
|
58
|
+
return (await this.element.$x(xpathQuery)).map((element) => new PuppeteerElementHandle(element, this.parentPage));
|
|
53
59
|
}
|
|
54
60
|
async boundingBox() {
|
|
55
61
|
const boundingBox = await this.element.boundingBox();
|
|
56
|
-
return utils_1.mapIfNotNull(boundingBox, boundingBox => boundingBox);
|
|
62
|
+
return utils_1.mapIfNotNull(boundingBox, (boundingBox) => boundingBox);
|
|
57
63
|
}
|
|
58
64
|
frame() {
|
|
59
|
-
return Promise.resolve(utils_1.mapIfNotNull(this.element.executionContext().frame(), frame => this.parentPage.getOrCreateFrame(frame)));
|
|
65
|
+
return Promise.resolve(utils_1.mapIfNotNull(this.element.executionContext().frame(), (frame) => this.parentPage.getOrCreateFrame(frame)));
|
|
60
66
|
}
|
|
61
67
|
press(key) {
|
|
62
68
|
return this.element.press(key);
|
|
@@ -115,7 +121,7 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
|
|
|
115
121
|
return this.getCdpClient().send(method, paramArgs);
|
|
116
122
|
}
|
|
117
123
|
getValue() {
|
|
118
|
-
return this.element.evaluate(el => el.value);
|
|
124
|
+
return this.element.evaluate((el) => el.value);
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
127
|
exports.PuppeteerElementHandle = PuppeteerElementHandle;
|
|
@@ -31,7 +31,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
|
|
|
31
31
|
childFrames() {
|
|
32
32
|
return this.frame
|
|
33
33
|
.childFrames()
|
|
34
|
-
.map(frame => this.parentPage.getOrCreateFrame(frame));
|
|
34
|
+
.map((frame) => this.parentPage.getOrCreateFrame(frame));
|
|
35
35
|
}
|
|
36
36
|
async $eval(selector, pageFunction, arg) {
|
|
37
37
|
const result = await this.frame.$eval(selector, pageFunction, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg));
|
|
@@ -43,13 +43,13 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
|
|
|
43
43
|
}
|
|
44
44
|
async $(selector) {
|
|
45
45
|
const handle = await this.frame.$(selector);
|
|
46
|
-
return utils_1.mapIfNotNull(handle, handle => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
46
|
+
return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
47
47
|
}
|
|
48
48
|
async $$(selector) {
|
|
49
|
-
return (await this.frame.$$(selector)).map(element => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this.parentPage));
|
|
49
|
+
return (await this.frame.$$(selector)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this.parentPage));
|
|
50
50
|
}
|
|
51
51
|
async $x(xpathQuery) {
|
|
52
|
-
return (await this.frame.$x(xpathQuery)).map(element => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this.parentPage));
|
|
52
|
+
return (await this.frame.$x(xpathQuery)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this.parentPage));
|
|
53
53
|
}
|
|
54
54
|
id() {
|
|
55
55
|
return this.frame._id;
|
|
@@ -63,7 +63,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
|
|
|
63
63
|
async goto(url, options) {
|
|
64
64
|
try {
|
|
65
65
|
const response = await this.frame.goto(url, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
66
|
-
return utils_1.mapIfNotNull(response, response => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this.parentPage));
|
|
66
|
+
return utils_1.mapIfNotNull(response, (response) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this.parentPage));
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
69
|
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
@@ -73,7 +73,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
parentFrame() {
|
|
76
|
-
return utils_1.mapIfNotNull(this.frame.parentFrame(), frame => this.parentPage.getOrCreateFrame(frame));
|
|
76
|
+
return utils_1.mapIfNotNull(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
77
77
|
}
|
|
78
78
|
evaluate(pageFunction, arg) {
|
|
79
79
|
return this.frame.evaluate(pageFunction, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg));
|
|
@@ -99,7 +99,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
|
|
|
99
99
|
}
|
|
100
100
|
async waitForSelector(selector, options) {
|
|
101
101
|
const handle = await this.frame.waitForSelector(selector, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
102
|
-
return utils_1.mapIfNotNull(handle, handle => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
102
|
+
return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
103
103
|
}
|
|
104
104
|
async getFrameOwnerElement() {
|
|
105
105
|
const parentFrame = this.parentFrame();
|
|
@@ -23,7 +23,7 @@ class PuppeteerHttpRequest {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
frame() {
|
|
26
|
-
return utils_1.mapIfNotNull(this.request.frame(), frame => this.parentPage.getOrCreateFrame(frame));
|
|
26
|
+
return utils_1.mapIfNotNull(this.request.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
27
27
|
}
|
|
28
28
|
url() {
|
|
29
29
|
return this.request.url();
|
|
@@ -15,10 +15,13 @@ class PuppeteerHttpResponse {
|
|
|
15
15
|
return this.response.url();
|
|
16
16
|
}
|
|
17
17
|
frame() {
|
|
18
|
-
return utils_1.mapIfNotNull(this.response.frame(), frame => this.parentPage.getOrCreateFrame(frame));
|
|
18
|
+
return utils_1.mapIfNotNull(this.response.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
19
19
|
}
|
|
20
20
|
request() {
|
|
21
21
|
return new puppeteerHttpRequest_1.PuppeteerHttpRequest(this.response.request(), this.parentPage);
|
|
22
22
|
}
|
|
23
|
+
json() {
|
|
24
|
+
return this.response.json();
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
exports.PuppeteerHttpResponse = PuppeteerHttpResponse;
|
|
@@ -10,16 +10,16 @@ class PuppeteerJsHandle {
|
|
|
10
10
|
}
|
|
11
11
|
async evaluateHandle(code, arg) {
|
|
12
12
|
const handle = await this.handle.evaluateHandle(code, PuppeteerJsHandle.unwrapProperties(arg));
|
|
13
|
-
return utils_1.mapIfNotNull(handle, handle => new PuppeteerJsHandle(handle, this.parentPage));
|
|
13
|
+
return utils_1.mapIfNotNull(handle, (handle) => new PuppeteerJsHandle(handle, this.parentPage));
|
|
14
14
|
}
|
|
15
15
|
asElement() {
|
|
16
|
-
return utils_1.mapIfNotNull(this.handle.asElement(), handle => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
16
|
+
return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
|
|
17
17
|
}
|
|
18
18
|
jsonValue() {
|
|
19
19
|
return this.handle.jsonValue();
|
|
20
20
|
}
|
|
21
21
|
async getProperty(propertyName) {
|
|
22
|
-
return utils_1.mapIfNotNull(await this.handle.getProperty(propertyName), handle => new PuppeteerJsHandle(handle, this.parentPage));
|
|
22
|
+
return utils_1.mapIfNotNull(await this.handle.getProperty(propertyName), (handle) => new PuppeteerJsHandle(handle, this.parentPage));
|
|
23
23
|
}
|
|
24
24
|
evaluate(pageFunction, arg) {
|
|
25
25
|
return this.handle.evaluate(pageFunction, PuppeteerJsHandle.unwrapProperties(arg));
|
|
@@ -35,12 +35,21 @@ class PuppeteerPage extends events_1.default {
|
|
|
35
35
|
this.browser.onPageClose(this);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
async screenshot() {
|
|
38
|
+
async screenshot(clip) {
|
|
39
|
+
const { visualViewport } = await this.makeCdpCall('Page.getLayoutMetrics');
|
|
39
40
|
await this.makeCdpCall('Target.activateTarget', {
|
|
40
41
|
targetId: this.getPageId(),
|
|
41
42
|
});
|
|
43
|
+
let cdpClip;
|
|
44
|
+
if (clip) {
|
|
45
|
+
cdpClip = {
|
|
46
|
+
...clip,
|
|
47
|
+
scale: visualViewport.scale,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
42
50
|
return this.makeCdpCall('Page.captureScreenshot', {
|
|
43
51
|
format: 'png',
|
|
52
|
+
clip: cdpClip,
|
|
44
53
|
captureBeyondViewport: false,
|
|
45
54
|
});
|
|
46
55
|
}
|
|
@@ -49,10 +58,8 @@ class PuppeteerPage extends events_1.default {
|
|
|
49
58
|
if (this.browser.credentials !== undefined) {
|
|
50
59
|
await this.page.authenticate(this.browser.credentials);
|
|
51
60
|
}
|
|
52
|
-
const opener = await ((_a = this.page
|
|
53
|
-
|
|
54
|
-
.opener()) === null || _a === void 0 ? void 0 : _a.page());
|
|
55
|
-
this.openerPage = await utils_1.mapIfNotNull(opener, page => this.browser.getOrCreatePage(page));
|
|
61
|
+
const opener = await ((_a = this.page.target().opener()) === null || _a === void 0 ? void 0 : _a.page());
|
|
62
|
+
this.openerPage = await utils_1.mapIfNotNull(opener, (page) => this.browser.getOrCreatePage(page));
|
|
56
63
|
}
|
|
57
64
|
makeCdpCall(method, paramArgs) {
|
|
58
65
|
return this.getCdpClient().send(method, paramArgs);
|
|
@@ -111,7 +118,7 @@ class PuppeteerPage extends events_1.default {
|
|
|
111
118
|
async waitForNavigation(options) {
|
|
112
119
|
try {
|
|
113
120
|
const result = await this.page.waitForNavigation(puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
114
|
-
return utils_1.mapIfNotNull(result, result => new puppeteerHttpResponse_1.PuppeteerHttpResponse(result, this));
|
|
121
|
+
return utils_1.mapIfNotNull(result, (result) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(result, this));
|
|
115
122
|
}
|
|
116
123
|
catch (e) {
|
|
117
124
|
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
@@ -133,7 +140,7 @@ class PuppeteerPage extends events_1.default {
|
|
|
133
140
|
}
|
|
134
141
|
async reload(options) {
|
|
135
142
|
try {
|
|
136
|
-
return utils_1.mapIfNotNull(await this.page.reload(puppeteerBrowserLauncher_1.convertWaitForOptions(options)), response => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this));
|
|
143
|
+
return utils_1.mapIfNotNull(await this.page.reload(puppeteerBrowserLauncher_1.convertWaitForOptions(options)), (response) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this));
|
|
137
144
|
}
|
|
138
145
|
catch (e) {
|
|
139
146
|
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
@@ -214,17 +221,17 @@ class PuppeteerPage extends events_1.default {
|
|
|
214
221
|
});
|
|
215
222
|
}
|
|
216
223
|
if (event === browserLauncher_1.PageEvent.Console && !this.listenerCount(event)) {
|
|
217
|
-
this.page.on('console', console => {
|
|
224
|
+
this.page.on('console', (console) => {
|
|
218
225
|
this.emit(browserLauncher_1.PageEvent.Console, new wrappers_1.PuppeteerWrappedConsoleMessage(console, this));
|
|
219
226
|
});
|
|
220
227
|
}
|
|
221
228
|
if (event === browserLauncher_1.PageEvent.PageError && !this.listenerCount(event)) {
|
|
222
|
-
this.page.on("pageerror", error => {
|
|
229
|
+
this.page.on("pageerror", (error) => {
|
|
223
230
|
this.emit(browserLauncher_1.PageEvent.PageError, error);
|
|
224
231
|
});
|
|
225
232
|
}
|
|
226
233
|
if (event === browserLauncher_1.PageEvent.Error && !this.listenerCount(event)) {
|
|
227
|
-
this.page.on("error", error => {
|
|
234
|
+
this.page.on("error", (error) => {
|
|
228
235
|
this.emit(browserLauncher_1.PageEvent.Error, error);
|
|
229
236
|
});
|
|
230
237
|
}
|
|
@@ -243,7 +250,7 @@ class PuppeteerPage extends events_1.default {
|
|
|
243
250
|
return this.mainFrame().evaluateHandleInSecondaryWorld(code, ...args);
|
|
244
251
|
}
|
|
245
252
|
evaluate(pageFunction, ...args) {
|
|
246
|
-
return this.page.evaluate(pageFunction, ...args === null || args === void 0 ? void 0 : args.map(argument => argument instanceof puppeteerJsHandle_1.PuppeteerJsHandle
|
|
253
|
+
return this.page.evaluate(pageFunction, ...args === null || args === void 0 ? void 0 : args.map((argument) => argument instanceof puppeteerJsHandle_1.PuppeteerJsHandle
|
|
247
254
|
? argument.getPuppeteerHandle()
|
|
248
255
|
: argument));
|
|
249
256
|
}
|
|
@@ -275,23 +282,23 @@ class PuppeteerPage extends events_1.default {
|
|
|
275
282
|
}
|
|
276
283
|
async $(selector) {
|
|
277
284
|
const handle = await this.page.$(selector);
|
|
278
|
-
return utils_1.mapIfNotNull(handle, handle => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
285
|
+
return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
279
286
|
}
|
|
280
287
|
async $$(selector) {
|
|
281
|
-
return (await this.page.$$(selector)).map(element => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
288
|
+
return (await this.page.$$(selector)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
282
289
|
}
|
|
283
290
|
async $x(xpathQuery) {
|
|
284
|
-
return (await this.page.$x(xpathQuery)).map(element => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
291
|
+
return (await this.page.$x(xpathQuery)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
285
292
|
}
|
|
286
293
|
static acceptDialogs(dialog) {
|
|
287
294
|
return dialog.accept();
|
|
288
295
|
}
|
|
289
296
|
async waitForSelector(selector, options) {
|
|
290
297
|
const handle = await this.page.waitForSelector(selector, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
|
|
291
|
-
return utils_1.mapIfNotNull(handle, handle => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
298
|
+
return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
292
299
|
}
|
|
293
300
|
frames() {
|
|
294
|
-
return this.page.frames().map(frame => this.getOrCreateFrame(frame));
|
|
301
|
+
return this.page.frames().map((frame) => this.getOrCreateFrame(frame));
|
|
295
302
|
}
|
|
296
303
|
async getBrowserBounds() {
|
|
297
304
|
const getWindowForTarget = await this.makeCdpCall('Browser.getWindowForTarget', { targetId: this.page.target()._targetId });
|
|
@@ -13,7 +13,7 @@ class PuppeteerWrappedConsoleMessage {
|
|
|
13
13
|
args() {
|
|
14
14
|
return this.message
|
|
15
15
|
.args()
|
|
16
|
-
.map(handle => new puppeteerJsHandle_1.PuppeteerJsHandle(handle, this.page));
|
|
16
|
+
.map((handle) => new puppeteerJsHandle_1.PuppeteerJsHandle(handle, this.page));
|
|
17
17
|
}
|
|
18
18
|
type() {
|
|
19
19
|
return this.message.type();
|
package/browserLauncher/types.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WaitForOptions = exports.LifecycleEvent = void 0;
|
|
3
|
+
exports.WaitForOptions = exports.LifecycleEvent = exports.DefaultTimeouts = void 0;
|
|
4
|
+
class DefaultTimeouts {
|
|
5
|
+
}
|
|
6
|
+
exports.DefaultTimeouts = DefaultTimeouts;
|
|
7
|
+
DefaultTimeouts.quickActionTimeoutMs = 5000;
|
|
8
|
+
DefaultTimeouts.defaultTextInputTimeoutMs = 30000;
|
|
4
9
|
var LifecycleEvent;
|
|
5
10
|
(function (LifecycleEvent) {
|
|
6
11
|
LifecycleEvent["DomContentLoaded"] = "domcontentloaded";
|
package/cli.js
CHANGED
|
@@ -32,15 +32,14 @@ const pureUtil_1 = require("./util/pureUtil");
|
|
|
32
32
|
const versionUtil_1 = require("./commands/commandUtil/versionUtil");
|
|
33
33
|
const chalk_1 = __importDefault(require("chalk"));
|
|
34
34
|
const loggingProvider_1 = require("./providers/logging/loggingProvider");
|
|
35
|
+
const logLineMessaging_1 = require("./core/messaging/logLineMessaging");
|
|
36
|
+
const messaging_1 = require("./core/messaging/messaging");
|
|
35
37
|
const updateNotifier = require('update-notifier');
|
|
36
38
|
const cliPackage = require('./package.json');
|
|
37
39
|
const UPDATE_CHECK_INTERVAL_MILLISECONDS = 24 * 60 * 60 * 1000;
|
|
38
40
|
const MIN_SUPPORTED_NODE_VERSION = versionUtil_1.extractNodeVersionTuple((_a = cliPackage === null || cliPackage === void 0 ? void 0 : cliPackage.engines) === null || _a === void 0 ? void 0 : _a.node);
|
|
39
41
|
require('v8-compile-cache');
|
|
40
|
-
require('yargonaut')
|
|
41
|
-
.style('cyan')
|
|
42
|
-
.helpStyle('magenta')
|
|
43
|
-
.errorsStyle('red');
|
|
42
|
+
require('yargonaut').style('cyan').helpStyle('magenta').errorsStyle('red');
|
|
44
43
|
yargs
|
|
45
44
|
.scriptName(env_1.SCRIPT_NAME)
|
|
46
45
|
.commandDir('./commands/applications')
|
|
@@ -65,6 +64,9 @@ yargs
|
|
|
65
64
|
.wrap(null)
|
|
66
65
|
.epilogue('Read full docs @ https://help.mabl.com/docs/mabl-cli')
|
|
67
66
|
.middleware([
|
|
67
|
+
() => {
|
|
68
|
+
logLineMessaging_1.registerConsoleLoggerForOutput(messaging_1.mablEventEmitter);
|
|
69
|
+
},
|
|
68
70
|
() => {
|
|
69
71
|
try {
|
|
70
72
|
const nodeVersion = versionUtil_1.extractNodeVersionTuple(process.version);
|
|
@@ -34,7 +34,7 @@ function printApplications(applications, output) {
|
|
|
34
34
|
head: ['ID', 'Name', 'Created time'],
|
|
35
35
|
wordWrap: true,
|
|
36
36
|
});
|
|
37
|
-
applications.forEach(application => {
|
|
37
|
+
applications.forEach((application) => {
|
|
38
38
|
table.push([
|
|
39
39
|
{ rowSpan: 1, content: application.id, vAlign: 'center' },
|
|
40
40
|
{ rowSpan: 1, content: application.name, vAlign: 'center' },
|
|
@@ -28,7 +28,7 @@ exports.builder = (yargs) => {
|
|
|
28
28
|
nargs: 1,
|
|
29
29
|
type: 'string',
|
|
30
30
|
})
|
|
31
|
-
.check(argv => {
|
|
31
|
+
.check((argv) => {
|
|
32
32
|
const branchName = argv[constants_1.CommandArgName];
|
|
33
33
|
if (!branches_1.isValidMablBranchName(branchName)) {
|
|
34
34
|
throw new Error(`[${branchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
@@ -58,7 +58,7 @@ function printBranches(branches, output) {
|
|
|
58
58
|
const table = new Table({
|
|
59
59
|
head: ['ID', 'Name', 'Status', 'Created'],
|
|
60
60
|
});
|
|
61
|
-
branches.forEach(branch => {
|
|
61
|
+
branches.forEach((branch) => {
|
|
62
62
|
table.push([
|
|
63
63
|
{ rowSpan: 1, content: branch.id, vAlign: 'center' },
|
|
64
64
|
{ rowSpan: 1, content: branch.name, vAlign: 'center' },
|