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 \ 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() }