@uuv/assistant 1.5.0 → 1.5.1

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.
@@ -1,5 +1,6 @@
1
1
  {
2
+ "packageJson": "/../../package.json",
2
3
  "reactScript": "/build/static/js/main.d482abe3.js",
3
4
  "cssFile": "/build/static/css/main.8c76db0a.css",
4
- "unifiedFile": "../unified-uuv-assistant.js"
5
+ "unifiedFile": "/../uuv-assistant-resources.bundle.js"
5
6
  }
@@ -23,6 +23,7 @@ const index_1 = require("./index");
23
23
  const chalk_1 = __importDefault(require("chalk"));
24
24
  const figlet_1 = __importDefault(require("figlet"));
25
25
  const fs_1 = __importDefault(require("fs"));
26
+ const conf_json_1 = __importDefault(require("./conf.json"));
26
27
  function printBanner(getCurrentVersion) {
27
28
  console.log(chalk_1.default.blueBright(figlet_1.default.textSync("UUV - Assistant", {
28
29
  font: "Big",
@@ -34,7 +35,7 @@ function printBanner(getCurrentVersion) {
34
35
  console.info(chalk_1.default.blueBright(`Version: ${getCurrentVersion()}\n\n`));
35
36
  }
36
37
  function getCurrentVersion() {
37
- const pJsonStr = fs_1.default.readFileSync(`${__dirname}/../package.json`, {
38
+ const pJsonStr = fs_1.default.readFileSync(`${__dirname}${conf_json_1.default.packageJson}`, {
38
39
  encoding: "utf8", flag: "r"
39
40
  });
40
41
  return JSON.parse(pJsonStr).version;
@@ -14,16 +14,25 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
17
20
  Object.defineProperty(exports, "__esModule", { value: true });
18
21
  exports.UuvAssistant = void 0;
22
+ const playwright_chromium_1 = require("playwright-chromium");
23
+ const conf_json_1 = __importDefault(require("./conf.json"));
24
+ const chalk_1 = __importDefault(require("chalk"));
25
+ const minimist_1 = __importDefault(require("minimist"));
19
26
  class UuvAssistant {
20
27
  async start(translatorFn) {
21
- const { chromium } = require("playwright-chromium");
22
- const argv = require("minimist")(process.argv.slice(2));
23
- const conf = require("./conf.json");
24
- const browser = await chromium.launch({ headless: false });
28
+ const argv = (0, minimist_1.default)(process.argv.slice(2));
29
+ const browser = await playwright_chromium_1.chromium.launch({ headless: false });
25
30
  const browserContext = await browser.newContext({ viewport: null });
26
31
  const page = await browserContext.newPage();
32
+ if (!argv["targetUrl"]) {
33
+ console.error(chalk_1.default.redBright("Parameter --targetUrl is required"));
34
+ process.exit(-1);
35
+ }
27
36
  const translatorDeclaration = translatorFn ?
28
37
  `var translator = ${translatorFn.toString()}; console.log('translator'); console.log(translator);` :
29
38
  "var translator = null;";
@@ -31,9 +40,9 @@ class UuvAssistant {
31
40
  content: `${translatorDeclaration}`
32
41
  });
33
42
  await browserContext.addInitScript({
34
- path: `${__dirname}${conf.unifiedFile}`
43
+ path: `${__dirname}${conf_json_1.default.unifiedFile}`
35
44
  });
36
- await page.goto(argv.targetUrl);
45
+ await page.goto(argv["targetUrl"]);
37
46
  }
38
47
  }
39
48
  exports.UuvAssistant = UuvAssistant;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/assistant",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
5
5
  "description": "UUV Helper used to improve the life of testers and developers by generating cucumber phrases from the GUI.",
6
6
  "license": "Apache-2.0",