@fluentui-react-native/tester 0.99.14 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +30 -1
- package/CHANGELOG.md +15 -2
- package/lib/E2E/Button/pages/ButtonPageObject.js +1 -1
- package/lib/E2E/Button/pages/ButtonPageObject.js.map +1 -1
- package/lib/E2E/Button/specs/Button.spec.win.js +3 -3
- package/lib/E2E/Button/specs/Button.spec.win.js.map +1 -1
- package/lib/E2E/ButtonExperimental/pages/ButtonExperimentalPageObject.js +1 -1
- package/lib/E2E/ButtonExperimental/pages/ButtonExperimentalPageObject.js.map +1 -1
- package/lib/E2E/ButtonExperimental/specs/ButtonExperimental.spec.win.js +3 -3
- package/lib/E2E/ButtonExperimental/specs/ButtonExperimental.spec.win.js.map +1 -1
- package/lib/E2E/Checkbox/pages/CheckboxPageObject.js +2 -2
- package/lib/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
- package/lib/E2E/Checkbox/specs/Checkbox.spec.win.js +2 -2
- package/lib/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
- package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +2 -2
- package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
- package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +2 -2
- package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
- package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +1 -1
- package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
- package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +4 -4
- package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
- package/lib/E2E/Menu/pages/MenuPageObject.js +2 -2
- package/lib/E2E/Menu/pages/MenuPageObject.js.map +1 -1
- package/lib/E2E/Menu/specs/Menu.spec.win.js +74 -210
- package/lib/E2E/Menu/specs/Menu.spec.win.js.map +1 -1
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js +1 -1
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
- package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js +4 -4
- package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.js +1 -1
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.js.map +1 -1
- package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js +2 -2
- package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
- package/lib/E2E/Switch/pages/SwitchPageObject.js +2 -2
- package/lib/E2E/Switch/pages/SwitchPageObject.js.map +1 -1
- package/lib/E2E/Switch/specs/Switch.spec.win.js +5 -5
- package/lib/E2E/Switch/specs/Switch.spec.win.js.map +1 -1
- package/lib/E2E/Tabs/pages/TabsPageObject.js +1 -1
- package/lib/E2E/Tabs/pages/TabsPageObject.js.map +1 -1
- package/lib/E2E/Tabs/specs/Tabs.spec.win.js +4 -4
- package/lib/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
- package/lib/E2E/common/BasePage.d.ts +5 -2
- package/lib/E2E/common/BasePage.d.ts.map +1 -1
- package/lib/E2E/common/BasePage.js +152 -48
- package/lib/E2E/common/BasePage.js.map +1 -1
- package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +0 -2
- package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -1
- package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +6 -13
- package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -1
- package/lib/E2E/common/consts.d.ts +58 -7
- package/lib/E2E/common/consts.d.ts.map +1 -1
- package/lib/FluentTester.js +2 -2
- package/lib/FluentTester.js.map +1 -1
- package/lib/TestComponents/Common/consts.d.ts +1 -0
- package/lib/TestComponents/Common/consts.d.ts.map +1 -1
- package/lib/TestComponents/Common/consts.js +2 -0
- package/lib/TestComponents/Common/consts.js.map +1 -1
- package/lib/TestComponents/Dropdown/DropdownTest.d.ts.map +1 -1
- package/lib/TestComponents/Dropdown/DropdownTest.js +2 -1
- package/lib/TestComponents/Dropdown/DropdownTest.js.map +1 -1
- package/lib/TestComponents/Menu/E2EMenuTest.d.ts.map +1 -1
- package/lib/TestComponents/Menu/E2EMenuTest.js +14 -11
- package/lib/TestComponents/Menu/E2EMenuTest.js.map +1 -1
- package/lib/TestComponents/Menu/consts.d.ts +1 -0
- package/lib/TestComponents/Menu/consts.d.ts.map +1 -1
- package/lib/TestComponents/Menu/consts.js +1 -0
- package/lib/TestComponents/Menu/consts.js.map +1 -1
- package/lib/TestComponents/Test.d.ts.map +1 -1
- package/lib/TestComponents/Test.js +8 -1
- package/lib/TestComponents/Test.js.map +1 -1
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js +1 -1
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Button/specs/Button.spec.win.js +3 -3
- package/lib-commonjs/E2E/Button/specs/Button.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/ButtonExperimental/pages/ButtonExperimentalPageObject.js +1 -1
- package/lib-commonjs/E2E/ButtonExperimental/pages/ButtonExperimentalPageObject.js.map +1 -1
- package/lib-commonjs/E2E/ButtonExperimental/specs/ButtonExperimental.spec.win.js +3 -3
- package/lib-commonjs/E2E/ButtonExperimental/specs/ButtonExperimental.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js +2 -2
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js +2 -2
- package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +2 -2
- package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
- package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +2 -2
- package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +1 -1
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +4 -4
- package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Menu/pages/MenuPageObject.js +2 -2
- package/lib-commonjs/E2E/Menu/pages/MenuPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.js +73 -209
- package/lib-commonjs/E2E/Menu/specs/Menu.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js +1 -1
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js +4 -4
- package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.js +1 -1
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.js.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js +2 -2
- package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Switch/pages/SwitchPageObject.js +2 -2
- package/lib-commonjs/E2E/Switch/pages/SwitchPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Switch/specs/Switch.spec.win.js +5 -5
- package/lib-commonjs/E2E/Switch/specs/Switch.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.js +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js +4 -4
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/common/BasePage.d.ts +5 -2
- package/lib-commonjs/E2E/common/BasePage.d.ts.map +1 -1
- package/lib-commonjs/E2E/common/BasePage.js +152 -48
- package/lib-commonjs/E2E/common/BasePage.js.map +1 -1
- package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +0 -2
- package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +5 -12
- package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/common/consts.d.ts +58 -7
- package/lib-commonjs/E2E/common/consts.d.ts.map +1 -1
- package/lib-commonjs/FluentTester.js +1 -1
- package/lib-commonjs/FluentTester.js.map +1 -1
- package/lib-commonjs/TestComponents/Common/consts.d.ts +1 -0
- package/lib-commonjs/TestComponents/Common/consts.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Common/consts.js +3 -1
- package/lib-commonjs/TestComponents/Common/consts.js.map +1 -1
- package/lib-commonjs/TestComponents/Dropdown/DropdownTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Dropdown/DropdownTest.js +1 -0
- package/lib-commonjs/TestComponents/Dropdown/DropdownTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Menu/E2EMenuTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Menu/E2EMenuTest.js +12 -9
- package/lib-commonjs/TestComponents/Menu/E2EMenuTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Menu/consts.d.ts +1 -0
- package/lib-commonjs/TestComponents/Menu/consts.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Menu/consts.js +2 -1
- package/lib-commonjs/TestComponents/Menu/consts.js.map +1 -1
- package/lib-commonjs/TestComponents/Test.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Test.js +8 -1
- package/lib-commonjs/TestComponents/Test.js.map +1 -1
- package/package.json +2 -2
- package/src/E2E/Button/pages/ButtonPageObject.ts +1 -1
- package/src/E2E/Button/specs/Button.spec.win.ts +3 -3
- package/src/E2E/ButtonExperimental/pages/ButtonExperimentalPageObject.ts +1 -1
- package/src/E2E/ButtonExperimental/specs/ButtonExperimental.spec.win.ts +3 -3
- package/src/E2E/Checkbox/pages/CheckboxPageObject.ts +2 -2
- package/src/E2E/Checkbox/specs/Checkbox.spec.win.ts +2 -2
- package/src/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.ts +2 -2
- package/src/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.ts +2 -2
- package/src/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.ts +1 -1
- package/src/E2E/ContextualMenu/specs/ContextualMenu.spec.win.ts +4 -4
- package/src/E2E/Menu/pages/MenuPageObject.ts +2 -2
- package/src/E2E/Menu/specs/Menu.spec.win.ts +24 -69
- package/src/E2E/MenuButton/pages/MenuButtonPageObject.win.ts +1 -1
- package/src/E2E/MenuButton/specs/MenuButton.spec.win.ts +4 -4
- package/src/E2E/RadioGroup/pages/RadioGroupPageObject.ts +1 -1
- package/src/E2E/RadioGroup/specs/RadioGroup.spec.win.ts +2 -2
- package/src/E2E/Switch/pages/SwitchPageObject.ts +2 -2
- package/src/E2E/Switch/specs/Switch.spec.win.ts +5 -5
- package/src/E2E/Tabs/pages/TabsPageObject.ts +1 -1
- package/src/E2E/Tabs/specs/Tabs.spec.win.ts +4 -4
- package/src/E2E/common/BasePage.ts +92 -21
- package/src/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.ts +6 -11
- package/src/E2E/common/consts.ts +60 -7
- package/src/FluentTester.tsx +2 -2
- package/src/TestComponents/Common/consts.ts +3 -0
- package/src/TestComponents/Dropdown/DropdownTest.tsx +2 -1
- package/src/TestComponents/Menu/E2EMenuTest.tsx +21 -17
- package/src/TestComponents/Menu/consts.ts +2 -0
- package/src/TestComponents/Test.tsx +10 -1
- package/wdio.conf.ios.js +5 -2
- package/wdio.conf.macos.js +3 -0
- package/wdio.conf.windows.js +3 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Keys } from './consts';
|
|
2
|
+
import { TESTPAGE_BUTTONS_SCROLLVIEWER } from '../../TestComponents/Common/consts';
|
|
3
|
+
|
|
1
4
|
const DUMMY_CHAR = '';
|
|
2
5
|
export const COMPONENT_SCROLL_COORDINATES = { x: -0, y: -100 }; // These are the offsets. Y is negative because we want the touch to move up (and thus it scrolls down)
|
|
3
6
|
|
|
@@ -66,19 +69,43 @@ export class BasePage {
|
|
|
66
69
|
/* Scrolls until the desired test page's button is displayed. We use the scroll viewer UI element as the point to start scrolling.
|
|
67
70
|
* We use a negative number as the Y-coordinate because that enables us to scroll downwards */
|
|
68
71
|
async scrollToComponentButton(platform: Platform): Promise<void> {
|
|
72
|
+
if (await (await this._pageButton).isDisplayed()) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const errorMsg =
|
|
77
|
+
'Could not scroll to the ' + this._pageName + "'s Button. Please see Pipeline artifacts for more debugging information.";
|
|
78
|
+
|
|
69
79
|
switch (platform) {
|
|
70
|
-
case Platform.Win32:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
case Platform.Win32: {
|
|
81
|
+
const scrollDownKeys = [Keys.PAGE_DOWN];
|
|
82
|
+
await browser.waitUntil(
|
|
83
|
+
async () => {
|
|
84
|
+
await (await this._firstTestPageButton).addValue(scrollDownKeys);
|
|
85
|
+
scrollDownKeys.push(Keys.PAGE_DOWN);
|
|
86
|
+
return await (await this._pageButton).isDisplayed();
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
timeout: this.waitForUiEvent,
|
|
90
|
+
timeoutMsg: errorMsg,
|
|
91
|
+
},
|
|
92
|
+
);
|
|
75
93
|
break;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
case Platform.iOS: {
|
|
97
|
+
await browser.waitUntil(
|
|
98
|
+
async () => {
|
|
99
|
+
await driver.execute('mobile: scroll', { direction: 'down' });
|
|
100
|
+
return await (await this._pageButton).isDisplayed();
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
timeout: this.waitForUiEvent,
|
|
104
|
+
timeoutMsg: errorMsg,
|
|
105
|
+
},
|
|
106
|
+
);
|
|
81
107
|
break;
|
|
108
|
+
}
|
|
82
109
|
|
|
83
110
|
case Platform.macOS:
|
|
84
111
|
// Not needed for macOS. It automatically scrolls
|
|
@@ -94,7 +121,7 @@ export class BasePage {
|
|
|
94
121
|
/* Waits for the test page to load. If the test page doesn't load before the timeout, it causes the test to fail. */
|
|
95
122
|
async waitForPageDisplayed(timeout?: number): Promise<void> {
|
|
96
123
|
await browser.waitUntil(async () => await this.isPageLoaded(), {
|
|
97
|
-
timeout: timeout ?? this.
|
|
124
|
+
timeout: timeout ?? this.waitForUiEvent,
|
|
98
125
|
timeoutMsg: this._pageName + ' did not render correctly. Please see /errorShots for more information.',
|
|
99
126
|
interval: 1500,
|
|
100
127
|
});
|
|
@@ -103,7 +130,7 @@ export class BasePage {
|
|
|
103
130
|
/* Waits for the test page's button to be displayed. If the button doesn't load before the timeout, it causes the test to fail. */
|
|
104
131
|
async waitForButtonDisplayed(timeout?: number): Promise<void> {
|
|
105
132
|
await browser.waitUntil(async () => await this.isButtonInView(), {
|
|
106
|
-
timeout: timeout ?? this.
|
|
133
|
+
timeout: timeout ?? this.waitForUiEvent,
|
|
107
134
|
timeoutMsg: 'Could not find the button to navigate to ' + this._pageName + '. Please see /errorShots for more information.',
|
|
108
135
|
interval: 1500,
|
|
109
136
|
});
|
|
@@ -112,27 +139,47 @@ export class BasePage {
|
|
|
112
139
|
/* Waits for the primary UI test element to be displayed. If the element doesn't load before the timeout, it causes the test to fail. */
|
|
113
140
|
async waitForPrimaryElementDisplayed(timeout?: number): Promise<void> {
|
|
114
141
|
await browser.waitUntil(async () => await this._primaryComponent.isDisplayed(), {
|
|
115
|
-
timeout: timeout ?? this.
|
|
142
|
+
timeout: timeout ?? this.waitForUiEvent,
|
|
116
143
|
timeoutMsg:
|
|
117
144
|
'The primary UI element for testing did not display correctly. Please see /errorShots of the first failed test for more information.',
|
|
118
145
|
interval: 1500,
|
|
119
146
|
});
|
|
120
147
|
}
|
|
121
148
|
|
|
122
|
-
/* Scrolls to the primary UI test element until it is displayed.
|
|
123
|
-
async scrollToTestElement(): Promise<void> {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
149
|
+
/* Scrolls to the primary UI test element until it is displayed. */
|
|
150
|
+
async scrollToTestElement(component?: WebdriverIO.Element): Promise<void> {
|
|
151
|
+
const ComponentToScrollTo = component ?? (await this._primaryComponent);
|
|
152
|
+
if (await ComponentToScrollTo.isDisplayed()) {
|
|
153
|
+
return;
|
|
127
154
|
}
|
|
128
|
-
|
|
155
|
+
|
|
156
|
+
// This button is at the top of every test page. It allows us to put focus in the test page pane so we can type PageDown
|
|
157
|
+
const FocusButton = await By('Focus_Button');
|
|
158
|
+
const scrollDownKeys = [Keys.PAGE_DOWN];
|
|
159
|
+
await browser.waitUntil(
|
|
160
|
+
async () => {
|
|
161
|
+
await FocusButton.addValue(scrollDownKeys);
|
|
162
|
+
scrollDownKeys.push(Keys.PAGE_DOWN);
|
|
163
|
+
return await ComponentToScrollTo.isDisplayed();
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
timeout: 30000,
|
|
167
|
+
timeoutMsg:
|
|
168
|
+
'Could not scroll to the ' +
|
|
169
|
+
this._pageName +
|
|
170
|
+
"'s main test element. Please see Pipeline artifacts for more debugging information.",
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
// We have this extra scroll here to ensure the whole component is visible.
|
|
175
|
+
await FocusButton.addValue(scrollDownKeys);
|
|
129
176
|
}
|
|
130
177
|
|
|
131
178
|
/* A method that allows the caller to pass in a condition. A wrapper for waitUntil(). Once testing becomes more extensive,
|
|
132
179
|
* this will allow cleaner code within all the Page Objects. */
|
|
133
180
|
async waitForCondition(condition?: () => Promise<boolean>, errorMsg?: string, timeout?: number): Promise<void> {
|
|
134
181
|
await browser.waitUntil(async () => await condition(), {
|
|
135
|
-
timeout: timeout ?? this.
|
|
182
|
+
timeout: timeout ?? this.waitForUiEvent,
|
|
136
183
|
timeoutMsg: errorMsg ?? 'Error. Please see /errorShots and logs for more information.',
|
|
137
184
|
interval: 1000,
|
|
138
185
|
});
|
|
@@ -156,6 +203,21 @@ export class BasePage {
|
|
|
156
203
|
return windowHandles.length > 1;
|
|
157
204
|
}
|
|
158
205
|
|
|
206
|
+
/* Finds the first test page button in the ScrollView */
|
|
207
|
+
async SetFirstScrollViewButtonChild() {
|
|
208
|
+
const TestChildren = await (await this._testPageButtonScrollViewer).$$('//*');
|
|
209
|
+
const reg = new RegExp('Homepage_[a-zA-Z]*_Button');
|
|
210
|
+
|
|
211
|
+
for (const child of TestChildren) {
|
|
212
|
+
const autoId = await child.getAttribute('AutomationId');
|
|
213
|
+
if (autoId && autoId !== TESTPAGE_BUTTONS_SCROLLVIEWER && autoId.match(reg)) {
|
|
214
|
+
return await child;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
|
|
159
221
|
/*****************************************/
|
|
160
222
|
/**************** Getters ****************/
|
|
161
223
|
/*****************************************/
|
|
@@ -197,6 +259,15 @@ export class BasePage {
|
|
|
197
259
|
return DUMMY_CHAR;
|
|
198
260
|
}
|
|
199
261
|
|
|
262
|
+
// The scrollviewer containing the list of buttons to navigate to each test page
|
|
263
|
+
get _testPageButtonScrollViewer() {
|
|
264
|
+
return By(TESTPAGE_BUTTONS_SCROLLVIEWER);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
get _firstTestPageButton() {
|
|
268
|
+
return this.SetFirstScrollViewButtonChild();
|
|
269
|
+
}
|
|
270
|
+
|
|
200
271
|
/****************** Error Messages ******************/
|
|
201
272
|
get ERRORMESSAGE_SUFFIX(): string {
|
|
202
273
|
return 'Please review logs and error screenshots for more information.';
|
|
@@ -215,5 +286,5 @@ export class BasePage {
|
|
|
215
286
|
}
|
|
216
287
|
|
|
217
288
|
// Default timeout to wait until page is displayed (10s)
|
|
218
|
-
|
|
289
|
+
waitForUiEvent: number = 25000;
|
|
219
290
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { BasePage
|
|
2
|
-
|
|
3
|
-
const ScrollViewTestId = 'SCROLLVIEW_TEST_ID';
|
|
1
|
+
import { BasePage } from '../../../common/BasePage';
|
|
2
|
+
import { TESTPAGE_BUTTONS_SCROLLVIEWER } from '../../../../TestComponents/Common/consts';
|
|
4
3
|
|
|
5
4
|
class NativeTestingPageObject extends BasePage {
|
|
6
5
|
async waitForScrollViewDisplayed(timeout?: number): Promise<void> {
|
|
7
6
|
await browser.waitUntil(async () => await this.doesScrollViewParentExist(), {
|
|
8
|
-
timeout: timeout ?? this.
|
|
7
|
+
timeout: timeout ?? this.waitForUiEvent,
|
|
9
8
|
timeoutMsg:
|
|
10
9
|
'For testing purposes we require that the root view contains a non-empty, immutable ScrollView of buttons that navigate to test pages.',
|
|
11
10
|
interval: 1000,
|
|
@@ -13,14 +12,14 @@ class NativeTestingPageObject extends BasePage {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
async doesScrollViewParentExist(): Promise<boolean> {
|
|
16
|
-
return await this.
|
|
15
|
+
return await this._testPageButtonScrollViewer.isDisplayed();
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
/* Validate the Children of the ScrollView stay intact. The children are the buttons that
|
|
20
19
|
* navigate to each test page. Also, validate these children exist with the proper testId format */
|
|
21
20
|
async validateScrollViewChildren(): Promise<boolean> {
|
|
22
21
|
// Gets all the children
|
|
23
|
-
const testChildren = await this.
|
|
22
|
+
const testChildren = await this._testPageButtonScrollViewer.$$('//*');
|
|
24
23
|
let foundValidButton = false;
|
|
25
24
|
|
|
26
25
|
// Ensure the testID (maps 1:1 to automationId) properties of the button children match the defined testing format
|
|
@@ -30,7 +29,7 @@ class NativeTestingPageObject extends BasePage {
|
|
|
30
29
|
// If automationId is found in the wrong format, return false.
|
|
31
30
|
for await (const child of testChildren) {
|
|
32
31
|
const autoId = await child.getAttribute('AutomationId');
|
|
33
|
-
if (autoId && autoId !==
|
|
32
|
+
if (autoId && autoId !== TESTPAGE_BUTTONS_SCROLLVIEWER) {
|
|
34
33
|
if (autoId.match(reg)) {
|
|
35
34
|
foundValidButton = true;
|
|
36
35
|
} else {
|
|
@@ -42,10 +41,6 @@ class NativeTestingPageObject extends BasePage {
|
|
|
42
41
|
|
|
43
42
|
return foundValidButton;
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
get _scrollViewParent() {
|
|
47
|
-
return By(ScrollViewTestId);
|
|
48
|
-
}
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
export default new NativeTestingPageObject();
|
package/src/E2E/common/consts.ts
CHANGED
|
@@ -18,11 +18,64 @@ export const PAGE_TIMEOUT = 15000;
|
|
|
18
18
|
|
|
19
19
|
/* Keyboard Key Constants */
|
|
20
20
|
export const enum Keys {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
NULL = '\uE000',
|
|
22
|
+
CANCEL = '\uE001', // ^break
|
|
23
|
+
HELP = '\uE002',
|
|
24
|
+
BACK_SPACE = '\uE003',
|
|
25
|
+
TAB = '\uE004',
|
|
26
|
+
CLEAR = '\uE005',
|
|
27
|
+
RETURN = '\uE006',
|
|
28
|
+
ENTER = '\uE007',
|
|
29
|
+
SHIFT = '\uE008',
|
|
30
|
+
CONTROL = '\uE009',
|
|
31
|
+
ALT = '\uE00A',
|
|
32
|
+
PAUSE = '\uE00B',
|
|
33
|
+
ESCAPE = '\uE00C',
|
|
34
|
+
SPACE = '\uE00D',
|
|
35
|
+
PAGE_UP = '\uE00E',
|
|
36
|
+
PAGE_DOWN = '\uE00F',
|
|
37
|
+
END = '\uE010',
|
|
38
|
+
HOME = '\uE011',
|
|
39
|
+
ARROW_LEFT = '\uE012',
|
|
40
|
+
LEFT = '\uE012',
|
|
41
|
+
ARROW_UP = '\uE013',
|
|
42
|
+
UP = '\uE013',
|
|
43
|
+
ARROW_RIGHT = '\uE014',
|
|
44
|
+
RIGHT = '\uE014',
|
|
45
|
+
ARROW_DOWN = '\uE015',
|
|
46
|
+
DOWN = '\uE015',
|
|
47
|
+
INSERT = '\uE016',
|
|
48
|
+
DELETE = '\uE017',
|
|
49
|
+
SEMICOLON = '\uE018',
|
|
50
|
+
EQUALS = '\uE019',
|
|
51
|
+
|
|
52
|
+
NUMPAD0 = '\uE01A', // number pad keys
|
|
53
|
+
NUMPAD1 = '\uE01B',
|
|
54
|
+
NUMPAD2 = '\uE01C',
|
|
55
|
+
NUMPAD3 = '\uE01D',
|
|
56
|
+
NUMPAD4 = '\uE01E',
|
|
57
|
+
NUMPAD5 = '\uE01F',
|
|
58
|
+
NUMPAD6 = '\uE020',
|
|
59
|
+
NUMPAD7 = '\uE021',
|
|
60
|
+
NUMPAD8 = '\uE022',
|
|
61
|
+
NUMPAD9 = '\uE023',
|
|
62
|
+
MULTIPLY = '\uE024',
|
|
63
|
+
ADD = '\uE025',
|
|
64
|
+
SEPARATOR = '\uE026',
|
|
65
|
+
SUBTRACT = '\uE027',
|
|
66
|
+
DECIMAL = '\uE028',
|
|
67
|
+
DIVIDE = '\uE029',
|
|
68
|
+
|
|
69
|
+
F1 = '\uE031', // function keys
|
|
70
|
+
F2 = '\uE032',
|
|
71
|
+
F3 = '\uE033',
|
|
72
|
+
F4 = '\uE034',
|
|
73
|
+
F5 = '\uE035',
|
|
74
|
+
F6 = '\uE036',
|
|
75
|
+
F7 = '\uE037',
|
|
76
|
+
F8 = '\uE038',
|
|
77
|
+
F9 = '\uE039',
|
|
78
|
+
F10 = '\uE03A',
|
|
79
|
+
F11 = '\uE03B',
|
|
80
|
+
F12 = '\uE03C',
|
|
28
81
|
}
|
package/src/FluentTester.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
|
4
4
|
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ScrollView, View, Text as RNText, Platform, SafeAreaView, BackHandler } from 'react-native';
|
|
7
|
-
import { BASE_TESTPAGE } from './TestComponents/Common/consts';
|
|
7
|
+
import { BASE_TESTPAGE, TESTPAGE_BUTTONS_SCROLLVIEWER } from './TestComponents/Common/consts';
|
|
8
8
|
import { commonTestStyles, fluentTesterStyles, mobileStyles } from './TestComponents/Common/styles';
|
|
9
9
|
import { useTheme } from '@fluentui-react-native/theme-types';
|
|
10
10
|
import { ThemePickers } from './theme/ThemePickers';
|
|
@@ -136,7 +136,7 @@ export const FluentTester: React.FunctionComponent<FluentTesterProps> = (props:
|
|
|
136
136
|
const TestList: React.FunctionComponent = () => {
|
|
137
137
|
return (
|
|
138
138
|
<View style={fluentTesterStyles.testList}>
|
|
139
|
-
<ScrollView contentContainerStyle={fluentTesterStyles.testListContainerStyle} testID=
|
|
139
|
+
<ScrollView contentContainerStyle={fluentTesterStyles.testListContainerStyle} testID={TESTPAGE_BUTTONS_SCROLLVIEWER}>
|
|
140
140
|
{sortedTestComponents.map((description, index) => {
|
|
141
141
|
return (
|
|
142
142
|
<Button
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Option } from '@fluentui-react-native/dropdown';
|
|
2
|
+
import { Option, Dropdown } from '@fluentui-react-native/dropdown';
|
|
3
3
|
import { Stack } from '@fluentui-react-native/stack';
|
|
4
4
|
import { stackStyle } from '../Common/styles';
|
|
5
5
|
import { DROPDOWN_TESTPAGE } from './consts';
|
|
@@ -8,6 +8,7 @@ import { Test, TestSection, PlatformStatus } from '../Test';
|
|
|
8
8
|
const DropdownDefault: React.FunctionComponent = () => {
|
|
9
9
|
return (
|
|
10
10
|
<Stack style={stackStyle}>
|
|
11
|
+
<Dropdown />
|
|
11
12
|
<Option>Test</Option>
|
|
12
13
|
<Option disabled>Disabled Test</Option>
|
|
13
14
|
</Stack>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
2
3
|
import { Stack } from '@fluentui-react-native/stack';
|
|
3
4
|
import { stackStyle } from '../Common/styles';
|
|
4
|
-
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
5
|
+
import { ButtonV1 as Button, ButtonV1 } from '@fluentui-react-native/button';
|
|
5
6
|
import { TextV1 as Text } from '@fluentui-react-native/text';
|
|
6
7
|
import { Menu, MenuItem, MenuList, MenuPopover, MenuTrigger } from '@fluentui-react-native/menu';
|
|
7
8
|
import {
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
MENU_ON_OPEN,
|
|
14
15
|
MENUITEM_TEST_COMPONENT,
|
|
15
16
|
MENUPOPOVER_TEST_COMPONENT,
|
|
17
|
+
MENU_DEFOCUS_BUTTON,
|
|
16
18
|
} from './consts';
|
|
17
19
|
|
|
18
20
|
export const E2EMenuTest: React.FunctionComponent = () => {
|
|
@@ -27,22 +29,24 @@ export const E2EMenuTest: React.FunctionComponent = () => {
|
|
|
27
29
|
|
|
28
30
|
return (
|
|
29
31
|
<Stack style={stackStyle}>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
<View style={{ flexDirection: 'row' }}>
|
|
33
|
+
{menuOpened ? <Text testID={MENU_ON_OPEN}>Menu opened</Text> : <Text testID={MENU_ON_CLOSE}>Menu closed</Text>}
|
|
34
|
+
<ButtonV1 testID={MENU_DEFOCUS_BUTTON}>Defocus Button</ButtonV1>
|
|
35
|
+
<Menu open={menuOpened} onOpenChange={onOpenChange}>
|
|
36
|
+
<MenuTrigger>
|
|
37
|
+
<Button testID={MENUTRIGGER_TEST_COMPONENT}>Test</Button>
|
|
38
|
+
</MenuTrigger>
|
|
39
|
+
<MenuPopover testID={MENUPOPOVER_TEST_COMPONENT}>
|
|
40
|
+
<MenuList>
|
|
41
|
+
<MenuItem testID={MENUITEM_TEST_COMPONENT} accessibilityLabel={MENUITEM_ACCESSIBILITY_LABEL}>
|
|
42
|
+
A plain MenuItem
|
|
43
|
+
</MenuItem>
|
|
44
|
+
<MenuItem disabled>A second disabled plain MenuItem</MenuItem>
|
|
45
|
+
<MenuItem testID={MENUITEM_NO_A11Y_LABEL_COMPONENT}>{MENUITEM_TEST_LABEL}</MenuItem>
|
|
46
|
+
</MenuList>
|
|
47
|
+
</MenuPopover>
|
|
48
|
+
</Menu>
|
|
49
|
+
</View>
|
|
46
50
|
</Stack>
|
|
47
51
|
);
|
|
48
52
|
};
|
|
@@ -14,3 +14,5 @@ export const MENUITEM_TEST_LABEL = 'Test MenuItem2 - No Accessibility Label'; //
|
|
|
14
14
|
|
|
15
15
|
export const MENU_ON_OPEN = 'Menu_On_Open'; // For testing the open functionality of Menu
|
|
16
16
|
export const MENU_ON_CLOSE = 'Menu_On_Close'; // For testing the open functionality of Menu
|
|
17
|
+
|
|
18
|
+
export const MENU_DEFOCUS_BUTTON = 'Menu_Defocus_Button'; // Used to move focus away from menu button
|
|
@@ -6,6 +6,7 @@ import { stackStyle } from './Common/styles';
|
|
|
6
6
|
import { useTheme } from '@fluentui-react-native/theme-types';
|
|
7
7
|
import Svg, { G, Path, SvgProps } from 'react-native-svg';
|
|
8
8
|
import { SvgIconProps } from '@fluentui-react-native/icon';
|
|
9
|
+
import { Button } from '@fluentui-react-native/experimental-button';
|
|
9
10
|
|
|
10
11
|
export type TestSection = {
|
|
11
12
|
name: string;
|
|
@@ -70,6 +71,11 @@ const styles = StyleSheet.create({
|
|
|
70
71
|
status: {
|
|
71
72
|
fontWeight: 'normal',
|
|
72
73
|
},
|
|
74
|
+
// This button is only for our E2E testing framework. We want to be able to put keyboard focus in any test page if we need it.
|
|
75
|
+
// This button will be at the top of every test page and allows us to do that. But we don't want partners to see it.
|
|
76
|
+
e2eFocusButton: {
|
|
77
|
+
opacity: 0,
|
|
78
|
+
},
|
|
73
79
|
});
|
|
74
80
|
|
|
75
81
|
export const Test = (props: TestProps): React.ReactElement<Record<string, never>> => {
|
|
@@ -107,11 +113,14 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
|
|
|
107
113
|
const toggleIconProps = Platform.OS === 'windows' ? { fontSource: fontIconProps } : { svgSource: svgProps, width: 12, height: 12 };
|
|
108
114
|
|
|
109
115
|
return (
|
|
110
|
-
<View
|
|
116
|
+
<View>
|
|
111
117
|
<View style={styles.header}>
|
|
112
118
|
<Text style={styles.name} variant="heroSemibold">
|
|
113
119
|
{props.name}
|
|
114
120
|
</Text>
|
|
121
|
+
<Button testID="Focus_Button" style={styles.e2eFocusButton}>
|
|
122
|
+
E2E Testing Button
|
|
123
|
+
</Button>
|
|
115
124
|
{props.spec && <Link url={props.spec} content="SPEC" />}
|
|
116
125
|
</View>
|
|
117
126
|
<Separator />
|
package/wdio.conf.ios.js
CHANGED
|
@@ -7,7 +7,7 @@ const jasmineDefaultTimeout = 60000; // 60 seconds for Jasmine test timeout
|
|
|
7
7
|
exports.config = {
|
|
8
8
|
runner: 'local', // Where should your test be launched
|
|
9
9
|
specs: ['src/E2E/**/specs/*.ios.ts'],
|
|
10
|
-
exclude: [
|
|
10
|
+
exclude: [],
|
|
11
11
|
|
|
12
12
|
maxInstances: 30,
|
|
13
13
|
capabilities: [
|
|
@@ -137,6 +137,9 @@ exports.config = {
|
|
|
137
137
|
* Function to be executed after a test (in Mocha/Jasmine).
|
|
138
138
|
*/
|
|
139
139
|
afterTest: function (test, context, results) {
|
|
140
|
+
const resultString = results.passed ? 'Passed' : 'Failed';
|
|
141
|
+
console.log('\n Test Case: ' + test.description + '. Result: ' + resultString + '\n');
|
|
142
|
+
|
|
140
143
|
// if test passed, ignore, else take and save screenshot. Unless it's the first test that boots the app,
|
|
141
144
|
// it may be useful to have a screenshot of the app on load.
|
|
142
145
|
if (results.passed) {
|
|
@@ -203,4 +206,4 @@ exports.config = {
|
|
|
203
206
|
*/
|
|
204
207
|
//onReload: function(oldSessionId, newSessionId) {
|
|
205
208
|
//}
|
|
206
|
-
};
|
|
209
|
+
};
|
package/wdio.conf.macos.js
CHANGED
|
@@ -154,6 +154,9 @@ exports.config = {
|
|
|
154
154
|
* Function to be executed after a test (in Mocha/Jasmine).
|
|
155
155
|
*/
|
|
156
156
|
afterTest: function (test, context, results) {
|
|
157
|
+
const resultString = results.passed ? 'Passed' : 'Failed';
|
|
158
|
+
console.log('\n Test Case: ' + test.description + '. Result: ' + resultString + '\n');
|
|
159
|
+
|
|
157
160
|
// if test passed, ignore, else take and save screenshot. Unless it's the first test that boots the app,
|
|
158
161
|
// it may be useful to have a screenshot of the app on load.
|
|
159
162
|
if (results.passed) {
|
package/wdio.conf.windows.js
CHANGED
|
@@ -159,6 +159,9 @@ exports.config = {
|
|
|
159
159
|
* Function to be executed after a test (in Mocha/Jasmine).
|
|
160
160
|
*/
|
|
161
161
|
afterTest: function (test, context, results) {
|
|
162
|
+
const resultString = results.passed ? 'Passed' : 'Failed';
|
|
163
|
+
console.log('\n Test Case: ' + test.description + '. Result: ' + resultString + '\n');
|
|
164
|
+
|
|
162
165
|
// if test passed, ignore, else take and save screenshot.
|
|
163
166
|
if (results.passed) {
|
|
164
167
|
return;
|