-
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 Setup #55046
[Mobile] Appium 2 Setup #55046
Conversation
Size Change: 0 B Total Size: 1.65 MB ℹ️ View Unchanged
|
Flaky tests detected in 024afb2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6430834144
|
8e2fc6a
to
261c15a
Compare
@@ -8,7 +8,7 @@ describe( 'Gutenberg Editor Rendering Media Blocks test', () => { | |||
await editorPage.initializeEditor( { initialData: mediaBlocks } ); | |||
|
|||
// Give some time to media placeholders to render. | |||
await editorPage.driver.sleep( 3000 ); | |||
await editorPage.driver.setTimeout( { implicit: 3000 } ); |
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.
After this change, I saw there's a pause
method (docs) maybe we can use this instead.
logLevel: 'error', | ||
capabilities: { | ||
platformName: PLATFORM_NAME, | ||
...prefixKeysWithAppium( desiredCaps ), |
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.
At first I was using appium:options
to pass all of these capabilities, but then I found an issue on SauceLabs when it was trying to trigger real devices instead of simulators. It turns out this option of using appium:options
is only available for Real devices (docs).
I'm open to other ideas on how to dynamically rename all capabilities to have the appium:
prefix.
@@ -18,7 +18,7 @@ jobs: | |||
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} | |||
strategy: | |||
matrix: | |||
xcode: ['13.3.1'] | |||
xcode: ['14.2'] |
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.
For the macos-12
runner the latest Xcode 14 version is 14.2
(docs)
- name: Switch Xcode version to ${{ matrix.xcode }} | ||
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | ||
|
||
- name: Launch simulator |
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've moved this to the beginning using the &
so it starts booting up in the background and doesn't block the rest of the steps.
|
||
await driver.setOrientation( 'PORTRAIT' ); | ||
return driver; | ||
}; | ||
|
||
const stopDriver = async ( driver ) => { | ||
if ( ! isLocalEnvironment() ) { | ||
const jobID = driver.sessionID; | ||
|
||
const hash = crypto |
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.
This was causing issues due to the server configuration changes for SauceLabs. The jobs links are public so I don't think we need that auth param.
- 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
2777c20
to
024afb2
Compare
Related PRs:
What?
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast