-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Mobile] Appium 2 Migration #55166
[Mobile] Appium 2 Migration #55166
Conversation
- Bumps Appium to version 2.0.0 - Removes wd in favor of WebdriverIO
- Updates test:e2e:build-wda with the new Appium home path for the xcuitest driver. - Updates test:e2e:android:local and test:e2e:ios:local to add the newly added appium:setup script to install drivers if needed.
- Move the Launch of the simulator step to the top so it starts booting up the simulator in the background, so it doesn't block the next steps while it's stating. - Install and cache the Appium drivers.
- It removes unneeded values after the migration. - Bumps the iOS platform version to 16.2. - Adds specific SauceLabs configuration that sets the Appium version to 2.0.0. - Adds a prefixKeysWithAppium util to append the "appium:" prefix for the Appium capabilities settings. This is added to simplify the modifications we do for some of the settings in runtime.
…s for Appium 2 and WebdriverIO
- Remove import of wd and set it as null temporarily while we migrate its usage to WebdriverIO
Update getIOSPlatformVersions to get the desired platform version from the capabilities settings instead of an inline value
- Update Remote configuration with the new structure for WebdriverIO and Appium 2 - Uses the prefixKeysWithAppium util for the Appium capabilities, we cannot use "appium:options" since that's only available for real devices and we use simulators instead. - The app capability value was updated to the new storage:filename= prefix this was important to make SauceLabs to work correctly
- Changes sessionID to sessionId - Removes the hash value to append in the Job URL, these URLs are public so it's not needed to append the auth param. - Updates driver.quit() to driver.deleteSession()
It adds a custom timeout to waitForDisplayed, the simulators in CI are slow so we need to give enough time to find the post title locator.
…te to WebdriverIO
Size Change: -857 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in 52b04f1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6627808133
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for setting this up!
I recognize this is a WIP, leaving a few thoughts for consideration.
… also updates the logic to the latest implementation from SauceLabs docs.
* Improve Screenrecording on Android by making sure of the following: The sdcard folder should exist in the emulator, if not there's a script that will create it. For skipped tests, it will remove empty folders that weren't needed. When having multiple Android emulators opened, it will use the deviceID that Appium is currently using. * Rename getAndroidDeviceID function to getDeviceID since it's not platform specific * Fix comment * Temp: log session * Use adb devices list to get the first active android emulator * Moves getAndroidEmulatorID to its own file and replaces its usage. It also adds specifying the device ID for Android local builds for cases when multiple devices/emulators are connected. * Remove unneeded filtering * Move setting the androidDeviceID value for Android cases only
* docs: Rewrite end-to-end testing documentation Update for breaking changes from upgrading Appium 2. Reduce verbosity and duplication to improve the approachability and maintainability of the documentation. * docs: Remove E2E test contributing documentation This was replaced by a section in the directory's README documentation. * docs: Rewrite end-to-end testing Getting Started section Update for breaking changes from upgrading Appium 2. Reduce verbosity and duplication between the `WordPress/gutenberg` repository to improve the approachability and maintainability of the documentation. * docs: Update links in Gutenberg for Mobile Apps code documentation Documents have been updated and consolidated to reduce verbosity and duplication to improve the approachability and maintainability of the documentation.
* Device tests - Removes skipped tests that haven't been enabled back for a while. These were disabled due to flakiness most likely to the interactions with the context menu to copy/paste text. If needed this can be restored once the flakiness issues are worked on. * Device Tests - Drag & Drop: removes disabled tests. These used utils that were flaky and have been disabled for a long time, they can be added back once stable utils are in place for pasting content. * Editor Page - Removes setHtmlContent since this util is not being used anymore. It can be added back if its needed. * Device Tests Utils - Removes usage of the wd library. It also removes, doubleTap, clickElementOutsideOfTextInput, and related utils to the context menu due to them being flaky and not currenlty in use: tapSelectAllAboveElement, tapCopyAboveElement and tapPasteAboveElement.
* test: Mitigate conflicts between development server caches Occasionally, cryptic npm package dependency errors can occur between test runs. They appear to originate from stale development caches, e.g. Metro server. Clearing these caches, which E2E tests should not rely upon mitigates the likelihood of these errors. * test: Prefix informative E2E test setup logs Merely an attempt to add structure to the outputted logs. * test: Avoid setup scripts during test runs There may be clarity and efficiency by having an explicit setup script. It was avoid running unnecessary scripts during test runs. It is also referenced in the current documentation as a script to run intentionally.
These assets are generated at build time for E2E testing. Seemingly, we do not leverage these generated files for the binary/bundle that we provide to the host apps. Therefore, we can safely ignore these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't approve my own PR but it looks good to me! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending a post providing migration details to contributors.
Use of the "Gutenberg for Mobile Apps" name is still under review. In the meantime, we should use the existing "Mobile Gutenberg" project name.
Related
What?
This PR updates Appium to the newest
2.0.0
version, it also replaces the usage ofwd
in favor ofWebdriverIO
.Why?
Newer versions of Xcode weren't compatible with Appium 1, so the code needs to be migrated to the latest version to stay up to date with the latest versions available and prevent disruptions in the future with a broken E2E testing environment.
How?
By completing the following tasks:
Setup
Tests
WD usage
wd
usage and removes disabled tests #55541Testing Instructions
CI checks should pass in both Gutenberg and Gutenberg Mobile.
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A