Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/legacy-mobile-split.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fluentui-react-native/tester": patch
---

FluentTester now hosts only macOS and Windows. Its iOS and Android host,
native projects, and assets move to the private `legacy-mobile` app, and the
mobile Appium E2E configurations are retired.
22 changes: 4 additions & 18 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,7 @@ jobs:

- name: Bundle Android
run: yarn bundle:android
working-directory: apps/fluent-tester

# Android E2E tests are currently disabled
# - name: Build Android APK
# ...
# - name: Run E2E Android tests
# ...
working-directory: apps/legacy-mobile

macos:
name: macOS PR
Expand Down Expand Up @@ -319,27 +313,19 @@ jobs:
run: |
set -eox pipefail
yarn bundle:ios
working-directory: apps/fluent-tester
working-directory: apps/legacy-mobile

- name: Pod install
run: |
set -eox pipefail
pod install --verbose
working-directory: apps/fluent-tester/ios
working-directory: apps/legacy-mobile/ios

- name: Build iOS app
run: ./.github/scripts/xcodebuild.mts apps/fluent-tester/ios/FluentTester.xcworkspace iphonesimulator ReactTestApp build
run: ./.github/scripts/xcodebuild.mts apps/legacy-mobile/ios/FluentTester.xcworkspace iphonesimulator ReactTestApp build
env:
CCACHE_DISABLE: 1

# iOS E2E tests are currently disabled
# - name: Prepare E2E iOS tests
# run: yarn e2eprep:ios
# working-directory: apps/E2E
# - name: Run E2E iOS tests
# run: yarn e2etest:ios
# working-directory: apps/E2E

windows:
name: Windows PR
runs-on: windows-latest
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
"name": "Attach to mobile packager",
"request": "attach",
"type": "reactnative",
"cwd": "${workspaceFolder}/apps/fluent-tester"
"cwd": "${workspaceFolder}/apps/legacy-mobile"
},
{
"name": "Attach to packager (Win32)",
Expand Down
13 changes: 0 additions & 13 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ catalog:
"@wdio/spec-reporter": ^9.24.0
appium: ^3.6.0
appium-mac2-driver: ^3.2.13
appium-uiautomator2-driver: ^6.7.8
appium-windows-driver: ^5.1.5
appium-xcuitest-driver: ^10.14.5
cross-env: ^10.1.0
expect-webdriverio: ^5.6.1
knip: ^6.12.1
Expand Down Expand Up @@ -101,28 +99,17 @@ packageExtensions:
appium-mac2-driver@*:
dependencies:
appium: "*"
appium-uiautomator2-driver@*:
dependencies:
appium: "*"
appium-webdriveragent@*:
dependencies:
appium-xcode: "*"
appium-windows-driver@*:
dependencies:
appium: "*"
appium-xcuitest-driver@*:
dependencies:
appium: "*"
devtools@6.12.1:
dependencies:
debug: ^4.4.3
appium@*:
dependencies:
"@colors/colors": "*"
appium-mac2-driver: "*"
appium-uiautomator2-driver: "*"
appium-windows-driver: "*"
appium-xcuitest-driver: "*"
expect-webdriverio@*:
dependencies:
"@wdio/globals": "*"
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Fixes to existing v0 and v1 components keep their current framework, public API,
1. If a component contains a native module, add its `podspec` path to the FluentTester Podfile. The React Native
community CLI does not support
[autolinking transitive dependencies](https://github.com/react-native-community/cli/issues/1347). Then run
`yarn && yarn build` from the root, and run `pod install` from `apps/fluent-tester/macos` or `apps/fluent-tester/ios`
for native Apple code.
`yarn && yarn build` from the root, and run `pod install` from `apps/fluent-tester/macos` for macOS or
`apps/legacy-mobile/ios` for iOS.

## Adding native code to your new component

Expand Down Expand Up @@ -243,7 +243,7 @@ To add a native module that wraps a FluentUI Android control:
- Add dependencies for kotlin, maven, react-native, etc
- Add dependency for FluentUIAndroid

c. Add @fluentui-react-native/<new-component> package under "dependencies" and "depcheck"/"ignoreMatches" in apps/fluent-tester/package.json in order for our Fluent Tester app to build and use your new Android component module
c. Add @fluentui-react-native/<new-component> package under "dependencies" and "depcheck"/"ignoreMatches" in the relevant tester host package.json (`apps/legacy-mobile` for iOS/Android and `apps/fluent-tester` for macOS/Windows) so native modules are available to each host.

## Creating a pull request

Expand Down
49 changes: 12 additions & 37 deletions apps/E2E/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,18 @@ Reports, original failures, and target-scoped evidence live under
Windows additionally requires a built, registered RN Test App with a verified
generated renderer; macOS requires its own built application and permissions.

Keep all legacy desktop and mobile lanes until per-test assertion mapping,
Keep all legacy desktop lanes until per-test assertion mapping,
equivalent-build comparisons, and at least 100 representative runs per endpoint
over 14 days demonstrate at least 99% infrastructure success and zero process
or input leaks. Hosted input-disabled checks do not qualify physical input.
The remaining sections describe the retained Appium workflow.
Historical iOS and Android specs remain under `apps/E2E/src` as dormant
assertion references. They have no active WebdriverIO configuration, Appium
preparation command, or PR lane. The iOS/Android host and build instructions
live in [`apps/legacy-mobile`](../legacy-mobile/README.md). Do not treat these
source specifications as executed coverage or restore mobile Appium runners as
part of the desktop migration.

The remaining sections describe retained desktop Appium workflows.

**There is currently an Appium issue with NPM v8.19.2. Please use an older version of NPM**

Expand Down Expand Up @@ -100,7 +107,8 @@ and drag & drop the **XCode Helper** app to **Security & Privacy -> Privacy -> A

- E2E - The root E2E testing folder containing test components and their respective platform-specific page objects and spec documents.
- reports - Each platform folder (apple, win32, windows) contains this folder that saves the test reports from Appium/WebDriverIO.
- wdio.conf.js - Each platform folder contains this file. It's the configuration file for WebDriverIO, which also configures Appium, WinAppDriver, and Jasmine parameters.
- `wdio.conf.<desktop>.js` - The active desktop configurations for WebdriverIO, Appium, WinAppDriver, and Jasmine.
- Historical iOS/Android spec files remain without runner configurations.

# Running E2E Tests

Expand All @@ -116,7 +124,7 @@ Yarn-managed drivers and load only the Windows driver. Do not change this to
`.appium` or run an unversioned `appium driver install windows`: that creates a
separate dependency tree outside the lockfile and can leave the driver unable
to import its Appium peer. Existing `.appium` installations are ignored by these
two endpoints; the mobile and macOS commands retain their existing setup.
two endpoints; the macOS command retains its existing setup.

Run `yarn test:appium` to check driver discovery, the locked package path and
version, the actual driver import, and the Windows/Win32 runner configuration
Expand Down Expand Up @@ -159,39 +167,6 @@ _Note: It could take up to a minute to load the test app with WebDriverIO, don't

_Note: It could take up to a minute to load the test app with WebDriverIO, don't panic, the tests will run :)_

## iOS Steps

First check that iOS configs in wdio.conf.ios.js are updated to match your dev environment. If the config doesn't match you may get an error message "App with bundle identifier 'com.microsoft.ReactTestApp' unknown"

- 'appium:deviceName' should be updated to a simulator that you have. You can check the ones you have by going to the 'Devices and Simulators' window in Xcode.
- 'appium:platformVersion' should be updated to match the iOS version of the simulator you're using. You can check what version this should be in the same 'Devices and Simulators' window.

1. Follow step #1 from "Win32 Steps" section above.
2. POD Install
- (from fluentui-react-native) `cd apps/fluent-tester/ios`
- (from fluentui-react-native/apps/fluent-tester/ios) `pod install`
3. Start the server
- (from fluentui-react-native) `cd apps/fluent-tester`
- (from fluentui-react-native/apps/fluent-tester) `yarn start`
4. Open a new command prompt and run the E2E tests
- (from fluentui-react-native/apps/E2E) `yarn e2etest:ios`

_Note: It could take up to a minute to load the test app with WebDriverIO, don't panic, the tests will run :)_

## Android Steps

1. Follow step #1 from "Win32 Steps" section above.
2. Start the server
- (from fluentui-react-native) `cd apps/fluent-tester`
- (from fluentui-react-native/apps/fluent-tester) `yarn start`
3. Install and run the app from a new command prompt
- (from fluentui-react-native) `cd apps/fluent-tester`
- (from fluentui-react-native/apps/fluent-tester) `yarn android`
4. Open a new command prompt and run the E2E tests
- (from fluentui-react-native/apps/E2E) `yarn e2etest:android`

_Note: It could take up to a minute to load the test app with WebDriverIO, don't panic, the tests will run :)_

# Authoring E2E Test

You just added a new component to FURN... Awesome! Now we need to make sure we have proper regression testing to make sure we put the safest product out there (don't worry, it's not as hard as it sounds). Here's what we have to do:
Expand Down
22 changes: 21 additions & 1 deletion apps/E2E/appium.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ const path = require('node:path');
const { test } = require('node:test');
const { pathToFileURL } = require('node:url');

const { scripts } = require('./package.json');
const { dependencies, devDependencies, scripts } = require('./package.json');
const legacyMobilePackage = require('../legacy-mobile/package.json');

test('legacy mobile Appium runner configs and commands are retired', () => {
for (const platform of ['android', 'ios']) {
const driver = platform === 'android' ? 'appium-uiautomator2-driver' : 'appium-xcuitest-driver';
assert.equal(scripts[`e2eprep:${platform}`], undefined);
assert.equal(scripts[`e2etest:${platform}`], undefined);
assert.equal(dependencies[driver], undefined);
assert.equal(devDependencies[driver], undefined);
assert.equal(require('node:fs').existsSync(path.join(__dirname, `wdio.conf.${platform}.js`)), false);
}
});

test('legacy mobile host has no Appium or WebdriverIO dependencies', () => {
const packageNames = [...Object.keys(legacyMobilePackage.dependencies ?? {}), ...Object.keys(legacyMobilePackage.devDependencies ?? {})];
assert.equal(
packageNames.some((name) => name === 'appium' || name.startsWith('appium-') || name === 'webdriverio' || name.startsWith('@wdio/')),
false,
);
});

test('Appium discovers and loads the Yarn-managed Windows driver', async () => {
const output = execFileSync(process.execPath, [require.resolve('appium/index.js'), 'driver', 'list', '--installed', '--json'], {
Expand Down
6 changes: 0 additions & 6 deletions apps/E2E/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@
"scripts": {
"build": "tsc -b",
"desktop-test": "desktop-test",
"e2eprep:android": "cross-env APPIUM_HOME=.appium yarn exec appium driver install uiautomator2",
"e2eprep:ios": "cross-env APPIUM_HOME=.appium yarn exec appium driver install xcuitest",
"e2eprep:macos": "cross-env APPIUM_HOME=.appium yarn exec appium driver install mac2",
"e2eprep:win32": "yarn test:appium",
"e2eprep:windows": "yarn test:appium",
"e2etest:android": "cross-env APPIUM_HOME=.appium wdio run wdio.conf.android.js",
"e2etest:ios": "cross-env APPIUM_HOME=.appium wdio run wdio.conf.ios.js",
"e2etest:macos": "cross-env APPIUM_HOME=.appium wdio run wdio.conf.macos.js",
"e2etest:win32": "cross-env APPIUM_HOME=. wdio run wdio.conf.win32.js",
"e2etest:windows": "rimraf errorShots reports && cross-env APPIUM_HOME=. wdio run wdio.conf.windows.js",
Expand Down Expand Up @@ -68,9 +64,7 @@
"@wdio/spec-reporter": "catalog:",
"appium": "catalog:",
"appium-mac2-driver": "catalog:",
"appium-uiautomator2-driver": "catalog:",
"appium-windows-driver": "catalog:",
"appium-xcuitest-driver": "catalog:",
"cross-env": "catalog:",
"expect-webdriverio": "catalog:",
"metro-config": "^0.83.8",
Expand Down
Loading
Loading