Skip to content

Commit

Permalink
test: update XPath expressions for Blockly v12 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
cwillisf committed Feb 20, 2025
1 parent 42a9f44 commit 7bb1ace
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions test/helpers/selenium-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ class SeleniumHelper {
// then finally click the toolbox text.
try {
await this.setTitle(`clickBlocksCategory ${categoryText}`);
await this.findByXpath('//div[contains(@class, "blocks_blocks")]');
await this.driver.sleep(100);
await this.clickText(categoryText, 'div[contains(@class, "blocks_blocks")]');

const desiredCategoryLabel = `*[contains(text(), "${categoryText}")]`;
const anyCategoryContainer = '*[contains(@class, "blocklyToolboxCategoryContainer")]';
const desiredCategoryContainer = `//${desiredCategoryLabel}/ancestor::${anyCategoryContainer}`;
await this.clickXpath(desiredCategoryContainer);

await this.driver.sleep(500); // Wait for scroll to finish
} catch (cause) {
throw await enhanceError(outerError, cause);
Expand Down
2 changes: 1 addition & 1 deletion test/integration/blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ describe('Working with the blocks', () => {

test('Use variable blocks after switching languages', async () => {
const myVariable = 'my\u00A0variable';
const changeVariableByScope = "*[@data-id='data_changevariableby']";
const changeVariableByScope = '*[contains(@class, "blocklyFlyout")]//*[contains(@class, "data_changevariableby")]';

await loadUri(uri);

Expand Down

0 comments on commit 7bb1ace

Please sign in to comment.