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 diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 1665d769e25f0..93a4d8ac34788 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 @@ -82,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 }} 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__/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__/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(); 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..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,6 +12,8 @@ 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 ); diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index fc73b1c1c878a..bd42abf2a2fa9 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, @@ -51,7 +51,7 @@ exports.android = { // SauceLabs config exports.sauceOptions = { - appiumVersion: '2.0.0', + appiumVersion: '2.1.3', }; exports.prefixKeysWithAppium = ( obj ) => { 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..a6a1ff225fe64 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" + "deviceName": "iPhone 15 Simulator", + "deviceTabletName": "iPad (10th generation) Simulator", + "platformVersion": "17.0" }, "pixelRatio": { "iPhone": 3, diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index c44bc277155e2..5689417b1430c 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() ); } } @@ -173,15 +170,24 @@ const setupDriver = async () => { ? serverConfigs.local : serverConfigs.sauce; - const driver = await remote( { - ...serverConfig, - logLevel: 'error', - capabilities: { - platformName: PLATFORM_NAME, - ...prefixKeysWithAppium( desiredCaps ), - ...sauceOptionsConfig, - }, - } ); + let driver; + try { + driver = await remote( { + ...serverConfig, + logLevel: 'debug', + // 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; @@ -296,11 +302,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(); diff --git a/packages/react-native-editor/bin/test-e2e-setup.sh b/packages/react-native-editor/bin/test-e2e-setup.sh index b4fd55c9bea12..11a5b98603ccb 100755 --- a/packages/react-native-editor/bin/test-e2e-setup.sh +++ b/packages/react-native-editor/bin/test-e2e-setup.sh @@ -6,17 +6,10 @@ # 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 -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" @@ -104,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."