Skip to content

Commit 059092f

Browse files
committed
chore: Add comment & enable most tests.
1 parent 28a32f4 commit 059092f

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

test/webdriverio/test/scroll_test.ts

Lines changed: 2 additions & 33 deletions
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.only('Insert scrolls new block into view', async function () {
42+
test('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

@@ -50,12 +50,6 @@ suite('Scrolling into view', function () {
5050
await sendKeyAndWait(this.browser, 'm');
5151
await sendKeyAndWait(this.browser, [Key.Alt, Key.ArrowDown], 25);
5252
await sendKeyAndWait(this.browser, Key.Enter);
53-
// Scroll back up, leaving cursor on the draw block out of the viewport.
54-
// const scrollPosition1 = await this.browser.execute(() => {
55-
// const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
56-
// return [workspace.scrollX, workspace.scrollY];
57-
// });
58-
// console.log("workspace scroll position before scroll:", scrollPosition1);
5953
await this.browser.execute(() => {
6054
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
6155
workspace.scrollBoundsIntoView(
@@ -64,12 +58,8 @@ suite('Scrolling into view', function () {
6458
).getBoundingRectangleWithoutChildren(),
6559
);
6660
});
61+
// Pause to allow scrolling to stabilize before proceeding.
6762
await this.browser.pause(PAUSE_TIME);
68-
// const scrollPosition2 = await this.browser.execute(() => {
69-
// const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
70-
// return [workspace.scrollX, workspace.scrollY];
71-
// });
72-
// console.log("workspace scroll position after scroll:", scrollPosition2);
7363

7464
// Insert and confirm the test block which should be scrolled into view.
7565
await sendKeyAndWait(this.browser, 't');
@@ -78,27 +68,6 @@ suite('Scrolling into view', function () {
7868

7969
// Assert new block has been scrolled into the viewport.
8070
await this.browser.pause(PAUSE_TIME);
81-
// const blockBounds = await this.browser.execute(() => {
82-
// const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
83-
// const block = workspace.getBlocksByType(
84-
// 'controls_if',
85-
// )[0] as Blockly.BlockSvg;
86-
// const blockBounds = block.getBoundingRectangleWithoutChildren();
87-
// return blockBounds;
88-
// });
89-
// console.log("block bounds:", blockBounds);
90-
// const viewport = await this.browser.execute(() => {
91-
// const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
92-
// const rawViewport = workspace.getMetricsManager().getViewMetrics(true);
93-
// const viewport = new Blockly.utils.Rect(
94-
// rawViewport.top,
95-
// rawViewport.top + rawViewport.height,
96-
// rawViewport.left,
97-
// rawViewport.left + rawViewport.width,
98-
// );
99-
// return viewport;
100-
// });
101-
// console.log("viewport:", viewport);
10271
const inViewport = await this.browser.execute(() => {
10372
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
10473
const block = workspace.getBlocksByType(

0 commit comments

Comments
 (0)