From aaf7dcd48662036087729cbd744f4691fc7a59bf Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 12:26:44 +0300 Subject: [PATCH 01/32] Add test script --- package.json | 2 +- scripts/test.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 scripts/test.js diff --git a/package.json b/package.json index cbf8e04..1cfcddd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "main": "lib/src/index", "scripts": { "pretest": "./node_modules/.bin/eslint *.js test", - "test": "jest", + "test": "node scripts/test", "start": "node ./scripts/start", "test-e2e-ios": "node ./scripts/test-e2e --ios", "test-unit-ios": "node ./scripts/test-unit --ios", diff --git a/scripts/test.js b/scripts/test.js new file mode 100644 index 0000000..2f4ad9f --- /dev/null +++ b/scripts/test.js @@ -0,0 +1,9 @@ +const exec = require('shell-utils').exec; + +run(); + +function run() { + exec.execSync(`jest`); + exec.execSync(`npm run test-unit-ios`); + exec.execSync(`npm run test-unit-android`); +} From e341894ed4c0bc4a58a872d696797abc32e5f1dc Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 12:33:45 +0300 Subject: [PATCH 02/32] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4555503..6fb4c82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: node_js +osx_image: xcode10.1 node_js: - "10" From 2e16ef7e7a6da2a5d9dd6b47c8f9fa99c1470845 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:32:36 +0300 Subject: [PATCH 03/32] circleCI support --- .circleci/config.yml | 17 +++++++++++++++++ package.json | 1 + scripts/install.ios.sh | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .circleci/config.yml create mode 100755 scripts/install.ios.sh diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..eae6e9f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,17 @@ + +version: 1 +macos: +xcode: "10.2.1" +jobs: + build: + steps: + - checkout + - run: + name: Install Dependencies + command: scripts/install.ios.sh + - run: + name: npm install + command: npm install + - run: + name: Detox iOS CI + command: 'npm run test-e2e-ios-release' \ No newline at end of file diff --git a/package.json b/package.json index 1cfcddd..72c3efb 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "start": "node ./scripts/start", "test-e2e-ios": "node ./scripts/test-e2e --ios", "test-unit-ios": "node ./scripts/test-unit --ios", + "test-unit-ios-release": "node ./scripts/test-unit --ios --release", "test-unit-android": "node ./scripts/test-unit --android", "test-js": "node ./scripts/test-js" }, diff --git a/scripts/install.ios.sh b/scripts/install.ios.sh new file mode 100755 index 0000000..5fac98e --- /dev/null +++ b/scripts/install.ios.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +$(dirname "$0")/install.sh + +HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install ruby +export PATH="/usr/local/opt/ruby/bin:$PATH" +gem install xcpretty +export CODE_SIGNING_REQUIRED=NO +HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew +HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils + +echo 'export PATH=$PATH' >> $BASH_ENV \ No newline at end of file From 3b5f60e382f0a33688825dc04357d1ca2a2848f0 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:33:33 +0300 Subject: [PATCH 04/32] Fix indentation --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eae6e9f..18160ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,8 +10,8 @@ jobs: name: Install Dependencies command: scripts/install.ios.sh - run: - name: npm install - command: npm install + name: npm install + command: npm install - run: name: Detox iOS CI command: 'npm run test-e2e-ios-release' \ No newline at end of file From 7a51cd12fb0c4fa55ef3add5acee88ee879ec351 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:34:30 +0300 Subject: [PATCH 05/32] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18160ed..225bd7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,8 @@ version: 1 -macos: -xcode: "10.2.1" jobs: + macos: + xcode: "10.2.1" build: steps: - checkout From 01c254ae4b6eec4103bc5949f79304588acb569e Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:36:33 +0300 Subject: [PATCH 06/32] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 225bd7a..f341b2b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ version: 1 jobs: - macos: + build: + macos: xcode: "10.2.1" - build: steps: - checkout - run: From 9cc8b3ebf6eae70b5491a3d2babec019b192109b Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:37:25 +0300 Subject: [PATCH 07/32] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f341b2b..225bd7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ version: 1 jobs: - build: - macos: + macos: xcode: "10.2.1" + build: steps: - checkout - run: From 39e62e8144e4b6c63072152f99f269280598387c Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:39:23 +0300 Subject: [PATCH 08/32] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 225bd7a..51cf88a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ version: 1 jobs: - macos: - xcode: "10.2.1" build: + macos: + xcode: "10.2.1" steps: - checkout - run: From da07f890f035ecd37cc289dbe9bd29edaa7acd95 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:41:06 +0300 Subject: [PATCH 09/32] Add install.sh --- scripts/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/install.sh diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..917122e --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,6 @@ +#!/bin/bash -e + +npm install -g lerna@2.4.0 +npm install -g react-native-cli +npm install -g detox-cli +git submodule update --init --recursive From ae5570f1598352050306e5578c3e2f3d9f82a1d7 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:46:46 +0300 Subject: [PATCH 10/32] Fix package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72c3efb..3cc8962 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "test": "node scripts/test", "start": "node ./scripts/start", "test-e2e-ios": "node ./scripts/test-e2e --ios", + "test-e2e-ios-release": "node ./scripts/test-e2e --ios --release", "test-unit-ios": "node ./scripts/test-unit --ios", - "test-unit-ios-release": "node ./scripts/test-unit --ios --release", "test-unit-android": "node ./scripts/test-unit --android", "test-js": "node ./scripts/test-js" }, From 381b559c8c19a0a2547fcf0e6f40e68581009dc1 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 16:56:29 +0300 Subject: [PATCH 11/32] Fix e2e --- .../NotificationsExampleApp_release.xcscheme | 119 ++++++++++++++++++ package.json | 4 +- 2 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp_release.xcscheme diff --git a/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp_release.xcscheme b/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp_release.xcscheme new file mode 100644 index 0000000..10ca932 --- /dev/null +++ b/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp_release.xcscheme @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index 3cc8962..4c95be8 100644 --- a/package.json +++ b/package.json @@ -93,8 +93,8 @@ "name": "iPhone X" }, "ios.sim.release": { - "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Release-iphonesimulator/playground.app", - "build": "RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground_release -project playground/ios/playground.xcodeproj -sdk iphonesimulator -configuration Release -derivedDataPath playground/ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=NO", + "binaryPath": "example/ios/DerivedData/NotificationsExampleApp/Build/Products/Release-iphonesimulator/playground.app", + "build": "RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme NotificationsExampleApp_release -project example/ios/NotificationsExampleApp.xcodeproj -sdk iphonesimulator -configuration Release -derivedDataPath example/ios/DerivedData/NotificationsExampleApp ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=NO", "type": "ios.simulator", "name": "iPhone X" } From 25da4fd9d82503a0dd0eb14e4ec9ce2db855e639 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:01:50 +0300 Subject: [PATCH 12/32] Fix e2e --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c95be8..3abce21 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "name": "iPhone X" }, "ios.sim.release": { - "binaryPath": "example/ios/DerivedData/NotificationsExampleApp/Build/Products/Release-iphonesimulator/playground.app", + "binaryPath": "example/ios/DerivedData/NotificationsExampleApp/Build/Products/Release-iphonesimulator/NotificationsExampleApp.app", "build": "RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme NotificationsExampleApp_release -project example/ios/NotificationsExampleApp.xcodeproj -sdk iphonesimulator -configuration Release -derivedDataPath example/ios/DerivedData/NotificationsExampleApp ONLY_ACTIVE_ARCH=YES -quiet -UseModernBuildSystem=NO", "type": "ios.simulator", "name": "iPhone X" From b11693bbea6870df8aeb1779b323f11482253214 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:12:02 +0300 Subject: [PATCH 13/32] Fix e2e --- e2e/Notifications.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/Notifications.test.js b/e2e/Notifications.test.js index fd39b4e..b6bb29b 100644 --- a/e2e/Notifications.test.js +++ b/e2e/Notifications.test.js @@ -1,5 +1,5 @@ const Utils = require('./Utils'); -const { elementByLabel } = Utils; +const {elementByLabel} = Utils; describe('Notifications', () => { describe('Foreground', () => { @@ -33,7 +33,7 @@ describe('Notifications', () => { describe('Dead state', () => { it('Receive notification', async () => { - await device.launchApp({newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); + await device.launchApp({delete: true, newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); await expect(elementByLabel('deadState/notification')).toBeVisible(); }); }); From 1c62ed5e8a4d21b9a1c1a50967e13634db6b729b Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:13:12 +0300 Subject: [PATCH 14/32] Add ci unit tests --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51cf88a..ae275ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,12 @@ jobs: - run: name: npm install command: npm install + - run: + name: iOS unit tests + command: 'npm run test-unit-ios' + - run: + name: Android unit tests + command: 'npm run test-unit-android' - run: name: Detox iOS CI command: 'npm run test-e2e-ios-release' \ No newline at end of file From e7fb74b597c6e0ca0476120ab8ab94c82faddbdd Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:14:26 +0300 Subject: [PATCH 15/32] Remove lerna --- scripts/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 917122e..9b65356 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,6 +1,5 @@ #!/bin/bash -e -npm install -g lerna@2.4.0 npm install -g react-native-cli npm install -g detox-cli git submodule update --init --recursive From 75da8996e43473dd0a7e1017ddebe51988f44980 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:27:10 +0300 Subject: [PATCH 16/32] Install android --- .circleci/config.yml | 3 +++ scripts/install.android.sh | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100755 scripts/install.android.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index ae275ba..547cd4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,9 @@ jobs: - run: name: Install Dependencies command: scripts/install.ios.sh + - run: + name: Install Android + command: scripts/install.android.sh - run: name: npm install command: npm install diff --git a/scripts/install.android.sh b/scripts/install.android.sh new file mode 100755 index 0000000..321a015 --- /dev/null +++ b/scripts/install.android.sh @@ -0,0 +1,40 @@ +#!/bin/bash -e +echo node -v $(node -v) + +$(dirname "$0")/install.sh + +if [ -z "$ZZ_BITRISE" ]; then +ANDROID_API=28 +ANDROID_HOME="/usr/local/share/android-sdk" +echo "export ANDROID_API=${ANDROID_API}" >> $BASH_ENV +echo "export ANDROID_HOME=${ANDROID_HOME}" >> $BASH_ENV + +cat $BASH_ENV + +# jdk +HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew untap adoptopenjdk/openjdk +HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew cask install adoptopenjdk8 + +export PATH="$PATH:$ANDROID_HOME/tools/bin" + +# set variables +ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip" +TMP_DIR=$(mktemp -d) + +# download and install sdk +cd "$TMP_DIR" +curl "$ANDROID_SDK_URL" > "sdk.zip" +unzip "sdk.zip" -d "$ANDROID_HOME" + +# install what you need +yes | sdkmanager --licenses || : +echo y | sdkmanager "platforms;android-${ANDROID_API}" +echo y | sdkmanager "platform-tools" +echo y | sdkmanager "build-tools;28.0.3" +echo y | sdkmanager "extras;android;m2repository" +echo y | sdkmanager "extras;google;m2repository" +echo y | sdkmanager "system-images;android-${ANDROID_API};google_apis;x86_64" +echo y | sdkmanager "extras;intel;Hardware_Accelerated_Execution_Manager" +echo y | sdkmanager "extras;google;google_play_services" +echo no | avdmanager create avd --force --name Nexus_5X_API_${ANDROID_API} --abi x86_64 --device "Nexus 5X" -k "system-images;android-${ANDROID_API};google_apis;x86_64" +fi \ No newline at end of file From caa1606ed33a580a4a76bb280e8456bcb3c709e3 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:29:19 +0300 Subject: [PATCH 17/32] Separated jobs --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 547cd4b..ba583e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,10 @@ jobs: - run: name: npm install command: npm install + test: + macos: + xcode: "10.2.1" + steps: - run: name: iOS unit tests command: 'npm run test-unit-ios' From 7f8f4081b983336f44aeb51c635bfc1dd2f29200 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 17:44:04 +0300 Subject: [PATCH 18/32] Enable parallelised tests --- .circleci/config.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba583e6..a4aa95d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,6 +18,7 @@ jobs: test: macos: xcode: "10.2.1" + parallelism: 3 steps: - run: name: iOS unit tests @@ -27,4 +28,11 @@ jobs: command: 'npm run test-unit-android' - run: name: Detox iOS CI - command: 'npm run test-e2e-ios-release' \ No newline at end of file + command: 'npm run test-e2e-ios-release' + +workflows: + version: 1 + build_and_test: + jobs: + - build + - test \ No newline at end of file From e25b4e706f136838f4a6fa30b8cf34b301e5b57c Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 18:00:12 +0300 Subject: [PATCH 19/32] Fix workflow --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4aa95d..0737c00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ -version: 1 +version: 2 jobs: build: macos: @@ -29,9 +29,8 @@ jobs: - run: name: Detox iOS CI command: 'npm run test-e2e-ios-release' - workflows: - version: 1 + version: 2 build_and_test: jobs: - build From eae86a3761fffbfad38e7973fbbbd18deb83d492 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 19:33:49 +0300 Subject: [PATCH 20/32] Remove multiple steps --- .circleci/config.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0737c00..547cd4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ -version: 2 +version: 1 jobs: build: macos: @@ -15,11 +15,6 @@ jobs: - run: name: npm install command: npm install - test: - macos: - xcode: "10.2.1" - parallelism: 3 - steps: - run: name: iOS unit tests command: 'npm run test-unit-ios' @@ -28,10 +23,4 @@ jobs: command: 'npm run test-unit-android' - run: name: Detox iOS CI - command: 'npm run test-e2e-ios-release' -workflows: - version: 2 - build_and_test: - jobs: - - build - - test \ No newline at end of file + command: 'npm run test-e2e-ios-release' \ No newline at end of file From c65d91c13485ea1cb17eb98f35d33cad2155d5df Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 20:41:25 +0300 Subject: [PATCH 21/32] Fix flaky tests --- e2e/Notifications.test.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/e2e/Notifications.test.js b/e2e/Notifications.test.js index b6bb29b..57cdc50 100644 --- a/e2e/Notifications.test.js +++ b/e2e/Notifications.test.js @@ -2,11 +2,11 @@ const Utils = require('./Utils'); const {elementByLabel} = Utils; describe('Notifications', () => { - describe('Foreground', () => { - beforeEach(async () => { - await device.relaunchApp({permissions: {notifications: 'YES'}}); - }); + beforeEach(async () => { + await device.relaunchApp({delete: true, permissions: {notifications: 'YES'}}); + }); + describe('Foreground', () => { it('Receive notification', async () => { await device.sendUserNotification(createNotification({link: 'foreground/notification'})); await expect(elementByLabel('foreground/notification')).toBeVisible(); @@ -19,10 +19,6 @@ describe('Notifications', () => { }); describe('Background', () => { - beforeEach(async () => { - await device.launchApp({newInstance: true, permissions: {notifications: 'YES'}}); - }); - it('Receive notification', async () => { device.sendToHome(); await expect(elementByLabel('background/notification')).toBeNotVisible(); @@ -33,7 +29,7 @@ describe('Notifications', () => { describe('Dead state', () => { it('Receive notification', async () => { - await device.launchApp({delete: true, newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); + await device.launchApp({newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); await expect(elementByLabel('deadState/notification')).toBeVisible(); }); }); From c505c577121dac1fa2635bf94c18a3a14f44dccc Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 20:46:14 +0300 Subject: [PATCH 22/32] Revert "Remove multiple steps" This reverts commit eae86a3761fffbfad38e7973fbbbd18deb83d492. --- .circleci/config.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 547cd4b..0737c00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ -version: 1 +version: 2 jobs: build: macos: @@ -15,6 +15,11 @@ jobs: - run: name: npm install command: npm install + test: + macos: + xcode: "10.2.1" + parallelism: 3 + steps: - run: name: iOS unit tests command: 'npm run test-unit-ios' @@ -23,4 +28,10 @@ jobs: command: 'npm run test-unit-android' - run: name: Detox iOS CI - command: 'npm run test-e2e-ios-release' \ No newline at end of file + command: 'npm run test-e2e-ios-release' +workflows: + version: 2 + build_and_test: + jobs: + - build + - test \ No newline at end of file From 2c604868a5d88f222870071145efffc4341c63a6 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 01:54:50 +0300 Subject: [PATCH 23/32] Fix ci multiple jobs --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0737c00..fc7cb33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,8 @@ jobs: name: npm install command: npm install test: + requires: + - build macos: xcode: "10.2.1" parallelism: 3 From add0007d539255d67f3ee5381fde69a51c3a4d6f Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 02:01:28 +0300 Subject: [PATCH 24/32] Fix ci --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc7cb33..2ec99fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,19 +16,23 @@ jobs: name: npm install command: npm install test: - requires: - - build macos: xcode: "10.2.1" parallelism: 3 steps: - run: + requires: + - build name: iOS unit tests command: 'npm run test-unit-ios' - run: + requires: + - build name: Android unit tests command: 'npm run test-unit-android' - run: + requires: + - build name: Detox iOS CI command: 'npm run test-e2e-ios-release' workflows: From d5e40b769e271474140e79a479f602cf92968cd1 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 20:18:25 +0300 Subject: [PATCH 25/32] f --- .circleci/config.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ec99fd..b1cfbf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,23 +21,19 @@ jobs: parallelism: 3 steps: - run: - requires: - - build name: iOS unit tests command: 'npm run test-unit-ios' - run: - requires: - - build name: Android unit tests command: 'npm run test-unit-android' - run: - requires: - - build name: Detox iOS CI command: 'npm run test-e2e-ios-release' workflows: version: 2 - build_and_test: + build-and-test: jobs: - build - - test \ No newline at end of file + - test: + requires: + - build \ No newline at end of file From c6cf840fd328af18e17718d7fc8a221e1b7d6a91 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 20:59:25 +0300 Subject: [PATCH 26/32] f --- .circleci/config.yml | 4 +--- README.md | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1cfbf1..b0e3848 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,9 +16,7 @@ jobs: name: npm install command: npm install test: - macos: - xcode: "10.2.1" - parallelism: 3 + parallelism: 3 steps: - run: name: iOS unit tests diff --git a/README.md b/README.md index 173f7a6..21eeeb1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# React Native Notifications [![Build Status](https://travis-ci.org/wix/react-native-notifications.svg)](https://travis-ci.org/wix/react-native-notifications) +# React Native Notifications [![CircleCI](https://circleci.com/gh/wix/react-native-notifications/tree/master.svg?style=svg)](https://circleci.com/gh/wix/react-native-notifications/tree/master) Handle all the aspects of push notifications for your app, including remote and local notifications, interactive notifications, silent notifications, and more. From fbf0cd191307bf9173719e302393bfb0d60643fe Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 21:40:47 +0300 Subject: [PATCH 27/32] f --- .circleci/config.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0e3848..f4a5b8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: - build: + test: macos: xcode: "10.2.1" steps: @@ -15,9 +15,6 @@ jobs: - run: name: npm install command: npm install - test: - parallelism: 3 - steps: - run: name: iOS unit tests command: 'npm run test-unit-ios' @@ -26,12 +23,4 @@ jobs: command: 'npm run test-unit-android' - run: name: Detox iOS CI - command: 'npm run test-e2e-ios-release' -workflows: - version: 2 - build-and-test: - jobs: - - build - - test: - requires: - - build \ No newline at end of file + command: 'npm run test-e2e-ios-release' \ No newline at end of file From fed75d922522ac920f5d41a30b5c6a6b9afe7d42 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 21:44:07 +0300 Subject: [PATCH 28/32] f --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f4a5b8e..8c534d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: - test: + build: macos: xcode: "10.2.1" steps: From 1df2efa2b862dd80f49e6f633ca6cc69cbe98498 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 22:02:59 +0300 Subject: [PATCH 29/32] f --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c534d1..0ee3cf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,5 +22,5 @@ jobs: name: Android unit tests command: 'npm run test-unit-android' - run: - name: Detox iOS CI + name: Detox iOS e2e tests command: 'npm run test-e2e-ios-release' \ No newline at end of file From 08076923f69c56240b441ead10ab63be6c9bae99 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 22:27:25 +0300 Subject: [PATCH 30/32] Fix tests --- e2e/Notifications.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/Notifications.test.js b/e2e/Notifications.test.js index 57cdc50..9b49c77 100644 --- a/e2e/Notifications.test.js +++ b/e2e/Notifications.test.js @@ -20,9 +20,9 @@ describe('Notifications', () => { describe('Background', () => { it('Receive notification', async () => { - device.sendToHome(); + await device.sendToHome(); await expect(elementByLabel('background/notification')).toBeNotVisible(); - device.launchApp({newInstance: false, userNotification: createNotification({link: 'background/notification'})}); + await device.launchApp({newInstance: false, userNotification: createNotification({link: 'background/notification'})}); await expect(elementByLabel('background/notification')).toBeVisible(); }); }); From fea314c434d13b966397531408de94bcc32bdc2d Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 22:30:51 +0300 Subject: [PATCH 31/32] f --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ee3cf6..1db2e65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,18 +9,18 @@ jobs: - run: name: Install Dependencies command: scripts/install.ios.sh - - run: - name: Install Android - command: scripts/install.android.sh + # - run: + # name: Install Android + # command: scripts/install.android.sh - run: name: npm install command: npm install - - run: - name: iOS unit tests - command: 'npm run test-unit-ios' - - run: - name: Android unit tests - command: 'npm run test-unit-android' + # - run: + # name: iOS unit tests + # command: 'npm run test-unit-ios' + # - run: + # name: Android unit tests + # command: 'npm run test-unit-android' - run: name: Detox iOS e2e tests command: 'npm run test-e2e-ios-release' \ No newline at end of file From a6fa3809361b1ab101afa4cca41592a70ca8b4e2 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 30 Jul 2019 22:47:14 +0300 Subject: [PATCH 32/32] Fix tests --- .circleci/config.yml | 18 +++++++++--------- e2e/Notifications.test.js | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1db2e65..0ee3cf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,18 +9,18 @@ jobs: - run: name: Install Dependencies command: scripts/install.ios.sh - # - run: - # name: Install Android - # command: scripts/install.android.sh + - run: + name: Install Android + command: scripts/install.android.sh - run: name: npm install command: npm install - # - run: - # name: iOS unit tests - # command: 'npm run test-unit-ios' - # - run: - # name: Android unit tests - # command: 'npm run test-unit-android' + - run: + name: iOS unit tests + command: 'npm run test-unit-ios' + - run: + name: Android unit tests + command: 'npm run test-unit-android' - run: name: Detox iOS e2e tests command: 'npm run test-e2e-ios-release' \ No newline at end of file diff --git a/e2e/Notifications.test.js b/e2e/Notifications.test.js index 9b49c77..d6ede11 100644 --- a/e2e/Notifications.test.js +++ b/e2e/Notifications.test.js @@ -7,28 +7,28 @@ describe('Notifications', () => { }); describe('Foreground', () => { - it('Receive notification', async () => { + it('Should receive notification', async () => { await device.sendUserNotification(createNotification({link: 'foreground/notification'})); await expect(elementByLabel('foreground/notification')).toBeVisible(); }); - it('Click notification', async () => { + it('Should open notification', async () => { await device.sendUserNotification(createNotification({link: 'foreground/notification/click', showAlert: true})); await expect(elementByLabel('Notification Clicked: foreground/notification/click')).toBeVisible(); }); }); describe('Background', () => { - it('Receive notification', async () => { + it('Should open notification', async () => { await device.sendToHome(); - await expect(elementByLabel('background/notification')).toBeNotVisible(); + await expect(elementByLabel('Notification Clicked: background/notification')).toBeNotVisible(); await device.launchApp({newInstance: false, userNotification: createNotification({link: 'background/notification'})}); - await expect(elementByLabel('background/notification')).toBeVisible(); + await expect(elementByLabel('Notification Clicked: background/notification')).toBeVisible(); }); }); describe('Dead state', () => { - it('Receive notification', async () => { + it('Should receive notification', async () => { await device.launchApp({newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); await expect(elementByLabel('deadState/notification')).toBeVisible(); });