@fluentui-react-native/tester 0.63.6 → 0.64.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 (64) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +10 -2
  3. package/lib/E2E/Menu/pages/MenuPageObject.d.ts +31 -0
  4. package/lib/E2E/Menu/pages/MenuPageObject.d.ts.map +1 -0
  5. package/lib/E2E/Menu/pages/MenuPageObject.js +109 -0
  6. package/lib/E2E/Menu/pages/MenuPageObject.js.map +1 -0
  7. package/lib/E2E/Menu/specs/Menu.spec.win.d.ts +2 -0
  8. package/lib/E2E/Menu/specs/Menu.spec.win.d.ts.map +1 -0
  9. package/lib/E2E/Menu/specs/Menu.spec.win.js +95 -0
  10. package/lib/E2E/Menu/specs/Menu.spec.win.js.map +1 -0
  11. package/lib/E2E/common/NavigateAppPage.win.d.ts +2 -0
  12. package/lib/E2E/common/NavigateAppPage.win.d.ts.map +1 -1
  13. package/lib/E2E/common/NavigateAppPage.win.js +11 -0
  14. package/lib/E2E/common/NavigateAppPage.win.js.map +1 -1
  15. package/lib/E2E/common/consts.d.ts +2 -0
  16. package/lib/E2E/common/consts.d.ts.map +1 -1
  17. package/lib/E2E/common/consts.js +2 -0
  18. package/lib/E2E/common/consts.js.map +1 -1
  19. package/lib/FluentTester/TestComponents/Menu/E2EMenuTest.d.ts +3 -0
  20. package/lib/FluentTester/TestComponents/Menu/E2EMenuTest.d.ts.map +1 -0
  21. package/lib/FluentTester/TestComponents/Menu/E2EMenuTest.js +24 -0
  22. package/lib/FluentTester/TestComponents/Menu/E2EMenuTest.js.map +1 -0
  23. package/lib/FluentTester/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  24. package/lib/FluentTester/TestComponents/Menu/MenuTest.js +6 -1
  25. package/lib/FluentTester/TestComponents/Menu/MenuTest.js.map +1 -1
  26. package/lib/FluentTester/TestComponents/Menu/consts.d.ts +8 -0
  27. package/lib/FluentTester/TestComponents/Menu/consts.d.ts.map +1 -1
  28. package/lib/FluentTester/TestComponents/Menu/consts.js +10 -0
  29. package/lib/FluentTester/TestComponents/Menu/consts.js.map +1 -1
  30. package/lib-commonjs/E2E/Menu/pages/MenuPageObject.d.ts +31 -0
  31. package/lib-commonjs/E2E/Menu/pages/MenuPageObject.d.ts.map +1 -0
  32. package/lib-commonjs/E2E/Menu/pages/MenuPageObject.js +111 -0
  33. package/lib-commonjs/E2E/Menu/pages/MenuPageObject.js.map +1 -0
  34. package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.d.ts +2 -0
  35. package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.d.ts.map +1 -0
  36. package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.js +98 -0
  37. package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.js.map +1 -0
  38. package/lib-commonjs/E2E/common/NavigateAppPage.win.d.ts +2 -0
  39. package/lib-commonjs/E2E/common/NavigateAppPage.win.d.ts.map +1 -1
  40. package/lib-commonjs/E2E/common/NavigateAppPage.win.js +41 -30
  41. package/lib-commonjs/E2E/common/NavigateAppPage.win.js.map +1 -1
  42. package/lib-commonjs/E2E/common/consts.d.ts +2 -0
  43. package/lib-commonjs/E2E/common/consts.d.ts.map +1 -1
  44. package/lib-commonjs/E2E/common/consts.js +3 -1
  45. package/lib-commonjs/E2E/common/consts.js.map +1 -1
  46. package/lib-commonjs/FluentTester/TestComponents/Menu/E2EMenuTest.d.ts +3 -0
  47. package/lib-commonjs/FluentTester/TestComponents/Menu/E2EMenuTest.d.ts.map +1 -0
  48. package/lib-commonjs/FluentTester/TestComponents/Menu/E2EMenuTest.js +29 -0
  49. package/lib-commonjs/FluentTester/TestComponents/Menu/E2EMenuTest.js.map +1 -0
  50. package/lib-commonjs/FluentTester/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  51. package/lib-commonjs/FluentTester/TestComponents/Menu/MenuTest.js +6 -1
  52. package/lib-commonjs/FluentTester/TestComponents/Menu/MenuTest.js.map +1 -1
  53. package/lib-commonjs/FluentTester/TestComponents/Menu/consts.d.ts +8 -0
  54. package/lib-commonjs/FluentTester/TestComponents/Menu/consts.d.ts.map +1 -1
  55. package/lib-commonjs/FluentTester/TestComponents/Menu/consts.js +11 -1
  56. package/lib-commonjs/FluentTester/TestComponents/Menu/consts.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/E2E/Menu/pages/MenuPageObject.ts +119 -0
  59. package/src/E2E/Menu/specs/Menu.spec.win.ts +121 -0
  60. package/src/E2E/common/NavigateAppPage.win.ts +9 -0
  61. package/src/E2E/common/consts.ts +2 -0
  62. package/src/FluentTester/TestComponents/Menu/E2EMenuTest.tsx +46 -0
  63. package/src/FluentTester/TestComponents/Menu/MenuTest.tsx +7 -1
  64. package/src/FluentTester/TestComponents/Menu/consts.ts +14 -0
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../src/FluentTester/TestComponents/Menu/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,aAAa,kBAAkB,CAAC"}
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../src/FluentTester/TestComponents/Menu/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AACvE,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAGvE,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,4BAA4B,6CAA6C,CAAC;AAGvF,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AACnF,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,aAAa,kBAAkB,CAAC"}
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MENU_TESTPAGE = exports.HOMEPAGE_MENU_BUTTON = void 0;
3
+ exports.MENU_ON_CLOSE = exports.MENU_ON_OPEN = exports.MENUITEM_TEST_LABEL = exports.MENUITEM_NO_A11Y_LABEL_COMPONENT = exports.MENUITEM_ACCESSIBILITY_LABEL = exports.MENUITEM_TEST_COMPONENT = exports.MENUPOPOVER_TEST_COMPONENT = exports.MENUTRIGGER_TEST_COMPONENT = exports.MENU_TESTPAGE = exports.HOMEPAGE_MENU_BUTTON = void 0;
4
4
  exports.HOMEPAGE_MENU_BUTTON = 'Homepage_Menu_Button';
5
5
  exports.MENU_TESTPAGE = 'Menu_TestPage';
6
+ exports.MENUTRIGGER_TEST_COMPONENT = 'MenuTrigger_Test_Component';
7
+ exports.MENUPOPOVER_TEST_COMPONENT = 'MenuPopover_Test_Component';
8
+ /* Test MenuItem 1 */
9
+ exports.MENUITEM_TEST_COMPONENT = 'MenuItem_Test_Component'; // A component on each specific test page
10
+ exports.MENUITEM_ACCESSIBILITY_LABEL = 'E2E testing MenuItem accessibility label';
11
+ /* Test MenuItem 2 */
12
+ exports.MENUITEM_NO_A11Y_LABEL_COMPONENT = 'MenuItem_No_A11y_label_Component';
13
+ exports.MENUITEM_TEST_LABEL = 'Test MenuItem2 - No Accessibility Label'; // A component on each specific test page
14
+ exports.MENU_ON_OPEN = 'Menu_On_Open'; // For testing the open functionality of Menu
15
+ exports.MENU_ON_CLOSE = 'Menu_On_Close'; // For testing the open functionality of Menu
6
16
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../../src/FluentTester/TestComponents/Menu/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,aAAa,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../../src/FluentTester/TestComponents/Menu/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,aAAa,GAAG,eAAe,CAAC;AAEhC,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAC1D,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,qBAAqB;AACR,QAAA,uBAAuB,GAAG,yBAAyB,CAAC,CAAC,yCAAyC;AAC9F,QAAA,4BAA4B,GAAG,0CAA0C,CAAC;AAEvF,qBAAqB;AACR,QAAA,gCAAgC,GAAG,kCAAkC,CAAC;AACtE,QAAA,mBAAmB,GAAG,yCAAyC,CAAC,CAAC,yCAAyC;AAE1G,QAAA,YAAY,GAAG,cAAc,CAAC,CAAC,6CAA6C;AAC5E,QAAA,aAAa,GAAG,eAAe,CAAC,CAAC,6CAA6C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/tester",
3
- "version": "0.63.6",
3
+ "version": "0.64.0",
4
4
  "description": "A test app to test FluentUI React Native Components during development",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft <fluentuinativeowners@microsoft.com>",
@@ -0,0 +1,119 @@
1
+ import {
2
+ MENU_TESTPAGE,
3
+ MENUTRIGGER_TEST_COMPONENT,
4
+ MENUITEM_NO_A11Y_LABEL_COMPONENT,
5
+ HOMEPAGE_MENU_BUTTON,
6
+ MENU_ON_OPEN,
7
+ MENU_ON_CLOSE,
8
+ MENUITEM_TEST_COMPONENT,
9
+ MENUPOPOVER_TEST_COMPONENT,
10
+ } from '../../../FluentTester/TestComponents/Menu/consts';
11
+ import { BasePage, By } from '../../common/BasePage.win';
12
+
13
+ /* This enum gives the spec file an EASY way to interact with SPECIFIC UI elements on the page.
14
+ * The spec file should import this enum and use it when wanting to interact with different elements on the page. */
15
+ export const enum MenuComponentSelector {
16
+ PrimaryComponent, //this._primaryComponent
17
+ SecondaryComponent, //this._secondaryComponent
18
+ TertiaryComponent, //this._tertiaryComponent
19
+ }
20
+
21
+ class MenuPageObject extends BasePage {
22
+ /******************************************************************/
23
+ /**************** UI Element Interaction Methods ******************/
24
+ /******************************************************************/
25
+ didMenuOpen(): boolean {
26
+ const callbackText = By(MENU_ON_OPEN);
27
+ browser.waitUntil(
28
+ () => {
29
+ return callbackText.isDisplayed();
30
+ },
31
+ {
32
+ timeout: this.waitForPageTimeout,
33
+ timeoutMsg: 'The Menu did not open.',
34
+ interval: 1000,
35
+ },
36
+ );
37
+
38
+ return callbackText.isDisplayed();
39
+ }
40
+
41
+ didMenuClose(): boolean {
42
+ const callbackText = By(MENU_ON_CLOSE);
43
+ browser.waitUntil(
44
+ () => {
45
+ return callbackText.isDisplayed();
46
+ },
47
+ {
48
+ timeout: this.waitForPageTimeout,
49
+ timeoutMsg: 'The Menu did not close.',
50
+ interval: 1000,
51
+ },
52
+ );
53
+
54
+ return callbackText.isDisplayed();
55
+ }
56
+
57
+ getMenuItemAccessibilityLabel(componentSelector: MenuComponentSelector): string {
58
+ switch (componentSelector) {
59
+ case MenuComponentSelector.PrimaryComponent:
60
+ return this._primaryComponent.getAttribute('Name');
61
+
62
+ case MenuComponentSelector.SecondaryComponent:
63
+ return this._secondaryComponent.getAttribute('Name');
64
+
65
+ case MenuComponentSelector.TertiaryComponent:
66
+ return this._tertiaryComponent.getAttribute('Name');
67
+ }
68
+ }
69
+
70
+ getMenuAccessibilityRole(): string {
71
+ return By(MENUPOPOVER_TEST_COMPONENT).getAttribute('ControlType');
72
+ }
73
+
74
+ getMenuItemAccessibilityRole(): string {
75
+ return this._secondaryComponent.getAttribute('ControlType');
76
+ }
77
+
78
+ /* Sends a Keyboarding command on a specific UI element */
79
+ sendKey(menuComponentSelector: MenuComponentSelector, key: string): void {
80
+ this.getMenuComponentSelector(menuComponentSelector).addValue(key);
81
+ }
82
+
83
+ /* Returns the correct WebDriverIO element from the Button Selector */
84
+ getMenuComponentSelector(menuComponentSelector?: MenuComponentSelector): WebdriverIO.Element {
85
+ if (menuComponentSelector == MenuComponentSelector.PrimaryComponent) {
86
+ return this._primaryComponent;
87
+ }
88
+ return this._primaryComponent;
89
+ }
90
+
91
+ /*****************************************/
92
+ /**************** Getters ****************/
93
+ /*****************************************/
94
+ get _testPage() {
95
+ return By(MENU_TESTPAGE);
96
+ }
97
+
98
+ get _pageName() {
99
+ return MENU_TESTPAGE;
100
+ }
101
+
102
+ get _primaryComponent() {
103
+ return By(MENUTRIGGER_TEST_COMPONENT);
104
+ }
105
+
106
+ get _secondaryComponent() {
107
+ return By(MENUITEM_TEST_COMPONENT);
108
+ }
109
+
110
+ get _tertiaryComponent() {
111
+ return By(MENUITEM_NO_A11Y_LABEL_COMPONENT);
112
+ }
113
+
114
+ get _pageButton() {
115
+ return By(HOMEPAGE_MENU_BUTTON);
116
+ }
117
+ }
118
+
119
+ export default new MenuPageObject();
@@ -0,0 +1,121 @@
1
+ import NavigateAppPage from '../../common/NavigateAppPage.win';
2
+ import MenuPageObject, { MenuComponentSelector } from '../pages/MenuPageObject';
3
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, Keys, MENUITEM_A11Y_ROLE, MENU_A11Y_ROLE } from '../../common/consts';
4
+ import { MENUITEM_ACCESSIBILITY_LABEL, MENUITEM_TEST_LABEL } from '../../../FluentTester/TestComponents/Menu';
5
+
6
+ // Before testing begins, allow up to 60 seconds for app to open
7
+ describe('Experimental Button Testing Initialization', function () {
8
+ it('Wait for app load', () => {
9
+ NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
10
+ expect(NavigateAppPage.isPageLoaded()).toBeTruthy(NavigateAppPage.ERRORMESSAGE_APPLOAD);
11
+ });
12
+
13
+ it('Click and navigate to Button test page', () => {
14
+ /* Scroll to component test page button in scrollview if not already visible*/
15
+ MenuPageObject.scrollToComponentButton();
16
+ MenuPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
17
+
18
+ /* Click on component button to navigate to test page */
19
+ NavigateAppPage.clickAndGoToMenuPage();
20
+ MenuPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
21
+
22
+ expect(MenuPageObject.isPageLoaded()).toBeTruthy(MenuPageObject.ERRORMESSAGE_PAGELOAD);
23
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
24
+ });
25
+ });
26
+
27
+ describe('Experimental Button Functional Testing', () => {
28
+ /* Scrolls and waits for the Button to be visible on the Test Page */
29
+ beforeEach(() => {
30
+ MenuPageObject.scrollToTestElement();
31
+ MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
32
+ });
33
+
34
+ it('Validate OnOpenChange() callback was fired -> Click', () => {
35
+ MenuPageObject.clickComponent();
36
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
37
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
38
+
39
+ MenuPageObject.clickComponent();
40
+ expect(MenuPageObject.didMenuClose()).toBeTruthy();
41
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
42
+ });
43
+
44
+ it('Validate OnOpenChange() callback was fired -> Type "Enter"', () => {
45
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
46
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
47
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
48
+
49
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
50
+ expect(MenuPageObject.didMenuClose()).toBeTruthy();
51
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
52
+ });
53
+
54
+ it('Validate OnOpenChange() callback was fired -> Type "Spacebar"', () => {
55
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Spacebar);
56
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
57
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
58
+
59
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Spacebar);
60
+ expect(MenuPageObject.didMenuClose()).toBeTruthy();
61
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
62
+ });
63
+ });
64
+
65
+ describe('Experimental Button Accessibility Testing', () => {
66
+ it('Experimental Button - Validate accessibilityRole of menu item is correct', () => {
67
+ MenuPageObject.scrollToTestElement();
68
+ MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
69
+
70
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
71
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
72
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
73
+
74
+ expect(MenuPageObject.getMenuItemAccessibilityRole()).toEqual(MENUITEM_A11Y_ROLE);
75
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
76
+
77
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
78
+ });
79
+
80
+ it('Experimental Button - Validate accessibilityRole of menu is correct', () => {
81
+ MenuPageObject.scrollToTestElement();
82
+ MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
83
+
84
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
85
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
86
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
87
+
88
+ expect(MenuPageObject.getMenuAccessibilityRole()).toEqual(MENU_A11Y_ROLE);
89
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
90
+
91
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
92
+ });
93
+
94
+ it('Experimental Button - Set accessibilityLabel', () => {
95
+ MenuPageObject.scrollToTestElement();
96
+ MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
97
+
98
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
99
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
100
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
101
+
102
+ expect(MenuPageObject.getMenuItemAccessibilityLabel(MenuComponentSelector.SecondaryComponent)).toEqual(MENUITEM_ACCESSIBILITY_LABEL);
103
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
104
+
105
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
106
+ });
107
+
108
+ it('Experimental Button - Do not set accessibilityLabel -> Default to Button label', () => {
109
+ MenuPageObject.scrollToTestElement();
110
+ MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
111
+
112
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
113
+ expect(MenuPageObject.didMenuOpen()).toBeTruthy();
114
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
115
+
116
+ expect(MenuPageObject.getMenuItemAccessibilityLabel(MenuComponentSelector.TertiaryComponent)).toEqual(MENUITEM_TEST_LABEL);
117
+ expect(MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
118
+
119
+ MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.Enter);
120
+ });
121
+ });
@@ -10,6 +10,7 @@ import { HOMEPAGE_FOCUSTRAPZONE_BUTTON } from '../../FluentTester/TestComponents
10
10
  import { HOMEPAGE_FOCUSZONE_BUTTON } from '../../FluentTester/TestComponents/FocusZone/consts';
11
11
  import { HOMEPAGE_ICON_BUTTON } from '../../FluentTester/TestComponents/Icon/consts';
12
12
  import { HOMEPAGE_LINK_BUTTON } from '../../FluentTester/TestComponents/Link/consts';
13
+ import { HOMEPAGE_MENU_BUTTON } from '../../FluentTester/TestComponents/Menu/consts';
13
14
  import { HOMEPAGE_MENUBUTTON_BUTTON } from '../../FluentTester/TestComponents/MenuButton/consts';
14
15
  import { HOMEPAGE_EXPERIMENTAL_MENU_BUTTON } from '../../FluentTester/TestComponents/MenuButtonExperimental/consts';
15
16
  import { HOMEPAGE_PERSONA_BUTTON } from '../../FluentTester/TestComponents/Persona/consts';
@@ -72,6 +73,10 @@ class NavigateAppPage extends BasePage {
72
73
  this.linkPage.click();
73
74
  }
74
75
 
76
+ clickAndGoToMenuPage() {
77
+ this.menuPage.click();
78
+ }
79
+
75
80
  clickAndGoToMenuButtonPage() {
76
81
  this.menuButtonPage.click();
77
82
  }
@@ -184,6 +189,10 @@ class NavigateAppPage extends BasePage {
184
189
  return By(HOMEPAGE_LINK_BUTTON);
185
190
  }
186
191
 
192
+ private get menuPage() {
193
+ return By(HOMEPAGE_MENU_BUTTON);
194
+ }
195
+
187
196
  private get menuButtonPage() {
188
197
  return By(HOMEPAGE_MENUBUTTON_BUTTON);
189
198
  }
@@ -4,6 +4,8 @@ export const CALLOUT_A11Y_ROLE = 'ControlType.Group';
4
4
  export const CHECKBOX_A11Y_ROLE = 'ControlType.CheckBox';
5
5
  export const LINK_A11Y_ROLE = 'ControlType.HyperLink';
6
6
  export const MENUBUTTON_A11Y_ROLE = 'ControlType.Button';
7
+ export const MENU_A11Y_ROLE = 'ControlType.Menu';
8
+ export const MENUITEM_A11Y_ROLE = 'ControlType.MenuItem';
7
9
  export const RADIOBUTTON_A11Y_ROLE = 'ControlType.RadioButton';
8
10
  export const RADIOGROUP_A11Y_ROLE = 'ControlType.List';
9
11
  export const TAB_A11Y_ROLE = 'ControlType.Tab';
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { Stack } from '@fluentui-react-native/stack';
3
+ import { stackStyle } from '../Common/styles';
4
+ import { ButtonV1 as Button } from '@fluentui-react-native/button';
5
+ import { Text } from '@fluentui-react-native/experimental-text';
6
+ import { Menu, MenuItem, MenuList, MenuPopover, MenuTrigger } from '@fluentui-react-native/menu';
7
+ import {
8
+ MENUITEM_ACCESSIBILITY_LABEL,
9
+ MENUITEM_NO_A11Y_LABEL_COMPONENT,
10
+ MENUTRIGGER_TEST_COMPONENT,
11
+ MENUITEM_TEST_LABEL,
12
+ MENU_ON_CLOSE,
13
+ MENU_ON_OPEN,
14
+ MENUITEM_TEST_COMPONENT,
15
+ MENUPOPOVER_TEST_COMPONENT,
16
+ } from './consts';
17
+
18
+ export const E2EMenuTest: React.FunctionComponent = () => {
19
+ const [menuOpened, setMenuOpened] = React.useState(false);
20
+
21
+ const onOpenChange = React.useCallback(
22
+ (_e: any, isOpen: boolean) => {
23
+ setMenuOpened(isOpen);
24
+ },
25
+ [setMenuOpened],
26
+ );
27
+
28
+ return (
29
+ <Stack style={stackStyle}>
30
+ <Menu open={menuOpened} onOpenChange={onOpenChange}>
31
+ <MenuTrigger>
32
+ <Button testID={MENUTRIGGER_TEST_COMPONENT}>Test</Button>
33
+ </MenuTrigger>
34
+ <MenuPopover testID={MENUPOPOVER_TEST_COMPONENT}>
35
+ <MenuList>
36
+ <MenuItem testID={MENUITEM_TEST_COMPONENT} accessibilityLabel={MENUITEM_ACCESSIBILITY_LABEL} content="A plain MenuItem" />
37
+ <MenuItem disabled content="A second disabled plain MenuItem" />
38
+ <MenuItem testID={MENUITEM_NO_A11Y_LABEL_COMPONENT} content={MENUITEM_TEST_LABEL} />
39
+ </MenuList>
40
+ </MenuPopover>
41
+ </Menu>
42
+
43
+ {menuOpened ? <Text testID={MENU_ON_OPEN}>Menu opened</Text> : <Text testID={MENU_ON_CLOSE}>Menu closed</Text>}
44
+ </Stack>
45
+ );
46
+ };
@@ -14,6 +14,7 @@ import { Stack } from '@fluentui-react-native/stack';
14
14
  import { stackStyle } from '../Common/styles';
15
15
  import { MENU_TESTPAGE } from './consts';
16
16
  import { Test, TestSection, PlatformStatus } from '../Test';
17
+ import { E2EMenuTest } from './E2EMenuTest';
17
18
 
18
19
  const MenuDefault: React.FunctionComponent = () => {
19
20
  return (
@@ -196,6 +197,10 @@ const menuSections: TestSection[] = [
196
197
  name: 'Menu Submenu',
197
198
  component: MenuSubMenu,
198
199
  },
200
+ {
201
+ name: 'Menu E2E',
202
+ component: E2EMenuTest,
203
+ },
199
204
  ];
200
205
 
201
206
  export const MenuTest: React.FunctionComponent = () => {
@@ -207,7 +212,8 @@ export const MenuTest: React.FunctionComponent = () => {
207
212
  androidStatus: 'Backlog',
208
213
  };
209
214
 
210
- const description = '!!!!!!!TODO TODO TODO TODO!!!!!!!!';
215
+ const description =
216
+ 'A Menu is an component that displays a list of options on a temporary surface. They are invoked when users interact with a button, action, or other control.';
211
217
 
212
218
  return <Test name="Menu Test" description={description} sections={menuSections} status={status}></Test>;
213
219
  };
@@ -1,2 +1,16 @@
1
1
  export const HOMEPAGE_MENU_BUTTON = 'Homepage_Menu_Button';
2
2
  export const MENU_TESTPAGE = 'Menu_TestPage';
3
+
4
+ export const MENUTRIGGER_TEST_COMPONENT = 'MenuTrigger_Test_Component';
5
+ export const MENUPOPOVER_TEST_COMPONENT = 'MenuPopover_Test_Component';
6
+
7
+ /* Test MenuItem 1 */
8
+ export const MENUITEM_TEST_COMPONENT = 'MenuItem_Test_Component'; // A component on each specific test page
9
+ export const MENUITEM_ACCESSIBILITY_LABEL = 'E2E testing MenuItem accessibility label';
10
+
11
+ /* Test MenuItem 2 */
12
+ export const MENUITEM_NO_A11Y_LABEL_COMPONENT = 'MenuItem_No_A11y_label_Component';
13
+ export const MENUITEM_TEST_LABEL = 'Test MenuItem2 - No Accessibility Label'; // A component on each specific test page
14
+
15
+ export const MENU_ON_OPEN = 'Menu_On_Open'; // For testing the open functionality of Menu
16
+ export const MENU_ON_CLOSE = 'Menu_On_Close'; // For testing the open functionality of Menu