Skip to content

Commit 8859f98

Browse files
committed
chore: Debug & disable test for investigation.
1 parent b85a4b1 commit 8859f98

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
@@ -44,7 +44,7 @@ suite('Scrolling into view', function () {
4444
await testSetup(testFileLocations.BASE, this.timeout());
4545
});
4646

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

@@ -72,6 +72,27 @@ suite('Scrolling into view', function () {
7272

7373
// Assert new block has been scrolled into the viewport.
7474
await this.browser.pause(PAUSE_TIME);
75+
const blockBounds = await this.browser.execute(() => {
76+
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
77+
const block = workspace.getBlocksByType(
78+
'controls_if',
79+
)[0] as Blockly.BlockSvg;
80+
const blockBounds = block.getBoundingRectangleWithoutChildren();
81+
return blockBounds;
82+
});
83+
console.log("block bounds:", blockBounds);
84+
const viewport = await this.browser.execute(() => {
85+
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
86+
const rawViewport = workspace.getMetricsManager().getViewMetrics(true);
87+
const viewport = new Blockly.utils.Rect(
88+
rawViewport.top,
89+
rawViewport.top + rawViewport.height,
90+
rawViewport.left,
91+
rawViewport.left + rawViewport.width,
92+
);
93+
return viewport;
94+
});
95+
console.log("viewport:", viewport);
7596
const inViewport = await this.browser.execute(() => {
7697
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
7798
const block = workspace.getBlocksByType(

0 commit comments

Comments
 (0)