From 9850e67c8e24338dcbceec99d847b6483642d733 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Fri, 5 Mar 2021 11:33:09 +0100 Subject: [PATCH 1/6] Update app path from React Native E2E Tests (iOS) workflow --- .github/workflows/rnmobile-ios-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 37868c32560aba..bdd1abb1ac8426 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -62,7 +62,7 @@ jobs: run: sudo xcode-select --switch /Applications/Xcode_12.app - name: Build (if needed) - run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/gutenberg || npm run native test:e2e:build-app:ios + run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios - name: Run iOS Device Tests run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }} From cf420c2896b484f793b039a48c7d307a3d441a73 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Fri, 5 Mar 2021 11:35:53 +0100 Subject: [PATCH 2/6] Add error handler to native e2e test setup --- packages/react-native-editor/jest_ui_test_environment.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-native-editor/jest_ui_test_environment.js b/packages/react-native-editor/jest_ui_test_environment.js index 052aa95da0781f..e5e6374936c6f0 100644 --- a/packages/react-native-editor/jest_ui_test_environment.js +++ b/packages/react-native-editor/jest_ui_test_environment.js @@ -13,8 +13,13 @@ const JSDOMEnvironment = require( 'jest-environment-jsdom' ); class CustomEnvironment extends JSDOMEnvironment { async setup() { - await super.setup(); - this.global.editorPage = await initializeEditorPage(); + try { + await super.setup(); + this.global.editorPage = await initializeEditorPage(); + } catch ( error ) { + // eslint-disable-next-line no-console + console.error( 'E2E setup exception:', error ); + } } async teardown() { From 0108c2742415477a2cb5512942567dd6654a4764 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 8 Mar 2021 10:43:40 +0100 Subject: [PATCH 3/6] Fix iOS simulator boot up for e2e tests --- packages/react-native-editor/__device-tests__/helpers/caps.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index 804ef802fb5c48..790666eff67a00 100644 --- a/packages/react-native-editor/__device-tests__/helpers/caps.js +++ b/packages/react-native-editor/__device-tests__/helpers/caps.js @@ -13,6 +13,7 @@ const ios = { exports.iosLocal = { ...ios, + waitForQuiescence: true, deviceName: 'iPhone 11', }; From 8a453f556f89f2403861e659c392958f6f16cda8 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 8 Mar 2021 13:56:40 +0100 Subject: [PATCH 4/6] Revert "Fix iOS simulator boot up for e2e tests" This reverts commit 0108c2742415477a2cb5512942567dd6654a4764. --- packages/react-native-editor/__device-tests__/helpers/caps.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index 790666eff67a00..804ef802fb5c48 100644 --- a/packages/react-native-editor/__device-tests__/helpers/caps.js +++ b/packages/react-native-editor/__device-tests__/helpers/caps.js @@ -13,7 +13,6 @@ const ios = { exports.iosLocal = { ...ios, - waitForQuiescence: true, deviceName: 'iPhone 11', }; From 7fb21370db204969411077eaeb5ab56ba56a2be1 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Tue, 9 Mar 2021 10:48:11 +0100 Subject: [PATCH 5/6] Update Xcode version to 12.2 in iOS native e2e tests --- .github/workflows/rnmobile-ios-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index bdd1abb1ac8426..4c577e75039ca7 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -59,7 +59,7 @@ jobs: run: npm run native test:e2e:bundle:ios - name: Switch Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_12.app + run: sudo xcode-select --switch /Applications/Xcode_12.2.app - name: Build (if needed) run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios From de9e594b7e70ea24b9ea906b7940e20f97060ecb Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Tue, 9 Mar 2021 11:44:30 +0100 Subject: [PATCH 6/6] Add xcode to matrix in iOS e2e tests workflow --- .github/workflows/rnmobile-ios-runner.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 4c577e75039ca7..60b119ff1ee0c2 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -14,6 +14,7 @@ jobs: runs-on: macos-latest strategy: matrix: + xcode: [12.2] native-test-name: [ gutenberg-editor-gallery ] @@ -38,7 +39,7 @@ jobs: uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 with: path: packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app - key: ${{ runner.os }}-ios-build-${{ hashFiles('ios-checksums.txt') }} + key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ hashFiles('ios-checksums.txt') }} - name: Restore pods cache uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 @@ -58,8 +59,8 @@ jobs: - name: Bundle iOS run: npm run native test:e2e:bundle:ios - - name: Switch Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_12.2.app + - name: Switch Xcode version to ${{ matrix.xcode }} + run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Build (if needed) run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios