Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST][RNMobile] Bump api-level of Android E2E tests #58370

Closed
wants to merge 12 commits into from
Closed
4 changes: 1 addition & 3 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ concurrency:
jobs:
test:
runs-on: macos-12
# Disable for now until we fix failures in the job.
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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ const isEditorVisible = async ( driver ) => {
? `//android.widget.EditText[contains(@content-desc, "Post title")]`
: `(//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther[contains(@name, "Post title")])`;

await driver.$( postTitleLocator ).waitForDisplayed( { timeout: 30000 } );
await driver.$( postTitleLocator ).waitForDisplayed( { timeout: 60000 } );
};

const waitForMediaLibrary = async ( driver ) => {
Expand Down
32 changes: 24 additions & 8 deletions packages/react-native-editor/bin/test-e2e-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash -e

# Appium drivers
UI_AUTOMATOR_2_VERSION="2.32.3"
XCUITEST_VERSION="5.7.0"

set -o pipefail

if command -v appium >/dev/null 2>&1; then
Expand All @@ -23,18 +27,30 @@ function log_error() {

output=$($APPIUM_CMD driver list --installed --json)

if echo "$output" | grep -q 'uiautomator2'; then
log_info "UiAutomator2 available."
# Detect 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"
elif [ "$matched_version" = "$UI_AUTOMATOR_2_VERSION" ]; then
log_info "UiAutomator2 version $UI_AUTOMATOR_2_VERSION is available."
else
log_info "UiAutomator2 not found, installing..."
$APPIUM_CMD driver install uiautomator2
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"
fi

if echo "$output" | grep -q 'xcuitest'; then
log_info "XCUITest available."
# Detect 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"
elif [ "$matched_version" = "$XCUITEST_VERSION" ]; then
log_info "XCUITest version $XCUITEST_VERSION is available."
else
log_info "XCUITest not found, installing..."
$APPIUM_CMD driver install xcuitest
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"
fi

CONFIG_FILE="$(pwd)/__device-tests__/helpers/device-config.json"
Expand Down
Loading