@fluentui-react-native/tester 0.51.5 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +136 -1
- package/CHANGELOG.md +30 -2
- package/lib/E2E/Button/pages/ButtonPageObject.d.ts +5 -0
- package/lib/E2E/Button/pages/ButtonPageObject.d.ts.map +1 -1
- package/lib/E2E/Button/pages/ButtonPageObject.js +11 -0
- 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/Checkbox/pages/CheckboxPageObject.d.ts +5 -0
- package/lib/E2E/Checkbox/pages/CheckboxPageObject.d.ts.map +1 -1
- package/lib/E2E/Checkbox/pages/CheckboxPageObject.js +11 -0
- 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/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts +12 -0
- package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts.map +1 -1
- package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +41 -1
- package/lib/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
- package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +24 -2
- package/lib/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts +12 -0
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts.map +1 -1
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js +39 -1
- package/lib/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
- package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js +27 -4
- package/lib/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js +3 -3
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js.map +1 -1
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts +13 -3
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts.map +1 -1
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.js +61 -11
- package/lib/E2E/RadioGroup/pages/RadioGroupPageObject.win.js.map +1 -1
- package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js +36 -12
- package/lib/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
- package/lib/E2E/Tabs/pages/TabsPageObject.macos.js +2 -2
- package/lib/E2E/Tabs/pages/TabsPageObject.macos.js.map +1 -1
- package/lib/E2E/Tabs/pages/TabsPageObject.win.d.ts +18 -3
- package/lib/E2E/Tabs/pages/TabsPageObject.win.d.ts.map +1 -1
- package/lib/E2E/Tabs/pages/TabsPageObject.win.js +86 -8
- package/lib/E2E/Tabs/pages/TabsPageObject.win.js.map +1 -1
- package/lib/E2E/Tabs/specs/Tabs.spec.win.js +35 -2
- package/lib/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
- package/lib/E2E/Tabs/specs/Tabs.spec.windows.d.ts +2 -0
- package/lib/E2E/Tabs/specs/Tabs.spec.windows.d.ts.map +1 -0
- package/lib/E2E/Tabs/specs/Tabs.spec.windows.js +66 -0
- package/lib/E2E/Tabs/specs/Tabs.spec.windows.js.map +1 -0
- package/lib/E2E/common/BasePage.win.d.ts +0 -1
- package/lib/E2E/common/BasePage.win.d.ts.map +1 -1
- package/lib/E2E/common/BasePage.win.js +0 -7
- package/lib/E2E/common/BasePage.win.js.map +1 -1
- package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +2 -2
- package/lib/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
- package/lib/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/MenuButton/consts.js +3 -2
- package/lib/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
- package/lib/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/MenuButton/testData.js +2 -0
- package/lib/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
- package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +6 -6
- package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
- package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
- package/lib/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/RadioGroup/consts.js +17 -9
- package/lib/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
- package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js +8 -8
- package/lib/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
- package/lib/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Tabs/consts.js +13 -8
- package/lib/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts +5 -0
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.d.ts.map +1 -1
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js +11 -0
- package/lib-commonjs/E2E/Button/pages/ButtonPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Button/specs/Button.spec.win.js +2 -2
- package/lib-commonjs/E2E/Button/specs/Button.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts +5 -0
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.d.ts.map +1 -1
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js +11 -0
- package/lib-commonjs/E2E/Checkbox/pages/CheckboxPageObject.js.map +1 -1
- package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js +1 -1
- package/lib-commonjs/E2E/Checkbox/specs/Checkbox.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts +12 -0
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js +40 -0
- package/lib-commonjs/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js +24 -2
- package/lib-commonjs/E2E/ContextualMenu/specs/ContextualMenu.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts +12 -0
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js +38 -0
- package/lib-commonjs/E2E/MenuButton/pages/MenuButtonPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js +27 -4
- package/lib-commonjs/E2E/MenuButton/specs/MenuButton.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js +2 -2
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.macos.js.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts +13 -3
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js +60 -10
- package/lib-commonjs/E2E/RadioGroup/pages/RadioGroupPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js +35 -11
- package/lib-commonjs/E2E/RadioGroup/specs/RadioGroup.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.macos.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts +18 -3
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js +85 -7
- package/lib-commonjs/E2E/Tabs/pages/TabsPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js +35 -2
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.win.js.map +1 -1
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts +2 -0
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.d.ts.map +1 -0
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js +69 -0
- package/lib-commonjs/E2E/Tabs/specs/Tabs.spec.windows.js.map +1 -0
- package/lib-commonjs/E2E/common/BasePage.win.d.ts +0 -1
- package/lib-commonjs/E2E/common/BasePage.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/common/BasePage.win.js +0 -7
- package/lib-commonjs/E2E/common/BasePage.win.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js +1 -1
- package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts +3 -2
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js +4 -3
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/consts.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js +2 -0
- package/lib-commonjs/FluentTester/TestComponents/MenuButton/testData.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js +5 -5
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts +12 -4
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js +18 -10
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/consts.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js +7 -7
- package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsE2ETest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts +8 -4
- package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js +14 -9
- package/lib-commonjs/FluentTester/TestComponents/Tabs/consts.js.map +1 -1
- package/package.json +21 -21
- package/src/E2E/Button/pages/ButtonPageObject.ts +19 -0
- package/src/E2E/Button/specs/Button.spec.win.ts +4 -8
- package/src/E2E/Checkbox/pages/CheckboxPageObject.ts +19 -0
- package/src/E2E/Checkbox/specs/Checkbox.spec.win.ts +3 -7
- package/src/E2E/ContextualMenu/pages/ContextualMenuPageObject.win.ts +49 -0
- package/src/E2E/ContextualMenu/specs/ContextualMenu.spec.win.ts +33 -4
- package/src/E2E/MenuButton/pages/MenuButtonPageObject.win.ts +46 -0
- package/src/E2E/MenuButton/specs/MenuButton.spec.win.ts +37 -6
- package/src/E2E/RadioGroup/pages/RadioGroupPageObject.macos.ts +4 -4
- package/src/E2E/RadioGroup/pages/RadioGroupPageObject.win.ts +70 -14
- package/src/E2E/RadioGroup/specs/RadioGroup.spec.win.ts +48 -14
- package/src/E2E/Tabs/pages/TabsPageObject.macos.ts +2 -2
- package/src/E2E/Tabs/pages/TabsPageObject.win.ts +90 -8
- package/src/E2E/Tabs/specs/Tabs.spec.win.ts +50 -4
- package/src/E2E/Tabs/specs/Tabs.spec.windows.ts +84 -0
- package/src/E2E/common/BasePage.win.ts +0 -8
- package/src/FluentTester/TestComponents/ContextualMenu/E2EContextualMenuTest.tsx +7 -2
- package/src/FluentTester/TestComponents/MenuButton/consts.ts +3 -2
- package/src/FluentTester/TestComponents/MenuButton/testData.ts +2 -0
- package/src/FluentTester/TestComponents/RadioGroup/RadioGroupE2ETest.tsx +14 -12
- package/src/FluentTester/TestComponents/RadioGroup/consts.ts +21 -11
- package/src/FluentTester/TestComponents/Tabs/TabsE2ETest.tsx +15 -11
- package/src/FluentTester/TestComponents/Tabs/consts.ts +16 -10
|
@@ -2,15 +2,22 @@ import {
|
|
|
2
2
|
RADIOGROUP_TESTPAGE,
|
|
3
3
|
RADIOGROUP_TEST_COMPONENT,
|
|
4
4
|
RADIOGROUP_NO_A11Y_LABEL_COMPONENT,
|
|
5
|
-
RADIOBUTTON_TEST_COMPONENT,
|
|
6
5
|
HOMEPAGE_RADIOGROUP_BUTTON,
|
|
7
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
return this._radioButton.getAttribute('Name');
|
|
29
|
+
return this.getRadioButton(radioButtonSelector).getAttribute('Name');
|
|
30
|
+
}
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
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.
|
|
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
|
-
|
|
62
|
-
|
|
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(
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
99
|
+
/* The first tab group has 3 Tab item headers, all listed below */
|
|
100
|
+
get _firstTabItem() {
|
|
101
|
+
return By(FIRST_TABS_ITEM);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
get _secondTabItem() {
|
|
105
|
+
return By(SECOND_TABS_ITEM);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get _thirdTabItem() {
|
|
109
|
+
return By(THIRD_TABS_ITEM);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Content shown when tab item is clicked */
|
|
113
|
+
get _firstTabItemContent() {
|
|
114
|
+
return By(FIRST_TABS_ITEM_CONTENT);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get _secondTabItemContent() {
|
|
118
|
+
return By(SECOND_TABS_ITEM_CONTENT);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
get _thirdTabItemContent() {
|
|
122
|
+
return By(THIRD_TABS_ITEM_CONTENT);
|
|
41
123
|
}
|
|
42
124
|
}
|
|
43
125
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import NavigateAppPage from '../../common/NavigateAppPage.win';
|
|
2
|
-
import TabsPageObject from '../pages/TabsPageObject.win';
|
|
3
|
-
import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE } from '../../common/consts';
|
|
2
|
+
import TabsPageObject, { TabItemSelector } from '../pages/TabsPageObject.win';
|
|
3
|
+
import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE, Keys } from '../../common/consts';
|
|
4
4
|
|
|
5
5
|
// Before testing begins, allow up to 60 seconds for app to open
|
|
6
6
|
describe('Tabs Testing Initialization', function () {
|
|
@@ -23,15 +23,61 @@ describe('Tabs Testing Initialization', function () {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
describe('Tabs Accessibility Testing', () => {
|
|
26
|
-
|
|
26
|
+
/* Scrolls and waits for the Tabs to be visible on the Test Page */
|
|
27
|
+
beforeEach(() => {
|
|
27
28
|
TabsPageObject.scrollToTestElement();
|
|
28
29
|
TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("Validate Tab's accessibilityRole is correct", () => {
|
|
29
33
|
expect(TabsPageObject.getAccessibilityRole()).toEqual(TAB_A11Y_ROLE);
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
it("Validate TabItem's accessibilityRole is correct", () => {
|
|
37
|
+
expect(TabsPageObject.getTabItemAccesibilityRole(TabItemSelector.First)).toEqual(TABITEM_A11Y_ROLE);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('Tabs Functional Tests', () => {
|
|
42
|
+
/* Scrolls and waits for the Tabs to be visible on the Test Page */
|
|
43
|
+
beforeEach(() => {
|
|
33
44
|
TabsPageObject.scrollToTestElement();
|
|
34
45
|
TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
35
|
-
|
|
46
|
+
|
|
47
|
+
// Reset the TabGroup by putting focus on First tab item
|
|
48
|
+
TabsPageObject.clickOnTabItem(TabItemSelector.First);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Click on the second tab header and validate the correct TabItem content is shown', () => {
|
|
52
|
+
TabsPageObject.clickOnTabItem(TabItemSelector.Second);
|
|
53
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
54
|
+
|
|
55
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('Keyboarding: Arrow Navigation: Right -> Down -> Left -> Up -> Validate the correct TabItem content is shown', () => {
|
|
59
|
+
/* At First tab element, press Right Arrow to navigate to the Second tab element */
|
|
60
|
+
TabsPageObject.sendKey(Keys.Right_Arrow, TabItemSelector.First);
|
|
61
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
62
|
+
|
|
63
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
64
|
+
|
|
65
|
+
/* At Second tab element, press Down Arrow to navigate to the Third tab element */
|
|
66
|
+
TabsPageObject.sendKey(Keys.Down_Arrow, TabItemSelector.Second);
|
|
67
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Third, PAGE_TIMEOUT);
|
|
68
|
+
|
|
69
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Third)).toBeTruthy();
|
|
70
|
+
|
|
71
|
+
/* At Third tab element, press Left Arrow to navigate to the Second tab element */
|
|
72
|
+
TabsPageObject.sendKey(Keys.Left_Arrow, TabItemSelector.Third);
|
|
73
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
74
|
+
|
|
75
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
76
|
+
|
|
77
|
+
/* At Second tab element, press Up Arrow to navigate to the First tab element */
|
|
78
|
+
TabsPageObject.sendKey(Keys.Up_Arrow, TabItemSelector.Second);
|
|
79
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.First, PAGE_TIMEOUT);
|
|
80
|
+
|
|
81
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.First)).toBeTruthy();
|
|
36
82
|
});
|
|
37
83
|
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import NavigateAppPage from '../../common/NavigateAppPage.win';
|
|
2
|
+
import TabsPageObject, { TabItemSelector } from '../pages/TabsPageObject.win';
|
|
3
|
+
import { TAB_A11Y_ROLE, BOOT_APP_TIMEOUT, PAGE_TIMEOUT, TABITEM_A11Y_ROLE } from '../../common/consts';
|
|
4
|
+
|
|
5
|
+
// Before testing begins, allow up to 60 seconds for app to open
|
|
6
|
+
describe('Tabs Testing Initialization', function () {
|
|
7
|
+
it('Wait for app load', () => {
|
|
8
|
+
NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
|
|
9
|
+
expect(NavigateAppPage.isPageLoaded()).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Click and navigate to Tabs test page', () => {
|
|
13
|
+
/* Scroll to component test page button in scrollview if not already visible*/
|
|
14
|
+
TabsPageObject.scrollToComponentButton();
|
|
15
|
+
TabsPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
|
|
16
|
+
|
|
17
|
+
/* Click on component button to navigate to test page */
|
|
18
|
+
NavigateAppPage.clickAndGoToTabsPage();
|
|
19
|
+
TabsPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
|
|
20
|
+
|
|
21
|
+
expect(TabsPageObject.isPageLoaded()).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('Tabs Accessibility Testing', () => {
|
|
26
|
+
/* Scrolls and waits for the Tabs to be visible on the Test Page */
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
TabsPageObject.scrollToTestElement();
|
|
29
|
+
TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("Validate Tab's accessibilityRole is correct", () => {
|
|
33
|
+
expect(TabsPageObject.getAccessibilityRole()).toEqual(TAB_A11Y_ROLE);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("Validate TabItem's accessibilityRole is correct", () => {
|
|
37
|
+
expect(TabsPageObject.getTabItemAccesibilityRole(TabItemSelector.First)).toEqual(TABITEM_A11Y_ROLE);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('Tabs Functional Tests', () => {
|
|
42
|
+
/* Scrolls and waits for the Tabs to be visible on the Test Page */
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
TabsPageObject.scrollToTestElement();
|
|
45
|
+
TabsPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
46
|
+
|
|
47
|
+
// Reset the TabGroup by putting focus on First tab item
|
|
48
|
+
TabsPageObject.clickOnTabItem(TabItemSelector.First);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Click on the second tab header and validate the correct TabItem content is shown', () => {
|
|
52
|
+
TabsPageObject.clickOnTabItem(TabItemSelector.Second);
|
|
53
|
+
TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
54
|
+
|
|
55
|
+
expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Keyboarding is currently not integrated for UWP tabs - Task #5758598
|
|
59
|
+
// it('Keyboarding: Arrow Navigation: Right -> Down -> Left -> Up -> Validate the correct TabItem content is shown', () => {
|
|
60
|
+
// /* At First tab element, press Right Arrow to navigate to the Second tab element */
|
|
61
|
+
// TabsPageObject.sendKey(Keys.Right_Arrow, TabItemSelector.First);
|
|
62
|
+
// TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
63
|
+
|
|
64
|
+
// expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
65
|
+
|
|
66
|
+
// /* At Second tab element, press Down Arrow to navigate to the Third tab element */
|
|
67
|
+
// TabsPageObject.sendKey(Keys.Down_Arrow, TabItemSelector.Second);
|
|
68
|
+
// TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Third, PAGE_TIMEOUT);
|
|
69
|
+
|
|
70
|
+
// expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Third)).toBeTruthy();
|
|
71
|
+
|
|
72
|
+
// /* At Third tab element, press Left Arrow to navigate to the Second tab element */
|
|
73
|
+
// TabsPageObject.sendKey(Keys.Left_Arrow, TabItemSelector.Third);
|
|
74
|
+
// TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.Second, PAGE_TIMEOUT);
|
|
75
|
+
|
|
76
|
+
// expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.Second)).toBeTruthy();
|
|
77
|
+
|
|
78
|
+
// /* At Second tab element, press Up Arrow to navigate to the First tab element */
|
|
79
|
+
// TabsPageObject.sendKey(Keys.Up_Arrow, TabItemSelector.Second);
|
|
80
|
+
// TabsPageObject.waitForTabsItemsToOpen(TabItemSelector.First, PAGE_TIMEOUT);
|
|
81
|
+
|
|
82
|
+
// expect(TabsPageObject.didTabItemContentLoad(TabItemSelector.First)).toBeTruthy();
|
|
83
|
+
// });
|
|
84
|
+
});
|
|
@@ -56,14 +56,6 @@ export class BasePage {
|
|
|
56
56
|
this._primaryComponent.click();
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/* ****TODO****: I need to better use the ComponentSelector for this. We shouldn't have the spec needing to import the constant string */
|
|
60
|
-
sendKey(componentID?: string, key?: string): void {
|
|
61
|
-
const component = By(componentID);
|
|
62
|
-
if (component.isDisplayed()) {
|
|
63
|
-
component.addValue(key); // Adding a value sends the key on that component
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
59
|
/* Scrolls until the desired test page's button is displayed. We use the scroll viewer UI element as the point to start scrolling.
|
|
68
60
|
* We use a negative number as the Y-coordinate because that enables us to scroll downwards */
|
|
69
61
|
scrollToComponentButton(): void {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Text, View, Switch } from 'react-native';
|
|
4
4
|
import { Button, ContextualMenu, ContextualMenuItem, Separator } from '@fluentui/react-native';
|
|
5
|
-
import { CONTEXTUALMENUITEM_TEST_COMPONENT } from './consts';
|
|
5
|
+
import { CONTEXTUALMENUITEM_TEST_COMPONENT, CONTEXTUALMENU_TEST_COMPONENT } from './consts';
|
|
6
6
|
|
|
7
7
|
export const E2EContextualMenuTest: React.FunctionComponent = () => {
|
|
8
8
|
const stdBtnRef = React.useRef(null);
|
|
@@ -75,7 +75,12 @@ export const E2EContextualMenuTest: React.FunctionComponent = () => {
|
|
|
75
75
|
<Text style={{ color: 'blue' }}>none</Text>
|
|
76
76
|
)}
|
|
77
77
|
</Text>
|
|
78
|
-
<Button
|
|
78
|
+
<Button
|
|
79
|
+
content="Press for ContextualMenu"
|
|
80
|
+
onClick={toggleShowContextualMenu}
|
|
81
|
+
componentRef={stdBtnRef}
|
|
82
|
+
testID={CONTEXTUALMENU_TEST_COMPONENT}
|
|
83
|
+
/>
|
|
79
84
|
</View>
|
|
80
85
|
</View>
|
|
81
86
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export const HOMEPAGE_MENU_BUTTON = '
|
|
2
|
-
export const MENU_BUTTON_TESTPAGE = '
|
|
1
|
+
export const HOMEPAGE_MENU_BUTTON = 'Homepage_MenuButton_Button';
|
|
2
|
+
export const MENU_BUTTON_TESTPAGE = 'MenuButton_TestPage';
|
|
3
3
|
|
|
4
4
|
/* E2E Testing Menu_Button 1 */
|
|
5
5
|
export const MENU_BUTTON_TEST_COMPONENT = 'Menu_Button_Test_Component'; // A component on each specific test page
|
|
6
6
|
export const MENU_BUTTON_ACCESSIBILITY_LABEL = 'E2E testing Menu_Button accessibility label';
|
|
7
|
+
export const MENU_ITEM_1_COMPONENT = 'Menu_Item_1_Component'; // The first menu item component
|
|
7
8
|
|
|
8
9
|
/* E2E Testing Menu_Button 2 */
|
|
9
10
|
export const MENU_BUTTON_NO_A11Y_LABEL_COMPONENT = 'Menu_Button_No_A11y_label_Component';
|
|
@@ -3,6 +3,7 @@ import { MenuButtonItemProps } from '@fluentui/react-native';
|
|
|
3
3
|
import { SvgIconProps } from '@fluentui-react-native/icon';
|
|
4
4
|
export const testImage = require('../Button/icon_24x24.png');
|
|
5
5
|
import TestSvg from '../Button/test.svg';
|
|
6
|
+
import { MENU_ITEM_1_COMPONENT } from './consts';
|
|
6
7
|
|
|
7
8
|
const svgProps: SvgIconProps = {
|
|
8
9
|
src: TestSvg,
|
|
@@ -14,6 +15,7 @@ export const menuItems: MenuButtonItemProps[] = [
|
|
|
14
15
|
itemKey: '1',
|
|
15
16
|
text: 'MenuItem 1',
|
|
16
17
|
icon: testImage,
|
|
18
|
+
testID: MENU_ITEM_1_COMPONENT,
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
itemKey: '2',
|
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
RADIOGROUP_NO_A11Y_LABEL_COMPONENT,
|
|
7
7
|
RADIOGROUP_TEST_COMPONENT_LABEL,
|
|
8
8
|
RADIOGROUP_ACCESSIBILITY_LABEL,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
FIRST_RADIO_BUTTON,
|
|
10
|
+
SECOND_RADIO_BUTTON,
|
|
11
|
+
THIRD_RADIO_BUTTON,
|
|
12
|
+
FOURTH_RADIO_BUTTON,
|
|
13
|
+
FIRST_RADIO_BUTTON_ACCESSIBILITY_LABEL,
|
|
14
|
+
SECOND_RADIO_BUTTON_LABEL,
|
|
13
15
|
} from './consts';
|
|
14
16
|
import { Stack } from '@fluentui-react-native/stack';
|
|
15
17
|
import { stackStyle } from '../Common/styles';
|
|
@@ -23,18 +25,18 @@ export const E2ERadioGroupTest: React.FunctionComponent = () => {
|
|
|
23
25
|
accessibilityLabel={RADIOGROUP_ACCESSIBILITY_LABEL}
|
|
24
26
|
testID={RADIOGROUP_TEST_COMPONENT}
|
|
25
27
|
>
|
|
26
|
-
<RadioButton content="Option A" buttonKey="A" />
|
|
27
28
|
<RadioButton
|
|
28
|
-
content="Option
|
|
29
|
-
buttonKey="
|
|
30
|
-
testID={
|
|
31
|
-
accessibilityLabel={
|
|
29
|
+
content="Option A"
|
|
30
|
+
buttonKey="A"
|
|
31
|
+
testID={FIRST_RADIO_BUTTON}
|
|
32
|
+
accessibilityLabel={FIRST_RADIO_BUTTON_ACCESSIBILITY_LABEL}
|
|
32
33
|
/>
|
|
33
|
-
<RadioButton content=
|
|
34
|
-
<RadioButton content="Option
|
|
34
|
+
<RadioButton content={SECOND_RADIO_BUTTON_LABEL} buttonKey="B" testID={SECOND_RADIO_BUTTON} />
|
|
35
|
+
<RadioButton content="Option C (disabled)" buttonKey="C" disabled={true} testID={THIRD_RADIO_BUTTON} />
|
|
36
|
+
<RadioButton content="Option D" buttonKey="C" testID={FOURTH_RADIO_BUTTON} />
|
|
35
37
|
</RadioGroup>
|
|
36
38
|
<RadioGroup label={RADIOGROUP_TEST_COMPONENT_LABEL} testID={RADIOGROUP_NO_A11Y_LABEL_COMPONENT}>
|
|
37
|
-
<RadioButton content=
|
|
39
|
+
<RadioButton content="Option W" buttonKey="W" />
|
|
38
40
|
<RadioButton content="Option X" buttonKey="X" />
|
|
39
41
|
<RadioButton content="Option Y (disabled)" buttonKey="C" disabled={true} />
|
|
40
42
|
<RadioButton content="Option Z" buttonKey="Z" />
|