@fluentui-react-native/tester 0.55.2 → 0.57.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 (183) hide show
  1. package/CHANGELOG.json +236 -1
  2. package/CHANGELOG.md +59 -2
  3. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  4. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  5. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +45 -1
  6. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  7. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  8. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  9. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +11 -0
  10. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -0
  11. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +57 -0
  12. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -0
  13. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts +2 -0
  14. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts.map +1 -0
  15. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js +26 -0
  16. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js.map +1 -0
  17. package/lib/FluentTester/FluentTester.d.ts.map +1 -1
  18. package/lib/FluentTester/FluentTester.js +8 -8
  19. package/lib/FluentTester/FluentTester.js.map +1 -1
  20. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.d.ts.map +1 -1
  21. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +28 -23
  22. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
  23. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  24. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  25. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  26. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  27. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  28. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  29. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  30. package/lib/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  31. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  32. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  33. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  34. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +23 -15
  35. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  36. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  37. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  38. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  39. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  40. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  41. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +37 -25
  42. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  43. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  44. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +9 -3
  45. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  46. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  47. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  48. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js +1 -0
  49. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  50. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  51. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  52. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  53. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  54. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  55. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  56. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  57. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  58. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  59. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  60. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  61. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  62. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  63. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  64. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  65. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  66. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  67. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  68. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  69. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  70. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  71. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  72. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js +21 -9
  73. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  74. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  75. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  76. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  77. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  78. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  79. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  80. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  81. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  82. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +44 -0
  83. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  84. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  85. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  86. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +11 -0
  87. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -0
  88. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +59 -0
  89. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -0
  90. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts +2 -0
  91. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts.map +1 -0
  92. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js +29 -0
  93. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js.map +1 -0
  94. package/lib-commonjs/FluentTester/FluentTester.d.ts.map +1 -1
  95. package/lib-commonjs/FluentTester/FluentTester.js +8 -8
  96. package/lib-commonjs/FluentTester/FluentTester.js.map +1 -1
  97. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.d.ts.map +1 -1
  98. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +28 -23
  99. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
  100. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  101. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  102. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  103. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  104. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  105. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  106. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  107. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  108. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  109. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  110. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  111. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +22 -14
  112. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  113. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  114. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  115. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  116. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  117. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  118. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +37 -25
  119. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  120. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  121. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +8 -2
  122. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  123. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  124. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  125. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js +2 -1
  126. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  127. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  128. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  129. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  130. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  131. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  132. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  133. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  134. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  135. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  136. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  137. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  138. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  139. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  140. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  141. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  142. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  143. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  144. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  145. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  146. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  147. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  148. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  149. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js +24 -10
  150. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  151. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  152. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  153. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  154. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  155. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  156. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  157. package/package.json +17 -18
  158. package/src/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.ts +63 -0
  159. package/src/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.ts +48 -2
  160. package/src/E2E/README.md +7 -0
  161. package/src/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.ts +56 -0
  162. package/src/E2E/common/NativeTesting/specs/NativeTesting.spec.win.ts +28 -0
  163. package/src/FluentTester/FluentTester.tsx +10 -10
  164. package/src/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.tsx +36 -26
  165. package/src/FluentTester/TestComponents/ActivityIndicator/consts.ts +3 -3
  166. package/src/FluentTester/TestComponents/Avatar/CustomizedAvatar.tsx +25 -31
  167. package/src/FluentTester/TestComponents/Badge/BadgeTest.tsx +11 -11
  168. package/src/FluentTester/TestComponents/Button/ButtonHOCTestSection.tsx +25 -16
  169. package/src/FluentTester/TestComponents/Button/ButtonSizeTestSection.tsx +0 -1
  170. package/src/FluentTester/TestComponents/Checkbox/CheckboxTest.tsx +29 -29
  171. package/src/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.tsx +49 -33
  172. package/src/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.tsx +13 -0
  173. package/src/FluentTester/TestComponents/CheckboxExperimental/consts.ts +2 -0
  174. package/src/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.tsx +3 -3
  175. package/src/FluentTester/TestComponents/Expander/ExpanderTest.tsx +23 -22
  176. package/src/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.tsx +12 -11
  177. package/src/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.tsx +12 -11
  178. package/src/FluentTester/TestComponents/Persona/CustomizeUsage.tsx +15 -28
  179. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +12 -22
  180. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.tsx +25 -31
  181. package/src/FluentTester/TestComponents/Shimmer/ShimmerTest.tsx +50 -10
  182. package/src/FluentTester/TestComponents/Text/CustomizeUsage.tsx +42 -42
  183. package/src/FluentTester/TestComponents/TextExperimental/CustomizeUsage.tsx +42 -42
@@ -1,11 +1,11 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
- import ExperimentalCheckboxPageObject from '../pages/ExperimentalCheckboxPageObject';
2
+ import ExperimentalCheckboxPageObject, { ExperimentalCheckboxSelector } from '../pages/ExperimentalCheckboxPageObject';
3
3
  import { ComponentSelector } from '../../common/BasePage.win';
4
4
  import {
5
5
  EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL,
6
6
  EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL,
7
7
  } from '../../../FluentTester/TestComponents/CheckboxExperimental/consts';
8
- import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, CHECKBOX_A11Y_ROLE } from '../../common/consts';
8
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, CHECKBOX_A11Y_ROLE, Keys } from '../../common/consts';
9
9
 
10
10
  describe('Experimental Checkbox Testing Initialization', () => {
11
11
  it('Wait for app load', () => {
@@ -28,6 +28,12 @@ describe('Experimental Checkbox Testing Initialization', () => {
28
28
  });
29
29
 
30
30
  describe('Experimental Checkbox Accessibility Testing', () => {
31
+ /* Scrolls and waits for the Checkbox to be visible on the Test Page */
32
+ beforeEach(() => {
33
+ ExperimentalCheckboxPageObject.scrollToTestElement();
34
+ ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
35
+ });
36
+
31
37
  it('Experimental Checkbox - Validate accessibilityRole is correct', () => {
32
38
  ExperimentalCheckboxPageObject.scrollToTestElement();
33
39
  ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
@@ -56,3 +62,43 @@ describe('Experimental Checkbox Accessibility Testing', () => {
56
62
  expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
57
63
  });
58
64
  });
65
+
66
+ describe('Checkbox Functional Testing', () => {
67
+ /* Scrolls and waits for the Checkbox to be visible on the Test Page AND un-checks the Checkbox */
68
+ beforeEach(() => {
69
+ ExperimentalCheckboxPageObject.scrollToTestElement();
70
+ ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
71
+
72
+ ExperimentalCheckboxPageObject.toggleCheckboxToUnchecked();
73
+ });
74
+
75
+ it("Click on a Checkbox -> Validate it toggles correctly AND calls the user's onChange", () => {
76
+ /* Validate the Checkbox is initially toggled OFF */
77
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeFalsy();
78
+
79
+ /* Click on the Checkbox to toggle on */
80
+ ExperimentalCheckboxPageObject.clickComponent();
81
+ ExperimentalCheckboxPageObject.waitForCheckboxChecked(PAGE_TIMEOUT);
82
+
83
+ expect(ExperimentalCheckboxPageObject.didOnChangeCallbackFire()).toBeTruthy();
84
+
85
+ /* Validate the Checkbox is toggled ON */
86
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeTruthy();
87
+
88
+ ExperimentalCheckboxPageObject.clickComponent();
89
+
90
+ /* Validate the Checkbox is toggled OFF */
91
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeFalsy();
92
+ expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
93
+ });
94
+
95
+ it('Click the "Spacebar" on a Checkbox and verify it toggles', () => {
96
+ /* Presses the "space bar" to select the Checkbox */
97
+ ExperimentalCheckboxPageObject.sendKey(ExperimentalCheckboxSelector.Primary, Keys.Spacebar);
98
+ ExperimentalCheckboxPageObject.waitForCheckboxChecked(PAGE_TIMEOUT);
99
+
100
+ /* Validate the Checkbox is selected */
101
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeTruthy();
102
+ expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
103
+ });
104
+ });
package/src/E2E/README.md CHANGED
@@ -94,6 +94,13 @@ You'll want to make one for your component under **apps/fluent-tester/src/Fluent
94
94
 
95
95
  **You can simply copy/paste a _consts.ts_ file from another component, and just change the name of the component in the const names and the values.**
96
96
 
97
+ **This is really important!**
98
+
99
+ There are a **two specific** naming conventions we need to follow to keep in-sync with the Native side.
100
+
101
+ 1. The button that navigates to each test page - **Homepage\_'componentName'\_Button**
102
+ 2. The test page itself that lets us validate if the page loaded - **'componentName'\_TestPage**
103
+
97
104
  Now, what are Page Objects and Spec Documents?
98
105
 
99
106
  ## Page Objects
@@ -0,0 +1,56 @@
1
+ import { BasePage, By } from '../../../common/BasePage.win';
2
+
3
+ const ScrollViewTestId = 'SCROLLVIEW_TEST_ID';
4
+
5
+ class NativeTestingPageObject extends BasePage {
6
+ waitForScrollViewDisplayed(timeout?: number): void {
7
+ browser.waitUntil(
8
+ () => {
9
+ return this.doesScrollViewParentExist();
10
+ },
11
+ {
12
+ timeout: timeout ?? this.waitForPageTimeout,
13
+ timeoutMsg:
14
+ 'For testing purposes we require that the root view contains a non-empty, immutable ScrollView of buttons that navigate to test pages.',
15
+ interval: 1000,
16
+ },
17
+ );
18
+ }
19
+
20
+ doesScrollViewParentExist(): boolean {
21
+ return this._scrollViewParent.isExisting();
22
+ }
23
+
24
+ /* Validate the Children of the ScrollView stay intact. The children are the buttons that
25
+ * navigate to each test page. Also, validate these children exist with the proper testId format */
26
+ validateScrollViewChildren(): boolean {
27
+ // Gets all the children
28
+ const testChildren = this._scrollViewParent.$$('//*');
29
+ let foundValidButton = false;
30
+
31
+ // Ensure the testID (maps 1:1 to automationId) properties of the button children match the defined testing format
32
+ const reg = new RegExp('Homepage_[a-zA-Z]*_Button');
33
+
34
+ // Iterate through children. Validate at least one valid button exists as a child to the ScrollView.
35
+ // If automationId is found in the wrong format, return false.
36
+ for (const child of testChildren) {
37
+ const autoId = child.getAttribute('AutomationId');
38
+ if (autoId && autoId !== ScrollViewTestId) {
39
+ if (autoId.match(reg)) {
40
+ foundValidButton = true;
41
+ } else {
42
+ // The correct format for testId was not followed. Return a failure.
43
+ return false;
44
+ }
45
+ }
46
+ }
47
+
48
+ return foundValidButton;
49
+ }
50
+
51
+ get _scrollViewParent() {
52
+ return By(ScrollViewTestId);
53
+ }
54
+ }
55
+
56
+ export default new NativeTestingPageObject();
@@ -0,0 +1,28 @@
1
+ import NavigateAppPage from '../../../common/NavigateAppPage.win';
2
+ import NativeTestingPageObject from '../pages/NativeTestingPageObject.win';
3
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../../common/consts';
4
+
5
+ describe('Native Safety Check Testing Initialization', () => {
6
+ it('Wait for app load', () => {
7
+ NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
8
+ expect(NavigateAppPage.isPageLoaded()).toBeTruthy(NavigateAppPage.ERRORMESSAGE_APPLOAD);
9
+ });
10
+
11
+ // The ScrollView in testing is the one that contains all the buttons that navigate to each component's
12
+ // test page. This is vital for our native testing, as we grab this ScrollView on the native side and
13
+ // to climb down the UI tree and find all of FURN's testable components.
14
+ // We need to make sure this ScrollView:
15
+ // 1) Continues to parent all the test buttons
16
+ // 2) Keeps testID='SCROLLVIEW_TEST_ID'
17
+ it('Validate the ScrollView containing all the navigational buttons exists', () => {
18
+ NativeTestingPageObject.waitForScrollViewDisplayed(PAGE_TIMEOUT);
19
+ expect(NativeTestingPageObject.doesScrollViewParentExist()).toBeTruthy();
20
+ });
21
+
22
+ // In addition to existing, we want to ensure the Children of the ScrollView stay intact. The children are the buttons that
23
+ // navigate to each test page. Validate these children exist with the proper testId format.
24
+ it('Validate the children of ScrollView are the buttons that navigate to each test page with proper automationId', () => {
25
+ NativeTestingPageObject.waitForScrollViewDisplayed(PAGE_TIMEOUT);
26
+ expect(NativeTestingPageObject.validateScrollViewChildren()).toBeTruthy();
27
+ });
28
+ });
@@ -44,6 +44,16 @@ const getThemedStyles = themedStyleSheet((t: Theme) => {
44
44
  };
45
45
  });
46
46
 
47
+ const HeaderSeparator = Separator.customize((t) => ({
48
+ color: t.colors.bodyFrameDivider,
49
+ separatorWidth: 2,
50
+ }));
51
+
52
+ const TestListSeparator = Separator.customize((t) => ({
53
+ color: t.colors.menuDivider,
54
+ separatorWidth: 2,
55
+ }));
56
+
47
57
  export const FluentTester: React.FunctionComponent<FluentTesterProps> = (props: FluentTesterProps) => {
48
58
  // sort tests alphabetically by name
49
59
  const sortedTestComponents = props.enabledTests.sort((a, b) => a.name.localeCompare(b.name));
@@ -66,16 +76,6 @@ export const FluentTester: React.FunctionComponent<FluentTesterProps> = (props:
66
76
 
67
77
  const TestComponent = selectedTestIndex == -1 ? EmptyComponent : sortedTestComponents[selectedTestIndex].component;
68
78
 
69
- const HeaderSeparator = Separator.customize((t) => ({
70
- color: t.colors.bodyFrameDivider,
71
- separatorWidth: 2,
72
- }));
73
-
74
- const TestListSeparator = Separator.customize((t) => ({
75
- color: t.colors.menuDivider,
76
- separatorWidth: 2,
77
- }));
78
-
79
79
  const themedStyles = getThemedStyles(useTheme());
80
80
 
81
81
  const RootView = Platform.select({
@@ -7,14 +7,30 @@ import { Test, TestSection, PlatformStatus } from '../Test';
7
7
  import { ACTIVITY_INDICATOR_TESTPAGE } from './consts';
8
8
  import { View, Switch } from 'react-native';
9
9
 
10
+ const basicActivityIndicator: React.FunctionComponent = () => {
11
+ const [animating, setAnimating] = React.useState(true);
12
+ const [hidesWhenStopped, setHidesWhenStopped] = React.useState(true);
13
+
14
+ return (
15
+ <Stack style={stackStyle}>
16
+ <View style={commonStyles.root}>
17
+ <View style={commonStyles.settings}>
18
+ <View style={commonStyles.switch}>
19
+ <Text>Animating</Text>
20
+ <Switch value={animating} onValueChange={setAnimating} />
21
+ </View>
22
+ <View style={commonStyles.switch}>
23
+ <Text>HidesWhenStopped</Text>
24
+ <Switch value={hidesWhenStopped} onValueChange={setHidesWhenStopped} />
25
+ </View>
26
+ </View>
27
+ <ActivityIndicator animating={animating} hidesWhenStopped={hidesWhenStopped} />
28
+ </View>
29
+ </Stack>
30
+ );
31
+ };
32
+
10
33
  const activityIndicatorTest: React.FunctionComponent = () => {
11
- /** Customize doesn't do anything
12
- * Tried having tokens not be props, but didn't work
13
- * Not sure how to test/check where the tokens are passed through other than just looking at the final render
14
- */
15
- const CustomizedActivityIndicator = ActivityIndicator.customize({
16
- activityIndicatorColor: 'orange',
17
- });
18
34
  return (
19
35
  <Stack style={stackStyle}>
20
36
  <Text>Extra Small</Text>
@@ -32,38 +48,27 @@ const activityIndicatorTest: React.FunctionComponent = () => {
32
48
  <ActivityIndicator size="xLarge" lineThickness="large" />
33
49
  <Text>Color props</Text>
34
50
  <ActivityIndicator activityIndicatorColor="orange" accessibilityLabel="orange progressbar" />
35
- <Text>Customized Activity Indicator (currently not working)</Text>
36
- <CustomizedActivityIndicator />
37
51
  </Stack>
38
52
  );
39
53
  };
40
54
 
41
- const basicActivityIndicator: React.FunctionComponent = () => {
42
- const [animating, setAnimating] = React.useState(true);
43
- const [hidesWhenStopped, setHidesWhenStopped] = React.useState(true);
55
+ const CustomizedActivityIndicator = ActivityIndicator.customize({
56
+ activityIndicatorColor: 'orange',
57
+ size: 'large',
58
+ });
44
59
 
60
+ const customizedActivityIndicatorTest: React.FunctionComponent = () => {
45
61
  return (
46
62
  <Stack style={stackStyle}>
47
- <View style={commonStyles.root}>
48
- <View style={commonStyles.settings}>
49
- <View style={commonStyles.switch}>
50
- <Text>Animating</Text>
51
- <Switch value={animating} onValueChange={setAnimating} />
52
- </View>
53
- <View style={commonStyles.switch}>
54
- <Text>HidesWhenStopped</Text>
55
- <Switch value={hidesWhenStopped} onValueChange={setHidesWhenStopped} />
56
- </View>
57
- </View>
58
- <ActivityIndicator animating={animating} hidesWhenStopped={hidesWhenStopped} />
59
- </View>
63
+ <Text>Customized Activity Indicator</Text>
64
+ <CustomizedActivityIndicator />
60
65
  </Stack>
61
66
  );
62
67
  };
63
68
 
64
69
  const activityIndicatorSections: TestSection[] = [
65
70
  {
66
- name: 'BaseActivityIndicator',
71
+ name: 'Base ActivityIndicator',
67
72
  testID: ACTIVITY_INDICATOR_TESTPAGE,
68
73
  component: basicActivityIndicator,
69
74
  },
@@ -72,6 +77,11 @@ const activityIndicatorSections: TestSection[] = [
72
77
  testID: ACTIVITY_INDICATOR_TESTPAGE,
73
78
  component: activityIndicatorTest,
74
79
  },
80
+ {
81
+ name: 'Customized ActivityIndicator',
82
+ testID: ACTIVITY_INDICATOR_TESTPAGE,
83
+ component: customizedActivityIndicatorTest,
84
+ },
75
85
  ];
76
86
 
77
87
  export const ActivityIndicatorTest: React.FunctionComponent = () => {
@@ -1,5 +1,5 @@
1
- export const HOMEPAGE_ACTIVITY_INDICATOR_BUTTON = 'HOMEPAGE_ACTIVITY_INDICATOR_BUTTON';
2
- export const ACTIVITY_INDICATOR_TESTPAGE = 'ACTIVITY_INDICATOR_TESTPAGE';
1
+ export const HOMEPAGE_ACTIVITY_INDICATOR_BUTTON = 'Homepage_ActivityIndicator_Button';
2
+ export const ACTIVITY_INDICATOR_TESTPAGE = 'ActivityIndicator_TestPage';
3
3
 
4
4
  /* Test ActivityIndicator 1 */
5
- export const ACTIVITY_INDICATOR_TEST_COMPONENT = 'Activity_Indicator_Test_Component'; // A component on each specific test page
5
+ export const ACTIVITY_INDICATOR_TEST_COMPONENT = 'ActivityIndicator_Test_Component'; // A component on each specific test page
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { JSAvatar, IconAlignment, JSAvatarTokens } from '@fluentui-react-native/experimental-avatar';
2
+ import { JSAvatar, IconAlignment } from '@fluentui-react-native/experimental-avatar';
3
3
  import { Switch, View, Text, TextInput, TextStyle } from 'react-native';
4
4
  import { Slider } from '../Common/Slider';
5
5
  import { steveBallmerPhotoUrl } from './../PersonaCoin/styles';
@@ -29,36 +29,30 @@ export const CustomizeUsage: React.FunctionComponent = () => {
29
29
  borderColor: theme.colors.inputBorder,
30
30
  };
31
31
 
32
- const tokens: JSAvatarTokens = {};
33
- if (coinColor) {
34
- tokens.backgroundColor = coinColor;
35
- }
36
- if (textColor) {
37
- tokens.color = textColor;
38
- }
39
- if (horizontalAlignment) {
40
- tokens.horizontalIconAlignment = horizontalAlignment;
41
- }
42
- if (verticalAlignment) {
43
- tokens.verticalIconAlignment = verticalAlignment;
44
- }
45
- if (iconSize) {
46
- tokens.iconSize = iconSize;
47
- }
48
- if (iconStrokeWidth) {
49
- tokens.iconStrokeWidth = iconStrokeWidth;
50
- }
51
- if (iconStrokeColor) {
52
- tokens.iconStrokeColor = iconStrokeColor;
53
- }
54
- if (initialsSize) {
55
- tokens.initialsSize = initialsSize;
56
- }
57
- if (physicalSize) {
58
- tokens.avatarSize = physicalSize;
59
- }
60
-
61
- const CustomizedAvatar = JSAvatar.customize(tokens);
32
+ const CustomizedAvatar = React.useMemo(() => {
33
+ const tokens = {
34
+ backgroundColor: coinColor,
35
+ color: textColor,
36
+ horizontalIconAlignment: horizontalAlignment,
37
+ verticalIconAlignment: verticalAlignment,
38
+ iconSize: iconSize,
39
+ iconStrokeWidth: iconStrokeWidth,
40
+ iconStrokeColor: iconStrokeColor,
41
+ initialsSize: initialsSize,
42
+ avatarSize: physicalSize,
43
+ };
44
+ return JSAvatar.customize(tokens);
45
+ }, [
46
+ coinColor,
47
+ textColor,
48
+ horizontalAlignment,
49
+ verticalAlignment,
50
+ iconSize,
51
+ iconStrokeWidth,
52
+ iconStrokeColor,
53
+ initialsSize,
54
+ physicalSize,
55
+ ]);
62
56
 
63
57
  return (
64
58
  <View style={commonStyles.root}>
@@ -8,6 +8,17 @@ import BadgeSvg from './oof.svg';
8
8
 
9
9
  import { SvgIconProps } from '@fluentui-react-native/icon';
10
10
 
11
+ const BadgeNoBorder = Badge.customize({
12
+ borderColor: 'transparent',
13
+ borderWidth: 0,
14
+ });
15
+
16
+ const StyledBadge = Badge.customize({
17
+ backgroundColor: 'yellow',
18
+ borderColor: '#f09',
19
+ borderWidth: 4,
20
+ });
21
+
11
22
  export const BasicBadge: React.FunctionComponent = () => {
12
23
  const svgProps: SvgIconProps = {
13
24
  src: BadgeSvg,
@@ -20,17 +31,6 @@ export const BasicBadge: React.FunctionComponent = () => {
20
31
  fontSize: 16,
21
32
  };
22
33
 
23
- const BadgeNoBorder = Badge.customize({
24
- borderColor: 'transparent',
25
- borderWidth: 0,
26
- });
27
-
28
- const StyledBadge = Badge.customize({
29
- backgroundColor: 'yellow',
30
- borderColor: '#f09',
31
- borderWidth: 4,
32
- });
33
-
34
34
  const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
35
35
  const iconProps = { svgSource: svgProps, width: 20, height: 20 };
36
36
 
@@ -1,32 +1,41 @@
1
1
  import { ButtonV1 as Button } from '@fluentui-react-native/button';
2
2
  import { Text } from '@fluentui-react-native/experimental-text';
3
- import { Icon } from '@fluentui-react-native/icon';
3
+ import { Icon, SvgIconProps } from '@fluentui-react-native/icon';
4
4
  import * as React from 'react';
5
- import { View } from 'react-native';
5
+ import { Platform, View } from 'react-native';
6
6
  import { commonTestStyles, stackStyle } from '../Common/styles';
7
+ import TestSvg from './test.svg';
8
+
9
+ const CustomText = Text.customize({ fontSize: 'header', color: 'hotpink' });
10
+ const CustomButton = Button.customize({ backgroundColor: 'pink' });
11
+ const CustomIconButton = Button.customize({ iconColor: 'yellow' });
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
+ const svgProps: SvgIconProps = {
25
+ src: TestSvg,
26
+ viewBox: '0 0 500 500',
27
+ };
7
28
 
8
29
  export const ButtonHOCTest: React.FunctionComponent = () => {
9
30
  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
- });
31
+ const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
24
32
 
25
33
  return (
26
34
  <View style={stackStyle}>
27
35
  <CustomButton style={commonTestStyles.vmargin} componentRef={buttonRef}>
28
36
  Customized Button with ref
29
37
  </CustomButton>
38
+ {svgIconsEnabled && <CustomIconButton icon={{ svgSource: svgProps }}>Customized Icon Button</CustomIconButton>}
30
39
  <Button
31
40
  style={commonTestStyles.vmargin}
32
41
  onClick={() => {
@@ -11,7 +11,6 @@ export const ButtonSizeTest: React.FunctionComponent = () => {
11
11
  viewBox: '0 0 500 500',
12
12
  };
13
13
  const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
14
-
15
14
  return (
16
15
  <View style={[stackStyle, commonTestStyles.view]}>
17
16
  {svgIconsEnabled && (
@@ -53,41 +53,41 @@ const otherCheckbox: React.FunctionComponent = () => {
53
53
  );
54
54
  };
55
55
 
56
- const tokenCheckbox: React.FunctionComponent = () => {
57
- const CircularCheckbox = Checkbox.customize({ tokens: { borderRadius: 50 } });
58
-
59
- const CircleColorCheckbox = Checkbox.customize({
60
- tokens: { borderRadius: 50, checkboxBackgroundColor: 'white' },
61
- _overrides: {
62
- checked: {
63
- tokens: {
64
- checkboxBackgroundColor: 'green',
65
- checkboxBorderColor: 'green',
66
- checkmarkColor: 'white',
67
- },
56
+ const CircularCheckbox = Checkbox.customize({ tokens: { borderRadius: 50 } });
57
+
58
+ const CircleColorCheckbox = Checkbox.customize({
59
+ tokens: { borderRadius: 50, checkboxBackgroundColor: 'white' },
60
+ _overrides: {
61
+ checked: {
62
+ tokens: {
63
+ checkboxBackgroundColor: 'green',
64
+ checkboxBorderColor: 'green',
65
+ checkmarkColor: 'white',
68
66
  },
69
- focused: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundHovered' } },
70
- hovered: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundHovered' } },
71
- pressed: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundPressed' } },
72
67
  },
73
- });
74
-
75
- const HoverCheckbox = Checkbox.customize({
76
- _overrides: {
77
- checked: {
78
- tokens: {
79
- checkboxBackgroundColor: 'black',
80
- checkmarkColor: 'white',
81
- },
68
+ focused: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundHovered' } },
69
+ hovered: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundHovered' } },
70
+ pressed: { tokens: { checkboxBackgroundColor: 'menuItemBackgroundPressed' } },
71
+ },
72
+ });
73
+
74
+ const HoverCheckbox = Checkbox.customize({
75
+ _overrides: {
76
+ checked: {
77
+ tokens: {
78
+ checkboxBackgroundColor: 'black',
79
+ checkmarkColor: 'white',
82
80
  },
83
- hovered: {
84
- tokens: {
85
- checkmarkVisibility: 1,
86
- },
81
+ },
82
+ hovered: {
83
+ tokens: {
84
+ checkmarkVisibility: 1,
87
85
  },
88
86
  },
89
- });
87
+ },
88
+ });
90
89
 
90
+ const tokenCheckbox: React.FunctionComponent = () => {
91
91
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
92
92
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
93
93