Skip to content

Commit 826e110

Browse files
committed
test: fix cypress test
1 parent f1410a2 commit 826e110

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

cypress/helpers/editor.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
export const getEditorShadow = () => cy.get("editor-wc").shadow();
22

3+
export const getSidebarPanel = () =>
4+
getEditorShadow().findByTestId("sidebar__panel");
5+
36
export const openSaveAndDownloadPanel = () => {
47
getEditorShadow().findByRole("button", { name: "Download project" }).click();
5-
getEditorShadow()
8+
9+
getSidebarPanel()
610
.findByRole("heading", { name: "Save & download" })
711
.should("be.visible");
812

913
return {
1014
uploadProject: (fixturePath) => {
11-
getEditorShadow()
12-
.find(".download-panel__download-section")
13-
.findByRole("button", { name: "Upload project" })
14-
.should("be.visible");
15-
getEditorShadow()
16-
.findByTestId("upload-file-input")
17-
.selectFile(fixturePath, { force: true });
15+
getSidebarPanel().within(() => {
16+
cy.findByRole("button", { name: "Upload project" }).should(
17+
"be.visible",
18+
);
19+
cy.findByTestId("upload-file-input").selectFile(fixturePath, {
20+
force: true,
21+
});
22+
});
1823
},
1924
downloadProject: () => {
20-
getEditorShadow()
21-
.find(".download-panel__download-section")
25+
getSidebarPanel()
2226
.findByRole("button", { name: "Download project" })
2327
.click();
2428
},

0 commit comments

Comments
 (0)