feat: enhance scrollIntoView to support native mobile#13870
feat: enhance scrollIntoView to support native mobile#13870christian-bromann merged 15 commits intomainfrom
Conversation
Initial setup to support Native apps
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/browser-runner
@wdio/appium-service
@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: |
- fix tests
|
Hmm, getting the following error when I try to test the command For native the elements are not always available as with web. I might have found a hack I'm not proud of. The |
It seem fine to me if we extend the if statement with scrollIntoView if we are in a mobile and native context, e.g. const browser = getBrowserObject(currentElement)
const shallSkipForMobileScrollIntoView = browser.isMobile && (await browser.getContext === 'NATIVE') |
Co-authored-by: Christian Bromann <git@bromann.dev>
Thanks, that's a solution. If we have the |
- changed code order - updated error messages - fixed UTs
How about enhancing the context manager the way we discussed so the extra call is obsolete? |
That's also what I wanted to do, but in a separate PR which would "revert" the extra call. I wanted to create "smaller" PRs because I don't have a lot of time the coming weeks |
|
Fixed it |
- due to the extra getContext call in mobile mode a lot of UT's failed
* feat: enhance scrollIntoView to support native mobile Initial setup to support Native apps * test: Add unit tests * fix: fix types * chore: add the docs and fix types * fix: make use of $$ from the browser - fix tests * Update packages/webdriverio/src/commands/element/scrollIntoView.ts Co-authored-by: Christian Bromann <git@bromann.dev> * chore: updates after feedback - changed code order - updated error messages - fixed UTs * fix: exclude the scrollIntoView * fix: fix type for scrollIntoView * fix: fix type * fix: type test * test: fix all UTs - due to the extra getContext call in mobile mode a lot of UT's failed --------- Co-authored-by: Christian Bromann <git@bromann.dev>
Initial setup to support Native apps
Proposed changes
This PR enhances the
scrollIntoViewto support native mobile apps by using the nativemobile:executemethods of the driversTypes 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
Reviewers: @webdriverio/project-committers