@uuv/assistant 1.3.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.
package/dist/README.md ADDED
@@ -0,0 +1,59 @@
1
+
2
+
3
+
4
+ # @uuv/assistant
5
+ <p align="center">
6
+ <a href="https://e2e-test-quest.github.io/uuv/">
7
+ <picture>
8
+ <img alt="UUV Logo" src="../docs/static/img/uuv.png">
9
+ </picture>
10
+ </a>
11
+ </p>
12
+ <p align="center">
13
+ <a href="https://e2e-test-quest.github.io/uuv/"><img src="https://img.shields.io/badge/documentation-black?&style=for-the-badge&logo=github&logoColor=white" alt="documentation"/></a>
14
+ </p>
15
+
16
+ <h3 align="center">
17
+ Test as final user
18
+ </h3>
19
+
20
+ <p align="center">
21
+ Make test writing fast, understandable by any human understanding English or French.
22
+ </p>
23
+
24
+ <p align="center">
25
+ <a href="https://www.npmjs.com/package/@uuv/assistant">
26
+ <img src="https://img.shields.io/badge/available%20on%20npm-grey?logo=npm" alt="npm"/>
27
+ </a>
28
+ <a href="https://www.npmjs.com/package/@uuv/assistant">
29
+ <img src="https://img.shields.io/badge/using-react-00DCFF?logo=react" alt="npm"/>
30
+ </a>
31
+ <a href="https://jestjs.io/fr/">
32
+ <img src="https://img.shields.io/badge/tested%20with-jest-yellow?logo=jest" alt="jest"/>
33
+ </a><br />
34
+ </p>
35
+
36
+ ## What is UUV wizard?
37
+
38
+ <p align="center">
39
+
40
+ `@uuv` library (User centric Usecases Validator) is an ecosystem that simplifies the writing of End to End tests in a BDD approach and a user-centric way.
41
+
42
+ With this wizard, we can generate cucumber sentences that will use an execution engine like cypress with [@uuv/cypress](https://www.npmjs.com/package/@uuv/cypress) or playwright with [@uuv/playwright](https://www.npmjs.com/package/@uuv/playwright).
43
+ </p>
44
+
45
+ <img src="./public/screenshots.gif" alt="assistant screenshots"/>
46
+
47
+ ## Installing
48
+
49
+ <a href="https://e2e-test-quest.github.io/uuv/docs/tools/uuv-assistant"><img src="https://img.shields.io/badge/run%20uuv%20wizard%20doc-red?&style=for-the-badge&logo=github&logoColor=white" alt="documentation for run uuv wizard"/></a>
50
+
51
+ <a href="https://e2e-test-quest.github.io/uuv/docs/wordings/generated-wording-description/en-generated-wording-description"><img src="https://img.shields.io/badge/sentences%20doc-red?&style=for-the-badge&logo=github&logoColor=white" alt="documentation containing sentences"/></a>
52
+
53
+ ## License
54
+
55
+ [<a href="https://www.npmjs.com/package/@uuv/cypress">
56
+ <img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="npm"/>
57
+ </a>](https://www.apache.org/licenses/LICENSE-2.0)
58
+
59
+ This project is licensed under the terms of the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
@@ -0,0 +1,4 @@
1
+ {
2
+ "reactScript": "/../../build/uuv/static/js/main.e5e49be0.js",
3
+ "cssFile": "/../../build/uuv/static/css/main.a63bc536.css"
4
+ }
@@ -0,0 +1 @@
1
+ export * from './uuv-assistant';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./uuv-assistant"), exports);
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ 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
+ });
@@ -0,0 +1,4 @@
1
+ export declare class UuvAssistant {
2
+ private initReactDomRootElementFn;
3
+ start(translatorFn?: (el: HTMLElement) => string): Promise<void>;
4
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UuvAssistant = void 0;
4
+ let translator;
5
+ class UuvAssistant {
6
+ initReactDomRootElementFn() {
7
+ 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
+ });
19
+ };
20
+ }
21
+ async start(translatorFn) {
22
+ const { chromium } = require("playwright-chromium");
23
+ const argv = require("minimist")(process.argv.slice(2));
24
+ const conf = require("./conf.json");
25
+ const browser = await chromium.launch({ headless: false });
26
+ const browserContext = await browser.newContext();
27
+ const page = await browserContext.newPage();
28
+ const translatorDeclaration = translatorFn ?
29
+ `var translator = ${translatorFn.toString()}; console.log('translator'); console.log(translator);` :
30
+ "var translator = null;";
31
+ await browserContext.addInitScript({
32
+ content: translatorDeclaration
33
+ });
34
+ await browserContext.addInitScript(this.initReactDomRootElementFn());
35
+ await browserContext.addInitScript({
36
+ path: `${__dirname}${conf.reactScript}`
37
+ });
38
+ await page.goto(argv.targetUrl);
39
+ await page.addStyleTag({
40
+ path: `${__dirname}${conf.cssFile}`
41
+ });
42
+ }
43
+ }
44
+ exports.UuvAssistant = UuvAssistant;
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@uuv/assistant",
3
+ "version": "1.3.0",
4
+ "author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
5
+ "description": "UUV wizard used to improve the life of testers and developers by generating cucumber phrases from the GUI.",
6
+ "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/e2e-test-quest/uuv"
10
+ },
11
+ "homepage": "https://e2e-test-quest.github.io/uuv/",
12
+ "keywords": [
13
+ "uuv",
14
+ "UUV",
15
+ "E2E",
16
+ "test",
17
+ "testing",
18
+ "cypress",
19
+ "testing-library",
20
+ "accessibility",
21
+ "accessibilité",
22
+ "a11y",
23
+ "cucumber",
24
+ "playwright",
25
+ "gherkin"
26
+ ],
27
+ "bin": {
28
+ "uuv-assistant": "./dist/launcher/uuv-assistant-launcher.js"
29
+ },
30
+ "scripts": {
31
+ "react:start": "react-scripts start",
32
+ "react:build": "react-scripts build",
33
+ "react:test": "react-scripts test",
34
+ "react:eject": "react-scripts eject",
35
+ "launch": "ts-node launcher/uuv-assistant-launcher.ts",
36
+ "launch:custom": "ts-node tests/uuv-assistant-custom-launcher.ts",
37
+ "conf:build": "node compute-conf.js",
38
+ "package": "npm pack --pack-destination=\"../../dist/packages\"",
39
+ "copy:sentences": "ts-node copy-sentences.ts",
40
+ "uuv": "node node_modules/@uuv/playwright/bin/uuv"
41
+ },
42
+ "dependencies": {
43
+ "@cucumber/cucumber": "9.1.0",
44
+ "antd": "^5.4.6",
45
+ "playwright-chromium": "1.33.0"
46
+ },
47
+ "browserslist": {
48
+ "production": [
49
+ ">0.2%",
50
+ "not dead",
51
+ "not op_mini all"
52
+ ],
53
+ "development": [
54
+ "last 1 chrome version",
55
+ "last 1 firefox version",
56
+ "last 1 safari version"
57
+ ]
58
+ },
59
+ "devDependencies": {
60
+ "@ant-design/icons": "^5.0.1",
61
+ "@testing-library/jest-dom": "5.16.5",
62
+ "@testing-library/react": "12.1.5",
63
+ "@testing-library/user-event": "14.4.3",
64
+ "@types/jest": "29.5.1",
65
+ "@types/jquery": "3.5.16",
66
+ "@types/node": "16.18.25",
67
+ "@types/react": "17.0.58",
68
+ "@types/react-dom": "17.0.20",
69
+ "@types/styled-components": "5.1.26",
70
+ "@types/testing-library__jest-dom": "5.14.5",
71
+ "@typescript-eslint/eslint-plugin": "5.59.1",
72
+ "@typescript-eslint/parser": "5.59.1",
73
+ "dom-accessibility-api": "0.5.16",
74
+ "eslint": "8.39.0",
75
+ "eslint-plugin-react": "7.32.2",
76
+ "inspector-dom": "0.1.1",
77
+ "jest": "^29.5.0",
78
+ "jest-environment-jsdom": "^29.5.0",
79
+ "minimist": "1.2.8",
80
+ "react": "17.0.2",
81
+ "react-dom": "17.0.2",
82
+ "react-scripts": "^5.0.1",
83
+ "replace-json-property": "1.8.0",
84
+ "styled-components": "5.3.10",
85
+ "ts-jest": "29.1.0",
86
+ "ts-loader": "^9.4.2",
87
+ "ts-node": "10.9.1",
88
+ "typescript": "4.9.5",
89
+ "web-vitals": "3.3.1"
90
+ },
91
+ "files": [
92
+ "dist/launcher/**/*",
93
+ "build/static/css/**/*.css",
94
+ "build/static/js/main.*.js",
95
+ "postinstall.js",
96
+ "target-config/**/*",
97
+ "public/en*.json"
98
+ ]
99
+ }