From 4075cf444028db6f1f1ada481f707c7ed9fbb7ea Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 16:59:43 +0100 Subject: [PATCH 01/27] Update Android runner to macos-13 and removes the appium drivers cache --- .github/workflows/rnmobile-android-runner.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index e0365c9b4d3d2..fd3c1c8eb68f0 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -15,8 +15,7 @@ concurrency: jobs: test: runs-on: macos-13 - if: false - #if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} + if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: matrix: native-test-name: [gutenberg-editor-rendering] @@ -37,13 +36,6 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node - - name: Restore tests setup cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - name: Prepare tests setup run: npm run native test:e2e:setup From 58934188b13be0aea722aa752863dc87d1418b4f Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 17:00:43 +0100 Subject: [PATCH 02/27] Updates iOS runner to Xcode 15.1 and removes appium drivers cache --- .github/workflows/rnmobile-ios-runner.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 1665d769e25f0..2b253147cd6f2 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -15,12 +15,11 @@ concurrency: jobs: test: runs-on: macos-13 - if: false - #if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} + if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: matrix: - xcode: ['14.2'] - device: ['iPhone 14'] + xcode: ['15.1'] + device: ['iPhone 15'] native-test-name: [gutenberg-editor-rendering] steps: @@ -42,13 +41,6 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node - - name: Restore tests setup cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - name: Prepare tests setup run: npm run native test:e2e:setup From 4ff658c6baa32ee94d184f90ccd8aa0b2a124fb9 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 17:03:09 +0100 Subject: [PATCH 03/27] Updates capabilities to iOS 17 --- .../react-native-editor/__device-tests__/README.md | 2 +- .../__device-tests__/helpers/caps.js | 2 +- .../__device-tests__/helpers/device-config.json | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/README.md b/packages/react-native-editor/__device-tests__/README.md index 719adbbcf9426..b38f1e2f00c9b 100644 --- a/packages/react-native-editor/__device-tests__/README.md +++ b/packages/react-native-editor/__device-tests__/README.md @@ -5,7 +5,7 @@ The Mobile Gutenberg (MG) project maintains a suite of automated end-to-end (E2E ## Setup 1. Complete the [React Native Getting Started](https://reactnative.dev/docs/environment-setup) guide for both iOS and Android, which covers setting up Xcode, Android Studio, the Android SDK. -1. Open [Xcode settings](https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes#Install-and-manage-Simulator-runtimes-in-settings) to install the iOS 16.2 simulator runtime. +1. Open [Xcode settings](https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes#Install-and-manage-Simulator-runtimes-in-settings) to install the iOS 17.2 simulator runtime. 1. Install [`jq`](https://jqlang.github.io/jq/download/) via [Homebrew](https://brew.sh/) or your preferred package manager. 1. `npm run native test:e2e:setup` diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index fc73b1c1c878a..be036cccfffaa 100644 --- a/packages/react-native-editor/__device-tests__/helpers/caps.js +++ b/packages/react-native-editor/__device-tests__/helpers/caps.js @@ -32,7 +32,7 @@ exports.iosServer = ( { iPadDevice = false } ) => ( { deviceName: ! iPadDevice ? iOSConfig.saucelabs.deviceName : iOSConfig.saucelabs.deviceTabletName, - platformVersion: iOSConfig.local.platformVersion, + platformVersion: iOSConfig.saucelabs.platformVersion, pixelRatio: ! iPadDevice ? iOSConfig.pixelRatio.iPhone : iOSConfig.pixelRatio.iPad, diff --git a/packages/react-native-editor/__device-tests__/helpers/device-config.json b/packages/react-native-editor/__device-tests__/helpers/device-config.json index 5f952099133dd..d73717febd97f 100644 --- a/packages/react-native-editor/__device-tests__/helpers/device-config.json +++ b/packages/react-native-editor/__device-tests__/helpers/device-config.json @@ -1,16 +1,14 @@ { "ios": { "local": { - "deviceName": "iPhone 14", + "deviceName": "iPhone 15", "deviceTabletName": "iPad (10th generation)", - "platformVersion": "16.2" + "platformVersion": "17.2" }, "saucelabs": { "deviceName": "iPhone 14 Simulator", - "deviceTabletName": "iPad (10th generation) Simulator" - }, - "buildkite": { - "platformVersion": "16.4" + "deviceTabletName": "iPad (10th generation) Simulator", + "platformVersion": "17.0" }, "pixelRatio": { "iPhone": 3, From 025de061d4ac2d43e993aca86060fdd7166f533a Mon Sep 17 00:00:00 2001 From: Gerardo Date: Wed, 10 Jan 2024 11:34:11 +0100 Subject: [PATCH 04/27] Update clickBeginningOfElement helper to take into account the padding of the block --- .../react-native-editor/__device-tests__/helpers/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index c44bc277155e2..c18ec0fb012ee 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -296,11 +296,15 @@ const clickMiddleOfElement = async ( driver, element ) => { // Clicks in the top left of an element. const clickBeginningOfElement = async ( driver, element ) => { const location = await element.getLocation(); + const borderPadding = 8; await driver .action( 'pointer', { parameters: { pointerType: 'touch' }, } ) - .move( { x: location.x, y: location.y } ) + .move( { + x: location.x + borderPadding, + y: location.y + borderPadding, + } ) .down() .up() .perform(); From 487c6d13e7e6a9a8b032076827cec65847863f59 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Wed, 10 Jan 2024 11:34:34 +0100 Subject: [PATCH 05/27] Update height size expectation to add an extra 1 pixel value --- .../gutenberg-editor-media-blocks-@canary.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js index 480d19cb966a0..acfc18be3aaf3 100644 --- a/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js +++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js @@ -122,9 +122,9 @@ onlyOniOS( 'Gutenberg Editor Cover Block test', () => { const { height } = await coverBlock.getSize(); // Height is set to 20rem, where 1rem is 16. - // There is also block's vertical padding equal 16. - // Finally, the total height should be 20 * 16 + 16 = 336. - expect( height ).toBe( 336 ); + // There is also block's vertical padding equal 16 and an extra 1 pixel value. + // Finally, the total height should be 20 * 16 + 16 + 1 = 337. + expect( height ).toBe( 337 ); await coverBlock.click(); expect( coverBlock ).toBeTruthy(); From f12314061a3bac5998c9eb944578ce1cd54a7bd9 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 15:35:15 +0100 Subject: [PATCH 06/27] Remove Appium home path usage --- .../react-native-editor/bin/build-e2e-wda.sh | 2 +- .../react-native-editor/bin/test-e2e-setup.sh | 21 +++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/react-native-editor/bin/build-e2e-wda.sh b/packages/react-native-editor/bin/build-e2e-wda.sh index 2b835fbd6e608..ab780dadc184e 100755 --- a/packages/react-native-editor/bin/build-e2e-wda.sh +++ b/packages/react-native-editor/bin/build-e2e-wda.sh @@ -7,4 +7,4 @@ CONFIG_FILE="$(pwd)/__device-tests__/helpers/device-config.json" IOS_DEVICE_NAME=$(jq -r '.ios.local.deviceName' "$CONFIG_FILE") IOS_PLATFORM_VERSION=$(jq -r '.ios.local.platformVersion' "$CONFIG_FILE") -xcodebuild -project ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS Simulator,name=$IOS_DEVICE_NAME,OS=$IOS_PLATFORM_VERSION" -derivedDataPath ios/build/WDA +xcodebuild -project ./../../node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS Simulator,name=$IOS_DEVICE_NAME,OS=$IOS_PLATFORM_VERSION" -derivedDataPath ios/build/WDA diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index b4fd55c9bea12..556738bceb64d 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -10,13 +10,6 @@ XCUITEST_VERSION="5.7.0" set -o pipefail -if command -v appium >/dev/null 2>&1; then - APPIUM_CMD="appium" -else - # Use relative path to access the locally installed appium - APPIUM_CMD="../../../node_modules/.bin/appium" -fi - function log_info() { printf "ℹ️ $1\n" } @@ -29,32 +22,32 @@ function log_error() { printf "❌ $1\n" } -output=$($APPIUM_CMD driver list --installed --json) +output=$(appium driver list --installed --json) # UiAutomator2 driver installation matched_version=$(echo "$output" | jq -r '.uiautomator2.version // empty') if [ -z "$matched_version" ]; then log_info "UiAutomator2 not installed, installing version $UI_AUTOMATOR_2_VERSION..." - $APPIUM_CMD driver install "uiautomator2@$UI_AUTOMATOR_2_VERSION" + appium driver install "uiautomator2@$UI_AUTOMATOR_2_VERSION" elif [ "$matched_version" = "$UI_AUTOMATOR_2_VERSION" ]; then log_info "UiAutomator2 version $UI_AUTOMATOR_2_VERSION is available." else log_info "UiAutomator2 version $matched_version is installed, replacing it with version $UI_AUTOMATOR_2_VERSION..." - $APPIUM_CMD driver uninstall uiautomator2 - $APPIUM_CMD driver install "uiautomator2@$UI_AUTOMATOR_2_VERSION" + appium driver uninstall uiautomator2 + appium driver install "uiautomator2@$UI_AUTOMATOR_2_VERSION" fi # XCUITest driver installation matched_version=$(echo "$output" | jq -r '.xcuitest.version // empty') if [ -z "$matched_version" ]; then log_info "XCUITest not installed, installing version $XCUITEST_VERSION..." - $APPIUM_CMD driver install "xcuitest@$XCUITEST_VERSION" + appium driver install "xcuitest@$XCUITEST_VERSION" elif [ "$matched_version" = "$XCUITEST_VERSION" ]; then log_info "XCUITest version $XCUITEST_VERSION is available." else log_info "XCUITest version $matched_version is installed, replacing it with version $XCUITEST_VERSION..." - $APPIUM_CMD driver uninstall xcuitest - $APPIUM_CMD driver install "xcuitest@$XCUITEST_VERSION" + appium driver uninstall xcuitest + appium driver install "xcuitest@$XCUITEST_VERSION" fi CONFIG_FILE="$(pwd)/__device-tests__/helpers/device-config.json" From 1427ce6ad1f3cdf5a95bc90cf4ae7051aae5bc6f Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 17:09:03 +0100 Subject: [PATCH 07/27] Updates Appium to 2.1.3 --- package-lock.json | 237 +++++++----------- package.json | 2 +- .../__device-tests__/helpers/caps.js | 2 +- 3 files changed, 87 insertions(+), 154 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b0dbbb0905cb..6e59a0bf71e24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "@types/sprintf-js": "1.1.2", "@types/uuid": "8.3.1", "ajv": "8.7.1", - "appium": "2.0.0", + "appium": "2.1.3", "babel-jest": "29.7.0", "babel-loader": "9.2.1", "babel-plugin-inline-json-import": "0.3.2", @@ -4323,6 +4323,7 @@ "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", "dev": true, + "license": "MIT", "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -16142,10 +16143,11 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==" }, "node_modules/@types/triple-beam": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.3.tgz", - "integrity": "sha512-6tOUG+nVHn0cJbVp25JFayS5UE6+xlbcNF9Lo9mU7U0zk3zeUShZied4YEQZjy1JBF043FSkdXw8YkUJuVtB5g==", - "dev": true + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", + "dev": true, + "license": "MIT" }, "node_modules/@types/uglify-js": { "version": "3.9.2", @@ -18592,18 +18594,19 @@ "integrity": "sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==" }, "node_modules/appium": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/appium/-/appium-2.0.0.tgz", - "integrity": "sha512-SfpaYI35aM2KcShL0gOMDcni9CIev4X+WfEFfncsoM+S3dyPd++FjwoH2pmRDk4yHTDNz8gCTbUizQN8fJgYpw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/appium/-/appium-2.1.3.tgz", + "integrity": "sha512-ChVu/DvwmPDF3lRt1teAQTjaXTNHgZ7MjPEUdw6b+r5D+t+euy4Z1uAWWggoXpR1RGU8xNftye8hkRaGTv788g==", "dev": true, "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "@appium/base-driver": "^9.3.15", - "@appium/base-plugin": "^2.2.15", - "@appium/docutils": "^0.4.4", + "@appium/base-driver": "^9.3.20", + "@appium/base-plugin": "^2.2.20", + "@appium/docutils": "^0.4.9", "@appium/schema": "^0.3.1", - "@appium/support": "^4.1.2", - "@appium/types": "^0.13.2", + "@appium/support": "^4.1.6", + "@appium/types": "^0.13.4", "@sidvind/better-ajv-errors": "2.1.0", "@types/argparse": "2.0.10", "@types/bluebird": "3.5.38", @@ -18620,18 +18623,17 @@ "bluebird": "3.7.2", "cross-env": "7.0.3", "find-up": "5.0.0", - "glob": "8.1.0", "lilconfig": "2.1.0", "lodash": "4.17.21", "npmlog": "7.0.1", "ora": "5.4.1", "package-changed": "3.0.0", "resolve-from": "5.0.0", - "semver": "7.5.3", + "semver": "7.5.4", "source-map-support": "0.5.21", - "teen_process": "2.0.2", - "type-fest": "3.11.1", - "winston": "3.9.0", + "teen_process": "2.0.4", + "type-fest": "3.13.1", + "winston": "3.10.0", "wrap-ansi": "7.0.0", "yaml": "2.3.1" }, @@ -18691,15 +18693,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/appium/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/appium/node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -18753,25 +18746,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/appium/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/appium/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -18802,18 +18776,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/appium/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/appium/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -18823,18 +18785,6 @@ "node": ">=6" } }, - "node_modules/appium/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/appium/node_modules/npmlog": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-7.0.1.tgz", @@ -18940,21 +18890,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/appium/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/appium/node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -18982,10 +18917,11 @@ } }, "node_modules/appium/node_modules/type-fest": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.1.tgz", - "integrity": "sha512-aCuRNRERRVh33lgQaJRlUxZqzfhzwTrsE98Mc3o3VXqmiaQdHacgUtJ0esp+7MvZ92qhtzKPeusaX6vIEcoreA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -21901,6 +21837,7 @@ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "dev": true, + "license": "MIT", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -21911,6 +21848,7 @@ "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -25256,7 +25194,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -27133,7 +27072,8 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fetch-blob": { "version": "3.2.0", @@ -27642,7 +27582,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/follow-redirects": { "version": "1.15.6", @@ -32672,7 +32613,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ky": { "version": "0.33.3", @@ -34848,24 +34790,39 @@ } }, "node_modules/logform": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.5.1.tgz", - "integrity": "sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", "dev": true, + "license": "MIT", "dependencies": { - "@colors/colors": "1.5.0", + "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", "fecha": "^4.2.0", "ms": "^2.1.1", "safe-stable-stringify": "^2.3.1", "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/logform/node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.1.90" } }, "node_modules/logform/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/logkitty": { "version": "0.7.1", @@ -39319,6 +39276,7 @@ "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "dev": true, + "license": "MIT", "dependencies": { "fn.name": "1.x.x" } @@ -44530,10 +44488,11 @@ } }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } @@ -46033,6 +45992,7 @@ "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -47337,54 +47297,20 @@ } }, "node_modules/teen_process": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-2.0.2.tgz", - "integrity": "sha512-8Be+s0d3XIs6rosilYTYR8/TY4JfAl8Der8ItWhI/o/MTYGLTcjvNUNk5AU8c1eTpJ98MF0xextE8VJtqhtUcg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-2.0.4.tgz", + "integrity": "sha512-34Jw6kbHF0alXf9Rqt7B4kL1mrO30siG4JgdFuzYOeahoF9fbzDxSovC4pEfQ8L614cy2BPnAQPBp+dWZGuZNw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/runtime": "7.19.0", "bluebird": "3.7.2", "lodash": "4.17.21", - "shell-quote": "1.7.3", - "source-map-support": "0.5.21", - "which": "2.0.2" - }, - "engines": { - "node": ">=14", - "npm": ">=6" - } - }, - "node_modules/teen_process/node_modules/@babel/runtime": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.0.tgz", - "integrity": "sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/teen_process/node_modules/shell-quote": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", - "dev": true - }, - "node_modules/teen_process/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "shell-quote": "1.8.1", + "source-map-support": "0.5.21" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0", + "npm": ">=8" } }, "node_modules/telejson": { @@ -47769,7 +47695,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/text-table": { "version": "0.2.0", @@ -48031,6 +47958,7 @@ "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14.0.0" } @@ -51300,10 +51228,11 @@ } }, "node_modules/winston": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.9.0.tgz", - "integrity": "sha512-jW51iW/X95BCW6MMtZWr2jKQBP4hV5bIDq9QrIjfDk6Q9QuxvTKEAlpUNAzP+HYHFFCeENhph16s0zEunu4uuQ==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.10.0.tgz", + "integrity": "sha512-nT6SIDaE9B7ZRO0u3UvdrimG0HkB7dSTAgInQnNR2SOPJ4bvq5q79+pXLftKmP52lJGW15+H5MCK0nM9D3KB/g==", "dev": true, + "license": "MIT", "dependencies": { "@colors/colors": "1.5.0", "@dabh/diagnostics": "^2.0.2", @@ -51322,17 +51251,18 @@ } }, "node_modules/winston-transport": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", "dev": true, + "license": "MIT", "dependencies": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", + "logform": "^2.7.0", + "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" }, "engines": { - "node": ">= 6.4.0" + "node": ">= 12.0.0" } }, "node_modules/winston-transport/node_modules/readable-stream": { @@ -51340,6 +51270,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -51354,6 +51285,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -51366,6 +51298,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", diff --git a/package.json b/package.json index f935ac7250d1c..e06b91473277a 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@types/sprintf-js": "1.1.2", "@types/uuid": "8.3.1", "ajv": "8.7.1", - "appium": "2.0.0", + "appium": "2.1.3", "babel-jest": "29.7.0", "babel-loader": "9.2.1", "babel-plugin-inline-json-import": "0.3.2", diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index be036cccfffaa..bd42abf2a2fa9 100644 --- a/packages/react-native-editor/__device-tests__/helpers/caps.js +++ b/packages/react-native-editor/__device-tests__/helpers/caps.js @@ -51,7 +51,7 @@ exports.android = { // SauceLabs config exports.sauceOptions = { - appiumVersion: '2.0.0', + appiumVersion: '2.1.3', }; exports.prefixKeysWithAppium = ( obj ) => { From 40355e5cbfffd75a23bfaa37546de26b649fe951 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 11 Jan 2024 17:11:11 +0100 Subject: [PATCH 08/27] Update Device config for SauceLabs --- .../__device-tests__/helpers/device-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/device-config.json b/packages/react-native-editor/__device-tests__/helpers/device-config.json index d73717febd97f..a6a1ff225fe64 100644 --- a/packages/react-native-editor/__device-tests__/helpers/device-config.json +++ b/packages/react-native-editor/__device-tests__/helpers/device-config.json @@ -6,7 +6,7 @@ "platformVersion": "17.2" }, "saucelabs": { - "deviceName": "iPhone 14 Simulator", + "deviceName": "iPhone 15 Simulator", "deviceTabletName": "iPad (10th generation) Simulator", "platformVersion": "17.0" }, From 7345071d5cbc129c205c0b1007623ed29dd4a22a Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 4 Dec 2024 14:59:26 -0500 Subject: [PATCH 09/27] ci: Reinstate Appium home directory usage It is unclear why this was removed, as the relative path will likely never be available if the drivers are installed via the `appium` CLI. --- packages/react-native-editor/bin/build-e2e-wda.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/bin/build-e2e-wda.sh b/packages/react-native-editor/bin/build-e2e-wda.sh index ab780dadc184e..2b835fbd6e608 100755 --- a/packages/react-native-editor/bin/build-e2e-wda.sh +++ b/packages/react-native-editor/bin/build-e2e-wda.sh @@ -7,4 +7,4 @@ CONFIG_FILE="$(pwd)/__device-tests__/helpers/device-config.json" IOS_DEVICE_NAME=$(jq -r '.ios.local.deviceName' "$CONFIG_FILE") IOS_PLATFORM_VERSION=$(jq -r '.ios.local.platformVersion' "$CONFIG_FILE") -xcodebuild -project ./../../node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS Simulator,name=$IOS_DEVICE_NAME,OS=$IOS_PLATFORM_VERSION" -derivedDataPath ios/build/WDA +xcodebuild -project ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS Simulator,name=$IOS_DEVICE_NAME,OS=$IOS_PLATFORM_VERSION" -derivedDataPath ios/build/WDA From 10d96dd96cfa0555dd8bc795ecbbac8ecf52a1c3 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 4 Dec 2024 16:40:05 -0500 Subject: [PATCH 10/27] ci: Reinstate test setup cache Presumably this was removed as a temporary debugging mechanism. Reinstating it should improve CI task performance. --- .github/workflows/rnmobile-android-runner.yml | 7 +++++++ .github/workflows/rnmobile-ios-runner.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index fd3c1c8eb68f0..38f74c2c79a5c 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -36,6 +36,13 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node + - name: Restore tests setup cache + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + with: + path: | + ~/.appium + key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} + - name: Prepare tests setup run: npm run native test:e2e:setup diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 2b253147cd6f2..92d3e846f7133 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -41,6 +41,13 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node + - name: Restore tests setup cache + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + with: + path: | + ~/.appium + key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} + - name: Prepare tests setup run: npm run native test:e2e:setup From 18f00e4b2461dd39939e7535f3c79f1e9162da4f Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 5 Dec 2024 09:15:25 -0500 Subject: [PATCH 11/27] test: E2E test setup script ensures Android package is installed It was an incorrect presumption the required package is installed, as the default package changes with Android Studio updates. --- packages/react-native-editor/bin/test-e2e-setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index 556738bceb64d..1de6d435d2956 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -97,11 +97,16 @@ function detect_or_create_emulator() { local emulator_id=$(echo "$emulator_name" | sed 's/ /_/g; s/\./_/g') local device_id=$(echo "$emulator_id" | awk -F '_' '{print tolower($1)"_"tolower($2)"_"tolower($3)}') local runtime_api=$(echo "$emulator_id" | awk -F '_' '{print $NF}') + local package="system-images;android-$runtime_api;google_apis;arm64-v8a" local emulator=$(emulator -list-avds | grep "$emulator_id") if [[ -z $emulator ]]; then log_info "$emulator_name not found, creating..." - avdmanager create avd -n "$emulator_id" -k "system-images;android-$runtime_api;google_apis;arm64-v8a" -d "$device_id" > /dev/null + if ! sdkmanager --list | grep -q "$package"; then + sdkmanager --install "$package" --channel=0 + fi + + avdmanager create avd -n "$emulator_id" -k "$package" -d "$device_id" > /dev/null log_success "$emulator_name created." else log_info "$emulator_name available." From 74d19dc060b7791d01373da6d5f8c734f2688571 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 5 Dec 2024 09:30:10 -0500 Subject: [PATCH 12/27] test: Update XCUITest version Utilize version compatible with targeted iOS and Xcode versions. --- packages/react-native-editor/bin/test-e2e-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index 1de6d435d2956..11a5b98603ccb 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -6,7 +6,7 @@ # NOTE: Please update the following versions when upgrading Appium. # ================================================================= UI_AUTOMATOR_2_VERSION="2.32.3" -XCUITEST_VERSION="5.7.0" +XCUITEST_VERSION="7.24.15" set -o pipefail From 9d26902d8dcacf706ad407f2a827c0f21624a1d9 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 5 Dec 2024 10:38:49 -0500 Subject: [PATCH 13/27] Revert "ci: Reinstate test setup cache" This reverts commit e76401377d10b508c781cfbeccf77fd7e6b82fae. --- .github/workflows/rnmobile-android-runner.yml | 7 ------- .github/workflows/rnmobile-ios-runner.yml | 7 ------- 2 files changed, 14 deletions(-) diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index 38f74c2c79a5c..fd3c1c8eb68f0 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -36,13 +36,6 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node - - name: Restore tests setup cache - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - name: Prepare tests setup run: npm run native test:e2e:setup diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 92d3e846f7133..2b253147cd6f2 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -41,13 +41,6 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node - - name: Restore tests setup cache - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - name: Prepare tests setup run: npm run native test:e2e:setup From 0bcfb6f5b145cd16859ec3d19acc25bd6d348eb2 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 5 Dec 2024 12:55:48 -0500 Subject: [PATCH 14/27] ci: Increment Appium port The CI logs claim the port is already in use, this is an attempt to workaround that report. --- .../__device-tests__/helpers/serverConfigs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js b/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js index 7bfefd45b0184..64a9b476be77d 100644 --- a/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js +++ b/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js @@ -1,6 +1,6 @@ exports.local = { host: '127.0.0.1', - port: 4723, // Port for local Appium runs. + port: 4724, // Port for local Appium runs. }; exports.sauce = { From bb590f327280186d44b4d3ac45dc27b3f3c0e83c Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 6 Dec 2024 11:24:37 -0500 Subject: [PATCH 15/27] Revert "ci: Increment Appium port" This reverts commit be69859773c40bb085a53697a5c2e636ac760b85. --- .../__device-tests__/helpers/serverConfigs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js b/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js index 64a9b476be77d..7bfefd45b0184 100644 --- a/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js +++ b/packages/react-native-editor/__device-tests__/helpers/serverConfigs.js @@ -1,6 +1,6 @@ exports.local = { host: '127.0.0.1', - port: 4724, // Port for local Appium runs. + port: 4723, // Port for local Appium runs. }; exports.sauce = { From 988e14243926621422471a2f0cd7528b01488f38 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 6 Dec 2024 12:28:23 -0500 Subject: [PATCH 16/27] test: Remove unnecessary `await` --- .../react-native-editor/__device-tests__/helpers/utils.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index c18ec0fb012ee..f92d66c032b4f 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -90,10 +90,7 @@ const setupDriver = async () => { } catch ( err ) { // Ignore error here, Appium is probably already running (Appium Inspector has its own server for instance) // eslint-disable-next-line no-console - await console.log( - 'Could not start Appium server', - err.toString() - ); + console.log( 'Could not start Appium server', err.toString() ); } } From 975ba89e226120f826dace09945153f5adeaba7a Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 6 Dec 2024 16:12:31 -0500 Subject: [PATCH 17/27] Revert "test: Update XCUITest version" This reverts commit a730ddba1639a41a972ef3e80ef1addf65e02a36. --- packages/react-native-editor/bin/test-e2e-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index 11a5b98603ccb..1de6d435d2956 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -6,7 +6,7 @@ # NOTE: Please update the following versions when upgrading Appium. # ================================================================= UI_AUTOMATOR_2_VERSION="2.32.3" -XCUITEST_VERSION="7.24.15" +XCUITEST_VERSION="5.7.0" set -o pipefail From ff1b8caddbe5a1dffbd8672835c856d64bdcc3c2 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 6 Dec 2024 16:22:56 -0500 Subject: [PATCH 18/27] ci: Increase log verbosity --- .../react-native-editor/__device-tests__/helpers/appium-local.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/__device-tests__/helpers/appium-local.js b/packages/react-native-editor/__device-tests__/helpers/appium-local.js index b4b4f415d10ce..8cfdcffe1540c 100644 --- a/packages/react-native-editor/__device-tests__/helpers/appium-local.js +++ b/packages/react-native-editor/__device-tests__/helpers/appium-local.js @@ -12,6 +12,7 @@ const start = ( { port = 4723, flags } ) => '--log', './appium-out.log', '--log-no-colors', + '--log-level debug', '--relaxed-security', // Needed for mobile:shell commend for text entry on Android flags, ].filter( Boolean ); From e13b2536a047492a4edacbdc5d28a8a620daa955 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 10:27:03 -0500 Subject: [PATCH 19/27] Reapply "test: Update XCUITest version" This reverts commit 5b84a96c1c4db584b7ea0de0fc511f3d15f218d2. --- packages/react-native-editor/bin/test-e2e-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index 1de6d435d2956..11a5b98603ccb 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -6,7 +6,7 @@ # NOTE: Please update the following versions when upgrading Appium. # ================================================================= UI_AUTOMATOR_2_VERSION="2.32.3" -XCUITEST_VERSION="5.7.0" +XCUITEST_VERSION="7.24.15" set -o pipefail From 1a6b76182d140683750de0bf112abb52d2d183a1 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 10:39:35 -0500 Subject: [PATCH 20/27] ci: Fix verbose Appium logging parameter --- .../__device-tests__/helpers/appium-local.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/appium-local.js b/packages/react-native-editor/__device-tests__/helpers/appium-local.js index 8cfdcffe1540c..a73937f38e419 100644 --- a/packages/react-native-editor/__device-tests__/helpers/appium-local.js +++ b/packages/react-native-editor/__device-tests__/helpers/appium-local.js @@ -12,7 +12,8 @@ const start = ( { port = 4723, flags } ) => '--log', './appium-out.log', '--log-no-colors', - '--log-level debug', + '--log-level', + 'debug', '--relaxed-security', // Needed for mobile:shell commend for text entry on Android flags, ].filter( Boolean ); From 1c946ffcf99bc37b2e30dc634c64ad95911dd989 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 14:11:54 -0500 Subject: [PATCH 21/27] ci: Trigger CI runs Intentionally empty commit to re-run passing CI tests. From 7fd7da5d8efeebb620169ff51e9f44f702d4193e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 14:55:32 -0500 Subject: [PATCH 22/27] ci: Double driver connection retry timeout Mitigate driver setup instability. The Webdriver.io driver sporadically fails to connect to the Appium server. This seemed to become more prevalent when upgrading to the macOS 13 runner. --- packages/react-native-editor/__device-tests__/helpers/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index f92d66c032b4f..101b2bd7bbfb6 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -173,6 +173,8 @@ const setupDriver = async () => { const driver = await remote( { ...serverConfig, logLevel: 'error', + // Mitigate driver setup instability by doubling the default timeout + connectionRetryTimeout: 240000, capabilities: { platformName: PLATFORM_NAME, ...prefixKeysWithAppium( desiredCaps ), From 6ea0a6f455af85c9577866983a5b000dae76bdc6 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 15:35:40 -0500 Subject: [PATCH 23/27] ci: Catch and log driver setup errors --- .../__device-tests__/helpers/utils.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index 101b2bd7bbfb6..63d3e019c50c0 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -170,17 +170,24 @@ const setupDriver = async () => { ? serverConfigs.local : serverConfigs.sauce; - const driver = await remote( { - ...serverConfig, - logLevel: 'error', - // Mitigate driver setup instability by doubling the default timeout - connectionRetryTimeout: 240000, - capabilities: { - platformName: PLATFORM_NAME, - ...prefixKeysWithAppium( desiredCaps ), - ...sauceOptionsConfig, - }, - } ); + let driver; + try { + driver = await remote( { + ...serverConfig, + logLevel: 'error', + // Mitigate driver setup instability by doubling the default timeout + connectionRetryTimeout: 240000, + capabilities: { + platformName: PLATFORM_NAME, + ...prefixKeysWithAppium( desiredCaps ), + ...sauceOptionsConfig, + }, + } ); + } catch ( error ) { + // eslint-disable-next-line no-console + console.error( 'Error setting up the driver:', error ); + throw error; + } await driver.setOrientation( 'PORTRAIT' ); return driver; From aedfcd2a3bd0c6e821348fe22c55b656981876c2 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 17:11:58 -0500 Subject: [PATCH 24/27] ci: Ensure Appium port is available Mitigate sporadic Appium server start failures from an occupied port. --- .github/workflows/rnmobile-ios-runner.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 2b253147cd6f2..93a4d8ac34788 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -74,6 +74,10 @@ jobs: - name: Build Web Driver Agent (if needed) run: test -d packages/react-native-editor/ios/build/WDA || npm run native test:e2e:build-wda + - name: Ensure Appium port is available + run: | + lsof -ti:4723 | xargs kill -9 || true + - name: Run iOS Device Tests run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }} From 6f941afbddfaee330606c62eb1bdd0d1902e618e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 10 Dec 2024 10:56:31 -0500 Subject: [PATCH 25/27] ci: Log processes using the Appium port --- .../__device-tests__/helpers/appium-local.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/react-native-editor/__device-tests__/helpers/appium-local.js b/packages/react-native-editor/__device-tests__/helpers/appium-local.js index a73937f38e419..86d57c820feff 100644 --- a/packages/react-native-editor/__device-tests__/helpers/appium-local.js +++ b/packages/react-native-editor/__device-tests__/helpers/appium-local.js @@ -6,6 +6,41 @@ const childProcess = require( 'child_process' ); // Spawns an appium process. const start = ( { port = 4723, flags } ) => new Promise( ( resolve, reject ) => { + // Log all processes using the same port + childProcess.exec( `lsof -i :${ port }`, ( err, stdout, stderr ) => { + if ( err ) { + // eslint-disable-next-line no-console + console.error( `>>>> Error executing lsof: ${ err }` ); + return; + } + if ( stderr ) { + // eslint-disable-next-line no-console + console.error( `>>>> stderr: ${ stderr }` ); + return; + } + // eslint-disable-next-line no-console + console.log( `>>>> Processes using port ${ port }:\n${ stdout }` ); + } ); + + // Kill all processes using the same port + childProcess.exec( + `lsof -t -i :${ port } | xargs kill -9`, + ( err, stdout, stderr ) => { + if ( err ) { + // eslint-disable-next-line no-console + console.error( `>>>> Error killing processes: ${ err }` ); + return; + } + if ( stderr ) { + // eslint-disable-next-line no-console + console.error( `>>>> stderr: ${ stderr }` ); + return; + } + // eslint-disable-next-line no-console + console.log( `>>>> Killed processes using port ${ port }` ); + } + ); + const args = [ '--port', port.toString(), From 1e0dccd15bd750cd0e9f762e70e73472932655fe Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 11 Dec 2024 07:46:46 -0500 Subject: [PATCH 26/27] ci: Enable Webdriver.io debug logs --- packages/react-native-editor/__device-tests__/helpers/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index 63d3e019c50c0..5689417b1430c 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -174,7 +174,7 @@ const setupDriver = async () => { try { driver = await remote( { ...serverConfig, - logLevel: 'error', + logLevel: 'debug', // Mitigate driver setup instability by doubling the default timeout connectionRetryTimeout: 240000, capabilities: { From d00b6ec9aba01a71e29488b81034730274c91afd Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 11 Dec 2024 07:47:52 -0500 Subject: [PATCH 27/27] Revert "ci: Log processes using the Appium port" This reverts commit 6f941afbddfaee330606c62eb1bdd0d1902e618e. --- .../__device-tests__/helpers/appium-local.js | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/appium-local.js b/packages/react-native-editor/__device-tests__/helpers/appium-local.js index 86d57c820feff..a73937f38e419 100644 --- a/packages/react-native-editor/__device-tests__/helpers/appium-local.js +++ b/packages/react-native-editor/__device-tests__/helpers/appium-local.js @@ -6,41 +6,6 @@ const childProcess = require( 'child_process' ); // Spawns an appium process. const start = ( { port = 4723, flags } ) => new Promise( ( resolve, reject ) => { - // Log all processes using the same port - childProcess.exec( `lsof -i :${ port }`, ( err, stdout, stderr ) => { - if ( err ) { - // eslint-disable-next-line no-console - console.error( `>>>> Error executing lsof: ${ err }` ); - return; - } - if ( stderr ) { - // eslint-disable-next-line no-console - console.error( `>>>> stderr: ${ stderr }` ); - return; - } - // eslint-disable-next-line no-console - console.log( `>>>> Processes using port ${ port }:\n${ stdout }` ); - } ); - - // Kill all processes using the same port - childProcess.exec( - `lsof -t -i :${ port } | xargs kill -9`, - ( err, stdout, stderr ) => { - if ( err ) { - // eslint-disable-next-line no-console - console.error( `>>>> Error killing processes: ${ err }` ); - return; - } - if ( stderr ) { - // eslint-disable-next-line no-console - console.error( `>>>> stderr: ${ stderr }` ); - return; - } - // eslint-disable-next-line no-console - console.log( `>>>> Killed processes using port ${ port }` ); - } - ); - const args = [ '--port', port.toString(),