diff --git a/frontend/cypress/e2e/addRepository.cy.ts b/frontend/cypress/e2e/addRepository.cy.ts index ab355aa9..efb7465c 100644 --- a/frontend/cypress/e2e/addRepository.cy.ts +++ b/frontend/cypress/e2e/addRepository.cy.ts @@ -1,9 +1,17 @@ describe("Adding repository flow", () => { + const addChartNameInput = "[data-cy='add-chart-name']"; + const addChartUrlInput = "[data-cy='add-chart-url']"; + const addChartRepositoryButton = "[data-cy='add-chart-repository-button']"; + it("Adding new chart repository", () => { cy.intercept("GET", "http://localhost:5173/status", { fixture: "status.json", }).as("status"); + cy.intercept("GET", "http://localhost:5173/api/helm/releases", { + fixture: "releases.json", + }).as("releases"); + cy.visit( "http://localhost:5173/#/minikube/installed?filteredNamespace=default" ); @@ -11,14 +19,14 @@ describe("Adding repository flow", () => { cy.get("[data-cy='navigation-link']").contains("Repository").click(); cy.get("[data-cy='install-repository-button']").click(); - cy.get("[data-cy='add-chart-name']").type("Komodorio"); - cy.get("[data-cy='add-chart-url']").type("https://helm-charts.komodor.io"); + cy.get(addChartNameInput).type("Komodorio"); + cy.get(addChartUrlInput).type("https://helm-charts.komodor.io"); cy.intercept("GET", "http://localhost:5173/api/helm/repositories", { fixture: "repositories.json", }).as("repositories"); - cy.get("[data-cy='add-chart-repository-button']").click(); + cy.get(addChartRepositoryButton).click(); cy.contains("https://helm-charts.komodor.io"); @@ -40,8 +48,6 @@ describe("Adding repository flow", () => { cy.contains("Confirm").click(); - cy.wait("@defaultReleases"); - - cy.wait("@history"); + cy.wait(["@defaultReleases", "@history"]); }); }); diff --git a/frontend/cypress/fixtures/releases.json b/frontend/cypress/fixtures/releases.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/frontend/cypress/fixtures/releases.json @@ -0,0 +1 @@ +[] \ No newline at end of file