diff --git a/.gitignore b/.gitignore index 346907b..d18b33c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ dist/ web-build/ # Native -android -ios +android/ +ios/ *.orig.* *.jks *.p8 @@ -80,3 +80,5 @@ bin/ # Detox artifacts/ +*.log + diff --git a/.detoxrc.js b/detox.config.js similarity index 96% rename from .detoxrc.js rename to detox.config.js index 2fde615..a315141 100644 --- a/.detoxrc.js +++ b/detox.config.js @@ -36,7 +36,7 @@ module.exports = { type: 'android.apk', build: 'cd android && ./gradlew :app:assembleDebug :app:assembleAndroidTest -DtestBuildType=debug && cd ..', - binaryPath: 'bin/expo-base.apk', + binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk', }, 'android.release': { type: 'android.apk', diff --git a/e2e/tests/starter.e2e.ts b/e2e/tests/starter.e2e.ts index 517df44..226871a 100644 --- a/e2e/tests/starter.e2e.ts +++ b/e2e/tests/starter.e2e.ts @@ -1,12 +1,17 @@ const { openApp } = require('../utils/openApp'); -import { by, element, expect } from 'detox'; +import { by, element, expect, waitFor } from 'detox'; -describe('Example', () => { +describe('User can sign in successfully', () => { beforeAll(async () => { await openApp(); }); - it('should have welcome screen', async () => { - await expect(element(by.id('home-screen'))).toBeVisible(); + it('should open sign in screen', async () => { + await expect(element(by.id('sign-in-screen'))).toBeVisible(); + await expect(element(by.id('sign-in-btn'))).toBeVisible(); + }); + + it('should open home screen when signed in', async () => { + await element(by.id('sign-in-btn')).tap().then(async () => await expect(element(by.id('sign-in-screen'))).toBeVisible()); }); }); diff --git a/e2e/utils/openApp.ts b/e2e/utils/openApp.ts index a8f2e9c..14a0202 100644 --- a/e2e/utils/openApp.ts +++ b/e2e/utils/openApp.ts @@ -1,5 +1,5 @@ -const appConfig = require('../../app.config.ts'); const { resolveConfig } = require('detox/internals'); +const appConfig = require('../../app.config.ts'); const platform = device.getPlatform(); @@ -39,8 +39,9 @@ async function openAppForDebugBuild(platform: string) { await sleep(3000); } +// URL should start with `expo+://` const getDeepLinkUrl = (url: string) => - `eastestsexample://expo-development-client/?url=${encodeURIComponent(url)}`; + `expo+expo-base://expo-development-client/?url=${encodeURIComponent(url)}`; const getDevLauncherPackagerUrl = (platform: string) => `http://localhost:8081/index.bundle?platform=${platform}&dev=true&minify=false&disableOnboarding=1`; diff --git a/index.js b/index.js new file mode 100644 index 0000000..5b83418 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +import 'expo-router/entry'; diff --git a/package.json b/package.json index a011dee..447fa5c 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,31 @@ { "name": "expo-base", - "main": "expo-router/entry", "version": "1.0.0", "scripts": { "start": "expo start", "start -c": "expo start -c", + "prebuild": "expo prebuild", "android": "expo run:android", + "android:release": "expo run:android --variant Release", "android:dev-build": "eas build --profile development --platform android", + "android:dev-build:local": "eas build --profile development --platform android --local", "android:preview": "eas build --profile preview --platform android", - "android:release": "expo run:android --variant Release", "ios": "expo run:ios", + "ios:release": "expo run:ios --variant Release", "ios:dev-build": "eas build --profile development --platform ios", + "ios:dev-build:local": "eas build --profile development --platform ios --local", "ios:preview": "eas build --profile preview --platform ios", - "ios:release": "expo run:ios --variant Release", "web": "expo start --web", "typecheck": "tsc", "test": "jest --watchAll", "e2e:ios:build": "detox build -c ios.release", "e2e:ios:test": "detox test -c ios.release", - "e2e:ios": "run-s e2e:ios:*", + "e2e:ios:debug:build": "detox build -c ios.debug", + "e2e:ios:debug:test": "detox test -c ios.debug", "e2e:android:build": "detox build -c android.release", "e2e:android:test": "detox test -c android.release", - "e2e:android": "run-s e2e:android:*", - "detox:android:debug:build": "detox build -c android.debug", - "detox:android:debug:test": "detox test -c android.debug --reuse", - "detox:ios:debug:build": "detox build -c ios.debug", - "detox:ios:debug:test": "detox test -c ios.debug" + "e2e:android:debug:build": "detox build -c android.debug", + "e2e:android:debug:test": "detox test -c android.debug --reuse" }, "jest": { "preset": "jest-expo" diff --git a/src/screens/SignIn.tsx b/src/screens/SignIn.tsx index 09cd796..c5bc33b 100644 --- a/src/screens/SignIn.tsx +++ b/src/screens/SignIn.tsx @@ -18,7 +18,7 @@ const SignIn = () => { return ( {t('signIn:title')} -