@fluentui-react-native/tester 0.51.2 → 0.52.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.
Files changed (193) hide show
  1. package/CHANGELOG.json +241 -1
  2. package/CHANGELOG.md +64 -2
  3. package/lib/E2E/Button/pages/ButtonPageObject.d.ts +5 -0
  4. package/lib/E2E/Button/pages/ButtonPageObject.d.ts.map +1 -1
  5. package/lib/E2E/Button/pages/ButtonPageObject.js +11 -0
  6. package/lib/E2E/Button/pages/ButtonPageObject.js.map +1 -1
  7. package/lib/E2E/Button/specs/Button.spec.win.js +3 -3
  8. package/lib/E2E/Button/specs/Button.spec.win.js.map +1 -1
  9. package/lib/E2E/Checkbox/pages/CheckboxPageObject.d.ts +5 -0
  10. package/lib/E2E/Checkbox/pages/CheckboxPageObject.d.ts.map +1 -1
  11. package/lib/E2E/Checkbox/pages/CheckboxPageObject.js +11 -0
  12. package/lib/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
  13. package/lib/E2E/Checkbox/specs/Checkbox.spec.win.js +2 -2
  14. package/lib/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
  15. package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts +12 -0
  16. package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts.map +1 -1
  17. package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +41 -1
  18. package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
  19. package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +24 -2
  20. package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
  21. package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts +12 -0
  22. package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts.map +1 -1
  23. package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js +39 -1
  24. package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
  25. package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js +27 -4
  26. package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
  27. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js +3 -3
  28. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js.map +1 -1
  29. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts +13 -3
  30. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts.map +1 -1
  31. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.js +61 -11
  32. package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.js.map +1 -1
  33. package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js +36 -12
  34. package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
  35. package/lib/E2E/Tabs/pages/TabsPageObject.macos.js +2 -2
  36. package/lib/E2E/Tabs/pages/TabsPageObject.macos.js.map +1 -1
  37. package/lib/E2E/Tabs/pages/TabsPageObject.win.d.ts +18 -3
  38. package/lib/E2E/Tabs/pages/TabsPageObject.win.d.ts.map +1 -1
  39. package/lib/E2E/Tabs/pages/TabsPageObject.win.js +86 -8
  40. package/lib/E2E/Tabs/pages/TabsPageObject.win.js.map +1 -1
  41. package/lib/E2E/Tabs/specs/Tabs.spec.win.js +35 -2
  42. package/lib/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
  43. package/lib/E2E/Tabs/specs/Tabs.spec.windows.d.ts +2 -0
  44. package/lib/E2E/Tabs/specs/Tabs.spec.windows.d.ts.map +1 -0
  45. package/lib/E2E/Tabs/specs/Tabs.spec.windows.js +66 -0
  46. package/lib/E2E/Tabs/specs/Tabs.spec.windows.js.map +1 -0
  47. package/lib/E2E/common/BasePage.win.d.ts +0 -1
  48. package/lib/E2E/common/BasePage.win.d.ts.map +1 -1
  49. package/lib/E2E/common/BasePage.win.js +0 -7
  50. package/lib/E2E/common/BasePage.win.js.map +1 -1
  51. package/lib/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  52. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js +12 -2
  53. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  54. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.d.ts +3 -0
  55. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.d.ts.map +1 -0
  56. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.js +32 -0
  57. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.js.map +1 -0
  58. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonTest.d.ts.map +1 -1
  59. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonTest.js +5 -0
  60. package/lib/FluentTester/TestComponents/ButtonExperimental/ButtonTest.js.map +1 -1
  61. package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
  62. package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +2 -2
  63. package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
  64. package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
  65. package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
  66. package/lib/FluentTester/TestComponents/MenuButton/consts.js +3 -2
  67. package/lib/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
  68. package/lib/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
  69. package/lib/FluentTester/TestComponents/MenuButton/testData.js +2 -0
  70. package/lib/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
  71. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
  72. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +6 -6
  73. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
  74. package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
  75. package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
  76. package/lib/FluentTester/TestComponents/RadioGroup/consts.js +17 -9
  77. package/lib/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
  78. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
  79. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js +8 -8
  80. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
  81. package/lib/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
  82. package/lib/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
  83. package/lib/FluentTester/TestComponents/Tabs/consts.js +13 -8
  84. package/lib/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
  85. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts +5 -0
  86. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts.map +1 -1
  87. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js +11 -0
  88. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js.map +1 -1
  89. package/lib-commonjs/E2E/Button/specs/Button.spec.win.js +2 -2
  90. package/lib-commonjs/E2E/Button/specs/Button.spec.win.js.map +1 -1
  91. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts +5 -0
  92. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts.map +1 -1
  93. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js +11 -0
  94. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
  95. package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js +1 -1
  96. package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
  97. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts +12 -0
  98. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts.map +1 -1
  99. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +40 -0
  100. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
  101. package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +24 -2
  102. package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
  103. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts +12 -0
  104. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts.map +1 -1
  105. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js +38 -0
  106. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
  107. package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js +27 -4
  108. package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
  109. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js +2 -2
  110. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js.map +1 -1
  111. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts +13 -3
  112. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts.map +1 -1
  113. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js +60 -10
  114. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js.map +1 -1
  115. package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js +35 -11
  116. package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
  117. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js +1 -1
  118. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js.map +1 -1
  119. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts +18 -3
  120. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts.map +1 -1
  121. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js +85 -7
  122. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js.map +1 -1
  123. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js +35 -2
  124. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
  125. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts +2 -0
  126. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts.map +1 -0
  127. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js +69 -0
  128. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js.map +1 -0
  129. package/lib-commonjs/E2E/common/BasePage.win.d.ts +0 -1
  130. package/lib-commonjs/E2E/common/BasePage.win.d.ts.map +1 -1
  131. package/lib-commonjs/E2E/common/BasePage.win.js +0 -7
  132. package/lib-commonjs/E2E/common/BasePage.win.js.map +1 -1
  133. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  134. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js +11 -1
  135. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  136. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.d.ts +3 -0
  137. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.d.ts.map +1 -0
  138. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.js +37 -0
  139. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.js.map +1 -0
  140. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonTest.d.ts.map +1 -1
  141. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonTest.js +5 -0
  142. package/lib-commonjs/FluentTester/TestComponents/ButtonExperimental/ButtonTest.js.map +1 -1
  143. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
  144. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +1 -1
  145. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
  146. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
  147. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
  148. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js +4 -3
  149. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
  150. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
  151. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js +2 -0
  152. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
  153. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
  154. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +5 -5
  155. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
  156. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
  157. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
  158. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js +18 -10
  159. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
  160. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
  161. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js +7 -7
  162. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
  163. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
  164. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
  165. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js +14 -9
  166. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
  167. package/package.json +21 -21
  168. package/src/E2E/Button/pages/ButtonPageObject.ts +19 -0
  169. package/src/E2E/Button/specs/Button.spec.win.ts +4 -8
  170. package/src/E2E/Checkbox/pages/CheckboxPageObject.ts +19 -0
  171. package/src/E2E/Checkbox/specs/Checkbox.spec.win.ts +3 -7
  172. package/src/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.ts +49 -0
  173. package/src/E2E/ContextualMenu/specs/ContextualMenu.spec.win.ts +33 -4
  174. package/src/E2E/MenuButton/pages/MenuButtonPageObject.win.ts +46 -0
  175. package/src/E2E/MenuButton/specs/MenuButton.spec.win.ts +37 -6
  176. package/src/E2E/RadioGroup/pages/RadioGroupPageObject.macos.ts +4 -4
  177. package/src/E2E/RadioGroup/pages/RadioGroupPageObject.win.ts +70 -14
  178. package/src/E2E/RadioGroup/specs/RadioGroup.spec.win.ts +48 -14
  179. package/src/E2E/Tabs/pages/TabsPageObject.macos.ts +2 -2
  180. package/src/E2E/Tabs/pages/TabsPageObject.win.ts +90 -8
  181. package/src/E2E/Tabs/specs/Tabs.spec.win.ts +50 -4
  182. package/src/E2E/Tabs/specs/Tabs.spec.windows.ts +84 -0
  183. package/src/E2E/common/BasePage.win.ts +0 -8
  184. package/src/FluentTester/TestComponents/Badge/BadgeTest.tsx +14 -1
  185. package/src/FluentTester/TestComponents/ButtonExperimental/ButtonHOCTestSection.tsx +43 -0
  186. package/src/FluentTester/TestComponents/ButtonExperimental/ButtonTest.tsx +5 -0
  187. package/src/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.tsx +7 -2
  188. package/src/FluentTester/TestComponents/MenuButton/consts.ts +3 -2
  189. package/src/FluentTester/TestComponents/MenuButton/testData.ts +2 -0
  190. package/src/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.tsx +14 -12
  191. package/src/FluentTester/TestComponents/RadioGroup/consts.ts +21 -11
  192. package/src/FluentTester/TestComponents/Tabs/TabsE2ETest.tsx +15 -11
  193. package/src/FluentTester/TestComponents/Tabs/consts.ts +16 -10
@@ -2,15 +2,22 @@ import {
2
2
  RADIOGROUP_TESTPAGE,
3
3
  RADIOGROUP_TEST_COMPONENT,
4
4
  RADIOGROUP_NO_A11Y_LABEL_COMPONENT,
5
- RADIOBUTTON_TEST_COMPONENT,
6
5
  HOMEPAGE_RADIOGROUP_BUTTON,
7
- RADIOBUTTON_NO_A11Y_LABEL_COMPONENT,
6
+ FIRST_RADIO_BUTTON,
7
+ SECOND_RADIO_BUTTON,
8
+ THIRD_RADIO_BUTTON,
9
+ FOURTH_RADIO_BUTTON,
8
10
  } from '../../../FluentTester/TestComponents/RadioGroup/consts';
9
11
  import { BasePage, By } from '../../common/BasePage.win';
10
12
 
13
+ /* This enum gives the spec file an EASY way to interact with SPECIFIC UI elements on the page.
14
+ * The main RadioGroup we are testing has FOUR RadioButtons. The spec file will
15
+ * import this enum to easily write tests using these 4 radio buttons. */
11
16
  export const enum RadioButtonSelector {
12
- Primary = 0, // this._primaryComponent
13
- Secondary, // this._secondaryComponent
17
+ First = 0, // this._firstRadioButton
18
+ Second, // this._secondRadioButton
19
+ Third, // this._thirdRadioButton
20
+ Fourth, // this._fourthRadioButton
14
21
  }
15
22
 
16
23
  class RadioGroupPage extends BasePage {
@@ -19,17 +26,56 @@ class RadioGroupPage extends BasePage {
19
26
  /******************************************************************/
20
27
  // Get RadioButton's accessibilityLabel
21
28
  getRBAccessibilityLabel(radioButtonSelector: RadioButtonSelector): string {
22
- switch (radioButtonSelector) {
23
- case RadioButtonSelector.Primary:
24
- return this._radioButton.getAttribute('Name');
29
+ return this.getRadioButton(radioButtonSelector).getAttribute('Name');
30
+ }
25
31
 
26
- case RadioButtonSelector.Secondary:
27
- return this._secondRadioButton.getAttribute('Name');
28
- }
32
+ /* This resets the RadioGroup selection by clicking/selecting the 1st RadioButton in the RadioGroup.
33
+ * Useful in beforeEach() hooks to reset the RadioGroup before additional tests */
34
+ resetRadioGroupSelection(): void {
35
+ this._firstRadioButton.click();
29
36
  }
30
37
 
31
38
  getRadioButtonAccesibilityRole(): string {
32
- return this._radioButton.getAttribute('ControlType');
39
+ return this._firstRadioButton.getAttribute('ControlType');
40
+ }
41
+
42
+ isRadioButtonSelected(radioButtonSelector: RadioButtonSelector): boolean {
43
+ return this.getRadioButton(radioButtonSelector).isSelected();
44
+ }
45
+
46
+ clickRadioButton(radioButtonSelector: RadioButtonSelector): void {
47
+ this.getRadioButton(radioButtonSelector).click();
48
+ }
49
+
50
+ waitForRadioButtonSelected(radioButtonSelector: RadioButtonSelector, timeout?: number): void {
51
+ browser.waitUntil(
52
+ () => {
53
+ return this.isRadioButtonSelected(radioButtonSelector);
54
+ },
55
+ {
56
+ timeout: timeout ?? this.waitForPageTimeout,
57
+ timeoutMsg: 'RadioButton was not selected correctly.',
58
+ interval: 1000,
59
+ },
60
+ );
61
+ }
62
+
63
+ /* Sends a Keyboarding command on a specific UI element */
64
+ sendKey(key: string, radioButtonSelector: RadioButtonSelector): void {
65
+ this.getRadioButton(radioButtonSelector).addValue(key);
66
+ }
67
+
68
+ /* Returns the correct WebDriverIO element from the RadioButton Selector */
69
+ getRadioButton(radioButtonSelector: RadioButtonSelector): WebdriverIO.Element {
70
+ if (radioButtonSelector == RadioButtonSelector.First) {
71
+ return this._firstRadioButton;
72
+ } else if (radioButtonSelector == RadioButtonSelector.Second) {
73
+ return this._secondRadioButton;
74
+ } else if (radioButtonSelector == RadioButtonSelector.Third) {
75
+ return this._thirdRadioButton;
76
+ } else {
77
+ return this._fourthRadioButton;
78
+ }
33
79
  }
34
80
 
35
81
  /*****************************************/
@@ -58,12 +104,22 @@ class RadioGroupPage extends BasePage {
58
104
  /***************/
59
105
  /* RadioButton *
60
106
  /**************/
61
- get _radioButton() {
62
- return By(RADIOBUTTON_TEST_COMPONENT);
107
+
108
+ /* The first RadioGroup has 4 radio buttons, all listed below */
109
+ get _firstRadioButton() {
110
+ return By(FIRST_RADIO_BUTTON);
63
111
  }
64
112
 
65
113
  get _secondRadioButton() {
66
- return By(RADIOBUTTON_NO_A11Y_LABEL_COMPONENT);
114
+ return By(SECOND_RADIO_BUTTON);
115
+ }
116
+
117
+ get _thirdRadioButton() {
118
+ return By(THIRD_RADIO_BUTTON);
119
+ }
120
+
121
+ get _fourthRadioButton() {
122
+ return By(FOURTH_RADIO_BUTTON);
67
123
  }
68
124
  }
69
125
 
@@ -1,12 +1,12 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
2
  import RadioGroupPageObject, { RadioButtonSelector } from '../pages/RadioGroupPageObject.win';
3
3
  import { ComponentSelector } from '../../common/BasePage.win';
4
- import { RADIOBUTTON_A11Y_ROLE, RADIOGROUP_A11Y_ROLE, PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
4
+ import { RADIOBUTTON_A11Y_ROLE, RADIOGROUP_A11Y_ROLE, PAGE_TIMEOUT, BOOT_APP_TIMEOUT, Keys } from '../../common/consts';
5
5
  import {
6
6
  RADIOGROUP_ACCESSIBILITY_LABEL,
7
7
  RADIOGROUP_TEST_COMPONENT_LABEL,
8
- RADIOBUTTON_ACCESSIBILITY_LABEL,
9
- RADIOBUTTON_TEST_COMPONENT_LABEL,
8
+ FIRST_RADIO_BUTTON_ACCESSIBILITY_LABEL,
9
+ SECOND_RADIO_BUTTON_LABEL,
10
10
  } from '../../../FluentTester/TestComponents/RadioGroup/consts';
11
11
 
12
12
  // Before testing begins, allow up to 60 seconds for app to open
@@ -30,39 +30,73 @@ describe('RadioGroup/RadioButton Testing Initialization', function () {
30
30
  });
31
31
 
32
32
  describe('RadioGroup/RadioButton Accessibility Testing', () => {
33
- it("Validate RadioGroup's accessibilityRole is correct", () => {
33
+ /* Scrolls and waits for the RadioGroup to be visible on the Test Page */
34
+ beforeEach(() => {
34
35
  RadioGroupPageObject.scrollToTestElement();
35
36
  RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
37
+ });
38
+
39
+ it("Validate RadioGroup's accessibilityRole is correct", () => {
36
40
  expect(RadioGroupPageObject.getAccessibilityRole()).toEqual(RADIOGROUP_A11Y_ROLE);
37
41
  });
38
42
 
39
43
  it("Validate RadioButton's accessibilityRole is correct", () => {
40
- RadioGroupPageObject.scrollToTestElement();
41
- RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
42
44
  expect(RadioGroupPageObject.getRadioButtonAccesibilityRole()).toEqual(RADIOBUTTON_A11Y_ROLE);
43
45
  });
44
46
 
45
47
  it('RadioGroup - Set accessibilityLabel', () => {
46
- RadioGroupPageObject.scrollToTestElement();
47
- RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
48
48
  expect(RadioGroupPageObject.getAccessibilityLabel(ComponentSelector.Primary)).toEqual(RADIOGROUP_ACCESSIBILITY_LABEL);
49
49
  });
50
50
 
51
51
  it('RadioGroup - Do not set accessibilityLabel -> Default to RadioGroup label', () => {
52
- RadioGroupPageObject.scrollToTestElement();
53
- RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
54
52
  expect(RadioGroupPageObject.getAccessibilityLabel(ComponentSelector.Secondary)).toEqual(RADIOGROUP_TEST_COMPONENT_LABEL);
55
53
  });
56
54
 
57
55
  it('RadioButton - Set accessibilityLabel', () => {
58
- RadioGroupPageObject.scrollToTestElement();
59
- RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
60
- expect(RadioGroupPageObject.getRBAccessibilityLabel(RadioButtonSelector.Primary)).toEqual(RADIOBUTTON_ACCESSIBILITY_LABEL);
56
+ expect(RadioGroupPageObject.getRBAccessibilityLabel(RadioButtonSelector.First)).toEqual(FIRST_RADIO_BUTTON_ACCESSIBILITY_LABEL);
61
57
  });
62
58
 
63
59
  it('RadioButton - Do not set accessibilityLabel -> Default to RadioButton label', () => {
60
+ expect(RadioGroupPageObject.getRBAccessibilityLabel(RadioButtonSelector.Second)).toEqual(SECOND_RADIO_BUTTON_LABEL);
61
+ });
62
+ });
63
+
64
+ describe('RadioGroup Functional Testing', () => {
65
+ /* This resets the RadioGroup state by clicking/selecting the 1st RadioButton in the RadioGroup */
66
+ beforeEach(() => {
64
67
  RadioGroupPageObject.scrollToTestElement();
65
68
  RadioGroupPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
66
- expect(RadioGroupPageObject.getRBAccessibilityLabel(RadioButtonSelector.Secondary)).toEqual(RADIOBUTTON_TEST_COMPONENT_LABEL);
69
+
70
+ RadioGroupPageObject.resetRadioGroupSelection();
71
+ });
72
+
73
+ it('Click on a RadioButton and ensure it changes state from unselected -> selected', () => {
74
+ /* Validate the RadioButton is not initially selected */
75
+ expect(RadioGroupPageObject.isRadioButtonSelected(RadioButtonSelector.Second)).toBeFalsy();
76
+
77
+ /* Click on the RadioButton to select it */
78
+ RadioGroupPageObject.clickRadioButton(RadioButtonSelector.Second);
79
+ RadioGroupPageObject.waitForRadioButtonSelected(RadioButtonSelector.Second, PAGE_TIMEOUT);
80
+
81
+ /* Validate the RadioButton is selected */
82
+ expect(RadioGroupPageObject.isRadioButtonSelected(RadioButtonSelector.Second)).toBeTruthy();
83
+ });
84
+
85
+ it('Keyboard to RadioButton and check for Selection state', () => {
86
+ // Presses the ArrowDown key while the first (A) RadioButton is selected
87
+ RadioGroupPageObject.sendKey(Keys.Down_Arrow, RadioButtonSelector.First);
88
+ RadioGroupPageObject.waitForRadioButtonSelected(RadioButtonSelector.Second, 5000);
89
+
90
+ /* Validate the RadioButton is selected */
91
+ expect(RadioGroupPageObject.isRadioButtonSelected(RadioButtonSelector.Second)).toBeTruthy();
92
+ });
93
+
94
+ it("Keyboard to DISABLED RadioButton and validate it doesn't get selected", () => {
95
+ // Presses the ArrowDown key while the second (B) RadioButton is selected
96
+ RadioGroupPageObject.sendKey(Keys.Down_Arrow, RadioButtonSelector.Second);
97
+ RadioGroupPageObject.waitForRadioButtonSelected(RadioButtonSelector.Fourth, 5000); // It should skip RadioButton 3 since it is disabled
98
+
99
+ /* Validate the RadioButton is selected */
100
+ expect(RadioGroupPageObject.isRadioButtonSelected(RadioButtonSelector.Fourth)).toBeTruthy();
67
101
  });
68
102
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TABS_TESTPAGE,
3
3
  TABS_TEST_COMPONENT,
4
- TABS_ITEM_TEST_COMPONENT,
4
+ FIRST_TABS_ITEM,
5
5
  HOMEPAGE_TABS_BUTTON,
6
6
  } from '../../../FluentTester/TestComponents/Tabs/consts';
7
7
  import { BasePage, By } from '../../common/BasePage.macos';
@@ -37,7 +37,7 @@ class TabsPageObject extends BasePage {
37
37
  /* TabItem *
38
38
  /***********/
39
39
  get _tabItem() {
40
- return By(TABS_ITEM_TEST_COMPONENT);
40
+ return By(FIRST_TABS_ITEM);
41
41
  }
42
42
  }
43
43
 
@@ -1,17 +1,80 @@
1
1
  import {
2
2
  TABS_TESTPAGE,
3
3
  TABS_TEST_COMPONENT,
4
- TABS_ITEM_TEST_COMPONENT,
5
4
  HOMEPAGE_TABS_BUTTON,
5
+ FIRST_TABS_ITEM,
6
+ SECOND_TABS_ITEM,
7
+ THIRD_TABS_ITEM,
8
+ FIRST_TABS_ITEM_CONTENT,
9
+ SECOND_TABS_ITEM_CONTENT,
10
+ THIRD_TABS_ITEM_CONTENT,
6
11
  } from '../../../FluentTester/TestComponents/Tabs/consts';
7
12
  import { BasePage, By } from '../../common/BasePage.win';
8
13
 
14
+ /* This enum gives the spec file an EASY way to interact with SPECIFIC UI elements on the page.
15
+ * The spec file should import this enum and use it when wanting to interact with different elements on the page.
16
+ * The main Tab group we are testing has THREE tab items. The spec file will
17
+ * import this enum to easily write tests using these 3 tab items */
18
+ export const enum TabItemSelector {
19
+ First = 0, // this._firstTabItem
20
+ Second, // this._secondTabItem
21
+ Third, // this._thirdTabItem
22
+ }
23
+
9
24
  class TabsPageObject extends BasePage {
10
25
  /******************************************************************/
11
26
  /**************** UI Element Interaction Methods ******************/
12
27
  /******************************************************************/
13
- getTabItemAccesibilityRole(): string {
14
- return this._tabItem.getAttribute('ControlType');
28
+ waitForTabsItemsToOpen(tabItemSelector: TabItemSelector, timeout?: number): void {
29
+ browser.waitUntil(
30
+ () => {
31
+ return this.didTabItemContentLoad(tabItemSelector);
32
+ },
33
+ {
34
+ timeout: timeout ?? this.waitForPageTimeout,
35
+ timeoutMsg: 'The Tab Items content did not open.',
36
+ interval: 1000,
37
+ },
38
+ );
39
+ }
40
+
41
+ getTabItemAccesibilityRole(tabItemSelector: TabItemSelector): string {
42
+ return this.getTabItem(tabItemSelector).getAttribute('ControlType');
43
+ }
44
+
45
+ clickOnTabItem(tabItemSelector: TabItemSelector): void {
46
+ this.getTabItem(tabItemSelector).click();
47
+ }
48
+
49
+ didTabItemContentLoad(tabItemSelector: TabItemSelector): boolean {
50
+ return this.getTabItemContent(tabItemSelector).isDisplayed();
51
+ }
52
+
53
+ /* Returns the correct WebDriverIO element from the TabItem Selector */
54
+ getTabItem(tabItemSelector: TabItemSelector): WebdriverIO.Element {
55
+ if (tabItemSelector == TabItemSelector.First) {
56
+ return this._firstTabItem;
57
+ } else if (tabItemSelector == TabItemSelector.Second) {
58
+ return this._secondTabItem;
59
+ } else {
60
+ return this._thirdTabItem;
61
+ }
62
+ }
63
+
64
+ /* Returns the correct WebDriverIO element from the TabItem Selector */
65
+ getTabItemContent(tabItemSelector: TabItemSelector): WebdriverIO.Element {
66
+ if (tabItemSelector == TabItemSelector.First) {
67
+ return this._firstTabItemContent;
68
+ } else if (tabItemSelector == TabItemSelector.Second) {
69
+ return this._secondTabItemContent;
70
+ } else {
71
+ return this._thirdTabItemContent;
72
+ }
73
+ }
74
+
75
+ /* Sends a Keyboarding command on a specific UI element */
76
+ sendKey(key: string, tabItemSelector: TabItemSelector): void {
77
+ this.getTabItem(tabItemSelector).addValue(key);
15
78
  }
16
79
 
17
80
  /*****************************************/
@@ -33,11 +96,30 @@ class TabsPageObject extends BasePage {
33
96
  return By(HOMEPAGE_TABS_BUTTON);
34
97
  }
35
98
 
36
- /***********/
37
- /* TabItem *
38
- /***********/
39
- get _tabItem() {
40
- return By(TABS_ITEM_TEST_COMPONENT);
99
+ /* The first tab group has 3 Tab item headers, all listed below */
100
+ get _firstTabItem() {
101
+ return By(FIRST_TABS_ITEM);
102
+ }
103
+
104
+ get _secondTabItem() {
105
+ return By(SECOND_TABS_ITEM);
106
+ }
107
+
108
+ get _thirdTabItem() {
109
+ return By(THIRD_TABS_ITEM);
110
+ }
111
+
112
+ /* Content shown when tab item is clicked */
113
+ get _firstTabItemContent() {
114
+ return By(FIRST_TABS_ITEM_CONTENT);
115
+ }
116
+
117
+ get _secondTabItemContent() {
118
+ return By(SECOND_TABS_ITEM_CONTENT);
119
+ }
120
+
121
+ get _thirdTabItemContent() {
122
+ return By(THIRD_TABS_ITEM_CONTENT);
41
123
  }
42
124
  }
43
125
 
@@ -1,6 +1,6 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
- import TabsPageObject from '../pages/TabsPageObject.win';
3
- import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE } from '../../common/consts';
2
+ import TabsPageObject, { TabItemSelector } from '../pages/TabsPageObject.win';
3
+ import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE, Keys } from '../../common/consts';
4
4
 
5
5
  // Before testing begins, allow up to 60 seconds for app to open
6
6
  describe('Tabs Testing Initialization', function () {
@@ -23,15 +23,61 @@ describe('Tabs Testing Initialization', function () {
23
23
  });
24
24
 
25
25
  describe('Tabs Accessibility Testing', () => {
26
- it("Validate Tab's accessibilityRole is correct", () => {
26
+ /* Scrolls and waits for the Tabs to be visible on the Test Page */
27
+ beforeEach(() => {
27
28
  TabsPageObject.scrollToTestElement();
28
29
  TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
30
+ });
31
+
32
+ it("Validate Tab's accessibilityRole is correct", () => {
29
33
  expect(TabsPageObject.getAccessibilityRole()).toEqual(TAB_A11Y_ROLE);
30
34
  });
31
35
 
32
36
  it("Validate TabItem's accessibilityRole is correct", () => {
37
+ expect(TabsPageObject.getTabItemAccesibilityRole(TabItemSelector.First)).toEqual(TABITEM_A11Y_ROLE);
38
+ });
39
+ });
40
+
41
+ describe('Tabs Functional Tests', () => {
42
+ /* Scrolls and waits for the Tabs to be visible on the Test Page */
43
+ beforeEach(() => {
33
44
  TabsPageObject.scrollToTestElement();
34
45
  TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
35
- expect(TabsPageObject.getTabItemAccesibilityRole()).toEqual(TABITEM_A11Y_ROLE);
46
+
47
+ // Reset the TabGroup by putting focus on First tab item
48
+ TabsPageObject.clickOnTabItem(TabItemSelector.First);
49
+ });
50
+
51
+ it('Click on the second tab header and validate the correct TabItem content is shown', () => {
52
+ TabsPageObject.clickOnTabItem(TabItemSelector.Second);
53
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
54
+
55
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
56
+ });
57
+
58
+ it('Keyboarding: Arrow Navigation: Right -> Down -> Left -> Up -> Validate the correct TabItem content is shown', () => {
59
+ /* At First tab element, press Right Arrow to navigate to the Second tab element */
60
+ TabsPageObject.sendKey(Keys.Right_Arrow, TabItemSelector.First);
61
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
62
+
63
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
64
+
65
+ /* At Second tab element, press Down Arrow to navigate to the Third tab element */
66
+ TabsPageObject.sendKey(Keys.Down_Arrow, TabItemSelector.Second);
67
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Third, PAGE_TIMEOUT);
68
+
69
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Third)).toBeTruthy();
70
+
71
+ /* At Third tab element, press Left Arrow to navigate to the Second tab element */
72
+ TabsPageObject.sendKey(Keys.Left_Arrow, TabItemSelector.Third);
73
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
74
+
75
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
76
+
77
+ /* At Second tab element, press Up Arrow to navigate to the First tab element */
78
+ TabsPageObject.sendKey(Keys.Up_Arrow, TabItemSelector.Second);
79
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.First, PAGE_TIMEOUT);
80
+
81
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.First)).toBeTruthy();
36
82
  });
37
83
  });
@@ -0,0 +1,84 @@
1
+ import NavigateAppPage from '../../common/NavigateAppPage.win';
2
+ import TabsPageObject, { TabItemSelector } from '../pages/TabsPageObject.win';
3
+ import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE } from '../../common/consts';
4
+
5
+ // Before testing begins, allow up to 60 seconds for app to open
6
+ describe('Tabs Testing Initialization', function () {
7
+ it('Wait for app load', () => {
8
+ NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
9
+ expect(NavigateAppPage.isPageLoaded()).toBeTruthy();
10
+ });
11
+
12
+ it('Click and navigate to Tabs test page', () => {
13
+ /* Scroll to component test page button in scrollview if not already visible*/
14
+ TabsPageObject.scrollToComponentButton();
15
+ TabsPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
16
+
17
+ /* Click on component button to navigate to test page */
18
+ NavigateAppPage.clickAndGoToTabsPage();
19
+ TabsPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
20
+
21
+ expect(TabsPageObject.isPageLoaded()).toBeTruthy();
22
+ });
23
+ });
24
+
25
+ describe('Tabs Accessibility Testing', () => {
26
+ /* Scrolls and waits for the Tabs to be visible on the Test Page */
27
+ beforeEach(() => {
28
+ TabsPageObject.scrollToTestElement();
29
+ TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
30
+ });
31
+
32
+ it("Validate Tab's accessibilityRole is correct", () => {
33
+ expect(TabsPageObject.getAccessibilityRole()).toEqual(TAB_A11Y_ROLE);
34
+ });
35
+
36
+ it("Validate TabItem's accessibilityRole is correct", () => {
37
+ expect(TabsPageObject.getTabItemAccesibilityRole(TabItemSelector.First)).toEqual(TABITEM_A11Y_ROLE);
38
+ });
39
+ });
40
+
41
+ describe('Tabs Functional Tests', () => {
42
+ /* Scrolls and waits for the Tabs to be visible on the Test Page */
43
+ beforeEach(() => {
44
+ TabsPageObject.scrollToTestElement();
45
+ TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
46
+
47
+ // Reset the TabGroup by putting focus on First tab item
48
+ TabsPageObject.clickOnTabItem(TabItemSelector.First);
49
+ });
50
+
51
+ it('Click on the second tab header and validate the correct TabItem content is shown', () => {
52
+ TabsPageObject.clickOnTabItem(TabItemSelector.Second);
53
+ TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
54
+
55
+ expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
56
+ });
57
+
58
+ // Keyboarding is currently not integrated for UWP tabs - Task #5758598
59
+ // it('Keyboarding: Arrow Navigation: Right -> Down -> Left -> Up -> Validate the correct TabItem content is shown', () => {
60
+ // /* At First tab element, press Right Arrow to navigate to the Second tab element */
61
+ // TabsPageObject.sendKey(Keys.Right_Arrow, TabItemSelector.First);
62
+ // TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
63
+
64
+ // expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
65
+
66
+ // /* At Second tab element, press Down Arrow to navigate to the Third tab element */
67
+ // TabsPageObject.sendKey(Keys.Down_Arrow, TabItemSelector.Second);
68
+ // TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Third, PAGE_TIMEOUT);
69
+
70
+ // expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Third)).toBeTruthy();
71
+
72
+ // /* At Third tab element, press Left Arrow to navigate to the Second tab element */
73
+ // TabsPageObject.sendKey(Keys.Left_Arrow, TabItemSelector.Third);
74
+ // TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
75
+
76
+ // expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
77
+
78
+ // /* At Second tab element, press Up Arrow to navigate to the First tab element */
79
+ // TabsPageObject.sendKey(Keys.Up_Arrow, TabItemSelector.Second);
80
+ // TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.First, PAGE_TIMEOUT);
81
+
82
+ // expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.First)).toBeTruthy();
83
+ // });
84
+ });
@@ -56,14 +56,6 @@ export class BasePage {
56
56
  this._primaryComponent.click();
57
57
  }
58
58
 
59
- /* ****TODO****: I need to better use the ComponentSelector for this. We shouldn't have the spec needing to import the constant string */
60
- sendKey(componentID?: string, key?: string): void {
61
- const component = By(componentID);
62
- if (component.isDisplayed()) {
63
- component.addValue(key); // Adding a value sends the key on that component
64
- }
65
- }
66
-
67
59
  /* Scrolls until the desired test page's button is displayed. We use the scroll viewer UI element as the point to start scrolling.
68
60
  * We use a negative number as the Y-coordinate because that enables us to scroll downwards */
69
61
  scrollToComponentButton(): void {
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { BADGE_TESTPAGE } from './consts';
4
4
  import { Test, TestSection, PlatformStatus } from '../Test';
5
5
  import { View, Platform, Text } from 'react-native';
6
- import { Badge, CompressibleBadge } from '@fluentui-react-native/badge';
6
+ import { Badge, CompressibleBadge, PresenceBadge } from '@fluentui-react-native/badge';
7
7
  import BadgeSvg from './oof.svg';
8
8
 
9
9
  import { SvgIconProps } from '@fluentui-react-native/icon';
@@ -65,6 +65,19 @@ export const BasicBadge: React.FunctionComponent = () => {
65
65
  <Text>Compressible badge</Text>
66
66
  <CompressibleBadge />
67
67
  <CompressibleBadge text="Basic compressible" />
68
+ {svgIconsEnabled && (
69
+ <>
70
+ <Text>Presence Badge</Text>
71
+ <PresenceBadge presence="available" size="largest" />
72
+ <PresenceBadge presence="available" isOutOfOffice={true} size="large" />
73
+ <PresenceBadge presence="doNotDisturb" text="doNotDisturb" isOutOfOffice={true} />
74
+ <PresenceBadge presence="away" size="small" />
75
+ <PresenceBadge presence="busy" size="smallest" />
76
+ <PresenceBadge presence="offline" />
77
+ <PresenceBadge presence="outOfOffice" />
78
+ <PresenceBadge presence="away" />
79
+ </>
80
+ )}
68
81
  </View>
69
82
  );
70
83
  };
@@ -0,0 +1,43 @@
1
+ import { Button } from '@fluentui-react-native/experimental-button';
2
+ import { Text } from '@fluentui-react-native/experimental-text';
3
+ import { Icon } from '@fluentui-react-native/icon';
4
+ import * as React from 'react';
5
+ import { View } from 'react-native';
6
+ import { commonTestStyles, stackStyle } from '../Common/styles';
7
+
8
+ export const ButtonHOCTest: React.FunctionComponent = () => {
9
+ const buttonRef = React.useRef(null);
10
+ const CustomText = Text.customize({ fontSize: 'header', color: 'hotpink' });
11
+ const CustomButton = Button.customize({ backgroundColor: 'pink' });
12
+ const ComposedButton = Button.compose({
13
+ slots: {
14
+ root: View,
15
+ icon: Icon,
16
+ content: CustomText,
17
+ },
18
+ slotProps: {
19
+ content: {
20
+ style: { marginTop: -1, marginBottom: 1, marginStart: 0, marginEnd: -2 },
21
+ },
22
+ },
23
+ });
24
+
25
+ return (
26
+ <View style={stackStyle}>
27
+ <CustomButton style={commonTestStyles.vmargin} componentRef={buttonRef}>
28
+ Customized Button with ref
29
+ </CustomButton>
30
+ <Button
31
+ style={commonTestStyles.vmargin}
32
+ onClick={() => {
33
+ if (buttonRef.current) {
34
+ buttonRef.current.focus();
35
+ }
36
+ }}
37
+ >
38
+ Press to focus Customized Button
39
+ </Button>
40
+ <ComposedButton style={commonTestStyles.vmargin}>Composed button using customized Text for text slot</ComposedButton>
41
+ </View>
42
+ );
43
+ };
@@ -7,6 +7,7 @@ import { ButtonIconTest } from './ButtonIconTestSection';
7
7
  import { ButtonSizeTest } from './ButtonSizeTestSection';
8
8
  import { ButtonShapeTest } from './ButtonShapeTestSection';
9
9
  import { E2EButtonExperimentalTest } from './E2EButtonTest';
10
+ import { ButtonHOCTest } from './ButtonHOCTestSection';
10
11
 
11
12
  const buttonSections: TestSection[] = [
12
13
  {
@@ -30,6 +31,10 @@ const buttonSections: TestSection[] = [
30
31
  name: 'Sizes',
31
32
  component: ButtonSizeTest,
32
33
  },
34
+ {
35
+ name: 'Customize, Compose, and Ref',
36
+ component: ButtonHOCTest,
37
+ },
33
38
  {
34
39
  name: 'E2E Button Testing',
35
40
  component: E2EButtonExperimentalTest,
@@ -2,7 +2,7 @@
2
2
  import * as React from 'react';
3
3
  import { Text, View, Switch } from 'react-native';
4
4
  import { Button, ContextualMenu, ContextualMenuItem, Separator } from '@fluentui/react-native';
5
- import { CONTEXTUALMENUITEM_TEST_COMPONENT } from './consts';
5
+ import { CONTEXTUALMENUITEM_TEST_COMPONENT, CONTEXTUALMENU_TEST_COMPONENT } from './consts';
6
6
 
7
7
  export const E2EContextualMenuTest: React.FunctionComponent = () => {
8
8
  const stdBtnRef = React.useRef(null);
@@ -75,7 +75,12 @@ export const E2EContextualMenuTest: React.FunctionComponent = () => {
75
75
  <Text style={{ color: 'blue' }}>none</Text>
76
76
  )}
77
77
  </Text>
78
- <Button content="Press for ContextualMenu" onClick={toggleShowContextualMenu} componentRef={stdBtnRef} />
78
+ <Button
79
+ content="Press for ContextualMenu"
80
+ onClick={toggleShowContextualMenu}
81
+ componentRef={stdBtnRef}
82
+ testID={CONTEXTUALMENU_TEST_COMPONENT}
83
+ />
79
84
  </View>
80
85
  </View>
81
86
 
@@ -1,9 +1,10 @@
1
- export const HOMEPAGE_MENU_BUTTON = 'Homepage_Menu_Button';
2
- export const MENU_BUTTON_TESTPAGE = 'Menu_Button_TestPage';
1
+ export const HOMEPAGE_MENU_BUTTON = 'Homepage_MenuButton_Button';
2
+ export const MENU_BUTTON_TESTPAGE = 'MenuButton_TestPage';
3
3
 
4
4
  /* E2E Testing Menu_Button 1 */
5
5
  export const MENU_BUTTON_TEST_COMPONENT = 'Menu_Button_Test_Component'; // A component on each specific test page
6
6
  export const MENU_BUTTON_ACCESSIBILITY_LABEL = 'E2E testing Menu_Button accessibility label';
7
+ export const MENU_ITEM_1_COMPONENT = 'Menu_Item_1_Component'; // The first menu item component
7
8
 
8
9
  /* E2E Testing Menu_Button 2 */
9
10
  export const MENU_BUTTON_NO_A11Y_LABEL_COMPONENT = 'Menu_Button_No_A11y_label_Component';