fix(@wdio/utils): properly detect Appium browser sessions#13949
fix(@wdio/utils): properly detect Appium browser sessions#13949christian-bromann merged 2 commits intomainfrom
Conversation
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browser-runner
@wdio/browserstack-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
| /** | ||
| * it is _not_ a mobile session if automationName is set to start a mobile session | ||
| */ | ||
| const automationName = capabilities['appium:options']?.automationName || capabilities['appium:automationName'] |
There was a problem hiding this comment.
this is strange, we are automating a mobile device, but only, if I understand it correctly, with a "browser driver". Shouldn't we introduce a new flag for this and use that to exclude specific mobile commands for non-mobile browser drivers?
There was a problem hiding this comment.
we are automating a mobile device
No, we are using Appium to automate a browser.
Shouldn't we introduce a new flag for this and use that to exclude specific mobile commands for non-mobile browser drivers?
I think there is a difference here, users can:
- run a browser session on a mobile device: WebdriverIO properly detects this and sets
isMobileto true (which I am not sure is right), however Appium in this case supportsgetContext(I think) - we are using Appium to automate a desktop browser, here
isMobileshould be false but was detected astrue
This patch fixes the second case. I would need more investigation to better understand the first case.
There was a problem hiding this comment.
This link/config from @mykola-mokhnach suggests something else. This is FF on Android which would still be a mobile session.
run a browser session on a mobile device: WebdriverIO properly detects this and sets isMobile to true (which I am not sure is right), however Appium in this case supports getContext (I think)
From what I know the default drivers (appium-xcuitest-driver and appium-uiautomator2-driver) can automate both, meaning web and native. That's the reason why they support thegetContext.
For now we can proceed with this change, but then we need to add a comment to the code that we need to rethink this logic
Co-authored-by: Wim Selles <wim@wswebcreation.nl>
Proposed changes
fixes #13947
Types of changes
Checklist
Backport Request
//: # (The current
mainbranch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8branch.)v9and doesn't need to be back-ported#XXXXXFurther comments
n/a
Reviewers: @webdriverio/project-committers