Skip to content

Commit

Permalink
#1621 In Cypress, open palette directly instead of simulating the act…
Browse files Browse the repository at this point in the history
…ion through the right-side flyout. (#1622)
  • Loading branch information
tomlyn authored Nov 7, 2023
1 parent bf6c362 commit 567fa61
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions canvas_modules/harness/cypress/support/canvas/test-harness-cmds.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,9 @@ Cypress.Commands.add("openCanvasDefinitionForExtraCanvas", (canvasFileName) => {
});
});

Cypress.Commands.add("openCanvasPalette", (paletteName) => {
cy.toggleCommonCanvasSidePanel();
cy.get("#harness-sidepanel-palette-dropdown").select(paletteName);
// Wait until we can get a palette flyout category from the canvas before proceeding. This
// allows the canvas to load and display before any more test case steps
// are executed. Note: this won't work if the testcase selects a second
// canvas while an existing canvas with nodes is displayed.
Cypress.Commands.add("openCanvasPalette", (paletteFileName) => {
cy.document().then((doc) => {
if (doc.canvasController.getCanvasConfig().enablePaletteLayout === "Modal") {
// Palette Layout - Modal
cy.get(".palette-dialog-categories");
} else {
// Palette Layout - Flyout
cy.get(".palette-flyout-category");
}
cy.toggleCommonCanvasSidePanel();
doc.setPaletteDropdownSelect(paletteFileName);
});
});

Expand Down

0 comments on commit 567fa61

Please sign in to comment.