Skip to content

[💡 Feature]: Add scroll behavior to w3c moveTo, click with offset arguments, and dnd methods #11544

@udarrr

Description

@udarrr

Is your feature request related to a problem?

Currently scrolling should be implemented in test level.
For example if i'd like to move pointer to element with scrolling I should do not so obvious action like scrolling because element can be shifted for some reason.

  1. moveTo
await (await browser.$("#root div.theme-switcher-menu > button > span")).scrollIntoView()
await browser.pause(animationTimeout)
await (await browser.$("#root div.theme-switcher-menu > button > span")).moveTo()
  1. w3c click with x,y
await (await browser.$("#root div.theme-switcher-menu > button > span")).scrollIntoView()
await browser.pause(animationTimeout)
await (await browser.$("#root div.theme-switcher-menu > button > span")).click({x: 1, y: 1})
  1. for dragAndDrop it can't be performed because of current implementation
    const browser = getBrowserObject(this);
    return browser.action('pointer')
        .move({ duration: 0, origin, x: 0, y: 0 })
        .down({ button: ACTION_BUTTON })
        .pause(10)
        .move({ duration, origin: targetOrigin, x: targetX, y: targetY })
        .up({ button: ACTION_BUTTON })
        .perform();

Describe the solution you'd like.

I'd like to suggest add scrollIntoView by default to the methods and some arguments for parametrizing the behavior.

  1. moveTo

just with arguments by default

await (await browser.$("#root div.theme-switcher-menu > button > span")).moveTo()

and with preset arguments

await (await browser.$("#root div.theme-switcher-menu > button > span")).moveTo({x: 10, y: 10, scrollOptions: options})

  1. the same for w3c clicking with x,y
  2. and maybe for dnd if it possible to iterate with the same 'pointer' after using 'wheel'

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions