Skip to content

Conversation

@cpcallen
Copy link
Collaborator

A bunch of small fixes and refactors of tests:

  • fix: Have scroll_test.ts restore window size after it's done.
  • docs: Use "WebdriverIO" instead of "Selenium" (since we don't use Selenium!)
  • chore: Remove unneeded timeout(0) calls.
  • fix: Set PAUSE_TIME to 0, making tests run about 50% faster by default.
  • fix: Fix one flakey right-click test in keyboard_mode_test.ts that was previously depending on a fixed-duration pause.
  • refactor: Use sendKeyAndWait in almost all places instead of browser.keys.

cpcallen added 6 commits July 10, 2025 10:57
We aren't using Selenium, so we shouldn't be saying we do.
On my relatively fast laptop none of these tests run slow enough
to fail due to the default 2s timeout.  Only one test takes longer
than 1s, and of the 1024ms that that that test takes, 700ms is
spent in brower.pause calls inside ssendKeyAndWait.
It's very useful to be able to make tests run more slowly so you
can watch them, but they should run as fast as possible by default.

This cuts total teste execution time on a 2021 MacBook Pro M1
approximately in half, from 42s to 22s.
Rather than waiting for some arbitrary amount of time after
right-clicking, wait for the context menu to appear.

This fixes the only test that started failing when PAUSE_TIME
was set to zero.
In most places we were already following browser.keys with a
browser.pause(PAUSE_TIME), so using sendKeysAndWait is more
succinct; in other places we didn't have the pause but it is
not harmful to add a pause (especially now the default PAUSE_TIME
is zero) and could be helpful when watching tests run with a
non-zero PAUSE_TIME.
@cpcallen cpcallen requested a review from a team as a code owner July 10, 2025 15:15
@cpcallen cpcallen requested review from maribethb and removed request for a team July 10, 2025 15:15
@maribethb maribethb self-assigned this Jul 11, 2025
Copy link
Collaborator

@maribethb maribethb left a comment

Choose a reason for hiding this comment

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

Tests are not passing, not sure if it's due to actual timeout or if the timeout is due to the test hanging after an error

this.timeout(0);

// Setup Selenium for all of the tests
// Clear the workspace and load start blocks.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that unlike the rest of the test files, this one only does this before the entire suite, not before each test. Possibly worth either changing that or adding a comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point re: documentation. I had noticed the setup vs. suiteSetup inconsistency. While looking in to that I realised that the tests in this suite are almost certainly passing only because of a combination of #632 and the fact that there happen to be a total of exactly the right number of tab stops in the document that tabNavigateToWorkspace loops focus back to where it started.

@cpcallen
Copy link
Collaborator Author

Tests are not passing, not sure if it's due to actual timeout or if the timeout is due to the test hanging after an error

Unfortunately the test failure is the same in both runs, is not due to a timeout, is not transient, and does not reproduce locally. :-(

Now attempting to bisect by pushing some partial reverts to this branch.

@cpcallen
Copy link
Collaborator Author

cpcallen commented Aug 8, 2025

Superseded by #692.

@cpcallen cpcallen closed this Aug 8, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Blockly 2025 Aug 8, 2025
@cpcallen cpcallen deleted the tests/624 branch August 11, 2025 09:35
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.

2 participants