Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Fixes for e2e tests (Gutenberg demo build cache + error logging in setup) #29589

Merged
merged 6 commits into from
Mar 9, 2021
Merged
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
9 changes: 5 additions & 4 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
xcode: [12.2]
native-test-name: [
gutenberg-editor-gallery
]
Expand All @@ -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
Expand All @@ -58,11 +59,11 @@ jobs:
- name: Bundle iOS
run: npm run native test:e2e:bundle:ios

- name: Switch Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_12.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/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 }}
Expand Down
9 changes: 7 additions & 2 deletions packages/react-native-editor/jest_ui_test_environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down