fix: Fix more browser tests#9183
Conversation
| }); | ||
|
|
||
| test('Redo block deletion', async function () { | ||
| // TODO(#9029) enable this test once deleting a block doesn't lose focus |
There was a problem hiding this comment.
This was fixed in #9195, can this be reenabled now?
tests/browser/test/test_setup.mjs
Outdated
| for (const input of block.inputList) { | ||
| for (const field of input.fieldRow) { |
There was a problem hiding this comment.
There's a recently-ish introduced getFields() that returns a generator that might be more convenient here, but not a blocker.
tests/browser/test/test_setup.mjs
Outdated
| while (!(await elementInBounds(browser, flyoutBlock))) { | ||
| await scrollFlyout(browser, 0, 50); | ||
| } |
There was a problem hiding this comment.
Could you use WorkspaceSvg.scrollBoundsIntoView(flyoutBlock.getBoundingRectangleWithoutChildren()) rather than scrolling repeatedly by a fixed amount until it's on screen?
There was a problem hiding this comment.
This would seemingly allow you to get rid of elementInBounds, since it should be safe to do unconditionally.
There was a problem hiding this comment.
It took some reworking of a few of the test methods, but does seem to be cleaner and work better overall. =)
| return vertInView && horInView; | ||
| }, element); | ||
| // Unicode escape to close flyout. | ||
| await browser.keys(['\uE00C']); |
There was a problem hiding this comment.
Can this be webdriverio.Key.Escape?
There was a problem hiding this comment.
Done here and elsewhere.
- Switch to using scrollBoundsIntoView instead of scrolling the flyout - Use webdriverio Key.Escape instead of the string code for it
RoboErikG
left a comment
There was a problem hiding this comment.
Updated based on comments
| }); | ||
|
|
||
| test('Redo block deletion', async function () { | ||
| // TODO(#9029) enable this test once deleting a block doesn't lose focus |
tests/browser/test/test_setup.mjs
Outdated
| for (const input of block.inputList) { | ||
| for (const field of input.fieldRow) { |
tests/browser/test/test_setup.mjs
Outdated
| while (!(await elementInBounds(browser, flyoutBlock))) { | ||
| await scrollFlyout(browser, 0, 50); | ||
| } |
There was a problem hiding this comment.
It took some reworking of a few of the test methods, but does seem to be cleaner and work better overall. =)
| return vertInView && horInView; | ||
| }, element); | ||
| // Unicode escape to close flyout. | ||
| await browser.keys(['\uE00C']); |
There was a problem hiding this comment.
Done here and elsewhere.
The basics
This fixes the remaining browser tests
The details
Resolves
Fixes #8953
Proposed Changes
Lots of fixes to the browser tests
Reason for Changes
Test Coverage
Documentation
Additional Information