diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index 2f79974c2df27c..5f33870be68799 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -43,6 +43,9 @@ jobs: ~/.appium key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} + - name: Prepare tests setup + run: npm run native test:e2e:setup + - name: Gradle cache uses: gradle/gradle-build-action@b5126f31dbc19dd434c3269bf8c28c315e121da2 # v2.8.1 diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index 58f7e88ed10196..5c63d3e9222042 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -12,15 +12,19 @@ fi output=$($APPIUM_CMD driver list --installed --json) if echo "$output" | grep -q 'uiautomator2'; then - echo 'UiAutomator2 is installed, skipping installation.' + echo '[info] UiAutomator2 is installed, skipping installation.' else - echo 'UiAutomator2 not found, installing...' + echo '[info] UiAutomator2 not found, installing...' $APPIUM_CMD driver install uiautomator2 fi if echo "$output" | grep -q 'xcuitest'; then - echo 'XCUITest is installed, skipping installation.' + echo '[info] XCUITest is installed, skipping installation.' else - echo 'XCUITest not found, installing...' + echo '[info] XCUITest not found, installing...' $APPIUM_CMD driver install xcuitest fi + +# Mitigate conflicts between development server caches and E2E tests +npm run clean:runtime > /dev/null +echo '[info] Runtime cache cleaned.' diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 020eb13fa7ac2d..14601cd572c37b 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -112,11 +112,11 @@ "test:e2e:setup": "./bin/test-e2e-setup.sh", "test:e2e:bundle:android": "mkdir -p android/app/src/main/assets && npm run rn-bundle -- --reset-cache --platform android --dev false --minify false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res", "test:e2e:build-app:android": "cd android && ./gradlew clean && ./gradlew assembleDebug", - "test:e2e:android:local": "npm run test:e2e:setup && npm run test:e2e:bundle:android && npm run test:e2e:build-app:android && TEST_RN_PLATFORM=android npm run device-tests:local", + "test:e2e:android:local": "npm run test:e2e:bundle:android && npm run test:e2e:build-app:android && TEST_RN_PLATFORM=android npm run device-tests:local", "test:e2e:bundle:ios": "mkdir -p ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app && npm run bundle:ios && cp bundle/ios/App.js ./ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle && cp -r bundle/ios/assets ./ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/", "test:e2e:build-app:ios": "npm run preios && ./bin/build_e2e_ios_app", "test:e2e:build-wda": "xcodebuild -project ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS Simulator,name=iPhone 13' -derivedDataPath ios/build/WDA", - "test:e2e:ios:local": "npm run test:e2e:setup && npm run test:e2e:bundle:ios && npm run test:e2e:build-app:ios && npm run test:e2e:build-wda && TEST_RN_PLATFORM=ios npm run device-tests:local", + "test:e2e:ios:local": "npm run test:e2e:bundle:ios && npm run test:e2e:build-app:ios && npm run test:e2e:build-wda && TEST_RN_PLATFORM=ios npm run device-tests:local", "build:gutenberg": "cd gutenberg && npm ci && npm run build", "clean": "npm run clean:build-artifacts; npm run clean:aztec; npm run clean:haste; npm run clean:metro; npm run clean:watchman", "clean:runtime": "npm run clean:haste; npm run clean:metro; npm run clean:watchman; npm run clean:babel-cache",