@fluentui-react-native/tester 0.51.3 → 0.52.1

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 (177) hide show
  1. package/CHANGELOG.json +205 -1
  2. package/CHANGELOG.md +58 -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/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
  55. package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +2 -2
  56. package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
  57. package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
  58. package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
  59. package/lib/FluentTester/TestComponents/MenuButton/consts.js +3 -2
  60. package/lib/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
  61. package/lib/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
  62. package/lib/FluentTester/TestComponents/MenuButton/testData.js +2 -0
  63. package/lib/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
  64. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
  65. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +6 -6
  66. package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
  67. package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
  68. package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
  69. package/lib/FluentTester/TestComponents/RadioGroup/consts.js +17 -9
  70. package/lib/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
  71. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
  72. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js +8 -8
  73. package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
  74. package/lib/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
  75. package/lib/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
  76. package/lib/FluentTester/TestComponents/Tabs/consts.js +13 -8
  77. package/lib/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
  78. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts +5 -0
  79. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts.map +1 -1
  80. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js +11 -0
  81. package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js.map +1 -1
  82. package/lib-commonjs/E2E/Button/specs/Button.spec.win.js +2 -2
  83. package/lib-commonjs/E2E/Button/specs/Button.spec.win.js.map +1 -1
  84. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts +5 -0
  85. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts.map +1 -1
  86. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js +11 -0
  87. package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
  88. package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js +1 -1
  89. package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
  90. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts +12 -0
  91. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts.map +1 -1
  92. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +40 -0
  93. package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
  94. package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +24 -2
  95. package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
  96. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts +12 -0
  97. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts.map +1 -1
  98. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js +38 -0
  99. package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
  100. package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js +27 -4
  101. package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
  102. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js +2 -2
  103. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js.map +1 -1
  104. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts +13 -3
  105. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts.map +1 -1
  106. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js +60 -10
  107. package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js.map +1 -1
  108. package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js +35 -11
  109. package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
  110. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js +1 -1
  111. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js.map +1 -1
  112. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts +18 -3
  113. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts.map +1 -1
  114. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js +85 -7
  115. package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js.map +1 -1
  116. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js +35 -2
  117. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
  118. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts +2 -0
  119. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts.map +1 -0
  120. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js +69 -0
  121. package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js.map +1 -0
  122. package/lib-commonjs/E2E/common/BasePage.win.d.ts +0 -1
  123. package/lib-commonjs/E2E/common/BasePage.win.d.ts.map +1 -1
  124. package/lib-commonjs/E2E/common/BasePage.win.js +0 -7
  125. package/lib-commonjs/E2E/common/BasePage.win.js.map +1 -1
  126. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  127. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js +11 -1
  128. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  129. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
  130. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +1 -1
  131. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
  132. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
  133. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
  134. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js +4 -3
  135. package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
  136. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
  137. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js +2 -0
  138. package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
  139. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
  140. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +5 -5
  141. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
  142. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
  143. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
  144. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js +18 -10
  145. package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
  146. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
  147. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js +7 -7
  148. package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
  149. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
  150. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
  151. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js +14 -9
  152. package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
  153. package/package.json +21 -21
  154. package/src/E2E/Button/pages/ButtonPageObject.ts +19 -0
  155. package/src/E2E/Button/specs/Button.spec.win.ts +4 -8
  156. package/src/E2E/Checkbox/pages/CheckboxPageObject.ts +19 -0
  157. package/src/E2E/Checkbox/specs/Checkbox.spec.win.ts +3 -7
  158. package/src/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.ts +49 -0
  159. package/src/E2E/ContextualMenu/specs/ContextualMenu.spec.win.ts +33 -4
  160. package/src/E2E/MenuButton/pages/MenuButtonPageObject.win.ts +46 -0
  161. package/src/E2E/MenuButton/specs/MenuButton.spec.win.ts +37 -6
  162. package/src/E2E/RadioGroup/pages/RadioGroupPageObject.macos.ts +4 -4
  163. package/src/E2E/RadioGroup/pages/RadioGroupPageObject.win.ts +70 -14
  164. package/src/E2E/RadioGroup/specs/RadioGroup.spec.win.ts +48 -14
  165. package/src/E2E/Tabs/pages/TabsPageObject.macos.ts +2 -2
  166. package/src/E2E/Tabs/pages/TabsPageObject.win.ts +90 -8
  167. package/src/E2E/Tabs/specs/Tabs.spec.win.ts +50 -4
  168. package/src/E2E/Tabs/specs/Tabs.spec.windows.ts +84 -0
  169. package/src/E2E/common/BasePage.win.ts +0 -8
  170. package/src/FluentTester/TestComponents/Badge/BadgeTest.tsx +14 -1
  171. package/src/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.tsx +7 -2
  172. package/src/FluentTester/TestComponents/MenuButton/consts.ts +3 -2
  173. package/src/FluentTester/TestComponents/MenuButton/testData.ts +2 -0
  174. package/src/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.tsx +14 -12
  175. package/src/FluentTester/TestComponents/RadioGroup/consts.ts +21 -11
  176. package/src/FluentTester/TestComponents/Tabs/TabsE2ETest.tsx +15 -11
  177. package/src/FluentTester/TestComponents/Tabs/consts.ts +16 -10
@@ -2,10 +2,55 @@ import {
2
2
  CONTEXTUALMENU_TESTPAGE,
3
3
  CONTEXTUALMENU_TEST_COMPONENT,
4
4
  HOMEPAGE_CONTEXTUALMENU_BUTTON,
5
+ CONTEXTUALMENUITEM_TEST_COMPONENT,
5
6
  } from '../../../FluentTester/TestComponents/ContextualMenu/consts';
6
7
  import { BasePage, By } from '../../common/BasePage.win';
7
8
 
9
+ /* This enum gives the spec file an EASY way to interact with SPECIFIC UI elements on the page.
10
+ * The spec file should import this enum and use it when wanting to interact with different elements on the page. */
11
+ export const enum ContextualMenuSelector {
12
+ ContextualMenu = 0, //this._primaryComponent
13
+ ContextualMenuItem, //this._contextualMenuItem
14
+ }
15
+
8
16
  class ContextualMenuPageObject extends BasePage {
17
+ /******************************************************************/
18
+ /**************** UI Element Interaction Methods ******************/
19
+ /******************************************************************/
20
+ waitForContextualMenuItemsToOpen(timeout?: number): void {
21
+ browser.waitUntil(
22
+ () => {
23
+ return this.contextualMenuItemDisplayed();
24
+ },
25
+ {
26
+ timeout: timeout ?? this.waitForPageTimeout,
27
+ timeoutMsg: 'The Contextual Menu Items did not open.',
28
+ interval: 1000,
29
+ },
30
+ );
31
+ }
32
+
33
+ /* Whether the contextual menu item is displayed or not. It should be displayed after clicking on the MenuButton */
34
+ contextualMenuItemDisplayed(): boolean {
35
+ return this._contextualMenuItem.isDisplayed();
36
+ }
37
+
38
+ /* Sends a Keyboarding command on a specific UI element */
39
+ sendKey(contextualMenuSelector: ContextualMenuSelector, key: string): void {
40
+ this.getContextualMenuSelector(contextualMenuSelector).addValue(key);
41
+ }
42
+
43
+ /* Returns the correct WebDriverIO element from the ContextualMenuSelector string */
44
+ getContextualMenuSelector(contextualMenuSelector?: ContextualMenuSelector): WebdriverIO.Element {
45
+ if (contextualMenuSelector == ContextualMenuSelector.ContextualMenu) {
46
+ return this._primaryComponent;
47
+ } else if (contextualMenuSelector == ContextualMenuSelector.ContextualMenuItem) {
48
+ return this._contextualMenuItem;
49
+ } else {
50
+ return this._primaryComponent;
51
+ }
52
+ }
53
+
9
54
  /*****************************************/
10
55
  /**************** Getters ****************/
11
56
  /*****************************************/
@@ -24,6 +69,10 @@ class ContextualMenuPageObject extends BasePage {
24
69
  get _pageButton() {
25
70
  return By(HOMEPAGE_CONTEXTUALMENU_BUTTON);
26
71
  }
72
+
73
+ get _contextualMenuItem() {
74
+ return By(CONTEXTUALMENUITEM_TEST_COMPONENT);
75
+ }
27
76
  }
28
77
 
29
78
  export default new ContextualMenuPageObject();
@@ -1,6 +1,6 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
- import ContextualMenuPageObjectObject from '../pages/ContextualMenuPageObject.win';
3
- import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
2
+ import ContextualMenuPageObjectObject, { ContextualMenuSelector } from '../pages/ContextualMenuPageObject.win';
3
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, Keys } from '../../common/consts';
4
4
 
5
5
  // Before testing begins, allow up to 60 seconds for app to open
6
6
  describe('ContextualMenu Testing Initialization', function () {
@@ -8,9 +8,7 @@ describe('ContextualMenu Testing Initialization', function () {
8
8
  NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
9
9
  expect(NavigateAppPage.isPageLoaded()).toBeTruthy();
10
10
  });
11
- });
12
11
 
13
- describe('ContextualMenu Functional Tests', () => {
14
12
  it('Click and navigate to ContextualMenu test page', () => {
15
13
  /* Scroll to component test page button in scrollview if not already visible*/
16
14
  ContextualMenuPageObjectObject.scrollToComponentButton();
@@ -23,3 +21,34 @@ describe('ContextualMenu Functional Tests', () => {
23
21
  expect(ContextualMenuPageObjectObject.isPageLoaded()).toBeTruthy();
24
22
  });
25
23
  });
24
+
25
+ describe('ContextualMenu Functional Tests', () => {
26
+ /* Scrolls and waits for the ContextualMenu to be visible on the Test Page */
27
+ beforeEach(() => {
28
+ ContextualMenuPageObjectObject.scrollToTestElement();
29
+ ContextualMenuPageObjectObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
30
+
31
+ ContextualMenuPageObjectObject.sendKey(ContextualMenuSelector.ContextualMenu, Keys.Escape); // Reset ContextualMenu state for next test
32
+ });
33
+
34
+ it('Click on ContextualMenu Button and validate that the list of ContextualMenu Items open', () => {
35
+ /* Click on the ContextualMenu */
36
+ ContextualMenuPageObjectObject.clickComponent();
37
+ ContextualMenuPageObjectObject.waitForContextualMenuItemsToOpen(PAGE_TIMEOUT);
38
+
39
+ expect(ContextualMenuPageObjectObject.contextualMenuItemDisplayed()).toBeTruthy();
40
+ });
41
+
42
+ it('Type "SpaceBar" to select the ContextualMenu and validate that the list of ContextualMenu Items open', () => {
43
+ /* Type a space on the ContextualMenu */
44
+ ContextualMenuPageObjectObject.sendKey(ContextualMenuSelector.ContextualMenu, Keys.Spacebar);
45
+ ContextualMenuPageObjectObject.waitForContextualMenuItemsToOpen(PAGE_TIMEOUT);
46
+
47
+ expect(ContextualMenuPageObjectObject.contextualMenuItemDisplayed()).toBeTruthy();
48
+ });
49
+
50
+ /* Runs after all tests. This ensures the ContextualMenu closes. If it stays open, the test driver won't be able to close the test app */
51
+ afterAll(() => {
52
+ ContextualMenuPageObjectObject.sendKey(ContextualMenuSelector.ContextualMenu, Keys.Escape); // Reset ContextualMenu state for next test
53
+ });
54
+ });
@@ -3,10 +3,52 @@ import {
3
3
  MENU_BUTTON_TEST_COMPONENT,
4
4
  HOMEPAGE_MENU_BUTTON,
5
5
  MENU_BUTTON_NO_A11Y_LABEL_COMPONENT,
6
+ MENU_ITEM_1_COMPONENT,
6
7
  } from '../../../FluentTester/TestComponents/MenuButton/consts';
7
8
  import { BasePage, By } from '../../common/BasePage.win';
8
9
 
10
+ export const enum MenuButtonSelector {
11
+ MenuButton = 0, // this._primarySelector
12
+ MenuItem1, // this._menuItem
13
+ }
14
+
9
15
  class MenuButtonPageObject extends BasePage {
16
+ /******************************************************************/
17
+ /**************** UI Element Interaction Methods ******************/
18
+ /******************************************************************/
19
+ waitForMenuItemsToOpen(timeout?: number): void {
20
+ browser.waitUntil(
21
+ () => {
22
+ return this.menuItemDisplayed();
23
+ },
24
+ {
25
+ timeout: timeout ?? this.waitForPageTimeout,
26
+ timeoutMsg: 'The Menu Items did not open.',
27
+ interval: 1000,
28
+ },
29
+ );
30
+ }
31
+
32
+ /* Whether the menu item is displayed or not. It should be displayed after clicking on the MenuButton */
33
+ menuItemDisplayed(): boolean {
34
+ return this._menuItem.isDisplayed();
35
+ }
36
+
37
+ /* Sends a Keyboarding command on a specific UI element */
38
+ sendKey(selector: MenuButtonSelector, key: string): void {
39
+ this.getMenuButtonSelector(selector).addValue(key);
40
+ }
41
+
42
+ /* Returns the correct WebDriverIO element from the MenuButton Selector */
43
+ getMenuButtonSelector(selector?: MenuButtonSelector): WebdriverIO.Element {
44
+ if (selector == MenuButtonSelector.MenuButton) {
45
+ return this._primaryComponent;
46
+ } else if (selector == MenuButtonSelector.MenuItem1) {
47
+ return this._menuItem;
48
+ }
49
+ return this._primaryComponent;
50
+ }
51
+
10
52
  /*****************************************/
11
53
  /**************** Getters ****************/
12
54
  /*****************************************/
@@ -29,6 +71,10 @@ class MenuButtonPageObject extends BasePage {
29
71
  get _pageButton() {
30
72
  return By(HOMEPAGE_MENU_BUTTON);
31
73
  }
74
+
75
+ get _menuItem() {
76
+ return By(MENU_ITEM_1_COMPONENT);
77
+ }
32
78
  }
33
79
 
34
80
  export default new MenuButtonPageObject();
@@ -1,6 +1,6 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
- import MenuButtonPageObject from '../pages/MenuButtonPageObject.win';
3
- import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, MENUBUTTON_A11Y_ROLE } from '../../common/consts';
2
+ import MenuButtonPageObject, { MenuButtonSelector } from '../pages/MenuButtonPageObject.win';
3
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, MENUBUTTON_A11Y_ROLE, Keys } from '../../common/consts';
4
4
  import { MENU_BUTTON_ACCESSIBILITY_LABEL, MENU_BUTTON_TEST_COMPONENT_LABEL } from '../../../FluentTester/TestComponents/MenuButton/consts';
5
5
  import { ComponentSelector } from '../../common/BasePage.win';
6
6
 
@@ -26,21 +26,52 @@ describe('MenuButton Testing Initialization', function () {
26
26
 
27
27
  /* This will be re-enabled with a MenuButton Bug is fixed. Currently in PR - "Integrating accessibilityLabel functionality for MenuButton #1117" */
28
28
  describe('MenuButton Accessibility Testing', () => {
29
- it('MenuButton - Validate accessibilityRole is correct', () => {
29
+ /* Scrolls and waits for the MenuButton to be visible on the Test Page */
30
+ beforeEach(() => {
30
31
  MenuButtonPageObject.scrollToTestElement();
31
32
  MenuButtonPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
33
+ });
34
+
35
+ it('MenuButton - Validate accessibilityRole is correct', () => {
32
36
  expect(MenuButtonPageObject.getAccessibilityRole()).toEqual(MENUBUTTON_A11Y_ROLE);
33
37
  });
34
38
 
35
39
  it('MenuButton - Set accessibilityLabel', () => {
36
- MenuButtonPageObject.scrollToTestElement();
37
- MenuButtonPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
38
40
  expect(MenuButtonPageObject.getAccessibilityLabel(ComponentSelector.Primary)).toEqual(MENU_BUTTON_ACCESSIBILITY_LABEL);
39
41
  });
40
42
 
41
43
  it('Do not set accessibilityLabel -> Default to MenuButton label', () => {
44
+ expect(MenuButtonPageObject.getAccessibilityLabel(ComponentSelector.Secondary)).toEqual(MENU_BUTTON_TEST_COMPONENT_LABEL);
45
+ });
46
+ });
47
+
48
+ describe('MenuButton Functional Testing', () => {
49
+ /* Scrolls and waits for the MenuButton to be visible on the Test Page */
50
+ beforeEach(() => {
42
51
  MenuButtonPageObject.scrollToTestElement();
43
52
  MenuButtonPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
44
- expect(MenuButtonPageObject.getAccessibilityLabel(ComponentSelector.Secondary)).toEqual(MENU_BUTTON_TEST_COMPONENT_LABEL);
53
+
54
+ MenuButtonPageObject.sendKey(MenuButtonSelector.MenuButton, Keys.Escape); // Reset MenuButton state for next test
55
+ });
56
+
57
+ it('Click on MenuButton and validate that the list of Menu Items open', () => {
58
+ /* Click on the MenuButton */
59
+ MenuButtonPageObject.clickComponent();
60
+ MenuButtonPageObject.waitForMenuItemsToOpen(PAGE_TIMEOUT);
61
+
62
+ expect(MenuButtonPageObject.menuItemDisplayed()).toBeTruthy();
63
+ });
64
+
65
+ it('Type "SpaceBar" to select the MenuButton and validate that the list of Menu Items open', () => {
66
+ /* Type a space on the MenuButton */
67
+ MenuButtonPageObject.sendKey(MenuButtonSelector.MenuButton, Keys.Spacebar);
68
+ MenuButtonPageObject.waitForMenuItemsToOpen(PAGE_TIMEOUT);
69
+
70
+ expect(MenuButtonPageObject.menuItemDisplayed()).toBeTruthy();
71
+ });
72
+
73
+ /* Runs after all tests. This ensures the MenuButton closes. If it stays open, the test driver won't be able to close the test app */
74
+ afterAll(() => {
75
+ MenuButtonPageObject.sendKey(MenuButtonSelector.MenuButton, Keys.Escape);
45
76
  });
46
77
  });
@@ -2,9 +2,9 @@ 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
8
  } from '../../../FluentTester/TestComponents/RadioGroup/consts';
9
9
  import { BasePage, By } from '../../common/BasePage.macos';
10
10
 
@@ -59,11 +59,11 @@ class RadioGroupPage extends BasePage {
59
59
  /* RadioButton *
60
60
  /**************/
61
61
  get _radioButton() {
62
- return By(RADIOBUTTON_TEST_COMPONENT);
62
+ return By(FIRST_RADIO_BUTTON);
63
63
  }
64
64
 
65
65
  get _secondRadioButton() {
66
- return By(RADIOBUTTON_NO_A11Y_LABEL_COMPONENT);
66
+ return By(SECOND_RADIO_BUTTON);
67
67
  }
68
68
  }
69
69
 
@@ -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