fix: Fix toolbox categories tests (Almost)

This fixes the the toolbox categories tests except for dragging out the four
empty statement blocks, which is fixed by https://github.com/google/blockly-samples/pull/2580

Once the latest version of samples is published the toolbox suite can be
re-enabled.
This commit is contained in:
Erik Pasternak
2025-07-11 13:50:22 -07:00
parent 60b7ee1325
commit 2c6c2e1a9d

View File

@@ -11,7 +11,7 @@
import * as chai from 'chai'; import * as chai from 'chai';
import {Key} from 'webdriverio'; import {Key} from 'webdriverio';
import { import {
dragBlockTypeFromFlyout, getBlockTypeFromCategory,
getCategory, getCategory,
PAUSE_TIME, PAUSE_TIME,
screenDirection, screenDirection,
@@ -148,7 +148,12 @@ async function openCategories(browser, categoryList, directionMultiplier) {
continue; continue;
} }
const blockType = await getNthBlockType(browser, categoryName, i); const blockType = await getNthBlockType(browser, categoryName, i);
dragBlockTypeFromFlyout(browser, categoryName, blockType, 50, 20); const blockElem = await getBlockTypeFromCategory(
browser,
categoryName,
blockType,
);
await blockElem.dragAndDrop({x: 50 * directionMultiplier, y: 20});
await browser.pause(PAUSE_TIME); await browser.pause(PAUSE_TIME);
// Should be one top level block on the workspace. // Should be one top level block on the workspace.
const topBlockCount = await browser.execute(() => { const topBlockCount = await browser.execute(() => {