Skip to content

Commit afb3635

Browse files
Merge pull request #841 from GetStream/develop
Next release
2 parents fc4011f + 8de7d8d commit afb3635

File tree

109 files changed

+264231
-6478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+264231
-6478
lines changed

.detoxrc.json

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"testRunner": "jest",
3+
"runnerConfig": "e2e/config.json",
4+
"skipLegacyWorkersInjection": true,
5+
"apps": {
6+
"ios.native.debug": {
7+
"name": "iOS NativeMessaging Debug",
8+
"type": "ios.app",
9+
"binaryPath": "examples/NativeMessaging/ios/build/Build/Products/Debug-iphonesimulator/NativeMessaging.app",
10+
"build": "cd examples/NativeMessaging && xcodebuild -workspace ios/NativeMessaging.xcworkspace -scheme NativeMessaging -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build"
11+
},
12+
"ios.native.release": {
13+
"name": "iOS NativeMessaging Release",
14+
"type": "ios.app",
15+
"binaryPath": "examples/NativeMessaging/ios/build/Build/Products/Release-iphonesimulator/NativeMessaging.app",
16+
"build": "cd examples/NativeMessaging && xcodebuild -workspace ios/NativeMessaging.xcworkspace -scheme NativeMessaging -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
17+
},
18+
"android.native.debug": {
19+
"name": "Android NativeMessaging Debug",
20+
"type": "android.apk",
21+
"binaryPath": "examples/NativeMessaging/android/app/build/outputs/apk/debug/app-debug.apk",
22+
"build": "cd examples/NativeMessaging/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug"
23+
},
24+
"android.native.release": {
25+
"name": "Android NativeMessaging Release",
26+
"type": "android.apk",
27+
"binaryPath": "examples/NativeMessaging/android/app/build/outputs/apk/release/app-release.apk",
28+
"build": "cd examples/NativeMessaging/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release"
29+
},
30+
"ios.sample.debug": {
31+
"name": "iOS SampleApp Debug",
32+
"type": "ios.app",
33+
"binaryPath": "examples/SampleApp/ios/build/Build/Products/Debug-iphonesimulator/SampleApp.app",
34+
"build": "cd examples/SampleApp && xcodebuild -workspace ios/SampleApp.xcworkspace -scheme SampleApp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build"
35+
},
36+
"ios.sample.release": {
37+
"name": "iOS SampleApp Release",
38+
"type": "ios.app",
39+
"binaryPath": "examples/SampleApp/ios/build/Build/Products/Release-iphonesimulator/SampleApp.app",
40+
"build": "cd examples/SampleApp && xcodebuild -workspace ios/SampleApp.xcworkspace -scheme SampleApp -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
41+
},
42+
"android.sample.debug": {
43+
"name": "Android SampleApp Debug",
44+
"type": "android.apk",
45+
"binaryPath": "examples/SampleApp/android/app/build/outputs/apk/release/app-release.apk",
46+
"build": "cd examples/SampleApp/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=debug"
47+
},
48+
"android.sample.release": {
49+
"name": "Android SampleApp Release",
50+
"type": "android.apk",
51+
"binaryPath": "examples/SampleApp/android/app/build/outputs/apk/release/app-release.apk",
52+
"build": "cd examples/SampleApp/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release"
53+
}
54+
},
55+
"devices": {
56+
"simulator": {
57+
"type": "ios.simulator",
58+
"device": {
59+
"type": "iPhone 12"
60+
}
61+
},
62+
"emulator": {
63+
"type": "android.emulator",
64+
"device": {
65+
"avdName": "Pixel4"
66+
}
67+
}
68+
},
69+
"configurations": {
70+
"ios.native.debug": {
71+
"device": "simulator",
72+
"app": "ios.native.debug"
73+
},
74+
"ios.native.release": {
75+
"device": "simulator",
76+
"app": "ios.native.release"
77+
},
78+
"android.native.debug": {
79+
"device": "emulator",
80+
"app": "android.native.debug"
81+
},
82+
"android.native.release": {
83+
"device": "emulator",
84+
"app": "android.native.release"
85+
},
86+
"ios.sample.debug": {
87+
"device": "simulator",
88+
"app": "ios.sample.debug"
89+
},
90+
"ios.sample.release": {
91+
"device": "simulator",
92+
"app": "ios.sample.release"
93+
},
94+
"android.sample.debug": {
95+
"device": "emulator",
96+
"app": "android.sample.debug"
97+
},
98+
"android.sample.release": {
99+
"device": "emulator",
100+
"app": "android.sample.release"
101+
}
102+
}
103+
}

.github/workflows/check-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check PR
1+
name: Lint & Unit Tests
22

33
on:
44
pull_request:
@@ -22,3 +22,5 @@ jobs:
2222
run: yarn --frozen-lockfile && yarn bootstrap-ci
2323
- name: Lint
2424
run: yarn lint
25+
- name: Test
26+
run: yarn test:unit
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: e2e-native-android
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
test:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Installation & Build Package
20+
run: yarn --frozen-lockfile && cd ./examples/NativeMessaging && yarn --frozen-lockfile
21+
- name: Install Java JDK
22+
uses: joschi/setup-jdk@v2
23+
with:
24+
java-version: '11'
25+
- name: Generate keystore
26+
run: cd ./examples/NativeMessaging/android/app && keytool -genkey -noprompt -dname "CN=automation, OU=RN, O=getstream L=NA, S=NA, C=NA" -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
27+
- name: Build
28+
run: yarn detox-native-android:build
29+
- name: Test
30+
uses: reactivecircus/android-emulator-runner@v2
31+
with:
32+
api-level: 29
33+
target: google_apis
34+
avd-name: Pixel4
35+
script: yarn detox-native-android:test
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: e2e-native-ios
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
test:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Installation & Build Package
20+
run: yarn --frozen-lockfile && cd ./examples/NativeMessaging && yarn --frozen-lockfile
21+
- name: Install Pods
22+
run: cd ./examples/NativeMessaging && npx pod-install
23+
- name: Install Detox Dependencies
24+
run: |
25+
brew tap wix/brew
26+
brew install applesimutils
27+
- name: Build
28+
run: yarn detox-native-ios:build
29+
- name: Test
30+
run: yarn detox-native-ios:test
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: e2e-sample-android
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
test:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Installation & Build Package
20+
# installation already takes care of calling prepare which calls build
21+
# for the sdk package
22+
run: yarn --frozen-lockfile && yarn bootstrap-ci
23+
- name: Install Java JDK
24+
uses: joschi/setup-jdk@v2
25+
with:
26+
java-version: '11'
27+
- name: Build
28+
run: yarn detox-sample-android:build
29+
- name: Test
30+
uses: reactivecircus/android-emulator-runner@v2
31+
with:
32+
api-level: 29
33+
target: google_apis
34+
avd-name: Pixel4
35+
script: yarn detox-sample-android:test
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: e2e-sample-ios
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
test:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Installation & Build Package
20+
# installation already takes care of calling prepare which calls build
21+
# for the sdk package
22+
run: yarn --frozen-lockfile && yarn bootstrap-ci
23+
- name: Install Pods
24+
run: cd ./examples/SampleApp && npx pod-install
25+
- name: Install Detox Dependencies
26+
run: |
27+
brew tap wix/brew
28+
brew install applesimutils
29+
- name: Build
30+
run: yarn detox-sample-ios:build
31+
- name: Test
32+
run: yarn detox-sample-ios:test
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('NativeMessaging', () => {
2+
beforeAll(async () => {
3+
await device.launchApp();
4+
});
5+
6+
beforeEach(async () => {
7+
await device.reloadReactNative();
8+
await waitFor(element(by.id('channel-list-messenger')))
9+
.toBeVisible()
10+
.withTimeout(5000);
11+
});
12+
13+
it('should render channel list', async () => {
14+
await expect(element(by.id('channel-preview-button')).atIndex(0)).toBeVisible();
15+
});
16+
});

e2e/SampleApp/channel-list.e2e.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('SampleApp', () => {
2+
beforeAll(async () => {
3+
await device.launchApp();
4+
});
5+
6+
beforeEach(async () => {
7+
await device.reloadReactNative();
8+
await waitFor(element(by.id('user-selector-screen')))
9+
.toBeVisible()
10+
.withTimeout(5000);
11+
});
12+
13+
it('should render user list', async () => {
14+
await expect(element(by.id('user-selector-button')).atIndex(0)).toBeVisible();
15+
});
16+
});

e2e/config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"maxWorkers": 1,
3+
"testEnvironment": "./environment",
4+
"testRunner": "jest-circus/runner",
5+
"testTimeout": 120000,
6+
"testRegex": "\\.e2e\\.js$",
7+
"reporters": ["detox/runners/jest/streamlineReporter"],
8+
"verbose": true
9+
}

e2e/environment.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const {
2+
DetoxCircusEnvironment,
3+
SpecReporter,
4+
WorkerAssignReporter,
5+
} = require('detox/runners/jest-circus');
6+
7+
class CustomDetoxEnvironment extends DetoxCircusEnvironment {
8+
constructor(config, context) {
9+
super(config, context);
10+
11+
// Can be safely removed, if you are content with the default value (=300000ms)
12+
this.initTimeout = 300000;
13+
14+
// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
15+
// This is strictly optional.
16+
this.registerListeners({
17+
SpecReporter,
18+
WorkerAssignReporter,
19+
});
20+
}
21+
}
22+
23+
module.exports = CustomDetoxEnvironment;

0 commit comments

Comments
 (0)