Skip to content

Commit 62453f8

Browse files
authored
Merge pull request #700 from Instabug/release/11.0.0
[MOB-8879] Release/11.0.0
2 parents a30a507 + 6cfc3b6 commit 62453f8

File tree

255 files changed

+13020
-13104
lines changed

Some content is hidden

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

255 files changed

+13020
-13104
lines changed

.circleci/config.yml

Lines changed: 39 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
version: 2
1+
version: 2.1
2+
orbs:
3+
android: circleci/[email protected]
24
jobs:
35
danger:
46
docker:
@@ -70,24 +72,22 @@ jobs:
7072
path: InstabugSample/test-results
7173

7274
test_android:
75+
executor:
76+
name: android/android-machine
77+
tag: "2022.03.1"
7378
working_directory: ~/project/InstabugSample
74-
docker:
75-
- image: circleci/android@sha256:793ae9aa1777ba7fc375109978b307ed03a49be468295a8778d588eba0670e4b
76-
environment:
77-
JVM_OPTS: -Xmx3200m
7879
steps:
7980
- checkout:
8081
path: ~/project
81-
- run: yarn
82-
- run:
83-
name: chmod permissions
84-
command: cd android && chmod +x ./gradlew
8582
- run:
86-
name: Download Dependencies
87-
command: cd android && ./gradlew androidDependencies
83+
name: Install Yarn
84+
command: npm install -g yarn
8885
- run:
89-
name: Run UnitTest
90-
command: cd android && ./gradlew test
86+
name: Install Node Packages
87+
command: yarn
88+
- android/run-tests:
89+
working-directory: ./android
90+
test-command: ./gradlew test
9191

9292
test_ios:
9393
macos:
@@ -146,62 +146,37 @@ jobs:
146146
command: detox test --configuration ios.sim.release --cleanup
147147

148148
e2e_android:
149-
macos:
150-
xcode: "10.2.0"
151-
working_directory: ~/project/InstabugSample
149+
executor:
150+
name: android/android-machine
151+
tag: "2022.03.1"
152+
working_directory: ~/project/InstabugSample/android
152153
steps:
153154
- checkout:
154155
path: ~/project
155-
- run:
156-
name: Install Android SDK
157-
command: |
158-
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask
159-
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk
160-
- run:
161-
name: Accept Android SDK Licenses
162-
command: (yes | sdkmanager --licenses) || true
163-
- run:
164-
name: Setup Android Environment Variables
165-
command: |
166-
echo 'export JAVA_HOME=`/usr/libexec/java_home -v 1.8`' >> $BASH_ENV
167-
echo 'export ANDROID_HOME=/usr/local/share/android-sdk' >> $BASH_ENV
168-
echo 'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk' >> $BASH_ENV
169-
echo 'export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> $BASH_ENV
170-
- run:
171-
name: SDK Manager - Download Emulator Image
172-
command: (yes | sdkmanager "platform-tools" "platforms;android-27" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;27.0.3" "system-images;android-27;google_apis;x86" "emulator" --verbose) || true
173-
- run:
174-
name: AVD Manager - Setup Emulator
175-
command: avdmanager create avd -n Nexus_6P_API_27 -k "system-images;android-27;google_apis;x86" -g google_apis -d "Nexus 6P"
176-
- run:
177-
name: Run Emulator in background
178-
command: /usr/local/share/android-sdk/emulator/emulator @Nexus_6P_API_27 -noaudio -no-boot-anim -no-window
179-
background: true
180-
- run:
181-
name: Install Node Packages
182-
command: sudo yarn
183-
- run:
184-
name: Generate Android Keystore
185-
command: cd android/app && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=AA, OU=AA, O=AA, L=AA, S=AA, C=EG"
186-
- run:
187-
name: Make gradlew Executable
188-
command: cd android && chmod +x ./gradlew
189-
- run:
190-
name: Download Android Dependencies
191-
command: cd android && ./gradlew androidDependencies
156+
- run:
157+
name: Install Yarn
158+
command: npm install --global yarn
192159
- run:
193160
name: Install Detox CLI
194-
command: sudo npm install -g detox-cli
161+
command: npm install --global detox-cli
195162
- run:
196-
name: Detox - Build Release App
197-
command: |
198-
sudo chmod -R 777 /Users/distiller/project/InstabugSample/node_modules/instabug-reactnative
199-
detox build --configuration android.emu.release
163+
name: Install Node Packages
164+
command: yarn
165+
- android/create-avd:
166+
avd-name: Nexus_6P_API_27
167+
install: true
168+
system-image: system-images;android-27;default;x86
169+
- android/start-emulator:
170+
avd-name: Nexus_6P_API_27
171+
no-window: true
172+
post-emulator-launch-assemble-command: |
173+
rm -rf ~/.gradle/caches
174+
./gradlew androidDependencies
175+
cd ..
176+
detox build -c android.emu.release
200177
- run:
201178
name: Detox - Run E2E Tests
202-
command: |
203-
sudo chmod -R 777 /Users/distiller/Library/Detox
204-
detox test --configuration android.emu.release --cleanup
179+
command: cd .. && detox test -c android.emu.release
205180

206181
publish:
207182
macos:
@@ -216,7 +191,6 @@ jobs:
216191
- run: cd project && Escape react-native publish
217192

218193
workflows:
219-
version: 2
220194
publish:
221195
jobs:
222196
- danger:
@@ -226,15 +200,15 @@ workflows:
226200
- test_android
227201
- test_ios
228202
- e2e_ios
229-
# - e2e_android
203+
- e2e_android
230204
- hold:
231205
requires:
232206
- test_module
233207
- test_sample
234-
# - test_android
208+
- test_android
235209
- test_ios
236210
- e2e_ios
237-
# - e2e_android
211+
- e2e_android
238212
type: approval
239213
filters:
240214
branches:

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 11.0.0 (2022-06-07)
2+
3+
* Bumps Instabug native SDKs to v11
4+
* Adds the ability to initialize the Android SDK from JavaScript. Check the migration guide referenced in our docs
5+
* Adds the ability to opt out of iOS source maps auto upload through the INSTABUG_SOURCEMAPS_UPLOAD_DISABLE env variable
6+
* Adds dynamic entry file support through the INSTABUG_ENTRY_FILE env variable
7+
* Adds the string keys for Repro Steps
8+
* Adds the new APIs: Instabug.addPrivateView and Instabug.removePrivateView
9+
* Deprecates Instabug.setPrivateView in favor of the newly introduced APIs
10+
* Removes the deprecated APIs. Check the migration guide referenced in our docs
11+
* Removes Surveys.setThresholdForReshowingSurveyAfterDismiss
12+
* Removes the string keys: surveysCustomThanksTitle and surveysCustomThanksSubtitle
13+
* Renames BugReporting.setAutoScreenRecordingMaxDuration to BugReporting.setAutoScreenRecordingDurationIOS to target iOS only
14+
* Fixes an issue with the setRequestFilterExpression API not working with Hermes
15+
* Fixes an issue with the swipe invocation event not working on Android
16+
117
## 10.13.0 (2022-03-17)
218

319
* Adds Instabug Experiments APIs

InstabugSample/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native-community',
4+
overrides: [
5+
{
6+
files: ['__e2e__/**.js'],
7+
env: { jest: true },
8+
globals: {
9+
device: false,
10+
waitFor: false,
11+
element: false,
12+
by: false,
13+
},
14+
},
15+
],
416
};

InstabugSample/App.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Instabug, {
2020
BugReporting,
2121
FeatureRequests,
2222
Surveys,
23-
Chats,
2423
CrashReporting,
2524
Replies,
2625
} from 'instabug-reactnative';
@@ -138,13 +137,11 @@ class Home extends Component<{}> {
138137
}
139138

140139
sendFeedback() {
141-
BugReporting.showWithOptions(BugReporting.reportType.feedback, [
142-
BugReporting.option.emailFieldHidden,
143-
]);
140+
BugReporting.show(BugReporting.reportType.feedback, [BugReporting.option.emailFieldHidden]);
144141
}
145142

146143
startNewConversation() {
147-
BugReporting.showWithOptions(BugReporting.reportType.question);
144+
BugReporting.show(BugReporting.reportType.question);
148145
}
149146

150147
showUnreadMessagesCount() {

InstabugSample/__e2e__/firstTest.e2e.js

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { getElement } from './utils/elements';
2+
import mockData from './utils/mock-data';
3+
4+
beforeEach(async () => {
5+
await device.launchApp();
6+
});
7+
8+
beforeEach(async () => {
9+
await device.reloadReactNative();
10+
});
11+
12+
it('reports a bug', async () => {
13+
await getElement('floatingButton').tap();
14+
await getElement('reportBugMenuItem').tap();
15+
16+
await getElement('emailField').typeText(mockData.email);
17+
await getElement('commentField').typeText(mockData.bugComment);
18+
await getElement('sendBugButton').tap();
19+
20+
await expect(getElement('thanksMessage')).toBeVisible();
21+
});
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { device, element, by } from 'detox';
2+
3+
const elements = {
4+
floatingButton: {
5+
ios: () => element(by.id('IBGFloatingButtonAccessibilityIdentifier')),
6+
android: () => element(by.type('android.widget.ImageButton')),
7+
},
8+
reportBugMenuItem: () => element(by.text('Report a bug')),
9+
emailField: {
10+
ios: () => element(by.id('IBGBugInputViewEmailFieldAccessibilityIdentifier')),
11+
android: () => element(by.type('android.widget.EditText')).atIndex(0),
12+
},
13+
commentField: {
14+
ios: () => element(by.id('IBGBugInputViewCommentFieldAccessibilityIdentifier')),
15+
android: () => element(by.type('android.widget.EditText')).atIndex(1),
16+
},
17+
sendBugButton: {
18+
ios: () => element(by.id('IBGBugVCNextButtonAccessibilityIdentifier')),
19+
android: () => element(by.type('androidx.appcompat.widget.ActionMenuView')),
20+
},
21+
thanksMessage: {
22+
ios: () => element(by.text('Thank you')),
23+
android: () => element(by.text('Thank you!')),
24+
},
25+
};
26+
27+
/**
28+
* Get element based on current platform.
29+
*
30+
* @param {keyof elements} name
31+
*/
32+
export function getElement(name) {
33+
if (!elements.hasOwnProperty(name)) {
34+
throw new Error(`Element with name ${name} does not exist.`);
35+
}
36+
37+
const el = elements[name];
38+
39+
if (typeof el === 'function') {
40+
return el();
41+
}
42+
43+
if (device.getPlatform() === 'ios') {
44+
return el.ios();
45+
}
46+
47+
return el.android();
48+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
3+
bugComment: 'This is a test bug',
4+
};

InstabugSample/android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ android {
137137
versionCode 1
138138
versionName "1.0"
139139
multiDexEnabled true
140-
140+
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
141+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
141142
}
142143
splits {
143144
abi {
@@ -194,7 +195,7 @@ dependencies {
194195
implementation fileTree(dir: "libs", include: ["*.jar"])
195196
//noinspection GradleDynamicVersion
196197
implementation "com.facebook.react:react-native:+" // From node_modules
197-
implementation 'com.android.support:multidex:1.0.3'
198+
implementation "androidx.multidex:multidex:2.0.1"
198199
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
199200

200201
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {

InstabugSample/android/app/src/androidTest/java/com/instabugsample/DetoxTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.instabugsample;
22

33
import com.wix.detox.Detox;
4+
import com.wix.detox.config.DetoxConfig;
45

56
import org.junit.Rule;
67
import org.junit.Test;
@@ -19,6 +20,11 @@ public class DetoxTest {
1920

2021
@Test
2122
public void runDetoxTests() {
22-
Detox.runTests(mActivityRule);
23+
DetoxConfig detoxConfig = new DetoxConfig();
24+
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
25+
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
26+
detoxConfig.rnContextLoadTimeoutSec = (com.instabugsample.BuildConfig.DEBUG ? 180 : 60);
27+
28+
Detox.runTests(mActivityRule, detoxConfig);
2329
}
2430
}

InstabugSample/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
android:icon="@mipmap/ic_launcher"
1010
android:roundIcon="@mipmap/ic_launcher_round"
1111
android:allowBackup="false"
12-
android:theme="@style/AppTheme">
12+
android:theme="@style/AppTheme"
13+
android:networkSecurityConfig="@xml/network_security_config">
1314
<activity
1415
android:name=".MainActivity"
16+
android:exported="true"
1517
android:label="@string/app_name"
1618
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
1719
android:launchMode="singleTask"

InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.facebook.react.ReactPackage;
1010
import com.facebook.soloader.SoLoader;
1111
import java.lang.reflect.InvocationTargetException;
12-
import com.instabug.reactlibrary.RNInstabugReactnativePackage;
1312

1413
import java.util.List;
1514

@@ -45,12 +44,6 @@ public ReactNativeHost getReactNativeHost() {
4544
@Override
4645
public void onCreate() {
4746
super.onCreate();
48-
new RNInstabugReactnativePackage.Builder("2c63627b9923e10eee2c8abf92e6925f", MainApplication.this)
49-
.setInvocationEvent("button")
50-
.setPrimaryColor("#1D82DC")
51-
.setFloatingEdge("left")
52-
.setFloatingButtonOffsetFromTop(250)
53-
.build();
5447
SoLoader.init(this, /* native exopackage */ false);
5548
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
5649
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="true">10.0.2.2</domain>
5+
<domain includeSubdomains="true">localhost</domain>
6+
</domain-config>
7+
</network-security-config>

0 commit comments

Comments
 (0)