Skip to content

Commit

Permalink
add first 2e2 local test using detox
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 committed Mar 27, 2024
1 parent 1c8e74b commit 4b71a3b
Show file tree
Hide file tree
Showing 14 changed files with 2,148 additions and 150 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ web-build/
.*.env.*
.env

# Detox
artifacts/

# Diagnostic reports (https://nodejs.org/api/report.html)
report/
3 changes: 2 additions & 1 deletion config/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ const config: ExpoConfig = {
dsn: process?.env?.SENTRY_DSN, // || 'sentry dsn, or use the `SENTRY_DSN` environment variable',
authToken: process?.env?.SENTRY_AUTH_TOKEN, // || 'sentry auth token, or use the `SENTRY_AUTH_TOKEN` environment variable',
}
]
],
'@config-plugins/detox'
],
ios: {
supportsTablet: false,
Expand Down
2 changes: 1 addition & 1 deletion config/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default (): JestConfigWithTsJest => ({
}]
},
resolver: 'ts-jest-resolver',
testRegex: 'test/.*\\.(test|spec)?\\.(ts|tsx)$',
testRegex: 'test/(?!e2e/).*\\.(test|spec)?\\.(ts|tsx)$',
// moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
preset: 'jest-expo',
transformIgnorePatterns: [
Expand Down
56 changes: 56 additions & 0 deletions detox.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/** @type {Detox.DetoxConfig} */
module.exports = {
logger: {
level: process.env.CI ? 'debug' : undefined
},
testRunner: {
args: {
$0: 'jest',
config: 'test/e2e/jest.config.js',
_: ['e2e']
}
},
artifacts: {
plugins: {
log: process.env.CI ? 'failing' : undefined,
screenshot: 'failing'
}
},
apps: {
'ios.release': {
type: 'ios.app',
build:
'xcodebuild -workspace ios/eastestsexample.xcworkspace -scheme eastestsexample -configuration Release -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/eastestsexample.app'
},
'android.release': {
type: 'android.apk',
build: 'cd android && gradlew clean :app:assembleRelease :app:assembleAndroidTest -DtestBuildType=release && cd ..',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk'
},
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14'
}
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Pixel_7_Pro_API_34'
}
}
},
configurations: {
'ios.release': {
device: 'simulator',
app: 'ios.release'
},
'android.emu.release': {
device: 'emulator',
app: 'android.release'
}
}
}
Loading

0 comments on commit 4b71a3b

Please sign in to comment.