From a4002611642d088993926d4e7873eb5f1efb4e4b Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:56:41 -0700 Subject: [PATCH 01/18] Add VisitAllPages Test --- .../test/RNTesterNavigation.ts | 7 ++-- .../test/visitAllPages.test.ts | 32 ++++++++++++++----- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 10cf237c4fe..48257813909 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -11,8 +11,8 @@ import {app} from '@react-native-windows/automation'; * Visit an example on the RNTester Components tab */ export async function goToComponentExample(example: string) { - //const componentsTabButton = await app.findElementByTestID('components-tab'); - //await componentsTabButton.click(); + const componentsTabButton = await app.findElementByTestID('components-tab'); + await componentsTabButton.click(); await goToExample(example); } @@ -28,7 +28,8 @@ export async function goToApiExample(example: string) { async function goToExample(example: string) { // Filter the list down to the one test, to improve the stability of selectors const searchBox = await app.findElementByTestID('explorer_search'); - await searchBox.setValue(regexEscape(example)); + // Only grab first three characters of string to reduce cases in WebDriverIO mistyping. + await searchBox.addValue(regexEscape(example.substring(0, 3))); const exampleButton = await app.findElementByTestID(example); await exampleButton.click(); diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 0758984aa00..06e81ed86f6 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -4,8 +4,12 @@ * * @format */ -//import {goToApiExample, goToComponentExample} from './RNTesterNavigation'; -//import {verifyNoErrorLogs} from './Helpers'; +import {goToApiExample, goToComponentExample} from './RNTesterNavigation'; +import {verifyNoErrorLogs} from './Helpers'; + +afterEach(async () => { + await verifyNoErrorLogs(); +}); type RNTesterExampleModule = { title: string; @@ -33,18 +37,30 @@ describe('visitAllPages', () => { }); for (const component of componentExamples) { - test(component, () => { - expect(true).toBe(true); - }); + if (component === 'Flyout' || component === 'XAML') { + continue; + } + + test(component, async () => await goToComponentExample(component)); } for (const api of apiExamples) { - if (api === 'Transforms') + if ( + api === 'Transforms' || + api === 'Keyboard Focus Example' || + api === 'Alerts' || + api === 'Linking' || + api === 'AppState' || + api === 'Border' || + api === 'Crash' || + api === 'Accessibility Windows' || + api === 'Accessibility' + ) // disable until either transformExample uses units, or that isn't an error continue; - test(api, () => { - expect(true).toBe(true); + test(api, async () => { + await goToApiExample(api); }); } }); From 0659c7bd12c69ddb52245b2630473c9b35f27c8b Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:43:15 -0700 Subject: [PATCH 02/18] Fix: Hold Tests Until Metro Loads Bundle --- packages/e2e-test-app-fabric/test/RNTesterNavigation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 48257813909..55781ef8a59 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -12,6 +12,7 @@ import {app} from '@react-native-windows/automation'; */ export async function goToComponentExample(example: string) { const componentsTabButton = await app.findElementByTestID('components-tab'); + await app.waitUntil(async () => await componentsTabButton.isDisplayed()); await componentsTabButton.click(); await goToExample(example); } @@ -21,6 +22,7 @@ export async function goToComponentExample(example: string) { */ export async function goToApiExample(example: string) { const componentsTabButton = await app.findElementByTestID('apis-tab'); + await app.waitUntil(async () => await componentsTabButton.isDisplayed()); await componentsTabButton.click(); await goToExample(example); } From 07ba9b27abc590e97980073071d923d187ec5f0b Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:28:00 -0700 Subject: [PATCH 03/18] Fix: Disable API Tests --- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 06e81ed86f6..97697e54ee4 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -44,7 +44,8 @@ describe('visitAllPages', () => { test(component, async () => await goToComponentExample(component)); } - for (const api of apiExamples) { + // Disable temporarily until tests become stable. Currently, windows loses focus randomly resulting in tests being stalled. + /*for (const api of apiExamples) { if ( api === 'Transforms' || api === 'Keyboard Focus Example' || @@ -62,7 +63,7 @@ describe('visitAllPages', () => { test(api, async () => { await goToApiExample(api); }); - } + }*/ }); export {}; From a582e5076bf9f49492d6e706f56b033f660ae6b8 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:36:50 -0700 Subject: [PATCH 04/18] Migrate to Release --- .ado/jobs/e2e-test.yml | 9 ++++++++- packages/e2e-test-app-fabric/jest.config.js | 2 +- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 2 +- .../windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp | 9 ++++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.ado/jobs/e2e-test.yml b/.ado/jobs/e2e-test.yml index f1d80690e34..ed175b04dc5 100644 --- a/.ado/jobs/e2e-test.yml +++ b/.ado/jobs/e2e-test.yml @@ -184,7 +184,7 @@ jobs: parameters: buildEnvironment: ${{ parameters.BuildEnvironment }} certificateName: reactUWPTestAppEncodedKey - buildConfiguration: Debug + buildConfiguration: Release buildPlatform: ${{ matrix.BuildPlatform }} buildLogDirectory: $(BuildLogDirectory) deployOption: '--no-deploy' @@ -194,6 +194,13 @@ jobs: echo ##vso[task.setvariable variable=StartedFabricTests]true displayName: Set StartedFabricTests + - task: CopyFiles@2 + displayName: Copy Bundle + inputs: + sourceFolder: packages/e2e-test-app-fabric/windows/x64/Release/Bundle + targetFolder: packages/e2e-test-app-fabric + contents: "**" + - script: yarn e2etest displayName: yarn e2etest workingDirectory: packages/e2e-test-app-fabric diff --git a/packages/e2e-test-app-fabric/jest.config.js b/packages/e2e-test-app-fabric/jest.config.js index 1a2488daeeb..773a60da66e 100644 --- a/packages/e2e-test-app-fabric/jest.config.js +++ b/packages/e2e-test-app-fabric/jest.config.js @@ -60,7 +60,7 @@ module.exports = { setupFilesAfterEnv: ['react-native-windows/jest/setup', './jest.setup.js'], testEnvironmentOptions: { - app: `windows\\x64\\Debug\\RNTesterApp-Fabric.exe`, + app: `windows\\x64\\Release\\RNTesterApp-Fabric.exe`, enableAutomationChannel: true, }, diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 97697e54ee4..8dc65aa0f57 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -28,7 +28,7 @@ type RNTesterList = { const testerList: RNTesterList = require('@react-native-windows/tester/js/utils/RNTesterList'); -const apiExamples = testerList.APIs.map(e => e.module.title); +//const apiExamples = testerList.APIs.map(e => e.module.title); const componentExamples = testerList.Components.map(e => e.module.title); describe('visitAllPages', () => { diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp index 17e636e57d9..7af6d54d2a3 100644 --- a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp @@ -82,14 +82,21 @@ struct WindowData { static HINSTANCE s_instance; static constexpr uint16_t defaultDebuggerPort{9229}; - std::wstring m_bundleFile = L"index"; bool m_windowInited{false}; winrt::Microsoft::ReactNative::CompositionHwndHost m_CompositionHwndHost{nullptr}; winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr}; winrt::Microsoft::ReactNative::ReactInstanceSettings m_instanceSettings{nullptr}; + #if BUNDLE + std::wstring m_bundleFile = L"index.windows"; + bool m_useWebDebugger{false}; + bool m_fastRefreshEnabled{false}; +#else + std::wstring m_bundleFile = L"index"; bool m_useWebDebugger{false}; bool m_fastRefreshEnabled{true}; +#endif + bool m_useDirectDebugger{false}; bool m_breakOnNextLine{false}; uint16_t m_debuggerPort{defaultDebuggerPort}; From 580a18b91e5200ef65d5c6f8ca3079b1f2e82a7e Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:38:51 -0700 Subject: [PATCH 05/18] Alter Path --- .ado/jobs/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/jobs/e2e-test.yml b/.ado/jobs/e2e-test.yml index ed175b04dc5..e802a6b9aaa 100644 --- a/.ado/jobs/e2e-test.yml +++ b/.ado/jobs/e2e-test.yml @@ -198,7 +198,7 @@ jobs: displayName: Copy Bundle inputs: sourceFolder: packages/e2e-test-app-fabric/windows/x64/Release/Bundle - targetFolder: packages/e2e-test-app-fabric + targetFolder: packages/e2e-test-app-fabric/Bundle contents: "**" - script: yarn e2etest From bf31bfc1443fa780b5d4175ce34e06e665b5d048 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:44:58 -0700 Subject: [PATCH 06/18] Adjust Commands --- packages/e2e-test-app-fabric/test/RNTesterNavigation.ts | 5 ++--- .../windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 55781ef8a59..56129e2a861 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -12,7 +12,7 @@ import {app} from '@react-native-windows/automation'; */ export async function goToComponentExample(example: string) { const componentsTabButton = await app.findElementByTestID('components-tab'); - await app.waitUntil(async () => await componentsTabButton.isDisplayed()); + await componentsTabButton.waitForDisplayed({timeout: 20000}); await componentsTabButton.click(); await goToExample(example); } @@ -22,7 +22,7 @@ export async function goToComponentExample(example: string) { */ export async function goToApiExample(example: string) { const componentsTabButton = await app.findElementByTestID('apis-tab'); - await app.waitUntil(async () => await componentsTabButton.isDisplayed()); + await componentsTabButton.waitForDisplayed({timeout: 20000}); await componentsTabButton.click(); await goToExample(example); } @@ -32,7 +32,6 @@ async function goToExample(example: string) { const searchBox = await app.findElementByTestID('explorer_search'); // Only grab first three characters of string to reduce cases in WebDriverIO mistyping. await searchBox.addValue(regexEscape(example.substring(0, 3))); - const exampleButton = await app.findElementByTestID(example); await exampleButton.click(); diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp index 7af6d54d2a3..c34bbc1539c 100644 --- a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp @@ -87,7 +87,7 @@ struct WindowData { winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr}; winrt::Microsoft::ReactNative::ReactInstanceSettings m_instanceSettings{nullptr}; - #if BUNDLE +#if BUNDLE std::wstring m_bundleFile = L"index.windows"; bool m_useWebDebugger{false}; bool m_fastRefreshEnabled{false}; From 11fde82a6fe50a3f165315a229ff25862508864b Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:01:41 -0700 Subject: [PATCH 07/18] Test Single Case --- .../e2e-test-app-fabric/test/visitAllPages.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 8dc65aa0f57..ffadb7c4f4e 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -4,7 +4,7 @@ * * @format */ -import {goToApiExample, goToComponentExample} from './RNTesterNavigation'; +import {goToComponentExample} from './RNTesterNavigation'; import {verifyNoErrorLogs} from './Helpers'; afterEach(async () => { @@ -29,20 +29,22 @@ type RNTesterList = { const testerList: RNTesterList = require('@react-native-windows/tester/js/utils/RNTesterList'); //const apiExamples = testerList.APIs.map(e => e.module.title); -const componentExamples = testerList.Components.map(e => e.module.title); +//const componentExamples = testerList.Components.map(e => e.module.title); describe('visitAllPages', () => { test('control', () => { expect(true).toBe(true); }); - for (const component of componentExamples) { + /*for (const component of componentExamples) { if (component === 'Flyout' || component === 'XAML') { continue; } test(component, async () => await goToComponentExample(component)); - } + }*/ + test('XMLHttpRequest', async () => + await goToComponentExample('XMLHttpRequest')); // Disable temporarily until tests become stable. Currently, windows loses focus randomly resulting in tests being stalled. /*for (const api of apiExamples) { From e131e6d7e9b7865ba6c1a6f33985d45aa67b00a2 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:47:15 -0700 Subject: [PATCH 08/18] Fire Warning if WebDriverIO loses focus --- .../test/RNTesterNavigation.ts | 20 +++++++++++++++++-- .../test/visitAllPages.test.ts | 8 +++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 56129e2a861..daf0d305325 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -12,7 +12,15 @@ import {app} from '@react-native-windows/automation'; */ export async function goToComponentExample(example: string) { const componentsTabButton = await app.findElementByTestID('components-tab'); - await componentsTabButton.waitForDisplayed({timeout: 20000}); + const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); + // Work around for WebDriverIO inconsistent behavior. + if (result) { + console.warn( + example, + 'page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', + ); + return; + } await componentsTabButton.click(); await goToExample(example); } @@ -22,7 +30,15 @@ export async function goToComponentExample(example: string) { */ export async function goToApiExample(example: string) { const componentsTabButton = await app.findElementByTestID('apis-tab'); - await componentsTabButton.waitForDisplayed({timeout: 20000}); + const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); + // Work around for WebDriverIO inconsistent behavior. + if (result) { + console.warn( + example, + 'page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', + ); + return; + } await componentsTabButton.click(); await goToExample(example); } diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index ffadb7c4f4e..75dfc127015 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -29,22 +29,20 @@ type RNTesterList = { const testerList: RNTesterList = require('@react-native-windows/tester/js/utils/RNTesterList'); //const apiExamples = testerList.APIs.map(e => e.module.title); -//const componentExamples = testerList.Components.map(e => e.module.title); +const componentExamples = testerList.Components.map(e => e.module.title); describe('visitAllPages', () => { test('control', () => { expect(true).toBe(true); }); - /*for (const component of componentExamples) { + for (const component of componentExamples) { if (component === 'Flyout' || component === 'XAML') { continue; } test(component, async () => await goToComponentExample(component)); - }*/ - test('XMLHttpRequest', async () => - await goToComponentExample('XMLHttpRequest')); + } // Disable temporarily until tests become stable. Currently, windows loses focus randomly resulting in tests being stalled. /*for (const api of apiExamples) { From 4099ed11ffdbc042f520334dcb2457795c0dfb5d Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:17:03 -0700 Subject: [PATCH 09/18] Adjuist --- packages/e2e-test-app-fabric/test/RNTesterNavigation.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index daf0d305325..87aa181f0d0 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -14,10 +14,10 @@ export async function goToComponentExample(example: string) { const componentsTabButton = await app.findElementByTestID('components-tab'); const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); // Work around for WebDriverIO inconsistent behavior. - if (result) { + if (!result) { console.warn( example, - 'page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', + 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', ); return; } @@ -32,10 +32,10 @@ export async function goToApiExample(example: string) { const componentsTabButton = await app.findElementByTestID('apis-tab'); const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); // Work around for WebDriverIO inconsistent behavior. - if (result) { + if (!result) { console.warn( example, - 'page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', + 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', ); return; } From 750962cf52ee972b800237535f202c034257b317 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:18:39 -0700 Subject: [PATCH 10/18] Add API --- .../test/visitAllPages.test.ts | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 75dfc127015..8bfe2e4d3b3 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -4,7 +4,7 @@ * * @format */ -import {goToComponentExample} from './RNTesterNavigation'; +import {goToApiExample, goToComponentExample} from './RNTesterNavigation'; import {verifyNoErrorLogs} from './Helpers'; afterEach(async () => { @@ -44,26 +44,15 @@ describe('visitAllPages', () => { test(component, async () => await goToComponentExample(component)); } - // Disable temporarily until tests become stable. Currently, windows loses focus randomly resulting in tests being stalled. - /*for (const api of apiExamples) { - if ( - api === 'Transforms' || - api === 'Keyboard Focus Example' || - api === 'Alerts' || - api === 'Linking' || - api === 'AppState' || - api === 'Border' || - api === 'Crash' || - api === 'Accessibility Windows' || - api === 'Accessibility' - ) - // disable until either transformExample uses units, or that isn't an error + for (const api of apiExamples) { + if (api === 'Transforms' || api === 'Keyboard Focus Example') + // Disable until tests are supported. continue; test(api, async () => { await goToApiExample(api); }); - }*/ + } }); export {}; From ebf7befb576c9015ee98f82274dacc5a28dd1c22 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:05:17 -0700 Subject: [PATCH 11/18] Fix File --- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 8bfe2e4d3b3..317d715c0ce 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -28,7 +28,7 @@ type RNTesterList = { const testerList: RNTesterList = require('@react-native-windows/tester/js/utils/RNTesterList'); -//const apiExamples = testerList.APIs.map(e => e.module.title); +const apiExamples = testerList.APIs.map(e => e.module.title); const componentExamples = testerList.Components.map(e => e.module.title); describe('visitAllPages', () => { From bf6034fadebabdd1a026b3963f8012692512f5ef Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:06:46 -0700 Subject: [PATCH 12/18] Add Additional Workaround --- .../e2e-test-app-fabric/test/RNTesterNavigation.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 87aa181f0d0..3399c3bc1d2 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -51,11 +51,16 @@ async function goToExample(example: string) { const exampleButton = await app.findElementByTestID(example); await exampleButton.click(); - // Make sure we've launched the example by waiting until the search box is - // no longer present, but make sure we haven't crashed by checking that nav - // buttons are still visible - await app.waitUntil(async () => !(await exampleButton.isDisplayed())); const componentsTab = await app.findElementByTestID('components-tab'); + const result = await componentsTab.waitForDisplayed({timeout: 5000}); + // Work around for WebDriverIO inconsistent behavior. + if (!result) { + console.warn( + example, + 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', + ); + return; + } expect(await componentsTab.isDisplayed()).toBe(true); } From 11f5ec051162010091810e71848281ff942acf9c Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:36:31 -0700 Subject: [PATCH 13/18] Add Backspace --- .../test/RNTesterNavigation.ts | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 3399c3bc1d2..0b3b8f943d7 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -12,15 +12,7 @@ import {app} from '@react-native-windows/automation'; */ export async function goToComponentExample(example: string) { const componentsTabButton = await app.findElementByTestID('components-tab'); - const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); - // Work around for WebDriverIO inconsistent behavior. - if (!result) { - console.warn( - example, - 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', - ); - return; - } + await componentsTabButton.waitForDisplayed({timeout: 20000}); await componentsTabButton.click(); await goToExample(example); } @@ -46,21 +38,14 @@ export async function goToApiExample(example: string) { async function goToExample(example: string) { // Filter the list down to the one test, to improve the stability of selectors const searchBox = await app.findElementByTestID('explorer_search'); + await searchBox.addValue(['Backspace', 'Backspace', 'Backspace']); // Only grab first three characters of string to reduce cases in WebDriverIO mistyping. await searchBox.addValue(regexEscape(example.substring(0, 3))); const exampleButton = await app.findElementByTestID(example); await exampleButton.click(); const componentsTab = await app.findElementByTestID('components-tab'); - const result = await componentsTab.waitForDisplayed({timeout: 5000}); - // Work around for WebDriverIO inconsistent behavior. - if (!result) { - console.warn( - example, - 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', - ); - return; - } + await componentsTab.waitForDisplayed({timeout: 5000}); expect(await componentsTab.isDisplayed()).toBe(true); } From b078e182efebe8c29286aca6e025c4afef09e2cb Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:21:45 -0700 Subject: [PATCH 14/18] Remove Border Example --- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 317d715c0ce..f320860f6db 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -45,7 +45,11 @@ describe('visitAllPages', () => { } for (const api of apiExamples) { - if (api === 'Transforms' || api === 'Keyboard Focus Example') + if ( + api === 'Transforms' || + api === 'Keyboard Focus Example' || + api === 'Border' + ) // Disable until tests are supported. continue; From a91e54386b5089904e77acbee553a3d60f8c8d57 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:04:16 -0700 Subject: [PATCH 15/18] Remove Unneeded Workaround --- .../e2e-test-app-fabric/test/RNTesterNavigation.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts index 0b3b8f943d7..815bc4516f6 100644 --- a/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts +++ b/packages/e2e-test-app-fabric/test/RNTesterNavigation.ts @@ -22,15 +22,7 @@ export async function goToComponentExample(example: string) { */ export async function goToApiExample(example: string) { const componentsTabButton = await app.findElementByTestID('apis-tab'); - const result = await componentsTabButton.waitForDisplayed({timeout: 20000}); - // Work around for WebDriverIO inconsistent behavior. - if (!result) { - console.warn( - example, - 'Page was skipped due to inconsistent WebDriverIO behavior. Please verify page can load locally or rerun this test.', - ); - return; - } + await componentsTabButton.waitForDisplayed({timeout: 20000}); await componentsTabButton.click(); await goToExample(example); } From d86b16227527f75161af8d0be796ebe667a5f261 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:35:48 -0700 Subject: [PATCH 16/18] Remove Faulty Test --- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index f320860f6db..38cb69da94c 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -48,7 +48,9 @@ describe('visitAllPages', () => { if ( api === 'Transforms' || api === 'Keyboard Focus Example' || - api === 'Border' + api === 'Border' || + api === 'Alerts' || + api === 'Crash' ) // Disable until tests are supported. continue; From 7855c104c2b040a5ea25486d0fab8fdff14acdf9 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Fri, 25 Aug 2023 12:18:44 -0700 Subject: [PATCH 17/18] Disable API --- .../e2e-test-app-fabric/test/visitAllPages.test.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 38cb69da94c..38ae0bc85e7 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -44,21 +44,16 @@ describe('visitAllPages', () => { test(component, async () => await goToComponentExample(component)); } - for (const api of apiExamples) { - if ( - api === 'Transforms' || - api === 'Keyboard Focus Example' || - api === 'Border' || - api === 'Alerts' || - api === 'Crash' - ) + // Disable Temporarily Until Stable + /*for (const api of apiExamples) { + if (api === 'Transforms' || api === 'Keyboard Focus Example') // Disable until tests are supported. continue; test(api, async () => { await goToApiExample(api); }); - } + }*/ }); export {}; From 1f7c3d454622fc3cbde20382f6416949e1ff0a09 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:09:57 -0700 Subject: [PATCH 18/18] Fix Lint --- packages/e2e-test-app-fabric/test/visitAllPages.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts index 38ae0bc85e7..cf3973798f3 100644 --- a/packages/e2e-test-app-fabric/test/visitAllPages.test.ts +++ b/packages/e2e-test-app-fabric/test/visitAllPages.test.ts @@ -4,7 +4,7 @@ * * @format */ -import {goToApiExample, goToComponentExample} from './RNTesterNavigation'; +import {goToComponentExample} from './RNTesterNavigation'; import {verifyNoErrorLogs} from './Helpers'; afterEach(async () => { @@ -28,7 +28,7 @@ type RNTesterList = { const testerList: RNTesterList = require('@react-native-windows/tester/js/utils/RNTesterList'); -const apiExamples = testerList.APIs.map(e => e.module.title); +//const apiExamples = testerList.APIs.map(e => e.module.title); const componentExamples = testerList.Components.map(e => e.module.title); describe('visitAllPages', () => {