xref: /expo/packages/expo-dev-client/.detoxrc.js (revision 383b651e)
1const path = require('path');
2
3function getArtifactsPath() {
4  if (process.env.GITHUB_WORKSPACE) {
5    return path.join(process.env.GITHUB_WORKSPACE, 'packages', 'expo-dev-client', 'artifacts');
6  }
7
8  return './artifacts';
9}
10
11const artifactsPath = getArtifactsPath();
12
13module.exports = {
14  'test-runner': 'jest',
15  runnerConfig: 'e2e/config.json',
16  skipLegacyWorkersInjection: true,
17  devices: {
18    emulator: {
19      type: 'android.emulator',
20      device: {
21        avdName: 'avd-33',
22      },
23    },
24    simulator: {
25      type: 'ios.simulator',
26      device: {
27        type: 'iPhone 13',
28      },
29    },
30  },
31  apps: {
32    'android.debug': {
33      type: 'android.apk',
34      binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
35      build:
36        'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..',
37    },
38    'ios.debug': {
39      type: 'ios.app',
40      binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/{{= it.name }}.app',
41      build:
42        'xcodebuild -workspace ios/{{= it.name }}.xcworkspace -scheme {{= it.name }} -configuration Debug -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build',
43    },
44  },
45  configurations: {
46    android: {
47      device: 'emulator',
48      app: 'android.debug',
49    },
50    ios: {
51      device: 'simulator',
52      app: 'ios.debug',
53    },
54  },
55  artifacts: {
56    rootDir: artifactsPath,
57    plugins: {
58      uiHierarchy: { enabled: true, keepOnlyFailedTestsArtifacts: true },
59      log: { enabled: true, keepOnlyFailedTestsArtifacts: true },
60      screenshot: {
61        enabled: true,
62        keepOnlyFailedTestsArtifacts: true,
63      },
64    },
65  },
66};
67