-
Notifications
You must be signed in to change notification settings - Fork 39
Adds CI coverage for the existing Detox iOS E2E suites in RNApp, ExpoApp54, and ExpoApp55. #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alpharius-ck
wants to merge
35
commits into
main
Choose a base branch
from
fixes-for-local-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
7b99a2a
feat: add shared jest tests for demo apps
narefyev91 7111313
feat: use correct version for yarn
narefyev91 d12501f
feat: add change set
alpharius-ck ca838d6
Potential fix for pull request finding
alpharius-ck 643b12c
feat: add required globals
alpharius-ck 0bd212f
feat: fixes for local build
alpharius-ck fde9f2b
Merge branch 'main' into fixes-for-local-build
alpharius-ck 3f0dd65
feat: add ios e2e tests
alpharius-ck 5eae0f4
chore: merge main to current branch
alpharius-ck 4c74e91
feat: add ios e2e tests
alpharius-ck e0c6bca
feat: update CI failed
alpharius-ck e126da0
feat: add document
alpharius-ck b0e8189
Merge branch 'main' into e2e-tests-for-rn-ios
alpharius-ck 5e70e03
feat: add concurent ci runs
alpharius-ck 370fee2
chore: add dispatch
alpharius-ck 7f4890a
chore: retrigger CI
alpharius-ck fce7ce1
feat: fix actions for detox
alpharius-ck 1b8180a
feat: fix actions for RNApp
alpharius-ck ac32c18
feat: add correct sim for ci
alpharius-ck ba5a4c7
feat: update ci
alpharius-ck 6079aa0
feat: update ci
alpharius-ck 26ff08e
feat: update RNApp on CI
alpharius-ck 9d94277
feat: update Expo55 on CI
alpharius-ck a53ac67
feat: add local bash commands
alpharius-ck ef6d578
feat: add fix for Expo55
alpharius-ck 9ed1725
feat: add fix for Expo55 ci
alpharius-ck 71c8e55
feat: add fix for Expo54 ci
alpharius-ck 07e3525
Merge branch 'main' into e2e-tests-for-rn-ios
alpharius-ck 4eeb404
feat: add fix for Vanilla android
alpharius-ck db3eb33
feat: add change set
alpharius-ck f41059b
feat: add changes based on first review
alpharius-ck 994dae2
feat: add more changes
alpharius-ck 699a96d
feat: add E2E tests for AppleApp
alpharius-ck 9b98257
feat: add missing local run
alpharius-ck 0097306
feat: fix e2e test
alpharius-ck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: iOS E2E (Detox) | ||
| description: Build and run Detox iOS end-to-end tests for a brownfield example app | ||
|
|
||
| inputs: | ||
| app-path: | ||
| description: 'Path to the app workspace (e.g. apps/RNApp)' | ||
| required: true | ||
|
|
||
| run-expo-prebuild: | ||
| description: 'Run brownfield codegen and Expo iOS prebuild before pod install' | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| run-brownfield-codegen: | ||
| description: 'Run brownfield codegen before building (required for RNApp)' | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| artifact-name: | ||
| description: 'Name prefix for Detox artifacts uploaded on failure' | ||
| required: false | ||
| default: 'detox' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Prepare iOS environment | ||
| uses: ./.github/actions/prepare-ios | ||
|
|
||
| - name: Install applesimutils | ||
| run: | | ||
| brew tap wix/brew | ||
| brew install applesimutils | ||
| shell: bash | ||
|
|
||
| - name: Brownfield codegen | ||
| if: inputs.run-brownfield-codegen == 'true' | ||
| run: yarn codegen | ||
| working-directory: ${{ inputs.app-path }} | ||
| shell: bash | ||
|
|
||
| - name: Expo iOS prebuild | ||
| if: inputs.run-expo-prebuild == 'true' | ||
| run: | | ||
| node ../../packages/cli/dist/main.js codegen | ||
| yarn expo prebuild --platform ios --no-install | ||
| working-directory: ${{ inputs.app-path }} | ||
| shell: bash | ||
|
|
||
| - name: Restore Pods cache | ||
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | ||
| with: | ||
| path: ${{ inputs.app-path }}/ios/Pods | ||
| key: ${{ runner.os }}-e2e-ios-pods-${{ inputs.app-path }}-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.app-path)) }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-e2e-ios-pods-${{ inputs.app-path }}- | ||
|
|
||
| - name: Install CocoaPods | ||
| run: pod install | ||
| working-directory: ${{ inputs.app-path }}/ios | ||
| shell: bash | ||
|
|
||
| - name: Restore Detox build cache | ||
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | ||
| with: | ||
| path: ${{ inputs.app-path }}/ios/build | ||
| key: ${{ runner.os }}-e2e-ios-build-${{ inputs.app-path }}-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.app-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.app-path)) }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-e2e-ios-build-${{ inputs.app-path }}- | ||
|
|
||
| - name: Detox build (iOS Simulator) | ||
| run: yarn e2e:build:ios | ||
| working-directory: ${{ inputs.app-path }} | ||
| shell: bash | ||
|
|
||
| - name: Detox test (iOS Simulator) | ||
| run: yarn e2e:test:ios | ||
| working-directory: ${{ inputs.app-path }} | ||
| shell: bash | ||
|
|
||
| - name: Upload Detox artifacts on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: ${{ inputs.artifact-name }}-ios | ||
| path: ${{ inputs.app-path }}/artifacts | ||
| if-no-files-found: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| const { | ||
| getIosSimulatorDeviceType, | ||
| } = require('../brownfield-example-shared-tests/detox-ios-simulator-device.cjs'); | ||
|
|
||
| /** | ||
| * Requires a native tree from `expo prebuild` / `expo run:ios` (ios/ + Pods). | ||
| * @type {Detox.DetoxConfig} | ||
| */ | ||
| module.exports = { | ||
| testRunner: { | ||
| $0: 'jest', | ||
| args: { | ||
| config: 'e2e/jest.config.cjs', | ||
| _: ['e2e'], | ||
| }, | ||
| jest: { | ||
| setupTimeout: 300000, | ||
| }, | ||
| }, | ||
| apps: { | ||
| 'ios.debug': { | ||
| type: 'ios.app', | ||
| binaryPath: | ||
| 'ios/build/Build/Products/Debug-iphonesimulator/ExpoApp54.app', | ||
| build: | ||
| 'xcodebuild -workspace ios/ExpoApp54.xcworkspace -scheme ExpoApp54 -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build', | ||
| }, | ||
| }, | ||
| devices: { | ||
| 'ios.sim': { | ||
| type: 'ios.simulator', | ||
| device: { | ||
| type: getIosSimulatorDeviceType(), | ||
| }, | ||
| }, | ||
| }, | ||
| configurations: { | ||
| 'ios.sim.debug': { | ||
| device: 'ios.sim', | ||
| app: 'ios.debug', | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ yarn-error.* | |
|
|
||
| app-example | ||
|
|
||
| # Detox | ||
| artifacts/ | ||
|
|
||
| # generated native folders | ||
| /ios | ||
| /android | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| const path = require('node:path'); | ||
|
|
||
| const appRoot = path.join(__dirname, '..'); | ||
| const sharedTestsRoot = path.join( | ||
| __dirname, | ||
| '../../brownfield-example-shared-tests' | ||
| ); | ||
|
|
||
| module.exports = { | ||
| maxWorkers: 1, | ||
| rootDir: appRoot, | ||
| roots: [appRoot, sharedTestsRoot], | ||
| modulePaths: [path.join(appRoot, 'node_modules')], | ||
| testTimeout: 120000, | ||
| verbose: true, | ||
| reporters: ['detox/runners/jest/reporter'], | ||
| globalSetup: 'detox/runners/jest/globalSetup', | ||
| globalTeardown: 'detox/runners/jest/globalTeardown', | ||
| testEnvironment: 'detox/runners/jest/testEnvironment', | ||
| testMatch: [ | ||
| path.join(sharedTestsRoot, 'e2e/expoPostMessageBrownfield.e2e.js'), | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| import { ExpoRoot } from 'expo-router'; | ||
| import type { ComponentProps } from 'react'; | ||
| import { AppRegistry } from 'react-native'; | ||
| import { SafeAreaProvider } from 'react-native-safe-area-context'; | ||
|
|
||
| import RNApp from './RNApp'; | ||
|
|
||
| function App() { | ||
| const ctx = require.context('./app'); | ||
| return <ExpoRoot context={ctx} />; | ||
| type RNAppRootProps = ComponentProps<typeof RNApp>; | ||
|
|
||
| function RNAppRoot(props: RNAppRootProps) { | ||
| return ( | ||
| <SafeAreaProvider> | ||
| <RNApp {...props} /> | ||
| </SafeAreaProvider> | ||
| ); | ||
| } | ||
|
|
||
| AppRegistry.registerComponent('RNApp', () => RNApp); | ||
| // Keep compatibility with Expo's default app key. | ||
| AppRegistry.registerComponent('main', () => App); | ||
| AppRegistry.registerComponent('RNApp', () => RNAppRoot); | ||
| AppRegistry.registerComponent('main', () => RNAppRoot); | ||
|
alpharius-ck marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.