@uuv/playwright 3.21.0 → 3.22.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.
|
@@ -12,7 +12,24 @@
|
|
|
12
12
|
* understanding English or French.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.TimeoutCookie = exports.SelectedElementCookie = exports.MockCookie = exports.CustomCookie = exports.FILTER_TYPE = exports.COOKIE_VALUE = exports.COOKIE_NAME = void 0;
|
|
16
|
+
exports.getPageOrElement = getPageOrElement;
|
|
17
|
+
exports.addCookie = addCookie;
|
|
18
|
+
exports.getCookie = getCookie;
|
|
19
|
+
exports.deleteCookieByName = deleteCookieByName;
|
|
20
|
+
exports.findWithRoleAndName = findWithRoleAndName;
|
|
21
|
+
exports.withinRoleAndName = withinRoleAndName;
|
|
22
|
+
exports.notFoundWithRoleAndName = notFoundWithRoleAndName;
|
|
23
|
+
exports.findWithRoleAndNameAndContent = findWithRoleAndNameAndContent;
|
|
24
|
+
exports.findWithRoleAndNameFocused = findWithRoleAndNameFocused;
|
|
25
|
+
exports.findWithRoleAndNameAndChecked = findWithRoleAndNameAndChecked;
|
|
26
|
+
exports.findWithRoleAndNameAndUnchecked = findWithRoleAndNameAndUnchecked;
|
|
27
|
+
exports.findWithRoleAndNameAndContentDisable = findWithRoleAndNameAndContentDisable;
|
|
28
|
+
exports.findWithRoleAndNameAndContentEnable = findWithRoleAndNameAndContentEnable;
|
|
29
|
+
exports.showAttributesInLocator = showAttributesInLocator;
|
|
30
|
+
exports.checkTextContentLocator = checkTextContentLocator;
|
|
31
|
+
exports.click = click;
|
|
32
|
+
exports.getTimeout = getTimeout;
|
|
16
33
|
const test_1 = require("@playwright/test");
|
|
17
34
|
const runner_commons_1 = require("@uuv/runner-commons");
|
|
18
35
|
var COOKIE_NAME;
|
|
@@ -115,7 +132,6 @@ async function getPageOrElement(world) {
|
|
|
115
132
|
}
|
|
116
133
|
return pointer;
|
|
117
134
|
}
|
|
118
|
-
exports.getPageOrElement = getPageOrElement;
|
|
119
135
|
async function addCookie(world, cookieName, newCookie) {
|
|
120
136
|
// console.debug("value", value)
|
|
121
137
|
const cookieNameStr = `${cookieName.toString()}_${world.testInfo.testId}`;
|
|
@@ -144,7 +160,6 @@ async function addCookie(world, cookieName, newCookie) {
|
|
|
144
160
|
}
|
|
145
161
|
await world.context.addCookies([{ name: cookieNameStr, value: JSON.stringify(cookieValue), path: "/", domain: ".github.com" }]);
|
|
146
162
|
}
|
|
147
|
-
exports.addCookie = addCookie;
|
|
148
163
|
async function getCookie(world, cookieName) {
|
|
149
164
|
const cookieNameStr = `${cookieName.toString()}_${world.testInfo.testId}`;
|
|
150
165
|
const cookies = await world.context.cookies();
|
|
@@ -157,7 +172,6 @@ async function getCookie(world, cookieName) {
|
|
|
157
172
|
}
|
|
158
173
|
return new CustomCookie();
|
|
159
174
|
}
|
|
160
|
-
exports.getCookie = getCookie;
|
|
161
175
|
async function deleteCookieByName(world, cookieName) {
|
|
162
176
|
const cookieToDelete = await getCookie(world, cookieName);
|
|
163
177
|
await world.context.addCookies([
|
|
@@ -167,16 +181,13 @@ async function deleteCookieByName(world, cookieName) {
|
|
|
167
181
|
},
|
|
168
182
|
]);
|
|
169
183
|
}
|
|
170
|
-
exports.deleteCookieByName = deleteCookieByName;
|
|
171
184
|
async function findWithRoleAndName(world, role, name) {
|
|
172
185
|
await findWithRoleAndNameAndContent(world, role, name);
|
|
173
186
|
}
|
|
174
|
-
exports.findWithRoleAndName = findWithRoleAndName;
|
|
175
187
|
async function withinRoleAndName(world, role, name) {
|
|
176
188
|
await findWithRoleAndNameAndContent(world, role, name, undefined, true);
|
|
177
189
|
await addCookie(world, COOKIE_NAME.SELECTED_ELEMENT, new SelectedElementCookie(FILTER_TYPE.SELECTOR, `role=${role}[name="${name}"]`));
|
|
178
190
|
}
|
|
179
|
-
exports.withinRoleAndName = withinRoleAndName;
|
|
180
191
|
async function notFoundWithRoleAndName(world, role, name) {
|
|
181
192
|
role = encodeURIComponent(role);
|
|
182
193
|
await getPageOrElement(world).then(async (element) => await (0, test_1.expect)(element.getByRole(role, {
|
|
@@ -185,7 +196,6 @@ async function notFoundWithRoleAndName(world, role, name) {
|
|
|
185
196
|
exact: true
|
|
186
197
|
})).toHaveCount(0, { timeout: await getTimeout(world) }));
|
|
187
198
|
}
|
|
188
|
-
exports.notFoundWithRoleAndName = notFoundWithRoleAndName;
|
|
189
199
|
async function findWithRoleAndNameAndContent(world, expectedRole, name, expectedTextContent = undefined, setFocus = false) {
|
|
190
200
|
expectedRole = encodeURIComponent(expectedRole);
|
|
191
201
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -197,7 +207,6 @@ async function findWithRoleAndNameAndContent(world, expectedRole, name, expected
|
|
|
197
207
|
await byRole.focus({ timeout: 10000 });
|
|
198
208
|
});
|
|
199
209
|
}
|
|
200
|
-
exports.findWithRoleAndNameAndContent = findWithRoleAndNameAndContent;
|
|
201
210
|
async function findWithRoleAndNameFocused(world, expectedRole, name) {
|
|
202
211
|
expectedRole = encodeURIComponent(expectedRole);
|
|
203
212
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -207,7 +216,6 @@ async function findWithRoleAndNameFocused(world, expectedRole, name) {
|
|
|
207
216
|
await (0, test_1.expect)(byRole).toBeFocused();
|
|
208
217
|
});
|
|
209
218
|
}
|
|
210
|
-
exports.findWithRoleAndNameFocused = findWithRoleAndNameFocused;
|
|
211
219
|
async function findWithRoleAndNameAndChecked(world, expectedRole, name) {
|
|
212
220
|
expectedRole = encodeURIComponent(expectedRole);
|
|
213
221
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -216,7 +224,6 @@ async function findWithRoleAndNameAndChecked(world, expectedRole, name) {
|
|
|
216
224
|
await (0, test_1.expect)(byRole).toBeChecked();
|
|
217
225
|
});
|
|
218
226
|
}
|
|
219
|
-
exports.findWithRoleAndNameAndChecked = findWithRoleAndNameAndChecked;
|
|
220
227
|
async function findWithRoleAndNameAndUnchecked(world, expectedRole, name) {
|
|
221
228
|
expectedRole = encodeURIComponent(expectedRole);
|
|
222
229
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -225,7 +232,6 @@ async function findWithRoleAndNameAndUnchecked(world, expectedRole, name) {
|
|
|
225
232
|
await (0, test_1.expect)(byRole).not.toBeChecked();
|
|
226
233
|
});
|
|
227
234
|
}
|
|
228
|
-
exports.findWithRoleAndNameAndUnchecked = findWithRoleAndNameAndUnchecked;
|
|
229
235
|
async function findWithRoleAndNameAndContentDisable(world, expectedRole, name, expectedTextContent) {
|
|
230
236
|
expectedRole = encodeURIComponent(expectedRole);
|
|
231
237
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -235,7 +241,6 @@ async function findWithRoleAndNameAndContentDisable(world, expectedRole, name, e
|
|
|
235
241
|
await (0, test_1.expect)(byRole).toBeDisabled();
|
|
236
242
|
});
|
|
237
243
|
}
|
|
238
|
-
exports.findWithRoleAndNameAndContentDisable = findWithRoleAndNameAndContentDisable;
|
|
239
244
|
async function findWithRoleAndNameAndContentEnable(world, expectedRole, name, expectedTextContent) {
|
|
240
245
|
expectedRole = encodeURIComponent(expectedRole);
|
|
241
246
|
await getPageOrElement(world).then(async (element) => {
|
|
@@ -245,7 +250,6 @@ async function findWithRoleAndNameAndContentEnable(world, expectedRole, name, ex
|
|
|
245
250
|
await (0, test_1.expect)(byRole).toBeEnabled();
|
|
246
251
|
});
|
|
247
252
|
}
|
|
248
|
-
exports.findWithRoleAndNameAndContentEnable = findWithRoleAndNameAndContentEnable;
|
|
249
253
|
async function showAttributesInLocator(element) {
|
|
250
254
|
const attributes = await element.evaluateHandle((aElement) => {
|
|
251
255
|
const attributeNames = aElement.getAttributeNames();
|
|
@@ -257,7 +261,6 @@ async function showAttributesInLocator(element) {
|
|
|
257
261
|
});
|
|
258
262
|
console.debug("attributes of ", element, await attributes.jsonValue());
|
|
259
263
|
}
|
|
260
|
-
exports.showAttributesInLocator = showAttributesInLocator;
|
|
261
264
|
async function checkTextContentLocator(locator, expectedTextContent) {
|
|
262
265
|
// await showAttributesInLocator(locator);
|
|
263
266
|
try {
|
|
@@ -291,7 +294,6 @@ async function checkTextContentLocator(locator, expectedTextContent) {
|
|
|
291
294
|
}
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
|
-
exports.checkTextContentLocator = checkTextContentLocator;
|
|
295
297
|
async function click(world, role, name) {
|
|
296
298
|
await getPageOrElement(world).then(async (element) => {
|
|
297
299
|
const byRole = element.getByRole(role, {
|
|
@@ -304,7 +306,6 @@ async function click(world, role, name) {
|
|
|
304
306
|
await deleteCookieByName(world, COOKIE_NAME.SELECTED_ELEMENT);
|
|
305
307
|
});
|
|
306
308
|
}
|
|
307
|
-
exports.click = click;
|
|
308
309
|
async function getTimeout(world) {
|
|
309
310
|
const cookieTimeout = await getCookie(world, COOKIE_NAME.TIMEOUT);
|
|
310
311
|
if (cookieTimeout?.isValid()) {
|
|
@@ -315,4 +316,3 @@ async function getTimeout(world) {
|
|
|
315
316
|
}
|
|
316
317
|
return runner_commons_1.DEFAULT_TIMEOUT;
|
|
317
318
|
}
|
|
318
|
-
exports.getTimeout = getTimeout;
|
package/dist/lib/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildConfig =
|
|
3
|
+
exports.buildConfig = buildConfig;
|
|
4
4
|
const playwright_bdd_1 = require("playwright-bdd");
|
|
5
5
|
function buildConfig(inputsPaths, imports = [
|
|
6
6
|
"cucumber/step_definitions/**/*.{js,ts}",
|
|
@@ -13,4 +13,3 @@ function buildConfig(inputsPaths, imports = [
|
|
|
13
13
|
featuresRoot: "e2e"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
exports.buildConfig = buildConfig;
|
|
@@ -27,18 +27,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
27
27
|
}) : function(o, v) {
|
|
28
28
|
o["default"] = v;
|
|
29
29
|
});
|
|
30
|
-
var __importStar = (this && this.__importStar) || function (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
37
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
49
|
};
|
|
40
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.
|
|
51
|
+
exports.UUVCliPlaywrightRunner = void 0;
|
|
52
|
+
exports.executePreprocessor = executePreprocessor;
|
|
42
53
|
const fs_1 = __importDefault(require("fs"));
|
|
43
54
|
const chalk_1 = __importDefault(require("chalk"));
|
|
44
55
|
const uuv_playwright_reporter_helper_1 = require("../reporter/uuv-playwright-reporter-helper");
|
|
@@ -145,4 +156,3 @@ function executePreprocessor(projectDir) {
|
|
|
145
156
|
executeSystemCommandHelper(`npx bddgen -c ${projectDir}/playwright.config.ts`);
|
|
146
157
|
console.log("preprocessor executed\n");
|
|
147
158
|
}
|
|
148
|
-
exports.executePreprocessor = executePreprocessor;
|
package/dist/lib/uuv-cli.js
CHANGED
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
* understanding English or French.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.main =
|
|
16
|
+
exports.main = main;
|
|
17
17
|
const runner_commons_1 = require("@uuv/runner-commons");
|
|
18
18
|
const runner_playwright_1 = require("./runner-playwright");
|
|
19
19
|
async function main(projectDir = "./uuv", tempDir = "uuv/.uuv-features-gen") {
|
|
20
20
|
const engine = new runner_commons_1.UUVCliEngine(new runner_playwright_1.UUVCliPlaywrightRunner(projectDir, tempDir));
|
|
21
21
|
engine.execute();
|
|
22
22
|
}
|
|
23
|
-
exports.main = main;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/playwright",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.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 facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and playwright",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@cucumber/tag-expressions": "^6.0.0",
|
|
47
47
|
"@playwright/test": "^1.44.1",
|
|
48
|
-
"@uuv/runner-commons": "2.36.
|
|
48
|
+
"@uuv/runner-commons": "2.36.1",
|
|
49
49
|
"axe-core": "4.10.2",
|
|
50
50
|
"axe-playwright": "2.0.3",
|
|
51
51
|
"chalk-table": "^1.0.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"nanoid": "^3.3.7",
|
|
57
57
|
"playwright-bdd": "^6.5.0",
|
|
58
58
|
"ts-node": "10.9.2",
|
|
59
|
-
"typescript": "5.
|
|
59
|
+
"typescript": "5.7.2"
|
|
60
60
|
},
|
|
61
61
|
"types": "./dist/index.d.ts",
|
|
62
62
|
"main": "./dist/index.js",
|