@uuv/assistant 1.4.2 → 1.5.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/README.md +1 -1
- package/dist/launcher/conf.json +3 -2
- package/dist/launcher/index.d.ts +1 -1
- package/dist/launcher/uuv-assistant-launcher.d.ts +15 -0
- package/dist/launcher/uuv-assistant-launcher.js +15 -0
- package/dist/launcher/uuv-assistant.d.ts +15 -1
- package/dist/launcher/uuv-assistant.js +17 -32
- package/dist/uuv-assistant-resources.bundle.js +25 -0
- package/package.json +20 -13
- package/build/static/css/main.8c76db0a.css +0 -1
- package/build/static/js/main.57c0adfd.js +0 -2
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ yarn add -D @uuv/assistant
|
|
|
94
94
|
## Usage
|
|
95
95
|
|
|
96
96
|
### Scenarios example
|
|
97
|
-
You can find test examples here : [
|
|
97
|
+
You can find test examples here : [weather-app.feature](https://github.com/e2e-test-quest/uuv/blob/main/example/weather-app.feature)
|
|
98
98
|
|
|
99
99
|
### Launch
|
|
100
100
|
To launch uuv assistant :
|
package/dist/launcher/conf.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"reactScript": "
|
|
3
|
-
"cssFile": "
|
|
2
|
+
"reactScript": "/build/static/js/main.d482abe3.js",
|
|
3
|
+
"cssFile": "/build/static/css/main.8c76db0a.css",
|
|
4
|
+
"unifiedFile": "../unified-uuv-assistant.js"
|
|
4
5
|
}
|
package/dist/launcher/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./uuv-assistant";
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copyright UUV.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
export {};
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Copyright UUV.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
3
18
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
19
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
20
|
};
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright UUV.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
export declare class UuvAssistant {
|
|
2
|
-
private initReactDomRootElementFn;
|
|
3
17
|
start(translatorFn?: (el: HTMLElement) => string): Promise<void>;
|
|
4
18
|
}
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Copyright UUV.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
5
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
18
|
exports.UuvAssistant = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
let translator;
|
|
9
|
-
let uuvCssContent;
|
|
10
19
|
class UuvAssistant {
|
|
11
|
-
initReactDomRootElementFn() {
|
|
12
|
-
return () => {
|
|
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
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
20
|
async start(translatorFn) {
|
|
34
21
|
const { chromium } = require("playwright-chromium");
|
|
35
22
|
const argv = require("minimist")(process.argv.slice(2));
|
|
@@ -40,13 +27,11 @@ class UuvAssistant {
|
|
|
40
27
|
const translatorDeclaration = translatorFn ?
|
|
41
28
|
`var translator = ${translatorFn.toString()}; console.log('translator'); console.log(translator);` :
|
|
42
29
|
"var translator = null;";
|
|
43
|
-
const cssContentDeclaration = `\n var uuvCssContent = "${fs_1.default.readFileSync(__dirname + conf.cssFile).toString()}"`;
|
|
44
30
|
await browserContext.addInitScript({
|
|
45
|
-
content: `${translatorDeclaration}
|
|
31
|
+
content: `${translatorDeclaration}`
|
|
46
32
|
});
|
|
47
|
-
await browserContext.addInitScript(this.initReactDomRootElementFn());
|
|
48
33
|
await browserContext.addInitScript({
|
|
49
|
-
path: `${__dirname}${conf.
|
|
34
|
+
path: `${__dirname}${conf.unifiedFile}`
|
|
50
35
|
});
|
|
51
36
|
await page.goto(argv.targetUrl);
|
|
52
37
|
}
|