Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow dragging from simple toolbox #7301

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/browser/test/test_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,17 @@ async function getNthBlockOfCategory(browser, categoryName, n) {
/**
* @param browser The active WebdriverIO Browser object.
* @param categoryName The name of the toolbox category to search.
* Null if the toolbox has no categories (simple).
* @param blockType The type of the block to search for.
* @return A Promise that resolves to the root element of the first
* block with the given type in the given category.
*/
async function getBlockTypeFromCategory(browser, categoryName, blockType) {
const category = await getCategory(browser, categoryName);
category.click();
await browser.pause(100);
if (categoryName) {
const category = await getCategory(browser, categoryName);
category.click();
await browser.pause(100);
}

const id = await browser.execute((blockType) => {
return Blockly.getMainWorkspace()
Expand Down Expand Up @@ -271,6 +274,7 @@ async function connect(
y: targetLocation.y - draggedLocation.y,
};
await draggedBlock.dragAndDrop(delta);
await browser.pause(200);
}

/**
Expand Down Expand Up @@ -310,6 +314,7 @@ async function dragNthBlockFromFlyout(browser, categoryName, n, x, y) {
*
* @param browser The active WebdriverIO Browser object.
* @param categoryName The name of the toolbox category to search.
* Null if the toolbox has no categories (simple).
* @param type The type of the block to search for.
* @param x The x-distance to drag, as a delta from the block's
* initial location on screen.
Expand Down