From 18cf90e65ebc532da0c035d8a4e60b963a943552 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 13:40:01 -0500 Subject: [PATCH 1/2] fix: use firstMatch in block inserter E2E test helper Blocks like Paragraph appear in multiple inserter sections (most-used and their category section), causing `app.buttons["Paragraph"]` to match multiple elements and fail with "Multiple matching elements found". Use `.firstMatch` since both buttons perform the same insert action. --- ios/Demo-iOS/GutenbergUITests/EditorUITestHelpers.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/Demo-iOS/GutenbergUITests/EditorUITestHelpers.swift b/ios/Demo-iOS/GutenbergUITests/EditorUITestHelpers.swift index 085eb9ae..98cfdb64 100644 --- a/ios/Demo-iOS/GutenbergUITests/EditorUITestHelpers.swift +++ b/ios/Demo-iOS/GutenbergUITests/EditorUITestHelpers.swift @@ -43,7 +43,9 @@ enum EditorUITestHelpers { XCTAssertTrue(addBlockButton.waitForExistence(timeout: 10), "Add block button not found in WebView toolbar") addBlockButton.tap() - let blockOption = app.buttons[name] + // Use firstMatch because the same block can appear in multiple + // inserter sections (e.g. most-used and its category section). + let blockOption = app.buttons[name].firstMatch XCTAssertTrue(blockOption.waitForExistence(timeout: 10), "\(name) block not found in block inserter") blockOption.tap() } From c518d695928e369b4fa6e223fa66933f23ae6ada Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 13:53:20 -0500 Subject: [PATCH 2/2] fix: always copy dist into iOS bundle for E2E tests The test-ios-e2e target only copied dist/ into the iOS bundle directory when ios/Sources/GutenbergKit/Gutenberg/ didn't exist. Since that directory is checked into git, it always exists on CI checkout, so the freshly built dist/ from the build-react pipeline step was never copied over the stale git-tracked bundle. Always replace the iOS bundle with the current dist/ contents to ensure E2E tests run against the latest JS build. --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0f6b89a7..3fedb4e5 100644 --- a/Makefile +++ b/Makefile @@ -222,10 +222,9 @@ test-ios-e2e: ## Run iOS E2E tests against the production build else \ echo "--- :white_check_mark: Using existing build. Use 'make build REFRESH_JS_BUILD=1' to rebuild."; \ fi - @if [ ! -d "./ios/Sources/GutenbergKit/Gutenberg" ]; then \ - echo "--- :open_file_folder: Copying build into iOS bundle"; \ - cp -r ./dist/. ./ios/Sources/GutenbergKit/Gutenberg/; \ - fi + @echo "--- :open_file_folder: Copying build into iOS bundle" + @rm -rf ./ios/Sources/GutenbergKit/Gutenberg/ + @cp -r ./dist/. ./ios/Sources/GutenbergKit/Gutenberg/ @echo "--- :ios: Running iOS E2E Tests (production build)" @set -o pipefail && \ xcodebuild test \