forked from finos/vuu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VUU21: Create e2e test for screenshot functionality
- Loading branch information
1 parent
c200376
commit a9c1f73
Showing
6 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "cypress-iframe"; | ||
import { SHELL_WITH_NEW_THEME_URL } from "../../support/constants"; | ||
|
||
context("Screenshot", () => { | ||
beforeEach(() => { | ||
cy.visit(SHELL_WITH_NEW_THEME_URL); | ||
}); | ||
|
||
it("Takes a screenshot of the current layout and displays it in the save layout dialog", () => { | ||
// Click the menu button | ||
// TODO: Give the button and tab an accessible selector | ||
cy.findByRole("tab", { name: "My Instruments" }).then((tab) => { | ||
cy.wrap(tab).findByRole("button").click(); | ||
}); | ||
|
||
// Click the save layout button | ||
// TODO: Can this be more accessible? | ||
cy.findByRole("menuitem", { name: "Save Layout" }).click(); | ||
|
||
// Check the screenshot is displayed | ||
// TODO: Don't find by classname, use an accessible selector | ||
cy.get(".vuuSaveLayoutPanel").then((dialog) => { | ||
cy.wrap(dialog) | ||
.find("img") | ||
.should("be.visible") | ||
.and(($img) => { | ||
expect($img[0].naturalWidth).to.be.greaterThan(0); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const SHELL_WITH_NEW_THEME_URL = | ||
"/Apps/ShellWithNewTheme?standalone&theme=vuu"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 4 additions & 10 deletions
14
vuu-ui/packages/vuu-shell/src/layout-management/SaveLayoutPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters