├── .watchmanconfig ├── e2e ├── mocha.opts ├── init.js └── firstTest.spec.js ├── .babelrc ├── .gitignore ├── example.gif ├── app.json ├── setup.sh ├── package.json ├── README.md └── App.js /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /e2e/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive --timeout 1200000 --bail 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | bin/ 5 | -------------------------------------------------------------------------------- /example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expo/with-detox-tests/HEAD/example.gif -------------------------------------------------------------------------------- /e2e/init.js: -------------------------------------------------------------------------------- 1 | require('babel-polyfill'); 2 | const detox = require('detox'); 3 | const config = require('../package.json').detox; 4 | 5 | before(async () => { 6 | await detox.init(config); 7 | }); 8 | 9 | after(async () => { 10 | await detox.cleanup(); 11 | }); 12 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "with-detox-tests", 4 | "description": "Demonstrates integration of the Detox gray box end-to-end testing library with Expo", 5 | "slug": "with-detox-tests", 6 | "privacy": "unlisted", 7 | "sdkVersion": "31.0.0", 8 | "version": "1.0.0", 9 | "orientation": "portrait" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # query expo.io to find most recent ipaUrl 4 | IPA_URL=`curl https://expo.io/--/api/v2/versions | python -c 'import sys, json; print json.load(sys.stdin)["iosUrl"]'` 5 | 6 | # download tar.gz 7 | TMP_PATH=/tmp/exponent.tar.gz 8 | wget -O $TMP_PATH $IPA_URL 9 | 10 | # recursively make app dir 11 | APP_PATH=bin/Exponent.app 12 | mkdir -p $APP_PATH 13 | 14 | # unzip tar.gz into APP_PATH 15 | tar -C $APP_PATH -xzf $TMP_PATH 16 | -------------------------------------------------------------------------------- /e2e/firstTest.spec.js: -------------------------------------------------------------------------------- 1 | const { reloadApp } = require('detox-expo-helpers'); 2 | 3 | describe('Example', () => { 4 | beforeEach(async () => { 5 | await reloadApp(); 6 | }); 7 | 8 | it('should have welcome screen', async () => { 9 | await expect(element(by.id('welcome'))).toBeVisible(); 10 | }); 11 | 12 | it('should show hello screen after tap', async () => { 13 | await element(by.id('hello_button')).tap(); 14 | await expect(element(by.label('Hello!!!'))).toBeVisible(); 15 | }); 16 | 17 | it('should show world screen after tap', async () => { 18 | await element(by.id('world_button')).tap(); 19 | await expect(element(by.label('World!!!'))).toBeVisible(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "detox-testing", 3 | "version": "0.0.0", 4 | "description": "Hello Expo!", 5 | "author": null, 6 | "private": true, 7 | "main": "node_modules/expo/AppEntry.js", 8 | "scripts": { 9 | "e2e": "detox test --configuration ios.sim" 10 | }, 11 | "dependencies": { 12 | "expo": "^31.0.4", 13 | "react": "16.5.0", 14 | "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz" 15 | }, 16 | "devDependencies": { 17 | "babel-polyfill": "^6.26.0", 18 | "detox": "^9.0.6", 19 | "detox-expo-helpers": "^0.6.0", 20 | "expo-detox-hook": "^1.0.10", 21 | "mocha": "^3.5.0" 22 | }, 23 | "detox": { 24 | "configurations": { 25 | "ios.sim": { 26 | "binaryPath": "bin/Exponent.app", 27 | "type": "ios.simulator", 28 | "name": "iPhone 7" 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚨 Attention! 🚨 2 | 3 | This repository is no longer maintained. We recommend that you refer to the following repository instead: https://github.com/yaron1m/expo-detox-typescript-example 4 | 5 |