@mablhq/mabl-cli 2.45.5 → 2.46.0

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.
@@ -35,6 +35,7 @@ const XCUITEST_VERSION = '7.24.15';
35
35
  const addOnConfigKey = 'add-on';
36
36
  var AddOnOptions;
37
37
  (function (AddOnOptions) {
38
+ AddOnOptions["browser"] = "browser";
38
39
  AddOnOptions["mobile"] = "mobile-tools";
39
40
  })(AddOnOptions || (exports.AddOnOptions = AddOnOptions = {}));
40
41
  exports.command = `install <${addOnConfigKey}>`;
@@ -44,7 +45,7 @@ exports.builder = (yargs) => {
44
45
  .positional(addOnConfigKey, {
45
46
  describe: 'add-on to install',
46
47
  type: 'string',
47
- choices: [AddOnOptions.mobile],
48
+ choices: [AddOnOptions.mobile, AddOnOptions.browser],
48
49
  })
49
50
  .option('android', {
50
51
  describe: `[${AddOnOptions.mobile}] The android driver version to use`,
@@ -53,10 +54,24 @@ exports.builder = (yargs) => {
53
54
  .option('ios', {
54
55
  describe: `[${AddOnOptions.mobile}] The ios driver version to use`,
55
56
  type: 'string',
57
+ })
58
+ .option('chrome', {
59
+ describe: `[${AddOnOptions.browser}] The chrome browser version to use`,
60
+ type: 'boolean',
61
+ })
62
+ .option('webkit', {
63
+ describe: `[${AddOnOptions.browser}] The webkit browser version to use`,
64
+ type: 'boolean',
65
+ hidden: true,
66
+ })
67
+ .option('firefox', {
68
+ describe: `[${AddOnOptions.browser}] The firefox browser version to use`,
69
+ type: 'boolean',
70
+ hidden: true,
56
71
  });
57
72
  };
58
73
  exports.handler = installAddOn;
59
- function installAddOn(parsed) {
74
+ async function installAddOn(parsed) {
60
75
  var _a, _b;
61
76
  const addOn = parsed[addOnConfigKey];
62
77
  const iosVersion = (_a = parsed.ios) !== null && _a !== void 0 ? _a : XCUITEST_VERSION;
@@ -86,6 +101,18 @@ function installAddOn(parsed) {
86
101
  }
87
102
  loggingProvider_1.logger.info('Installation of mobile add on tools complete');
88
103
  return;
104
+ case AddOnOptions.browser:
105
+ const browser = parsed.chrome
106
+ ? 'chrome'
107
+ : parsed.webkit
108
+ ? 'webkit'
109
+ : 'firefox';
110
+ loggingProvider_1.logger.info(`Installing ${browser} browser`);
111
+ await require('playwright-core/lib/server').installBrowsersForNpmInstall([
112
+ browser,
113
+ ]);
114
+ loggingProvider_1.logger.info('Installation of browser add on tools complete');
115
+ return;
89
116
  default:
90
117
  throw new Error(`Invalid add on provided [${addOn}]`);
91
118
  }