Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions cypress/e2e/main.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ describe("MusicBlocks Application", () => {

it("should toggle full-screen mode", () => {
cy.get("#FullScreen").click();
cy.document().its("fullscreenElement").should("exist");
cy.wait(500);
cy.document().its("fullscreenElement").should("not.be.null");
cy.get("#FullScreen").click();
cy.document().its("fullscreenElement").should("not.exist");
cy.wait(500);
cy.document().its("fullscreenElement").should("be.null");
});

it("should toggle the toolbar menu", () => {
Expand Down Expand Up @@ -140,13 +142,21 @@ describe("MusicBlocks Application", () => {

describe("Planet Page Interaction", () => {
it("should load the Planet page and return to the main page when clicking the close button", () => {
cy.get("#planetIcon > .material-icons")
.should("exist")
.and("be.visible")
.click();
cy.get("#planet-iframe")
.should("be.visible");
cy.get("#planetIcon > .material-icons").should("exist").and("be.visible").click();

cy.get("#planet-iframe", { timeout: 10000 })
.should("be.visible")
.and("have.attr", "src")
.and("not.be.empty");

cy.get("#planet-iframe").then(($iframe) => {
const iframeSrc = $iframe.attr("src");
cy.log("Iframe source:", iframeSrc);
});

cy.window().then((win) => {
win.document.getElementById("planet-iframe").style.display = "block";
});
});
});

});
});