Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ npm-debug.*
web-build/


apps/testing-nx-e2e/artifacts
apps/testing-nx-e2e/artifacts
apps/consumer-app-test-e2e/artifacts
apps/dayily-rotine-e2e/artifacts
11 changes: 11 additions & 0 deletions apps/consumer-app-test-e2e/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": []
}
100 changes: 100 additions & 0 deletions apps/consumer-app-test-e2e/.detoxrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"testRunner": "jest",
"runnerConfig": "jest.config.json",
"apps": {
"ios.debug": {
"type": "ios.app",
"build": "cd ../consumer-app-test/ios && xcodebuild -workspace ConsumerAppTest.xcworkspace -scheme ConsumerAppTest -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13' -derivedDataPath ./build -quiet",
"binaryPath": "../consumer-app-test/ios/build/Build/Products/Debug-iphonesimulator/ConsumerAppTest.app"
},
"ios.release": {
"type": "ios.app",
"build": "cd ../consumer-app-test/ios && xcodebuild -workspace ConsumerAppTest.xcworkspace -scheme ConsumerAppTest -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13' -derivedDataPath ./build -quiet",
"binaryPath": "../consumer-app-test/ios/build/Build/Products/Release-iphonesimulator/ConsumerAppTest.app"
},

"ios.eas": {
"type": "ios.app",
"build": "npx nx run consumer-app-test:download --platform ios --distribution simulator --output=apps/consumer-app-test/dist/",
"binaryPath": "../consumer-app-test/dist/ConsumerAppTest.app"
},
"ios.local": {
"type": "ios.app",
"build": "npx nx run consumer-app-test:build --platform ios --profile preview --wait --local --no-interactive --output=apps/consumer-app-test/dist/",
"binaryPath": "../consumer-app-test/dist/ConsumerAppTest.app"
},

"android.debug": {
"type": "android.apk",
"build": "cd ../consumer-app-test/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug",
"binaryPath": "../consumer-app-test/android/app/build/outputs/apk/debug/app-debug.apk"
},
"android.release": {
"type": "android.apk",
"build": "cd ../consumer-app-test/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release",
"binaryPath": "../consumer-app-test/android/app/build/outputs/apk/release/app-release.apk"
},

"android.eas": {
"type": "ios.app",
"build": "npx nx run consumer-app-test:download --platform android --output=apps/consumer-app-test/dist/",
"binaryPath": "../consumer-app-test/dist/ConsumerAppTest.apk"
},
"android.local": {
"type": "ios.app",
"build": "npx nx run consumer-app-test:build --platform android --profile preview --wait --local --no-interactive --output=apps/consumer-app-test/dist/",
"binaryPath": "../consumer-app-test/dist/ConsumerAppTest.apk"
}
},
"devices": {
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 13"
}
},
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "Pixel_4a_API_30"
}
}
},
"configurations": {
"ios.sim.release": {
"device": "simulator",
"app": "ios.release"
},
"ios.sim.debug": {
"device": "simulator",
"app": "ios.debug"
},

"ios.sim.eas": {
"device": "simulator",
"app": "ios.eas"
},
"ios.sim.local": {
"device": "simulator",
"app": "ios.local"
},

"android.emu.release": {
"device": "emulator",
"app": "android.release"
},
"android.emu.debug": {
"device": "emulator",
"app": "android.debug"
},

"android.emu.eas": {
"device": "simulator",
"app": "android.eas"
},
"android.emu.local": {
"device": "simulator",
"app": "android.local"
}
}
}
18 changes: 18 additions & 0 deletions apps/consumer-app-test-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
24 changes: 24 additions & 0 deletions apps/consumer-app-test-e2e/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// setup from https://github.com/wix/Detox/blob/master/docs/Guide.Jest.md#e2eenvironmentjs
const {
DetoxCircusEnvironment,
SpecReporter,
WorkerAssignReporter,
} = require('detox/runners/jest-circus');

class CustomDetoxEnvironment extends DetoxCircusEnvironment {
constructor(config, context) {
super(config, context);

// Can be safely removed, if you are content with the default value (=300000ms)
this.initTimeout = 300000;

// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
// This is strictly optional.
this.registerListeners({
SpecReporter,
WorkerAssignReporter,
});
}
}

module.exports = CustomDetoxEnvironment;
12 changes: 12 additions & 0 deletions apps/consumer-app-test-e2e/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"preset": "../../jest.preset",
"testEnvironment": "./environment",
"testRunner": "jest-circus/runner",
"testTimeout": 120000,
"reporters": ["detox/runners/jest/streamlineReporter"],
"setupFilesAfterEnv": ["<rootDir>/test-setup.ts"],
"transform": {
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
"^.+\\.[tj]sx?$": "babel-jest"
}
}
92 changes: 92 additions & 0 deletions apps/consumer-app-test-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/consumer-app-test-e2e/src",
"projectType": "application",
"targets": {
"build-ios": {
"executor": "@nrwl/detox:build",
"options": {
"detoxConfiguration": "ios.sim.debug"
},
"configurations": {
"local": {
"detoxConfiguration": "ios.sim.local"
},
"bare": {
"detoxConfiguration": "ios.sim.debug"
},
"production": {
"detoxConfiguration": "ios.sim.release"
}
}
},
"test-ios": {
"executor": "@nrwl/detox:test",
"options": {
"detoxConfiguration": "ios.sim.eas",
"buildTarget": "consumer-app-test-e2e:build-ios"
},
"configurations": {
"local": {
"detoxConfiguration": "ios.sim.local",
"buildTarget": "consumer-app-test-e2e:build-ios:local"
},
"bare": {
"detoxConfiguration": "ios.sim.debug",
"buildTarget": "consumer-app-test-e2e:build-ios:bare"
},
"production": {
"detoxConfiguration": "ios.sim.release",
"buildTarget": "consumer-app-test-e2e:build-ios:production"
}
}
},
"build-android": {
"executor": "@nrwl/detox:build",
"options": {
"detoxConfiguration": "android.emu.debug"
},
"configurations": {
"local": {
"detoxConfiguration": "android.emu.local"
},
"bare": {
"detoxConfiguration": "android.emu.debug"
},
"production": {
"detoxConfiguration": "android.emu.release"
}
}
},
"test-android": {
"executor": "@nrwl/detox:test",
"options": {
"detoxConfiguration": "android.emu.eas",
"buildTarget": "consumer-app-test-e2e:build-ios"
},
"configurations": {
"local": {
"detoxConfiguration": "android.emu.local",
"buildTarget": "consumer-app-test-e2e:build-ios:local"
},
"bare": {
"detoxConfiguration": "android.emu.debug",
"buildTarget": "consumer-app-test-e2e:build-ios:bare"
},
"production": {
"detoxConfiguration": "android.emu.release",
"buildTarget": "consumer-app-test-e2e:build-ios:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/consumer-app-test-e2e/**/*.{ts,tsx,js,jsx}"]
}
}
},
"tags": [],
"implicitDependencies": ["consumer-app-test"]
}
13 changes: 13 additions & 0 deletions apps/consumer-app-test-e2e/src/app.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { device, element, by, expect } from 'detox';

describe('ConsumerAppTest', () => {
beforeEach(async () => {
await device.reloadReactNative();
});

it('should display welcome message', async () => {
await expect(element(by.id('heading'))).toHaveText(
'Welcome ConsumerAppTest 👋'
);
});
});
5 changes: 5 additions & 0 deletions apps/consumer-app-test-e2e/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { device } from 'detox';

beforeAll(async () => {
await device.launchApp();
});
10 changes: 10 additions & 0 deletions apps/consumer-app-test-e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["node", "jest", "detox"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}
10 changes: 10 additions & 0 deletions apps/consumer-app-test-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.e2e.json"
}
]
}
20 changes: 20 additions & 0 deletions apps/consumer-app-test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", ".expo", "node_modules", "web-build"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
30 changes: 30 additions & 0 deletions apps/consumer-app-test/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"expo": {
"name": "ConsumerAppTest",
"slug": "consumer-app-test",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added apps/consumer-app-test/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/consumer-app-test/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/consumer-app-test/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/consumer-app-test/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/consumer-app-test/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions apps/consumer-app-test/assets/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions apps/consumer-app-test/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
Loading