@uuv/playwright 1.9.0 → 1.10.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.
|
@@ -17,4 +17,5 @@ export interface UUVPlaywrightCucumberMapItem {
|
|
|
17
17
|
generatedFile: string;
|
|
18
18
|
}
|
|
19
19
|
export declare const UUVPlaywrightCucumberMapFile = ".uuv-playwright-cucumber-map.json";
|
|
20
|
+
export declare function executePreprocessor(tempDir: string, configDir: string): Promise<void>;
|
|
20
21
|
export declare function run(mode: "open" | "e2e", tempDir?: string, configDir?: string, generateHtmlReport?: boolean, env?: any, targetTestFile?: string): Promise<void>;
|
|
@@ -13,16 +13,40 @@
|
|
|
13
13
|
* understanding English or French.
|
|
14
14
|
*/
|
|
15
15
|
"use strict";
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
16
39
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
40
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
41
|
};
|
|
19
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.run = exports.UUVPlaywrightCucumberMapFile = void 0;
|
|
43
|
+
exports.run = exports.executePreprocessor = exports.UUVPlaywrightCucumberMapFile = void 0;
|
|
21
44
|
const chalk_1 = __importDefault(require("chalk"));
|
|
22
45
|
const gen_1 = require("../cucumber/preprocessor/gen");
|
|
23
46
|
const fs_1 = __importDefault(require("fs"));
|
|
24
|
-
const child_process_1 = require("child_process");
|
|
47
|
+
const child_process_1 = __importStar(require("child_process"));
|
|
25
48
|
const uuv_playwright_reporter_helper_1 = require("../reporter/uuv-playwright-reporter-helper");
|
|
49
|
+
const path_1 = __importDefault(require("path"));
|
|
26
50
|
exports.UUVPlaywrightCucumberMapFile = ".uuv-playwright-cucumber-map.json";
|
|
27
51
|
async function bddGen(tempDir) {
|
|
28
52
|
try {
|
|
@@ -123,8 +147,12 @@ async function executePreprocessor(tempDir, configDir) {
|
|
|
123
147
|
translateFeatures(tempDir, configDir);
|
|
124
148
|
console.log("preprocessor executed");
|
|
125
149
|
}
|
|
150
|
+
exports.executePreprocessor = executePreprocessor;
|
|
126
151
|
async function run(mode, tempDir = "uuv/.features-gen/e2e", configDir = "uuv", generateHtmlReport = false, env, targetTestFile) {
|
|
127
152
|
await executePreprocessor(tempDir, configDir);
|
|
153
|
+
if (mode === "open") {
|
|
154
|
+
child_process_1.default.fork(path_1.default.join(__dirname, "watch-test-files"), [tempDir, configDir]);
|
|
155
|
+
}
|
|
128
156
|
runPlaywright(mode, configDir, generateHtmlReport, env, targetTestFile);
|
|
129
157
|
}
|
|
130
158
|
exports.run = run;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Software Name : UUV
|
|
3
|
+
*
|
|
4
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 Orange
|
|
5
|
+
* SPDX-License-Identifier: MIT
|
|
6
|
+
*
|
|
7
|
+
* This software is distributed under the MIT License,
|
|
8
|
+
* the text of which is available at https://spdx.org/licenses/MIT.html
|
|
9
|
+
* or see the "LICENSE" file for more details.
|
|
10
|
+
*
|
|
11
|
+
* Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley
|
|
12
|
+
* Software description: Make test writing fast, understandable by any human
|
|
13
|
+
* understanding English or French.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Software Name : UUV
|
|
3
|
+
*
|
|
4
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 Orange
|
|
5
|
+
* SPDX-License-Identifier: MIT
|
|
6
|
+
*
|
|
7
|
+
* This software is distributed under the MIT License,
|
|
8
|
+
* the text of which is available at https://spdx.org/licenses/MIT.html
|
|
9
|
+
* or see the "LICENSE" file for more details.
|
|
10
|
+
*
|
|
11
|
+
* Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley
|
|
12
|
+
* Software description: Make test writing fast, understandable by any human
|
|
13
|
+
* understanding English or French.
|
|
14
|
+
*/
|
|
15
|
+
"use strict";
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
const runner_playwright_1 = require("./runner-playwright");
|
|
21
|
+
const chokidar_1 = __importDefault(require("chokidar"));
|
|
22
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
23
|
+
const tempDir = process.argv[2];
|
|
24
|
+
const configDir = process.argv[3];
|
|
25
|
+
if (!tempDir || !configDir) {
|
|
26
|
+
console.log(chalk_1.default.redBright("An error occurred during test files watching"));
|
|
27
|
+
process.exit(-1);
|
|
28
|
+
}
|
|
29
|
+
chokidar_1.default.watch(`${configDir}/e2e/**/*.feature`, {
|
|
30
|
+
ignoreInitial: true
|
|
31
|
+
})
|
|
32
|
+
.on("change", async (event, path) => {
|
|
33
|
+
console.log(chalk_1.default.yellowBright("\nRefreshing test files..."));
|
|
34
|
+
await (0, runner_playwright_1.executePreprocessor)(tempDir, configDir);
|
|
35
|
+
console.log(chalk_1.default.yellowBright("Test files refreshed\n"));
|
|
36
|
+
})
|
|
37
|
+
.on("add", async (path) => {
|
|
38
|
+
console.log(chalk_1.default.yellowBright(`\nFile ${path} has been added`));
|
|
39
|
+
await (0, runner_playwright_1.executePreprocessor)(tempDir, configDir);
|
|
40
|
+
console.log(chalk_1.default.yellowBright("Test files refreshed\n"));
|
|
41
|
+
})
|
|
42
|
+
.on("unlink", async (path) => {
|
|
43
|
+
console.log(chalk_1.default.yellowBright(`\nFile ${path} has been removed`));
|
|
44
|
+
await (0, runner_playwright_1.executePreprocessor)(tempDir, configDir);
|
|
45
|
+
console.log(chalk_1.default.yellowBright("Test files refreshed\n"));
|
|
46
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/playwright",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
|
|
6
6
|
"description": "A solution to run E2E tests written in cucumber(BDD) with playwright.",
|
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@cucumber/cucumber": "9.3.0",
|
|
48
48
|
"@playwright/test": "1.33.0",
|
|
49
|
-
"@uuv/runner-commons": "1.
|
|
49
|
+
"@uuv/runner-commons": "1.8.0",
|
|
50
50
|
"axe-core": "4.7.2",
|
|
51
51
|
"axe-playwright": "1.2.3",
|
|
52
52
|
"chalk": "4.1.2",
|
|
53
53
|
"chalk-table": "^1.0.2",
|
|
54
|
+
"chokidar": "3.5.3",
|
|
54
55
|
"cucumber-json-report-formatter": "0.1.4",
|
|
55
56
|
"figlet": "1.6.0",
|
|
56
57
|
"minimist": "1.2.8",
|