Skip to content
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

[py] support wheel also to build sync actions #13619

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

kkb912002
Copy link

@kkb912002 kkb912002 commented Feb 23, 2024

Description

Make ActionChains.scroll_* functions fill pause to key, pointer actions queue each for building sync actions.
And make the other functions fill pause to scroll actions queue also.

Motivation and Context

Problem:
When run the code below, pause actions are carried out differently than intended.

actions = ActionChains(driver)
actions.scroll_...()
actions.pause(5)
actions.scroll_...()
actions.pause(5)
actions.scroll_...()
actions.perform()

Built actions:

[
  { type: "pointer", .., actions: [{ type: "pause", duration: 5000 }, { type: "pause", duration: 5000 }],
  { type: "key", ......, actions: [{ type: "pause", duration: 5000 }, { type: "pause", duration: 5000 }],
  { type: "wheel", ...., actions: [{ type: "scroll", .. }, { type: "scroll", .. }, { type: "scroll", .. }]
]

Should be(simplified):

[
  { type: "pointer", .., actions: [{ pause 0 }, { pause 5000 }, { pause 0 }, { pause 5000 }, { pause 0 }],
  { type: "key", ......, actions: [{ pause 0 }, { pause 5000 }, { pause 0 }, { pause 5000 }, { pause 0 }],
  { type: "wheel", ...., actions: [{ scroll }, { pause 5000 }, { scroll 0 }, { pause 5000 }, { scroll 0 }]
]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Feb 23, 2024

CLA assistant check
All committers have signed the CLA.

@AutomatedTester
Copy link
Member

Can you add a test that shows what you're after and that passes after this change? Looking at the code I don't think it is doing what you're after but would like to see a test in case I am missing something

@kkb912002
Copy link
Author

kkb912002 commented Feb 26, 2024

Can you add a test that shows what you're after and that passes after this change? Looking at the code I don't think it is doing what you're after but would like to see a test in case I am missing something

I modified the existing test case to fail on the trunk branch.

On the trunk: pointerDown and scroll actions are performed at the same time.

[
  { type: "pointer", .., actions: [{ pointerDown }, { pointerUp }, { pause 0 },   { pause 0 }, { pause 0 } ...],
  { type: "key", ......, actions: [{ pause 0 },     { pause 0 },   { keyDown f }, { keyUp f }, { keyDown o } ...],
  { type: "wheel", ...., actions: [{ scroll }]
]

Fixed:

[
  { type: "pointer", .., actions: [{ pointerDown }, { pointerUp }, { pause 0 }, { pause 0 },   { pause 0 }, { pause 0 } ...],
  { type: "key", ......, actions: [{ pause 0 },     { pause 0 },   { pause 0 }, { keyDown f }, { keyUp f }, { keyDown o } ...],
  { type: "wheel", ...., actions: [{ pause 0 },     { pause 0 },   { scroll },  { pause 0 },   { pause 0 }, { pause 0 } ...]
]

@kkb912002 kkb912002 force-pushed the py-support-wheel-also-to-build-sync-actions branch 2 times, most recently from 5127331 to f9fef5c Compare March 3, 2024 21:15
@kkb912002 kkb912002 force-pushed the py-support-wheel-also-to-build-sync-actions branch 2 times, most recently from 7039c04 to 007f845 Compare March 7, 2024 01:41
@kkb912002 kkb912002 force-pushed the py-support-wheel-also-to-build-sync-actions branch from 007f845 to 236cbb1 Compare March 17, 2024 23:10
@kkb912002
Copy link
Author

@AutomatedTester
Isn't this enough?

@kkb912002 kkb912002 force-pushed the py-support-wheel-also-to-build-sync-actions branch from 236cbb1 to 3ab9f78 Compare March 19, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants