@uuv/cypress 1.8.2 → 1.9.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/CHANGELOG.md +23 -0
- package/dist/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.js +18 -0
- package/dist/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.js +18 -0
- package/dist/cypress/cypress.config.js +10 -5
- package/dist/lib/uuv-cli.js +1 -0
- package/package.json +6 -5
- package/src/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.ts +20 -0
- package/src/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# [1.9.0](https://github.com/Orange-OpenSource/uuv/compare/runner-cypress-v1.8.3...runner-cypress-v1.9.0) (2023-09-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency cypress to v12.17.4 ([998b754](https://github.com/Orange-OpenSource/uuv/commit/998b754038941de8b035abbd47800d45b1dac022))
|
|
7
|
+
* **deps:** update dependency cypress-real-events to v1.10.1 ([f60978d](https://github.com/Orange-OpenSource/uuv/commit/f60978da4bdd76483bcb2479324ccbbf3b36d87b))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add sentences to click on element and reset context, [#250](https://github.com/Orange-OpenSource/uuv/issues/250) ([347e327](https://github.com/Orange-OpenSource/uuv/commit/347e327bdfc5c6befc3a58a2c880bea3b0c8400c))
|
|
13
|
+
* **docs:** add autocompletion searchfield to steps definition page, [#255](https://github.com/Orange-OpenSource/uuv/issues/255) ([a0323ee](https://github.com/Orange-OpenSource/uuv/commit/a0323eec01a6351f9b60399398d145cb2bc86779))
|
|
14
|
+
* update example test files, [#250](https://github.com/Orange-OpenSource/uuv/issues/250) ([ffc15b5](https://github.com/Orange-OpenSource/uuv/commit/ffc15b5a66ee7d3712541722228f53b692c7a1ab))
|
|
15
|
+
|
|
16
|
+
## [1.8.3](https://github.com/Orange-OpenSource/uuv/compare/runner-cypress-v1.8.2...runner-cypress-v1.8.3) (2023-08-31)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **runner-cypress:** call badeball preprecessor befor teamcity logs, [#239](https://github.com/Orange-OpenSource/uuv/issues/239) ([f12ae26](https://github.com/Orange-OpenSource/uuv/commit/f12ae261e71d4662ea0cc7b3a2cbcd32344a19b2))
|
|
22
|
+
* **runner-cypress:** return error code when an error occured, [#239](https://github.com/Orange-OpenSource/uuv/issues/239) ([fbc8b97](https://github.com/Orange-OpenSource/uuv/commit/fbc8b97eacef535356e479a7d87fdf2e16df1549))
|
|
23
|
+
|
|
1
24
|
## [1.8.2](https://github.com/Orange-OpenSource/uuv/compare/runner-cypress-v1.8.1...runner-cypress-v1.8.2) (2023-08-31)
|
|
2
25
|
|
|
3
26
|
|
package/dist/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.js
CHANGED
|
@@ -33,6 +33,12 @@ const core_engine_1 = require("../core-engine");
|
|
|
33
33
|
context.focusedElement.click();
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
|
+
(0, cypress_cucumber_preprocessor_1.When)(`I click on button named {string}`, function (name) {
|
|
37
|
+
click("button", name);
|
|
38
|
+
});
|
|
39
|
+
(0, cypress_cucumber_preprocessor_1.When)(`I click on element with role {string} and name {string}`, function (role, name) {
|
|
40
|
+
click(role, name);
|
|
41
|
+
});
|
|
36
42
|
(0, cypress_cucumber_preprocessor_1.When)(`I type the sentence {string}`, function (textToType) {
|
|
37
43
|
cy.uuvCheckContextFocusedElement().then((context) => {
|
|
38
44
|
context.focusedElement.focus();
|
|
@@ -308,3 +314,15 @@ function pressKey(context, key) {
|
|
|
308
314
|
focusedElement: cy.focused()
|
|
309
315
|
});
|
|
310
316
|
}
|
|
317
|
+
function click(role, name) {
|
|
318
|
+
cy.uuvGetContext().then(context => {
|
|
319
|
+
const parentElement = context.focusedElement;
|
|
320
|
+
if (parentElement) {
|
|
321
|
+
cy.uuvFindByRole(role, { name: name }).uuvFoundedElement().click();
|
|
322
|
+
cy.wrap(new _context_1.Context()).as("context");
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
cy.findByRole(role, { name: name }).click();
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
package/dist/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.js
CHANGED
|
@@ -33,6 +33,12 @@ const core_engine_1 = require("../core-engine");
|
|
|
33
33
|
context.focusedElement.click();
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
|
+
(0, cypress_cucumber_preprocessor_1.When)(`je clique sur le bouton nommé {string}`, function (name) {
|
|
37
|
+
click("button", name);
|
|
38
|
+
});
|
|
39
|
+
(0, cypress_cucumber_preprocessor_1.When)(`je clique sur l'élément avec le rôle {string} et le nom {string}`, function (role, name) {
|
|
40
|
+
click(role, name);
|
|
41
|
+
});
|
|
36
42
|
(0, cypress_cucumber_preprocessor_1.When)(`je saisie le(s) mot(s) {string}`, function (textToType) {
|
|
37
43
|
cy.uuvCheckContextFocusedElement().then((context) => {
|
|
38
44
|
context.focusedElement.focus();
|
|
@@ -308,3 +314,15 @@ function pressKey(context, key) {
|
|
|
308
314
|
focusedElement: cy.focused()
|
|
309
315
|
});
|
|
310
316
|
}
|
|
317
|
+
function click(role, name) {
|
|
318
|
+
cy.uuvGetContext().then(context => {
|
|
319
|
+
const parentElement = context.focusedElement;
|
|
320
|
+
if (parentElement) {
|
|
321
|
+
cy.uuvFindByRole(role, { name: name }).uuvFoundedElement().click();
|
|
322
|
+
cy.wrap(new _context_1.Context()).as("context");
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
cy.findByRole(role, { name: name }).click();
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
@@ -34,7 +34,8 @@ async function setupNodeEvents(on, config) {
|
|
|
34
34
|
resolve: {
|
|
35
35
|
extensions: [".ts", ".js"],
|
|
36
36
|
fallback: {
|
|
37
|
-
fs: false
|
|
37
|
+
fs: false,
|
|
38
|
+
path: require.resolve("path-browserify")
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
module: {
|
|
@@ -64,19 +65,23 @@ async function setupNodeEvents(on, config) {
|
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
67
|
}));
|
|
67
|
-
on("before:run", () => {
|
|
68
|
+
on("before:run", async () => {
|
|
69
|
+
await (0, cypress_cucumber_preprocessor_1.beforeRunHandler)(config);
|
|
68
70
|
logTeamCity("##teamcity[progressStart 'Running UUV Tests']");
|
|
69
71
|
});
|
|
70
|
-
on("after:run", () => {
|
|
72
|
+
on("after:run", async () => {
|
|
73
|
+
await (0, cypress_cucumber_preprocessor_1.afterRunHandler)(config);
|
|
71
74
|
logTeamCity("##teamcity[progressFinish 'Running UUV Tests']");
|
|
72
75
|
});
|
|
73
|
-
on("before:spec", (spec) => {
|
|
76
|
+
on("before:spec", async (spec) => {
|
|
74
77
|
if (!startedFile.includes(spec.absolute)) {
|
|
78
|
+
await (0, cypress_cucumber_preprocessor_1.beforeSpecHandler)(config);
|
|
75
79
|
logTeamCity(`##teamcity[testSuiteStarted ${teamcityAddName(spec.baseName)} ${teamcityFlowId(spec.baseName)} ${teamcityAddCustomField("locationHint", "test://" + spec.absolute)} ]`);
|
|
76
80
|
startedFile.push(spec.absolute);
|
|
77
81
|
}
|
|
78
82
|
});
|
|
79
|
-
on("after:spec", (spec, results) => {
|
|
83
|
+
on("after:spec", async (spec, results) => {
|
|
84
|
+
await (0, cypress_cucumber_preprocessor_1.afterSpecHandler)(config, spec, results);
|
|
80
85
|
results?.tests?.forEach(test => {
|
|
81
86
|
logTeamCity(`##teamcity[testStarted ${teamcityAddName(test.title[1])} ${teamcityFlowIdAndParentFlowId(test.title[1], spec.baseName)} ${teamcityAddCustomField("locationHint", "test://" + spec.absolute)} ]`);
|
|
82
87
|
if (test.state === "passed") {
|
package/dist/lib/uuv-cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/cypress",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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 cypress.",
|
|
@@ -46,17 +46,18 @@
|
|
|
46
46
|
"@badeball/cypress-cucumber-preprocessor": "16.0.3",
|
|
47
47
|
"@cypress/webpack-preprocessor": "5.17.1",
|
|
48
48
|
"@testing-library/cypress": "9.0.0",
|
|
49
|
-
"@uuv/runner-commons": "1.
|
|
49
|
+
"@uuv/runner-commons": "1.7.0",
|
|
50
50
|
"axe-core": "4.7.2",
|
|
51
51
|
"chalk": "4.1.2",
|
|
52
52
|
"cucumber-json-report-formatter": "0.1.4",
|
|
53
|
-
"cypress": "12.17.
|
|
53
|
+
"cypress": "12.17.4",
|
|
54
54
|
"cypress-axe": "1.4.0",
|
|
55
55
|
"cypress-real-events": "^1.10.0",
|
|
56
56
|
"figlet": "1.6.0",
|
|
57
57
|
"is-admin": "2.1.1",
|
|
58
58
|
"minimist": "1.2.8",
|
|
59
59
|
"multiple-cucumber-html-reporter": "3.3.0",
|
|
60
|
+
"path-browserify": "^1.0.1",
|
|
60
61
|
"ts-node": "10.9.1",
|
|
61
62
|
"typescript": "4.9.5",
|
|
62
63
|
"webpack": "5.88.2"
|
|
@@ -99,9 +100,9 @@
|
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@types/minimist": "1.2.2",
|
|
102
|
-
"@types/node": "16.18.
|
|
103
|
+
"@types/node": "16.18.50",
|
|
103
104
|
"cross-env": "7.0.3",
|
|
104
|
-
"eslint-plugin-cypress": "2.
|
|
105
|
+
"eslint-plugin-cypress": "2.14.0",
|
|
105
106
|
"serve-handler": "6.1.5",
|
|
106
107
|
"ts-loader": "9.4.2",
|
|
107
108
|
"tsconfig-paths": "4.2.0"
|
package/src/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.ts
CHANGED
|
@@ -43,6 +43,14 @@ When(`I click`, function() {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
When(`I click on button named {string}`, function(name: string) {
|
|
47
|
+
click("button", name);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
When(`I click on element with role {string} and name {string}`, function(role: string, name: string) {
|
|
51
|
+
click(role, name);
|
|
52
|
+
});
|
|
53
|
+
|
|
46
54
|
When(`I type the sentence {string}`, function(textToType: string) {
|
|
47
55
|
cy.uuvCheckContextFocusedElement().then((context) => {
|
|
48
56
|
context.focusedElement!.focus();
|
|
@@ -415,3 +423,15 @@ function pressKey(context: Cypress.Chainable<JQuery<HTMLElement>>, key: string)
|
|
|
415
423
|
focusedElement: cy.focused()
|
|
416
424
|
});
|
|
417
425
|
}
|
|
426
|
+
|
|
427
|
+
function click(role: string, name: string) {
|
|
428
|
+
cy.uuvGetContext().then(context => {
|
|
429
|
+
const parentElement = context.focusedElement;
|
|
430
|
+
if (parentElement) {
|
|
431
|
+
cy.uuvFindByRole(role, { name: name }).uuvFoundedElement().click();
|
|
432
|
+
cy.wrap(new Context()).as("context");
|
|
433
|
+
} else {
|
|
434
|
+
cy.findByRole(role, { name: name }).click();
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|
package/src/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.ts
CHANGED
|
@@ -43,6 +43,14 @@ When(`je clique`, function() {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
When(`je clique sur le bouton nommé {string}`, function(name: string) {
|
|
47
|
+
click("button", name);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
When(`je clique sur l'élément avec le rôle {string} et le nom {string}`, function(role: string, name: string) {
|
|
51
|
+
click(role, name);
|
|
52
|
+
});
|
|
53
|
+
|
|
46
54
|
When(`je saisie le(s) mot(s) {string}`, function(textToType: string) {
|
|
47
55
|
cy.uuvCheckContextFocusedElement().then((context) => {
|
|
48
56
|
context.focusedElement!.focus();
|
|
@@ -415,3 +423,15 @@ function pressKey(context: Cypress.Chainable<JQuery<HTMLElement>>, key: string)
|
|
|
415
423
|
focusedElement: cy.focused()
|
|
416
424
|
});
|
|
417
425
|
}
|
|
426
|
+
|
|
427
|
+
function click(role: string, name: string) {
|
|
428
|
+
cy.uuvGetContext().then(context => {
|
|
429
|
+
const parentElement = context.focusedElement;
|
|
430
|
+
if (parentElement) {
|
|
431
|
+
cy.uuvFindByRole(role, { name: name }).uuvFoundedElement().click();
|
|
432
|
+
cy.wrap(new Context()).as("context");
|
|
433
|
+
} else {
|
|
434
|
+
cy.findByRole(role, { name: name }).click();
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|