Automated E2E Testing Improvements (#1086)

* Yarn

* Merge

* Fixing repo

* Update package

* Merge

* Removing change file

* Transferring E2E Improvements to this branch. Other branch had weird CI errors

* Change files

* Upgrading WebDriverIO package

* Reversing WDIO upgrade
This commit is contained in:
Samuel Freiberg 2021-10-20 15:15:04 -07:00 коммит произвёл GitHub
Родитель fcfde38aaf
Коммит d4016c370e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
31 изменённых файлов: 401 добавлений и 105 удалений

Просмотреть файл

@ -4,17 +4,6 @@ parameters:
buildArtifacts:
steps:
# Generate reports. This task doesn't end until a ctrl+c is pressed. I'm not sure how to end it in this case, so
# I added a 1 minute timer. It should always generate the report in this time, then the task timeouts and continues on the pipeline.
# continueOnError is true because the pipeline should continue even on failure
- script: |
yarn report
workingDirectory: apps\${{parameters.platform}}
continueOnError: true
timeoutInMinutes: 1
displayName: "generate ${{parameters.platform}} report"
condition: and (succeededOrFailed(), eq(${{parameters.buildArtifacts}}, 'success'))
# Copy errorShots to FluentTesterDump
- task: CopyFiles@2
inputs:
@ -23,20 +12,6 @@ steps:
displayName: "Copy tree dump screenshots"
condition: and (succeededOrFailed(), eq(${{parameters.buildArtifacts}}, 'success'))
# Copy appium log to FluentTesterDump
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)\apps\${{parameters.platform}}\reports\
contents: "*"
targetFolder: $(Build.StagingDirectory)/E2E_${{parameters.applicationType}}_Dump
displayName: "Copy tree dump report logs"
condition: and (succeededOrFailed(), eq(${{parameters.buildArtifacts}}, 'success'))
- powershell: |
Move-Item -Path $(Build.SourcesDirectory)\apps\${{parameters.platform}}\allure-report -Destination $(Build.StagingDirectory)/E2E_${{parameters.applicationType}}_Dump
displayName: "Copy allure report"
condition: and (succeededOrFailed(), eq(${{parameters.buildArtifacts}}, 'success'))
# Publish FluentTesterDump
- task: PublishBuildArtifacts@1
inputs:

Просмотреть файл

@ -80,7 +80,7 @@
"ts-node": "^8.10.1",
"tsconfig-paths": "^3.9.0",
"typescript": "3.8.3",
"webdriverio": "5.22.4"
"webdriverio": "6.2.0"
},
"peerDependencies": {
"@office-iss/react-native-win32": "^0.63.7",

Просмотреть файл

@ -25,116 +25,174 @@ const PAGE_TIMEOUT = 15000;
describe('Open the app', function () {
it('Boot app', () => {
BootTestPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
browser.saveScreenshot('./errorShots/onBoot.png'); // Take a screenshot of the app for testing purposes
expect(BootTestPage.isPageLoaded()).toBeTruthy();
});
});
describe('Click on each test page and check if it renders', function () {
it('Button Test Page', () => {
/* Scroll to component test page button in scrollview if not already visible*/
ButtonTestPage.scrollToComponentButton();
ButtonTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
/* Click on component button to navigate to test page */
BootTestPage.clickAndGoToButtonPage();
ButtonTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ButtonTestPage.isPageLoaded()).toBeTruthy();
});
it('Callout Test Page', () => {
CalloutTestPage.scrollToComponentButton();
CalloutTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToCalloutPage();
CalloutTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(CalloutTestPage.isPageLoaded()).toBeTruthy();
});
it('Checkbox Test Page', () => {
CheckboxTestPage.scrollToComponentButton();
CheckboxTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToCheckboxPage();
CheckboxTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(CheckboxTestPage.isPageLoaded()).toBeTruthy();
});
it('ContextualMenu Test Page', () => {
ContextualMenuTestPage.scrollToComponentButton();
ContextualMenuTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToContextualMenuPage();
ContextualMenuTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ContextualMenuTestPage.isPageLoaded()).toBeTruthy();
});
it('Experimental Tabs Test Page', () => {
ExperimentalTabsTestPage.scrollToComponentButton();
ExperimentalTabsTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToExperimentalTabsPage();
ExperimentalTabsTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ExperimentalTabsTestPage.isPageLoaded()).toBeTruthy();
});
it('FocusTrapZone Test Page', () => {
FocusTrapZoneTestPage.scrollToComponentButton();
FocusTrapZoneTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToFocusTrapZonePage();
FocusTrapZoneTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(FocusTrapZoneTestPage.isPageLoaded()).toBeTruthy();
});
it('FocusZone Test Page', () => {
FocusZoneTestPage.scrollToComponentButton();
FocusZoneTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToFocusZonePage();
FocusZoneTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(FocusZoneTestPage.isPageLoaded()).toBeTruthy();
});
it('Icon Test Page', () => {
IconTestPage.scrollToComponentButton();
IconTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToIconPage();
IconTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(IconTestPage.isPageLoaded()).toBeTruthy();
});
it('Link Test Page', () => {
LinkTestPage.scrollToComponentButton();
LinkTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToLinkPage();
LinkTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(LinkTestPage.isPageLoaded()).toBeTruthy();
});
it('Tabs Test Page', () => {
BootTestPage.clickAndGoToTabsPage();
TabsTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TabsTestPage.isPageLoaded()).toBeTruthy();
});
it('Persona Test Page', () => {
PersonaTestPage.scrollToComponentButton();
PersonaTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToPersonaPage();
PersonaTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(PersonaTestPage.isPageLoaded()).toBeTruthy();
});
it('PersonaCoin Test Page', () => {
PersonaCoinTestPage.scrollToComponentButton();
PersonaCoinTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToPersonaCoinPage();
PersonaCoinTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(PersonaCoinTestPage.isPageLoaded()).toBeTruthy();
});
it('Pressable Test Page', () => {
PressableTestPage.scrollToComponentButton();
PressableTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToPressablePage();
PressableTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(PressableTestPage.isPageLoaded()).toBeTruthy();
});
it('RadioGroup Test Page', () => {
RadioGroupTestPage.scrollToComponentButton();
RadioGroupTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToRadioGroupPage();
RadioGroupTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(RadioGroupTestPage.isPageLoaded()).toBeTruthy();
});
it('Separator Test Page', () => {
SeparatorTestPage.scrollToComponentButton();
SeparatorTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToSeparatorPage();
SeparatorTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(SeparatorTestPage.isPageLoaded()).toBeTruthy();
});
it('Svg Test Page', () => {
SvgTestPage.scrollToComponentButton();
SvgTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToSvgPage();
SvgTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(SvgTestPage.isPageLoaded()).toBeTruthy();
});
it('Tabs Test Page', () => {
TabsTestPage.scrollToComponentButton();
TabsTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToTabsPage();
TabsTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TabsTestPage.isPageLoaded()).toBeTruthy();
});
it('Text Test Page', () => {
TextTestPage.scrollToComponentButton();
TextTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToTextPage();
TextTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TextTestPage.isPageLoaded()).toBeTruthy();
});
it('Theme Test Page', () => {
ThemeTestPage.scrollToComponentButton();
ThemeTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToThemePage();
ThemeTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ThemeTestPage.isPageLoaded()).toBeTruthy();
});
});

Просмотреть файл

@ -18,68 +18,102 @@ const PAGE_TIMEOUT = 15000;
describe('Open the app', function () {
it('Boot app', () => {
BootTestPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
browser.saveScreenshot('./errorShots/onBoot.png'); // Take a screenshot of the app for testing purposes
expect(BootTestPage.isPageLoaded()).toBeTruthy();
});
});
describe('Click on each test page and check if it renders', function () {
it('Button Test Page', () => {
/* Scroll to component test page button in scrollview if not already visible*/
ButtonTestPage.scrollToComponentButton();
ButtonTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
/* Click on component button to navigate to test page */
BootTestPage.clickAndGoToButtonPage();
ButtonTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ButtonTestPage.isPageLoaded()).toBeTruthy();
});
it('Callout Test Page', () => {
CalloutTestPage.scrollToComponentButton();
CalloutTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToCalloutPage();
CalloutTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(CalloutTestPage.isPageLoaded()).toBeTruthy();
});
it('Checkbox Test Page', () => {
CheckboxTestPage.scrollToComponentButton();
CheckboxTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToCheckboxPage();
CheckboxTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(CheckboxTestPage.isPageLoaded()).toBeTruthy();
});
it('Link Test Page', () => {
LinkTestPage.scrollToComponentButton();
LinkTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToLinkPage();
LinkTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(LinkTestPage.isPageLoaded()).toBeTruthy();
});
it('PersonaCoin Test Page', () => {
PersonaCoinTestPage.scrollToComponentButton();
PersonaCoinTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToPersonaCoinPage();
PersonaCoinTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(PersonaCoinTestPage.isPageLoaded()).toBeTruthy();
});
it('Pressable Test Page', () => {
PressableTestPage.scrollToComponentButton();
PressableTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToPressablePage();
PressableTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(PressableTestPage.isPageLoaded()).toBeTruthy();
});
it('Separator Test Page', () => {
SeparatorTestPage.scrollToComponentButton();
SeparatorTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToSeparatorPage();
SeparatorTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(SeparatorTestPage.isPageLoaded()).toBeTruthy();
});
it('Text Test Page', () => {
BootTestPage.clickAndGoToTextPage();
TextTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TextTestPage.isPageLoaded()).toBeTruthy();
});
it('Tabs Test Page', () => {
TabsTestPage.scrollToComponentButton();
TabsTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToTabsPage();
TabsTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TabsTestPage.isPageLoaded()).toBeTruthy();
});
it('Text Test Page', () => {
TextTestPage.scrollToComponentButton();
TextTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToTextPage();
TextTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(TextTestPage.isPageLoaded()).toBeTruthy();
});
it('Theme Test Page', () => {
ThemeTestPage.scrollToComponentButton();
ThemeTestPage.waitForButtonDisplayed(PAGE_TIMEOUT);
BootTestPage.clickAndGoToThemePage();
ThemeTestPage.waitForPageDisplayed(PAGE_TIMEOUT);
expect(ThemeTestPage.isPageLoaded()).toBeTruthy();
});
});

Просмотреть файл

@ -1,4 +1,4 @@
import { BUTTON_TESTPAGE } from '../../../FluentTester/TestComponents/Button/consts';
import { BUTTON_TESTPAGE, HOMEPAGE_BUTTON_BUTTON } from '../../../FluentTester/TestComponents/Button/consts';
import { BasePage, By } from '../../common/BasePage';
class ButtonTestPage extends BasePage {
@ -9,6 +9,10 @@ class ButtonTestPage extends BasePage {
get _pageName() {
return BUTTON_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_BUTTON_BUTTON);
}
}
export default new ButtonTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { CALLOUT_TESTPAGE } from '../../../FluentTester/TestComponents/Callout/consts';
import { CALLOUT_TESTPAGE, HOMEPAGE_CALLOUT_BUTTON } from '../../../FluentTester/TestComponents/Callout/consts';
import { BasePage, By } from '../../common/BasePage';
class CalloutTestPage extends BasePage {
@ -9,6 +9,10 @@ class CalloutTestPage extends BasePage {
get _pageName() {
return CALLOUT_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_CALLOUT_BUTTON);
}
}
export default new CalloutTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { CHECKBOX_TESTPAGE } from '../../../FluentTester/TestComponents/Checkbox/consts';
import { CHECKBOX_TESTPAGE, HOMEPAGE_CHECKBOX_BUTTON } from '../../../FluentTester/TestComponents/Checkbox/consts';
import { BasePage, By } from '../../common/BasePage';
class CheckboxTestPage extends BasePage {
@ -9,6 +9,10 @@ class CheckboxTestPage extends BasePage {
get _pageName() {
return CHECKBOX_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_CHECKBOX_BUTTON);
}
}
export default new CheckboxTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { CONTEXTUALMENU_TESTPAGE } from '../../../FluentTester/TestComponents/ContextualMenu/consts';
import { CONTEXTUALMENU_TESTPAGE, HOMEPAGE_CONTEXTUALMENU_BUTTON } from '../../../FluentTester/TestComponents/ContextualMenu/consts';
import { BasePage, By } from '../../common/BasePage';
class ContextualMenuPage extends BasePage {
@ -9,6 +9,10 @@ class ContextualMenuPage extends BasePage {
get _pageName() {
return CONTEXTUALMENU_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_CONTEXTUALMENU_BUTTON);
}
}
export default new ContextualMenuPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { FOCUSTRAPZONE_TESTPAGE } from '../../../FluentTester/TestComponents/FocusTrapZone/consts';
import { FOCUSTRAPZONE_TESTPAGE, HOMEPAGE_FOCUSTRAPZONE_BUTTON } from '../../../FluentTester/TestComponents/FocusTrapZone/consts';
import { BasePage, By } from '../../common/BasePage';
class FocusTrapZonePage extends BasePage {
@ -9,6 +9,10 @@ class FocusTrapZonePage extends BasePage {
get _pageName() {
return FOCUSTRAPZONE_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_FOCUSTRAPZONE_BUTTON);
}
}
export default new FocusTrapZonePage();

Просмотреть файл

@ -1,4 +1,4 @@
import { FOCUSZONE_TESTPAGE } from '../../../FluentTester/TestComponents/FocusZone/consts';
import { FOCUSZONE_TESTPAGE, HOMEPAGE_FOCUSZONE_BUTTON } from '../../../FluentTester/TestComponents/FocusZone/consts';
import { BasePage, By } from '../../common/BasePage';
class FocusZoneTestPage extends BasePage {
@ -9,6 +9,10 @@ class FocusZoneTestPage extends BasePage {
get _pageName() {
return FOCUSZONE_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_FOCUSZONE_BUTTON);
}
}
export default new FocusZoneTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { ICON_TESTPAGE } from '../../../FluentTester/TestComponents/Icon/consts';
import { ICON_TESTPAGE, HOMEPAGE_ICON_BUTTON } from '../../../FluentTester/TestComponents/Icon/consts';
import { BasePage, By } from '../../common/BasePage';
class IconTestPage extends BasePage {
@ -9,6 +9,10 @@ class IconTestPage extends BasePage {
get _pageName() {
return ICON_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_ICON_BUTTON);
}
}
export default new IconTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { LINK_TESTPAGE } from '../../../FluentTester/TestComponents/Link/consts';
import { LINK_TESTPAGE, HOMEPAGE_LINK_BUTTON } from '../../../FluentTester/TestComponents/Link/consts';
import { BasePage, By } from '../../common/BasePage';
class LinkTestPage extends BasePage {
@ -9,6 +9,10 @@ class LinkTestPage extends BasePage {
get _pageName() {
return LINK_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_LINK_BUTTON);
}
}
export default new LinkTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { PERSONA_TESTPAGE } from '../../../FluentTester/TestComponents/Persona/consts';
import { PERSONA_TESTPAGE, HOMEPAGE_PERSONA_BUTTON } from '../../../FluentTester/TestComponents/Persona/consts';
import { BasePage, By } from '../../common/BasePage';
class PersonaTestPage extends BasePage {
@ -9,6 +9,10 @@ class PersonaTestPage extends BasePage {
get _pageName() {
return PERSONA_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_PERSONA_BUTTON);
}
}
export default new PersonaTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { PERSONACOIN_TESTPAGE } from '../../../FluentTester/TestComponents/PersonaCoin/consts';
import { PERSONACOIN_TESTPAGE, HOMEPAGE_PERSONACOIN_BUTTON } from '../../../FluentTester/TestComponents/PersonaCoin/consts';
import { BasePage, By } from '../../common/BasePage';
class PersonaCoinTestPage extends BasePage {
@ -9,6 +9,10 @@ class PersonaCoinTestPage extends BasePage {
get _pageName() {
return PERSONACOIN_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_PERSONACOIN_BUTTON);
}
}
export default new PersonaCoinTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { PRESSABLE_TESTPAGE } from '../../../FluentTester/TestComponents/Pressable/consts';
import { PRESSABLE_TESTPAGE, HOMEPAGE_PRESSABLE_BUTTON } from '../../../FluentTester/TestComponents/Pressable/consts';
import { BasePage, By } from '../../common/BasePage';
class PressableTestPage extends BasePage {
@ -9,6 +9,10 @@ class PressableTestPage extends BasePage {
get _pageName() {
return PRESSABLE_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_PRESSABLE_BUTTON);
}
}
export default new PressableTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { RADIOGROUP_TESTPAGE } from '../../../FluentTester/TestComponents/RadioGroup/consts';
import { RADIOGROUP_TESTPAGE, HOMEPAGE_RADIOGROUP_BUTTON } from '../../../FluentTester/TestComponents/RadioGroup/consts';
import { BasePage, By } from '../../common/BasePage';
class RadioGroupPage extends BasePage {
@ -9,6 +9,10 @@ class RadioGroupPage extends BasePage {
get _pageName() {
return RADIOGROUP_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_RADIOGROUP_BUTTON);
}
}
export default new RadioGroupPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { SEPARATOR_TESTPAGE } from '../../../FluentTester/TestComponents/Separator/consts';
import { SEPARATOR_TESTPAGE, HOMEPAGE_SEPARATOR_BUTTON } from '../../../FluentTester/TestComponents/Separator/consts';
import { BasePage, By } from '../../common/BasePage';
class SeparatorTestPage extends BasePage {
@ -9,6 +9,10 @@ class SeparatorTestPage extends BasePage {
get _pageName() {
return SEPARATOR_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_SEPARATOR_BUTTON);
}
}
export default new SeparatorTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { SVG_TESTPAGE } from '../../../FluentTester/TestComponents/Svg/consts';
import { SVG_TESTPAGE, HOMEPAGE_SVG_BUTTON } from '../../../FluentTester/TestComponents/Svg/consts';
import { BasePage, By } from '../../common/BasePage';
class SvgTestPage extends BasePage {
@ -9,6 +9,10 @@ class SvgTestPage extends BasePage {
get _pageName() {
return SVG_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_SVG_BUTTON);
}
}
export default new SvgTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { TABS_TESTPAGE } from '../../../FluentTester/TestComponents/Tabs/consts';
import { TABS_TESTPAGE, HOMEPAGE_TABS_BUTTON } from '../../../FluentTester/TestComponents/Tabs/consts';
import { BasePage, By } from '../../common/BasePage';
class TabsTestPage extends BasePage {
@ -9,6 +9,10 @@ class TabsTestPage extends BasePage {
get _pageName() {
return TABS_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_TABS_BUTTON);
}
}
export default new TabsTestPage();

Просмотреть файл

@ -1,4 +1,7 @@
import { EXPERIMENTAL_TABS_TESTPAGE } from '../../../FluentTester/TestComponents/TabsExperimental/consts';
import {
EXPERIMENTAL_TABS_TESTPAGE,
HOMEPAGE_EXPERIMENTAL_TABS_BUTTON,
} from '../../../FluentTester/TestComponents/TabsExperimental/consts';
import { BasePage, By } from '../../common/BasePage';
class ExperimentalTabsTestPage extends BasePage {
@ -9,6 +12,10 @@ class ExperimentalTabsTestPage extends BasePage {
get _pageName() {
return EXPERIMENTAL_TABS_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_EXPERIMENTAL_TABS_BUTTON);
}
}
export default new ExperimentalTabsTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { TEXT_TESTPAGE } from '../../../FluentTester/TestComponents/Text/consts';
import { TEXT_TESTPAGE, HOMEPAGE_TEXT_BUTTON } from '../../../FluentTester/TestComponents/Text/consts';
import { BasePage, By } from '../../common/BasePage';
class TextTestPage extends BasePage {
@ -9,6 +9,10 @@ class TextTestPage extends BasePage {
get _pageName() {
return TEXT_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_TEXT_BUTTON);
}
}
export default new TextTestPage();

Просмотреть файл

@ -1,4 +1,4 @@
import { THEME_TESTPAGE } from '../../../FluentTester/TestComponents/Theme/consts';
import { THEME_TESTPAGE, HOMEPAGE_THEME_BUTTON } from '../../../FluentTester/TestComponents/Theme/consts';
import { BasePage, By } from '../../common/BasePage';
class ThemeTestPage extends BasePage {
@ -9,6 +9,10 @@ class ThemeTestPage extends BasePage {
get _pageName() {
return THEME_TESTPAGE;
}
get _pageButton() {
return By(HOMEPAGE_THEME_BUTTON);
}
}
export default new ThemeTestPage();

Просмотреть файл

@ -1,4 +1,5 @@
const DUMMY_CHAR = '';
const COMPONENT_SCROLL_COORDINATES = { x: -0, y: -40 }; // These are the offsets. Y is negative because we want the touch to move up (and thus it scrolls down)
export function By(testId: string): WebdriverIO.Element {
return $('~' + testId);
@ -9,6 +10,18 @@ export class BasePage {
return this._testPage.isDisplayed();
}
isButtonInView(): boolean {
return this._pageButton.isDisplayed();
}
// Scrolls to the component button in the list of components.
scrollToComponentButton(): void {
if (!this.isButtonInView()) {
const scrollViewElement = $('~SCROLLVIEW_TEST_ID');
driver.touchScroll(COMPONENT_SCROLL_COORDINATES.x, COMPONENT_SCROLL_COORDINATES.y, scrollViewElement.elementId);
}
}
// Waits for page to be loaded. Timeout could differ depending on usage.
waitForPageDisplayed(timeout?: number): void {
browser.waitUntil(
@ -18,6 +31,27 @@ export class BasePage {
timeout ?? this.waitForPageTimeout,
this._pageName + ' did not render correctly. Please see /errorShots of the first failed test for more information.',
1000,
// {
// timeout: timeout ?? this.waitForPageTimeout,
// timeoutMsg: this._pageName + ' did not render correctly. Please see /errorShots for more information.',
// interval: 1000,
// },
);
}
waitForButtonDisplayed(timeout?: number): void {
browser.waitUntil(
() => {
return this.isButtonInView();
},
timeout ?? this.waitForPageTimeout,
this._pageName + ' did not render correctly. Please see /errorShots of the first failed test for more information.',
1000,
// {
// timeout: timeout ?? this.waitForPageTimeout,
// timeoutMsg: 'Could not find the button to navigate to ' + this._pageName + '. Please see /errorShots for more information.',
// interval: 1000,
// },
);
}
@ -31,6 +65,11 @@ export class BasePage {
return DUMMY_CHAR;
}
// The button to select the page
get _pageButton(): WebdriverIO.Element {
return By(DUMMY_CHAR);
}
// Default timeout to wait until page is displayed (10s)
private waitForPageTimeout: number = 10000;
private waitForPageTimeout: number = 15000;
}

Просмотреть файл

@ -133,7 +133,7 @@ export const FluentTester: React.FunctionComponent<FluentTesterProps> = (props:
const TestList: React.FunctionComponent = () => {
return (
<View style={fluentTesterStyles.testList}>
<ScrollView contentContainerStyle={fluentTesterStyles.testListContainerStyle}>
<ScrollView contentContainerStyle={fluentTesterStyles.testListContainerStyle} testID="SCROLLVIEW_TEST_ID">
{sortedTestComponents.map((description, index) => {
return (
<Button

Просмотреть файл

@ -24,8 +24,6 @@
"run-win32-dev-web": "rex-win32 --bundle index --component FluentTester --basePath ./dist --useDevMain --useWebDebugger --windowTitle \"FluentUI Tester\" --useFastRefresh --pluginProps --debugBundlePath index --jsEngine v8",
"run-win32-devmain": "rex-win32 --bundle index.win32 --component FluentTester --basePath ./dist --useDevMain --windowTitle \"FluentUI Tester\" --pluginProps --debugBundlePath index --jsEngine v8",
"e2etest": "rimraf reports/* && wdio",
"report": "allure generate allure-results --clean",
"generate-report": "allure generate allure-results --clean && allure open",
"prettier": "fluentui-scripts prettier",
"prettier-fix": "fluentui-scripts prettier --fix true"
},

Просмотреть файл

@ -62,15 +62,7 @@ exports.config = {
// Adding an extra retry will hopefully reduce the risk of engineers seeing a false-negative
specFileRetries: 3,
reporters: [
'spec',
[
'allure',
{
outputDir: 'allure-results',
},
],
],
reporters: ['spec'],
/*
** ===================
@ -115,11 +107,6 @@ exports.config = {
rimraf.sync('./errorShots');
}
fs.mkdirSync('./errorShots');
if (fs.existsSync('./allure-results')) {
rimraf.sync('./allure-results');
}
fs.mkdirSync('./allure-results');
},
/**
* Gets executed before test execution begins. At this point you can access to all global
@ -165,17 +152,15 @@ exports.config = {
/**
* Function to be executed after a test (in Mocha/Jasmine).
*/
afterTest: function (test) {
// if test passed, ignore, else take and save screenshot.
/* UPDATE: I want to take screenshots after every test to help gauge certain CI failures.
* I will re-enable this once I am able to determine what's causing some CI failures
*/
// if (test.passed) {
// return;
// }
afterTest: function (test, context, results) {
// if test passed, ignore, else take and save screenshot. Unless it's the first test that boots the app,
// it may be useful to have a screenshot of the app on load.
if (results.passed) {
return;
}
// get current test title and clean it, to use it as file name
const fileName = encodeURIComponent(test.title.replace(/\s+/g, '-'));
const fileName = encodeURIComponent(test.description.replace(/\s+/g, '-'));
// build file path
const filePath = './errorShots/' + fileName + '.png';

Просмотреть файл

@ -8,11 +8,9 @@
"clean": "fluentui-scripts clean",
"code-style": "fluentui-scripts code-style",
"depcheck": "fluentui-scripts depcheck",
"e2etest": "rimraf allure-results/* errorShots/* reports/* && wdio",
"generate-report": "allure generate allure-results --clean && allure open",
"e2etest": "rimraf errorShots/* reports/* && wdio",
"just": "fluentui-scripts",
"lint": "fluentui-scripts lint",
"report": "allure generate allure-results --clean",
"start": "react-native start",
"test": "fluentui-scripts jest",
"prewindows": "install-windows-test-app --use-nuget",

Просмотреть файл

@ -54,15 +54,7 @@ exports.config = {
// Adding an extra retry will hopefully reduce the risk of engineers seeing a false-negative
specFileRetries: 3,
reporters: [
'spec',
[
'allure',
{
outputDir: 'allure-results',
},
],
],
reporters: ['spec'],
/*
** ===================
@ -103,7 +95,6 @@ exports.config = {
*/
beforeSession: function (/* config, capabilities, specs */) {
fs.mkdirSync('./errorShots', {recursive: true});
fs.mkdirSync('./allure-results', {recursive: true});
},
/**
* Gets executed before test execution begins. At this point you can access to all global
@ -149,17 +140,14 @@ exports.config = {
/**
* Function to be executed after a test (in Mocha/Jasmine).
*/
afterTest: function (test /*, context*/) {
afterTest: function (test, context, results) {
// if test passed, ignore, else take and save screenshot.
/* UPDATE: I want to take screenshots after every test to help gauge certain CI failures.
* I will re-enable this once I am able to determine what's causing some CI failures
*/
// if (test.passed) {
// return;
// }
if (results.passed) {
return;
}
// get current test title and clean it, to use it as file name
const fileName = encodeURIComponent(test.title.replace(/\s+/g, '-'));
const fileName = encodeURIComponent(test.description.replace(/\s+/g, '-'));
// build file path
const filePath = './errorShots/' + fileName + '.png';

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Transferring E2E Improvements to this branch. Other branch had weird CI errors",
"packageName": "@fluentui-react-native/tester",
"email": "safreibe@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Transferring E2E Improvements to this branch. Other branch had weird CI errors",
"packageName": "@fluentui-react-native/tester-win32",
"email": "safreibe@microsoft.com",
"dependentChangeType": "patch"
}

134
yarn.lock
Просмотреть файл

@ -3392,6 +3392,15 @@
deepmerge "^4.0.0"
glob "^7.1.2"
"@wdio/config@6.1.14":
version "6.1.14"
resolved "https://registry.yarnpkg.com/@wdio/config/-/config-6.1.14.tgz#41dec1cebcc76e387b44ddef0302839ffac1f99f"
integrity sha512-MXHMHwtkAblfnIxONs9aW//T9Fq5XIw3oH+tztcBRvNTTAIXmwHd+4sOjAwjpCdBSGs0C4kM/aTpGfwDZVURvQ==
dependencies:
"@wdio/logger" "6.0.16"
deepmerge "^4.0.0"
glob "^7.1.2"
"@wdio/config@6.1.2":
version "6.1.2"
resolved "https://registry.yarnpkg.com/@wdio/config/-/config-6.1.2.tgz#580287bc751eea3a22445d65a6a5b276a33232de"
@ -3451,6 +3460,11 @@
resolved "https://registry.yarnpkg.com/@wdio/protocols/-/protocols-6.1.11.tgz#96f3508497310fac0e9ea80daead2b1f26e57c4e"
integrity sha512-opauqB8kxsUOHrNxHv24D+DjULOvxQUfwSIGL4pv6u/b/Jzni4Nmjy4wcIb8TFXvWWvp7JfFQM1DntM0gQ0d3g==
"@wdio/protocols@6.1.25":
version "6.1.25"
resolved "https://registry.yarnpkg.com/@wdio/protocols/-/protocols-6.1.25.tgz#a5059fce8eb070610792708b228b5e53831d1f33"
integrity sha512-C84qqh5J6nE1zTjwF3svDUah3FvoUzMUGeRe8w//QPBcJIGNRgmVLgeFV7Cp2EwI5ag+BUfXExQ0bFtcZYHIVA==
"@wdio/repl@5.18.6":
version "5.18.6"
resolved "https://registry.yarnpkg.com/@wdio/repl/-/repl-5.18.6.tgz#6e3467ff6e52879f726579a2053baf98a00e9a0f"
@ -3472,6 +3486,13 @@
dependencies:
"@wdio/utils" "6.1.8"
"@wdio/repl@6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@wdio/repl/-/repl-6.2.0.tgz#3edb83f9b310e007c87cddb31b265ec4404d48a7"
integrity sha512-63yuCBCLrTC1D5uk6wJ6D3lyhi5i3Dvj8sQuqSma66c+xYPQRNA/Jp6V+43CsnOzUDLvhliSjCanrl3/i2sOcg==
dependencies:
"@wdio/utils" "6.2.0"
"@wdio/reporter@5.22.4":
version "5.22.4"
resolved "https://registry.yarnpkg.com/@wdio/reporter/-/reporter-5.22.4.tgz#d0ae86980e694e56604fd3f745c55e58335eceef"
@ -3534,6 +3555,13 @@
dependencies:
"@wdio/logger" "6.0.16"
"@wdio/utils@6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@wdio/utils/-/utils-6.2.0.tgz#8aa23ecbab9374aa6c80d54c37f6d88caa25d613"
integrity sha512-nPx430WPtZts09pcFwkTMO3zm6F7qvPuOcbvCschSW6ay8ebBvS6lkKnAHxCjrslsIF8+lOESuF0QrWycoouRA==
dependencies:
"@wdio/logger" "6.0.16"
"@webassemblyjs/ast@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
@ -7343,6 +7371,20 @@ devtools@6.1.11:
ua-parser-js "^0.7.21"
uuid "^8.0.0"
devtools@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/devtools/-/devtools-6.2.0.tgz#c373c0970857ed675efe4ac8c918264bd73ca085"
integrity sha512-PmDKnIlDdP5+b6VurEnrIiLdzpSuWeWfge8tXJWjvFPhoqvwzdw4j5YSFo/QRWusS37Mk/j/rNUUawYP0u/ZKg==
dependencies:
"@wdio/config" "6.1.14"
"@wdio/logger" "6.0.16"
"@wdio/protocols" "6.1.25"
"@wdio/utils" "6.2.0"
chrome-launcher "^0.13.1"
puppeteer-core "^4.0.0"
ua-parser-js "^0.7.21"
uuid "^8.0.0"
diagnostic-channel-publishers@0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.4.4.tgz#57c3b80b7e7f576f95be3a257d5e94550f0082d6"
@ -12976,6 +13018,11 @@ mississippi@^3.0.0:
stream-each "^1.1.0"
through2 "^2.0.0"
mitt@^2.0.1:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mitt/-/mitt-2.1.0.tgz#f740577c23176c6205b121b2973514eade1b2230"
integrity sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==
mixin-deep@^1.2.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
@ -14689,6 +14736,23 @@ puppeteer-core@^3.0.0:
unbzip2-stream "^1.3.3"
ws "^7.2.3"
puppeteer-core@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-4.0.1.tgz#d6026add5fe058de22cd80879967eaa5e9be4cfb"
integrity sha512-8OfHmUkEXU/k7Bmcdm6KRWhIIfmayv/ce1AUDkP0nTLK2IpjulFggxq1dZhWgWHXebeLILbieMvAor7tSf3EqQ==
dependencies:
debug "^4.1.0"
extract-zip "^2.0.0"
https-proxy-agent "^4.0.0"
mime "^2.0.3"
mitt "^2.0.1"
progress "^2.0.1"
proxy-from-env "^1.0.0"
rimraf "^3.0.2"
tar-fs "^2.0.0"
unbzip2-stream "^1.3.3"
ws "^7.2.3"
q@^1.1.2, q@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
@ -15282,7 +15346,24 @@ request-promise-core@1.1.3:
dependencies:
lodash "^4.17.15"
request-promise@4.x, request-promise@^4.1.1, request-promise@^4.2.2, request-promise@^4.2.5:
request-promise-core@1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f"
integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==
dependencies:
lodash "^4.17.19"
request-promise@4.x:
version "4.2.6"
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.6.tgz#7e7e5b9578630e6f598e3813c0f8eb342a27f0a2"
integrity sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ==
dependencies:
bluebird "^3.5.0"
request-promise-core "1.1.4"
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"
request-promise@^4.1.1, request-promise@^4.2.2, request-promise@^4.2.5:
version "4.2.5"
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.5.tgz#186222c59ae512f3497dfe4d75a9c8461bd0053c"
integrity sha512-ZgnepCykFdmpq86fKGwqntyTiUrHycALuGggpyCZwMvGaZWgxW6yagT0FHkgo5LzYvOaCNvxYwWYIjevSH1EDg==
@ -15468,6 +15549,11 @@ rgb2hex@^0.1.0:
resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.1.10.tgz#4fdd432665273e2d5900434940ceba0a04c8a8a8"
integrity sha512-vKz+kzolWbL3rke/xeTE2+6vHmZnNxGyDnaVW4OckntAIcc7DcZzWkQSfxMDwqHS8vhgySnIFyBUH7lIk6PxvQ==
rgb2hex@^0.2.0:
version "0.2.5"
resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.2.5.tgz#f82230cd3ab1364fa73c99be3a691ed688f8dbdc"
integrity sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw==
rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
@ -15802,6 +15888,13 @@ serialize-error@^6.0.0:
dependencies:
type-fest "^0.12.0"
serialize-error@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18"
integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==
dependencies:
type-fest "^0.13.1"
serialize-javascript@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
@ -17168,6 +17261,11 @@ type-fest@^0.12.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.12.0.tgz#f57a27ab81c68d136a51fd71467eff94157fa1ee"
integrity sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==
type-fest@^0.13.1:
version "0.13.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934"
integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==
type-fest@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
@ -17690,6 +17788,18 @@ webdriver@6.1.11:
got "^11.0.2"
lodash.merge "^4.6.1"
webdriver@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/webdriver/-/webdriver-6.2.0.tgz#333983ae0b5aee4c39bcf6202b8b60a92edace0b"
integrity sha512-8jcuMK0ygfVT0ySImE89TD79rmYzvKS3ImG/+xvS9CUzrlYJpXTos8OTM962YaqkX/nEiGlT4HdV+4SH1J27WQ==
dependencies:
"@wdio/config" "6.1.14"
"@wdio/logger" "6.0.16"
"@wdio/protocols" "6.1.25"
"@wdio/utils" "6.2.0"
got "^11.0.2"
lodash.merge "^4.6.1"
webdriverio@5.22.4:
version "5.22.4"
resolved "https://registry.yarnpkg.com/webdriverio/-/webdriverio-5.22.4.tgz#56819998196d86f5a405a76fb41cae10e7dcd641"
@ -17732,6 +17842,28 @@ webdriverio@5.23.0, webdriverio@^5.10.9:
serialize-error "^5.0.0"
webdriver "5.23.0"
webdriverio@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/webdriverio/-/webdriverio-6.2.0.tgz#85c9ba83b0ab61e4b056cefe07a65b3be5f1463a"
integrity sha512-TpikNm7Glm9qqWfvVbO5u9BbmDpPULI1PsJG9eDgL8eP7QoDsJs3gYwAizoBZlcRB9u/m8PESN/+B5H14NCvkA==
dependencies:
"@wdio/config" "6.1.14"
"@wdio/logger" "6.0.16"
"@wdio/repl" "6.2.0"
"@wdio/utils" "6.2.0"
archiver "^4.0.1"
css-value "^0.0.1"
devtools "6.2.0"
grapheme-splitter "^1.0.2"
lodash.clonedeep "^4.5.0"
lodash.isobject "^3.0.2"
lodash.isplainobject "^4.0.6"
lodash.zip "^4.2.0"
resq "^1.6.0"
rgb2hex "^0.2.0"
serialize-error "^7.0.0"
webdriver "6.2.0"
webdriverio@^6.0.2:
version "6.1.11"
resolved "https://registry.yarnpkg.com/webdriverio/-/webdriverio-6.1.11.tgz#40d214678111ac3436bac525ff10bce16b1f4561"