Skip to content

Commit

Permalink
Cleaning the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir198 committed Jan 21, 2024
1 parent 4a44b58 commit 520d951
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions frontend/cypress/e2e/addRepository.cy.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
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"
);

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");

Expand All @@ -40,8 +48,6 @@ describe("Adding repository flow", () => {

cy.contains("Confirm").click();

cy.wait("@defaultReleases");

cy.wait("@history");
cy.wait(["@defaultReleases", "@history"]);
});
});
1 change: 1 addition & 0 deletions frontend/cypress/fixtures/releases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]

0 comments on commit 520d951

Please sign in to comment.