fix(tests): use new helper function for right-clicks

This commit is contained in:
Rachel Fenichel
2023-09-12 14:45:08 -07:00
parent 1f5dc25b3c
commit 6a920a87cc
2 changed files with 8 additions and 5 deletions

View File

@@ -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(

View File

@@ -542,6 +542,7 @@ module.exports = {
getSelectedBlockElement,
getSelectedBlockId,
getBlockElementById,
getClickableBlockElementById,
getCategory,
getNthBlockOfCategory,
getBlockTypeFromCategory,