@uuv/assistant 1.4.0 → 1.4.2

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,4 +1,4 @@
1
1
  {
2
- "reactScript": "/../../build/static/js/main.4685455a.js",
3
- "cssFile": "/../../build/static/css/main.a63bc536.css"
2
+ "reactScript": "/../../build/static/js/main.57c0adfd.js",
3
+ "cssFile": "/../../build/static/css/main.8c76db0a.css"
4
4
  }
@@ -1,8 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  const index_1 = require("./index");
5
- console.log('UUV Assistant starting...');
6
- new index_1.UuvAssistant().start().then(() => {
7
- console.log('UUV Assistant started');
8
- });
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const figlet_1 = __importDefault(require("figlet"));
10
+ const fs_1 = __importDefault(require("fs"));
11
+ function printBanner(getCurrentVersion) {
12
+ console.log(chalk_1.default.blueBright(figlet_1.default.textSync("UUV - Assistant", {
13
+ font: "Big",
14
+ horizontalLayout: "default",
15
+ verticalLayout: "default",
16
+ width: 80,
17
+ whitespaceBreak: true
18
+ })));
19
+ console.info(chalk_1.default.blueBright(`Version: ${getCurrentVersion()}\n\n`));
20
+ }
21
+ function getCurrentVersion() {
22
+ const pJsonStr = fs_1.default.readFileSync(`${__dirname}/../package.json`, {
23
+ encoding: "utf8", flag: "r"
24
+ });
25
+ return JSON.parse(pJsonStr).version;
26
+ }
27
+ function main() {
28
+ console.log("UUV Assistant starting...");
29
+ printBanner(getCurrentVersion);
30
+ new index_1.UuvAssistant().start().then(() => {
31
+ console.log(chalk_1.default.yellow("UUV Assistant started"));
32
+ });
33
+ }
34
+ main();
@@ -1,21 +1,33 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.UuvAssistant = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
4
8
  let translator;
9
+ let uuvCssContent;
5
10
  class UuvAssistant {
6
11
  initReactDomRootElementFn() {
7
12
  return () => {
8
- document.addEventListener("DOMContentLoaded", () => {
9
- const rootElement = document.createElement("div");
10
- const event = translator !== undefined ? new CustomEvent("UUVAssistantReadyToLoad", {
11
- detail: {
12
- translator: translator
13
- }
14
- }) : new Event("UUVAssistantReadyToLoad");
15
- rootElement.id = "uvv-assistant-root";
16
- document.body.appendChild(rootElement);
17
- document.dispatchEvent(event);
18
- });
13
+ window.onload = function () {
14
+ if (window.location === window.parent.location) {
15
+ console.log("DOMContentLoaded");
16
+ const rootElement = document.createElement("div");
17
+ const event = translator !== undefined ? new CustomEvent("UUVAssistantReadyToLoad", {
18
+ detail: {
19
+ translator: translator
20
+ }
21
+ }) : new Event("UUVAssistantReadyToLoad");
22
+ rootElement.id = "uvv-assistant-root";
23
+ document.body.appendChild(rootElement);
24
+ document.dispatchEvent(event);
25
+ const style = document.createElement("style");
26
+ style.type = "text/css";
27
+ style.innerHTML = uuvCssContent;
28
+ document.getElementsByTagName("head")[0].appendChild(style);
29
+ }
30
+ };
19
31
  };
20
32
  }
21
33
  async start(translatorFn) {
@@ -23,22 +35,20 @@ class UuvAssistant {
23
35
  const argv = require("minimist")(process.argv.slice(2));
24
36
  const conf = require("./conf.json");
25
37
  const browser = await chromium.launch({ headless: false });
26
- const browserContext = await browser.newContext();
38
+ const browserContext = await browser.newContext({ viewport: null });
27
39
  const page = await browserContext.newPage();
28
40
  const translatorDeclaration = translatorFn ?
29
41
  `var translator = ${translatorFn.toString()}; console.log('translator'); console.log(translator);` :
30
42
  "var translator = null;";
43
+ const cssContentDeclaration = `\n var uuvCssContent = "${fs_1.default.readFileSync(__dirname + conf.cssFile).toString()}"`;
31
44
  await browserContext.addInitScript({
32
- content: translatorDeclaration
45
+ content: `${translatorDeclaration}${cssContentDeclaration}`
33
46
  });
34
47
  await browserContext.addInitScript(this.initReactDomRootElementFn());
35
48
  await browserContext.addInitScript({
36
49
  path: `${__dirname}${conf.reactScript}`
37
50
  });
38
51
  await page.goto(argv.targetUrl);
39
- await page.addStyleTag({
40
- path: `${__dirname}${conf.cssFile}`
41
- });
42
52
  }
43
53
  }
44
54
  exports.UuvAssistant = UuvAssistant;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/assistant",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
5
5
  "description": "UUV wizard used to improve the life of testers and developers by generating cucumber phrases from the GUI.",
6
6
  "license": "Apache-2.0",
@@ -11,18 +11,22 @@
11
11
  "homepage": "https://e2e-test-quest.github.io/uuv/",
12
12
  "keywords": [
13
13
  "uuv",
14
- "UUV",
15
- "E2E",
14
+ "e2e",
15
+ "end2end",
16
+ "end 2 end",
16
17
  "test",
17
18
  "testing",
18
- "cypress",
19
- "testing-library",
20
19
  "accessibility",
21
20
  "accessibilite",
22
21
  "a11y",
23
- "cucumber",
22
+ "cypress",
24
23
  "playwright",
25
- "gherkin"
24
+ "testing-library",
25
+ "cucumber",
26
+ "gherkin",
27
+ "bdd",
28
+ "tdd",
29
+ "acceptance"
26
30
  ],
27
31
  "bin": {
28
32
  "uuv-assistant": "./dist/launcher/uuv-assistant-launcher.js"
@@ -42,8 +46,8 @@
42
46
  "test": "jest"
43
47
  },
44
48
  "dependencies": {
45
- "@cucumber/cucumber": "9.1.0",
46
- "antd": "^5.4.6",
49
+ "antd": "5.4.6",
50
+ "figlet": "1.6.0",
47
51
  "playwright-chromium": "1.33.0"
48
52
  },
49
53
  "browserslist": {
@@ -1,2 +0,0 @@
1
- body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.uuvAssistant{box-shadow:0 .0625em .0625em rgba(0,0,0,.25),0 .125em .5em rgba(0,0,0,.25),inset 0 0 0 1px hsla(0,0%,100%,.1);opacity:95%}.uuvArrowExpander{cursor:pointer;left:50%;width:30px}.uuvArrowExpander,.uuvFloatingButton{border-color:grey;height:30px;position:absolute;top:-1em}.uuvFloatingButton{width:120px;z-index:9999999779}.uuvActionAside :disabled{width:200px}.uuvActionAside{border-color:grey;margin-left:10%;margin-right:10px;width:80%}
2
- /*# sourceMappingURL=main.a63bc536.css.map*/