Skip to content

Commit 8d56eba

Browse files
committed
chore: Re-isolate scroll test.
It's failing either again (after WIO update) or when run with the rest of the test suite.
1 parent 75d0c73 commit 8d56eba

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

test/webdriverio/test/scroll_test.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ suite('Scrolling into view', function () {
3939
await testSetup(testFileLocations.BASE, this.timeout());
4040
});
4141

42-
test('Insert scrolls new block into view', async function () {
42+
test.only('Insert scrolls new block into view', async function () {
4343
// Increase timeout to 10s for this longer test.
4444
this.timeout(PAUSE_TIME ? 0 : 10000);
4545

@@ -67,6 +67,27 @@ suite('Scrolling into view', function () {
6767

6868
// Assert new block has been scrolled into the viewport.
6969
await this.browser.pause(PAUSE_TIME);
70+
const blockBounds = await this.browser.execute(() => {
71+
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
72+
const block = workspace.getBlocksByType(
73+
'controls_if',
74+
)[0] as Blockly.BlockSvg;
75+
const blockBounds = block.getBoundingRectangleWithoutChildren();
76+
return blockBounds;
77+
});
78+
console.log("block bounds:", blockBounds);
79+
const viewport = await this.browser.execute(() => {
80+
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
81+
const rawViewport = workspace.getMetricsManager().getViewMetrics(true);
82+
const viewport = new Blockly.utils.Rect(
83+
rawViewport.top,
84+
rawViewport.top + rawViewport.height,
85+
rawViewport.left,
86+
rawViewport.left + rawViewport.width,
87+
);
88+
return viewport;
89+
});
90+
console.log("viewport:", viewport);
7091
const inViewport = await this.browser.execute(() => {
7192
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
7293
const block = workspace.getBlocksByType(

0 commit comments

Comments
 (0)