fix: tune isMobile for Appium situation#10491
Merged
christian-bromann merged 4 commits intowebdriverio:mainfrom Jun 3, 2023
Merged
fix: tune isMobile for Appium situation#10491christian-bromann merged 4 commits intowebdriverio:mainfrom
christian-bromann merged 4 commits intowebdriverio:mainfrom
Conversation
christian-bromann
approved these changes
Jun 3, 2023
Member
christian-bromann
left a comment
There was a problem hiding this comment.
This makes totally sense, thank you 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Current
isMobiledetection returnstrueif the session was appium by checking the caps hasappium:. In this case, for example. the displayed check method call calls/displayedendpoint, although Appium would like to expect to get JS one for chrome/msedge (desktop browser) for https://github.com/appium/appium-chromium-driver . It could cause unexpected W3C/MJSONWP endpoint call. So this PR's idea is to make the isMobile true only when the platformName is ios, tvos and android. For Appium's case, probably the platformName is more accurate in detecting whether the target device is mobile, or not.Btw, when I tried to run
npm run test:unitto check the test code, I got an error below. Thus I haven't completed the test case yet.npx vitest ./packages/wdio-utils/testsalso returned the same result.Let me kick this repository's CI how the test case will be... (since it did not work on my local...)
In my brief testing on my local, iOS session was handled as isMobile as true but false for chrome desktop. This is expected behavior.
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers