@uuv/runner-commons 2.21.0 → 2.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [2.22.0](https://github.com/Orange-OpenSource/uuv/compare/runner-commons-v2.21.0...runner-commons-v2.22.0) (2024-08-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **runner-cypress:** update dependency cypress to v13.13.2 ([7b0044e](https://github.com/Orange-OpenSource/uuv/commit/7b0044efdf2448c6883029e9cefcae05927d5264))
7
+
8
+
9
+ ### Features
10
+
11
+ * add checked state sentences, [#733](https://github.com/Orange-OpenSource/uuv/issues/733) ([62abd39](https://github.com/Orange-OpenSource/uuv/commit/62abd394259574965d543fc5e40c3854f3dbaf1d))
12
+ * **assistant:** update dependency antd to v5.20.0 ([709fdd3](https://github.com/Orange-OpenSource/uuv/commit/709fdd3b222b2b9ff4a6fcc0649e704ad81327b1))
13
+
1
14
  # [2.21.0](https://github.com/Orange-OpenSource/uuv/compare/runner-commons-v2.20.0...runner-commons-v2.21.0) (2024-07-28)
2
15
 
3
16
 
@@ -59,6 +59,18 @@
59
59
  "description": "Writes the sentence given as a parameter inside the specified field (useful for example to fill in a form field)",
60
60
  "wording": "I type the sentence {string} in $definiteArticle $roleName named {string}",
61
61
  "section": "type"
62
+ },
63
+ {
64
+ "key": "key.then.element.withRoleAndNameAndChecked",
65
+ "description": "Checks that an Html element exists with the specified [accessible role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#aria_role_types) and [name](https://russmaxdesign.github.io/html-elements-names/) and is checked",
66
+ "wording": "I should see $indefiniteArticle $roleName named {string} checked",
67
+ "section": "checkable"
68
+ },
69
+ {
70
+ "key": "key.then.element.withRoleAndNameAndUnchecked",
71
+ "description": "Checks that an Html element exists with the specified [accessible role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#aria_role_types) and [name](https://russmaxdesign.github.io/html-elements-names/) and is unchecked",
72
+ "wording": "I should see $indefiniteArticle $roleName named {string} unchecked",
73
+ "section": "checkable"
62
74
  }
63
75
  ]
64
76
  }
@@ -19,7 +19,8 @@ class EnAccessibleRole extends accessible_role_1.AccessibleRole {
19
19
  shouldGenerateTypeSentence;
20
20
  shouldGenerateContainsSentence;
21
21
  shouldGenerateKeyboardSentence;
22
- constructor(id, name, definiteArticle = DEFINITE_ARTICLE.THE, indefiniteArticle = INDEFINITE_ARTICLE.A, shouldGenerateTypeSentence = true, shouldGenerateContainsSentence = true, shouldGenerateKeyboardSentence = false) {
22
+ shouldGenerateCheckedSentence;
23
+ constructor(id, name, definiteArticle = DEFINITE_ARTICLE.THE, indefiniteArticle = INDEFINITE_ARTICLE.A, shouldGenerateTypeSentence = true, shouldGenerateContainsSentence = true, shouldGenerateKeyboardSentence = false, shouldGenerateCheckedSentence = false) {
23
24
  super();
24
25
  this.id = id;
25
26
  this.name = name;
@@ -28,9 +29,10 @@ class EnAccessibleRole extends accessible_role_1.AccessibleRole {
28
29
  this.shouldGenerateTypeSentence = shouldGenerateTypeSentence;
29
30
  this.shouldGenerateContainsSentence = shouldGenerateContainsSentence;
30
31
  this.shouldGenerateKeyboardSentence = shouldGenerateKeyboardSentence;
32
+ this.shouldGenerateCheckedSentence = shouldGenerateCheckedSentence;
31
33
  }
32
34
  static from(input) {
33
- return new EnAccessibleRole(input.id, input.name, input.definiteArticle, input.indefiniteArticle, input.shouldGenerateTypeSentence, input.shouldGenerateContainsSentence, input.shouldGenerateKeyboardSentence);
35
+ return new EnAccessibleRole(input.id, input.name, input.definiteArticle, input.indefiniteArticle, input.shouldGenerateTypeSentence, input.shouldGenerateContainsSentence, input.shouldGenerateKeyboardSentence, input.shouldGenerateCheckedSentence);
34
36
  }
35
37
  getDefiniteArticle() {
36
38
  return this.definiteArticle.toString();
@@ -53,7 +55,7 @@ exports.EN_ROLES = [
53
55
  { id: "banner", name: "banner" },
54
56
  { id: "button", name: "button", shouldGenerateKeyboardSentence: true },
55
57
  { id: "cell", name: "cell" },
56
- { id: "checkbox", name: "checkbox", shouldGenerateKeyboardSentence: true },
58
+ { id: "checkbox", name: "checkbox", shouldGenerateKeyboardSentence: true, shouldGenerateCheckedSentence: true },
57
59
  { id: "columnheader", name: "column header" },
58
60
  { id: "combobox", name: "combo box", shouldGenerateKeyboardSentence: true },
59
61
  { id: "command", name: "command" },
@@ -87,7 +89,7 @@ exports.EN_ROLES = [
87
89
  { id: "menubar", name: "menubar" },
88
90
  { id: "menuitem", name: "menuitem", shouldGenerateKeyboardSentence: true },
89
91
  { id: "menuitemcheckbox", name: "menuitemcheckbox", shouldGenerateKeyboardSentence: true },
90
- { id: "menuitemradio", name: "menuitemradio", shouldGenerateKeyboardSentence: true },
92
+ { id: "menuitemradio", name: "menuitemradio", shouldGenerateKeyboardSentence: true, shouldGenerateCheckedSentence: true },
91
93
  { id: "meter", name: "counter" },
92
94
  { id: "navigation", name: "navigation" },
93
95
  { id: "none", name: "no" },
@@ -95,7 +97,7 @@ exports.EN_ROLES = [
95
97
  { id: "option", name: "option", indefiniteArticle: INDEFINITE_ARTICLE.AN },
96
98
  { id: "presentation", name: "presentation" },
97
99
  { id: "progressbar", name: "progress bar" },
98
- { id: "radio", name: "radio", shouldGenerateKeyboardSentence: true },
100
+ { id: "radio", name: "radio", shouldGenerateKeyboardSentence: true, shouldGenerateCheckedSentence: true },
99
101
  { id: "radiogroup", name: "radio group" },
100
102
  { id: "range", name: "range" },
101
103
  { id: "region", name: "region" },
@@ -21,7 +21,8 @@ class FrAccessibleRole extends accessible_role_1.AccessibleRole {
21
21
  shouldGenerateTypeSentence;
22
22
  shouldGenerateContainsSentence;
23
23
  shouldGenerateKeyboardSentence;
24
- constructor(id, name, definiteArticle, indefiniteArticle, shouldGenerateTypeSentence = true, shouldGenerateContainsSentence = true, shouldGenerateKeyboardSentence = false) {
24
+ shouldGenerateCheckedSentence;
25
+ constructor(id, name, definiteArticle, indefiniteArticle, shouldGenerateTypeSentence = true, shouldGenerateContainsSentence = true, shouldGenerateKeyboardSentence = false, shouldGenerateCheckedSentence = false) {
25
26
  super();
26
27
  this.id = id;
27
28
  this.name = name;
@@ -30,6 +31,7 @@ class FrAccessibleRole extends accessible_role_1.AccessibleRole {
30
31
  this.shouldGenerateTypeSentence = shouldGenerateTypeSentence;
31
32
  this.shouldGenerateContainsSentence = shouldGenerateContainsSentence;
32
33
  this.shouldGenerateKeyboardSentence = shouldGenerateKeyboardSentence;
34
+ this.shouldGenerateCheckedSentence = shouldGenerateCheckedSentence;
33
35
  }
34
36
  getDefiniteArticle() {
35
37
  return this.definiteArticle.toString();
@@ -103,7 +105,8 @@ exports.FR_ROLES = [
103
105
  name: "case à cocher",
104
106
  definiteArticle: FR_DEFINITE_ARTICLE.LA,
105
107
  indefiniteArticle: FR_INDEFINITE_ARTICLE.UNE,
106
- shouldGenerateKeyboardSentence: true
108
+ shouldGenerateKeyboardSentence: true,
109
+ shouldGenerateCheckedSentence: true
107
110
  },
108
111
  {
109
112
  id: "columnheader",
@@ -315,7 +318,8 @@ exports.FR_ROLES = [
315
318
  name: "menu d'élement de bouton radio",
316
319
  definiteArticle: FR_DEFINITE_ARTICLE.LE,
317
320
  indefiniteArticle: FR_INDEFINITE_ARTICLE.UN,
318
- shouldGenerateKeyboardSentence: true
321
+ shouldGenerateKeyboardSentence: true,
322
+ shouldGenerateCheckedSentence: true
319
323
  },
320
324
  {
321
325
  id: "meter",
@@ -364,7 +368,8 @@ exports.FR_ROLES = [
364
368
  name: "bouton radio",
365
369
  definiteArticle: FR_DEFINITE_ARTICLE.LE,
366
370
  indefiniteArticle: FR_INDEFINITE_ARTICLE.UN,
367
- shouldGenerateKeyboardSentence: true
371
+ shouldGenerateKeyboardSentence: true,
372
+ shouldGenerateCheckedSentence: true
368
373
  },
369
374
  {
370
375
  id: "radiogroup",
@@ -579,4 +584,4 @@ exports.FR_ROLES = [
579
584
  definiteArticle: FR_DEFINITE_ARTICLE.LA,
580
585
  indefiniteArticle: FR_INDEFINITE_ARTICLE.UNE
581
586
  }
582
- ].map((role) => new FrAccessibleRole(role.id, role.name, role.definiteArticle, role.indefiniteArticle, role.shouldGenerateContainsSentence, role.shouldGenerateContainsSentence, role.shouldGenerateKeyboardSentence));
587
+ ].map((role) => new FrAccessibleRole(role.id, role.name, role.definiteArticle, role.indefiniteArticle, role.shouldGenerateContainsSentence, role.shouldGenerateContainsSentence, role.shouldGenerateKeyboardSentence, role.shouldGenerateCheckedSentence));
@@ -46,6 +46,8 @@
46
46
  "withRoleAndName": "",
47
47
  "withTestId": "",
48
48
  "withRoleAndNameAndContent": "",
49
+ "withRoleAndNameAndChecked": "",
50
+ "withRoleAndNameAndUnchecked": "",
49
51
  "withRoleAndNameFocused": "",
50
52
  "nextWithRoleAndNameFocused": "",
51
53
  "previousWithRoleAndNameFocused": "",
@@ -4,6 +4,7 @@ export declare abstract class AccessibleRole {
4
4
  shouldGenerateTypeSentence: boolean;
5
5
  shouldGenerateContainsSentence: boolean;
6
6
  shouldGenerateKeyboardSentence: boolean;
7
+ shouldGenerateCheckedSentence: boolean;
7
8
  abstract getDefiniteArticle(): string;
8
9
  abstract getIndefiniteArticle(): string;
9
10
  abstract getOfDefiniteArticle(): string;
@@ -7,5 +7,6 @@ class AccessibleRole {
7
7
  shouldGenerateTypeSentence;
8
8
  shouldGenerateContainsSentence;
9
9
  shouldGenerateKeyboardSentence = false;
10
+ shouldGenerateCheckedSentence = false;
10
11
  }
11
12
  exports.AccessibleRole = AccessibleRole;
@@ -103,6 +103,10 @@ class BasedRoleStepDefinition extends common_1.GenerateFileProcessing {
103
103
  if (!role.shouldGenerateKeyboardSentence) {
104
104
  dataUpdated = dataUpdated.replace(/\/\/ Begin of Keyboard Section[\s\S]*?\/\/ End of Keyboard Section/, "");
105
105
  }
106
+ // Exclude Role based Checked sentence if specified
107
+ if (!role.shouldGenerateCheckedSentence) {
108
+ dataUpdated = dataUpdated.replace(/\/\/ Begin of Checkable Section[\s\S]*?\/\/ End of Checkable Section/, "");
109
+ }
106
110
  const generatedFilename = generatedFile.replace("$roleId", role.id);
107
111
  // console.debug(">>> data", dataUpdated)
108
112
  // console.debug(">>> generatedFilename", generatedFilename)
@@ -202,6 +202,8 @@ function runGenerateDoc(destDir) {
202
202
  return role.shouldGenerateTypeSentence;
203
203
  case "keyboard":
204
204
  return role.shouldGenerateKeyboardSentence;
205
+ case "checkable":
206
+ return role.shouldGenerateCheckedSentence;
205
207
  default:
206
208
  return true;
207
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/runner-commons",
3
- "version": "2.21.0",
3
+ "version": "2.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 common lib for uuv",
@@ -59,6 +59,18 @@
59
59
  "description": "Writes the sentence given as a parameter inside the specified field (useful for example to fill in a form field)",
60
60
  "wording": "I type the sentence {string} in $definiteArticle $roleName named {string}",
61
61
  "section": "type"
62
+ },
63
+ {
64
+ "key": "key.then.element.withRoleAndNameAndChecked",
65
+ "description": "Checks that an Html element exists with the specified [accessible role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#aria_role_types) and [name](https://russmaxdesign.github.io/html-elements-names/) and is checked",
66
+ "wording": "I should see $indefiniteArticle $roleName named {string} checked",
67
+ "section": "checkable"
68
+ },
69
+ {
70
+ "key": "key.then.element.withRoleAndNameAndUnchecked",
71
+ "description": "Checks that an Html element exists with the specified [accessible role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#aria_role_types) and [name](https://russmaxdesign.github.io/html-elements-names/) and is unchecked",
72
+ "wording": "I should see $indefiniteArticle $roleName named {string} unchecked",
73
+ "section": "checkable"
62
74
  }
63
75
  ]
64
76
  }
@@ -59,6 +59,18 @@
59
59
  "description": "Saisie de la phrase passée en paramètre dans le champ spécifié(utile par exemple pour remplir un champ de formulaire).",
60
60
  "wording": "je saisie le(s) mot(s) {string} dans $definiteArticle$roleName $namedAdjective {string}",
61
61
  "section": "type"
62
+ },
63
+ {
64
+ "key": "key.then.element.withRoleAndNameAndChecked",
65
+ "description": "Vérifie l'existence d'un élément Html ayant le rôle $roleId, le [nom accessible](https://russmaxdesign.github.io/html-elements-names/) et coché",
66
+ "wording": "je dois voir $indefiniteArticle $roleName $namedAdjective {string} coché(e)",
67
+ "section": "checkable"
68
+ },
69
+ {
70
+ "key": "key.then.element.withRoleAndNameAndUnchecked",
71
+ "description": "Vérifie l'existence d'un élément Html ayant le rôle $roleId, le [nom accessible](https://russmaxdesign.github.io/html-elements-names/) et décoché",
72
+ "wording": "je dois voir $indefiniteArticle $roleName $namedAdjective {string} décoché(e)",
73
+ "section": "checkable"
62
74
  }
63
75
  ]
64
76
  }