From 6a920a87ccf1a3e47ddd069bccf4f11cc86677d5 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 12 Sep 2023 14:45:08 -0700 Subject: [PATCH] fix(tests): use new helper function for right-clicks --- tests/browser/test/delete_blocks_test.js | 12 +++++++----- tests/browser/test/test_setup.js | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/browser/test/delete_blocks_test.js b/tests/browser/test/delete_blocks_test.js index e493b840b..843003d77 100644 --- a/tests/browser/test/delete_blocks_test.js +++ b/tests/browser/test/delete_blocks_test.js @@ -10,6 +10,7 @@ const { testFileLocations, getAllBlocks, getBlockElementById, + getClickableBlockElementById, contextMenuSelect, PAUSE_TIME, } = require('./test_setup'); @@ -132,13 +133,14 @@ suite('Delete blocks', function (done) { }); }); - test('Delete block using backspace key', async function () { + test.only('Delete block using backspace key', async function () { const before = (await getAllBlocks(this.browser)).length; // Get first print block, click to select it, and delete it using backspace key. - const block = (await getBlockElementById(this.browser, firstBlockId)).$( - '.blocklyPath', - ); - await block.click(); + // const block = (await getBlockElementById(this.browser, firstBlockId)).$( + // '.blocklyPath', + // ); + const clickEl = await getClickableBlockElementById(this.browser, firstBlockId); + await clickEl.click(); await this.browser.keys([Key.Backspace]); const after = (await getAllBlocks(this.browser)).length; chai.assert.equal( diff --git a/tests/browser/test/test_setup.js b/tests/browser/test/test_setup.js index 055ac2249..b7819888e 100644 --- a/tests/browser/test/test_setup.js +++ b/tests/browser/test/test_setup.js @@ -542,6 +542,7 @@ module.exports = { getSelectedBlockElement, getSelectedBlockId, getBlockElementById, + getClickableBlockElementById, getCategory, getNthBlockOfCategory, getBlockTypeFromCategory,