Skip to content

Commit 4ba3eb0

Browse files
authored
Rename test files to Legacy/V1 instead of using "experimental" (#2473)
* Rename file folders * Fix paths * Fix paths * Fix build * Rename e2e files * Rename test files * Rename all e2e test pages, specs, consts * Rename consts and tests in test components * Clean up loose ends * Change files * Fix some links * Address feedback * Change files * Fix build issues
1 parent f7492a5 commit 4ba3eb0

File tree

202 files changed

+1875
-1993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+1875
-1993
lines changed

apps/E2E/src/Button/specs/Button.spec.win.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

apps/E2E/src/ButtonExperimental/specs/ButtonExperimental.spec.win.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.
File renamed without changes.

apps/E2E/src/Button/pages/ButtonPageObject.ts renamed to apps/E2E/src/ButtonLegacy/pages/ButtonLegacyPageObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const enum ButtonSelector {
1313
PrimaryButton, //this._primaryComponent
1414
}
1515

16-
class ButtonPageObject extends BasePage {
16+
class ButtonLegacyPageObject extends BasePage {
1717
/******************************************************************/
1818
/**************** UI Element Interaction Methods ******************/
1919
/******************************************************************/
@@ -69,4 +69,4 @@ class ButtonPageObject extends BasePage {
6969
}
7070
}
7171

72-
export default new ButtonPageObject();
72+
export default new ButtonLegacyPageObject();
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import NavigateAppPage from '../../common/NavigateAppPage';
2-
import ButtonPageObject from '../pages/ButtonPageObject';
2+
import ButtonLegacyPageObject from '../pages/ButtonLegacyPageObject';
33
import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
44

55
// Before testing begins, allow up to 60 seconds for app to open
@@ -10,13 +10,13 @@ describe('Button Testing Initialization', function () {
1010
});
1111

1212
it('Click and navigate to Button test page', async () => {
13-
await ButtonPageObject.mobileScrollToComponentButton();
14-
await ButtonPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
13+
await ButtonLegacyPageObject.mobileScrollToComponentButton();
14+
await ButtonLegacyPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
1515

1616
/* Click on component button to navigate to test page */
1717
await NavigateAppPage.clickAndGoToButtonPage();
18-
await ButtonPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
18+
await ButtonLegacyPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
1919

20-
await expect(await ButtonPageObject.isPageLoaded()).toBeTruthy();
20+
await expect(await ButtonLegacyPageObject.isPageLoaded()).toBeTruthy();
2121
});
2222
});
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import NavigateAppPage from '../../common/NavigateAppPage';
2-
import ButtonPageObject from '../pages/ButtonPageObject';
2+
import ButtonLegacyPageObject from '../pages/ButtonLegacyPageObject';
33
import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
44

55
// Before testing begins, allow up to 60 seconds for app to open
6-
describe('Button Testing Initialization', function () {
6+
describe('Button Legacy Testing Initialization', function () {
77
it('Wait for app load', async () => {
88
await NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
99
await expect(await NavigateAppPage.isPageLoaded()).toBeTruthy();
1010
});
1111

12-
it('Click and navigate to Button test page', async () => {
13-
await ButtonPageObject.mobileScrollToComponentButton();
14-
await ButtonPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
12+
it('Click and navigate to Button Legacy test page', async () => {
13+
await ButtonLegacyPageObject.mobileScrollToComponentButton();
14+
await ButtonLegacyPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
1515

1616
/* Click on component button to navigate to test page */
1717
await NavigateAppPage.clickAndGoToButtonPage();
18-
await ButtonPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
18+
await ButtonLegacyPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
1919

20-
await expect(await ButtonPageObject.isPageLoaded()).toBeTruthy();
20+
await expect(await ButtonLegacyPageObject.isPageLoaded()).toBeTruthy();
2121
});
2222
});
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import NavigateAppPage from '../../common/NavigateAppPage';
2-
import ButtonPageObject from '../pages/ButtonPageObject';
2+
import ButtonLegacyPageObject from '../pages/ButtonLegacyPageObject';
33
import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
44

55
// Before testing begins, allow up to 60 seconds for app to open
6-
describe('Button Testing Initialization', function () {
6+
describe('Button Legacy Testing Initialization', function () {
77
it('Wait for app load', async () => {
88
await NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
99
await expect(await NavigateAppPage.isPageLoaded()).toBeTruthy();
1010
});
1111

12-
it('Click and navigate to Button test page', async () => {
13-
await ButtonPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
12+
it('Click and navigate to Button Legacy test page', async () => {
13+
await ButtonLegacyPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
1414

1515
/* Click on component button to navigate to test page */
1616
await NavigateAppPage.clickAndGoToButtonPage();
17-
await ButtonPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
17+
await ButtonLegacyPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
1818

19-
await expect(await ButtonPageObject.isPageLoaded()).toBeTruthy();
19+
await expect(await ButtonLegacyPageObject.isPageLoaded()).toBeTruthy();
2020
});
2121
});
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import NavigateAppPage from '../../common/NavigateAppPage';
2+
import ButtonLegacyPageObject, { ButtonSelector } from '../pages/ButtonLegacyPageObject';
3+
import { ComponentSelector } from '../../common/BasePage';
4+
import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, BUTTON_A11Y_ROLE, Keys } from '../../common/consts';
5+
import { BUTTON_ACCESSIBILITY_LABEL_DEPRECATED, BUTTON_TEST_COMPONENT_LABEL_DEPRECATED } from '../consts';
6+
7+
// Before testing begins, allow up to 60 seconds for app to open
8+
describe('Button Legacy Testing Initialization', function () {
9+
it('Wait for app load', async () => {
10+
await NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
11+
await expect(await NavigateAppPage.isPageLoaded()).toBeTruthy(NavigateAppPage.ERRORMESSAGE_APPLOAD);
12+
});
13+
14+
it('Click and navigate to Button Legacy test page', async () => {
15+
/* Click on component button to navigate to test page */
16+
await NavigateAppPage.clickAndGoToButtonPage();
17+
await ButtonLegacyPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
18+
19+
await expect(await ButtonLegacyPageObject.isPageLoaded()).toBeTruthy(ButtonLegacyPageObject.ERRORMESSAGE_PAGELOAD);
20+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
21+
});
22+
});
23+
24+
describe('Button Legacy Accessibility Testing', () => {
25+
/* Scrolls and waits for the Button to be visible on the Test Page */
26+
beforeEach(async () => {
27+
await ButtonLegacyPageObject.scrollToTestElement();
28+
});
29+
30+
it('Button - Validate accessibilityRole is correct', async () => {
31+
await expect(await ButtonLegacyPageObject.getAccessibilityRole()).toEqual(BUTTON_A11Y_ROLE);
32+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
33+
});
34+
35+
it('Button - Set accessibilityLabel', async () => {
36+
await expect(await ButtonLegacyPageObject.getAccessibilityLabel(ComponentSelector.Primary)).toEqual(
37+
BUTTON_ACCESSIBILITY_LABEL_DEPRECATED,
38+
);
39+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
40+
});
41+
42+
it('Button - Do not set accessibilityLabel -> Default to Button label', async () => {
43+
await expect(await ButtonLegacyPageObject.getAccessibilityLabel(ComponentSelector.Secondary)).toEqual(
44+
BUTTON_TEST_COMPONENT_LABEL_DEPRECATED,
45+
);
46+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
47+
});
48+
});
49+
50+
describe('Button Legacy Functional Testing', () => {
51+
/* Scrolls and waits for the Button to be visible on the Test Page */
52+
beforeEach(async () => {
53+
await ButtonLegacyPageObject.scrollToTestElement();
54+
});
55+
56+
it('Validate OnClick() callback was fired -> Click', async () => {
57+
await ButtonLegacyPageObject.clickComponent();
58+
await expect(await ButtonLegacyPageObject.didOnClickCallbackFire()).toBeTruthy();
59+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
60+
61+
await ButtonLegacyPageObject.clickComponent(); // Reset Button State
62+
});
63+
64+
it('Validate OnClick() callback was fired -> Type "Enter"', async () => {
65+
await ButtonLegacyPageObject.sendKey(ButtonSelector.PrimaryButton, Keys.ENTER);
66+
await expect(await ButtonLegacyPageObject.didOnClickCallbackFire()).toBeTruthy();
67+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
68+
69+
await ButtonLegacyPageObject.clickComponent(); // Reset Button State
70+
});
71+
72+
it('Validate OnClick() callback was fired -> Type "SPACE"', async () => {
73+
await ButtonLegacyPageObject.sendKey(ButtonSelector.PrimaryButton, Keys.SPACE);
74+
await expect(await ButtonLegacyPageObject.didOnClickCallbackFire()).toBeTruthy();
75+
await expect(await ButtonLegacyPageObject.didAssertPopup()).toBeFalsy(ButtonLegacyPageObject.ERRORMESSAGE_ASSERT);
76+
});
77+
});

apps/E2E/src/ButtonExperimental/pages/ButtonExperimentalPageObject.ts renamed to apps/E2E/src/ButtonV1/pages/ButtonV1PageObject.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
BUTTON_NO_A11Y_LABEL_COMPONENT,
55
HOMEPAGE_BUTTON_BUTTON,
66
BUTTON_ON_PRESS,
7-
} from '../../Button/consts';
7+
} from '../../ButtonLegacy/consts';
88
import { BasePage, By } from '../../common/BasePage';
9-
class ButtonExperimentalPageObject extends BasePage {
9+
class ButtonV1PageObject extends BasePage {
1010
/******************************************************************/
1111
/**************** UI Element Interaction Methods ******************/
1212
/******************************************************************/
@@ -45,4 +45,4 @@ class ButtonExperimentalPageObject extends BasePage {
4545
}
4646
}
4747

48-
export default new ButtonExperimentalPageObject();
48+
export default new ButtonV1PageObject();

0 commit comments

Comments
 (0)