Skip to content

Speculative fix for flaky flappydrag UI test#63569

Merged
fisher-alice merged 1 commit into
stagingfrom
alice/flappydrag
Jan 29, 2025
Merged

Speculative fix for flaky flappydrag UI test#63569
fisher-alice merged 1 commit into
stagingfrom
alice/flappydrag

Conversation

@fisher-alice

@fisher-alice fisher-alice commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

This is a speculative fix for the flaky flappydrag UI test. From the Saucelabs video, the 2nd toolbox block is being dragged but ends up between the two blocks already in the workspace instead of below both blocks.

I added a plus offset 0,60 to the 2nd drag step so that the 'playSound' block is dragged well below where the 'flap' block is in the workspace.

def generate_drag_code(from, to, target_dx, target_dy)
id_selector = get_id_selector
generate_selector_drag_code "[#{id_selector}='#{from}']:last", "[#{id_selector}='#{to}']", target_dx, target_dy
end
def generate_selector_drag_code(from, to, target_dx, target_dy)
to_offset = generate_offset_code(to)
from_offset = generate_offset_code(from)
"var drag_dx = #{to_offset}.left - #{from_offset}.left;" \
"var drag_dy = #{to_offset}.top - #{from_offset}.top;" \
"$(\"#{from}\").simulate( 'drag', {handle: 'corner', dx: drag_dx + #{target_dx}, dy: drag_dy + #{target_dy}, moves: 5});"
end

Before update

flappydrag.mov

On Saucelabs

After update

On Saucelabs

Links

Slack thread

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@fisher-alice fisher-alice requested review from a team and sanchitmalhotra126 January 29, 2025 19:53
@fisher-alice fisher-alice marked this pull request as ready for review January 29, 2025 19:53

@molly-moen molly-moen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify that this still passes on chrome?

@fisher-alice

Copy link
Copy Markdown
Contributor Author

Did you verify that this still passes on chrome?

Yes - thanks! https://app.saucelabs.com/tests/eb800813f78844f0b80d4b83a802ace5

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.

3 participants