Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
leafty committed Dec 20, 2024
1 parent 35499c0 commit f3a5a57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
13 changes: 4 additions & 9 deletions tests/cypress/e2e/groupV2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,8 @@ describe("Work with group data connectors, missing permissions", () => {
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("public-storage").should("be.visible").click();
cy.getDataCy("data-connector-edit").should("be.visible").click();
cy.contains(
"You do not have the required permissions to modify this data connector"
).should("be.visible");
cy.getDataCy("data-connector-credentials").should("be.visible");
cy.getDataCy("data-connector-edit").should("not.exist");
});

it("delete a group data connector", () => {
Expand All @@ -481,10 +479,7 @@ describe("Work with group data connectors, missing permissions", () => {
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("public-storage").should("be.visible").click();
cy.getDataCy("button-with-menu-dropdown").should("be.visible").click();
cy.getDataCy("data-connector-delete").should("be.visible").click();
cy.contains(
"You do not have the required permissions to delete this data connector"
).should("be.visible");
cy.getDataCy("data-connector-credentials").should("be.visible");
cy.getDataCy("data-connector-delete").should("not.exist");
});
});
1 change: 0 additions & 1 deletion tests/cypress/e2e/groupV2DataConnectorCredentials.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ describe("Set up data connectors with credentials", () => {
);

// clear credentials
openDataConnectorMenu();
cy.getDataCy("data-connector-credentials").click();
cy.getDataCy("data-connector-credentials-modal")
.contains("The saved credentials for this data connector are incomplete")
Expand Down
23 changes: 8 additions & 15 deletions tests/cypress/e2e/projectV2setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@

import fixtures from "../support/renkulab-fixtures";

function openDataConnectorMenu() {
cy.getDataCy("data-connector-edit")
.parent()
.find("[data-cy=button-with-menu-dropdown]")
.first()
.click();
}

describe("Set up project components", () => {
beforeEach(() => {
fixtures
Expand Down Expand Up @@ -89,6 +81,7 @@ describe("Set up project components", () => {
}).as("getSessionsV2");
fixtures
.readProjectV2({ fixture: "projectV2/read-projectV2-empty.json" })
.getProjectV2Permissions({ projectId: "01HYJE5FR1JV4CWFMBFJQFQ4RM" })
.listProjectDataConnectors()
.getDataConnector()
.sessionLaunchers()
Expand Down Expand Up @@ -292,7 +285,11 @@ describe("Set up data connectors", () => {
cy.wait("@listProjectDataConnectors");

cy.contains("example storage").should("be.visible").click();
openDataConnectorMenu();
cy.getDataCy("data-connector-credentials")
.should("be.visible")
.siblings()
.get("[data-cy=button-with-menu-dropdown]")
.click();
cy.getDataCy("data-connector-delete").should("be.visible").click();
cy.wait("@getProjectV2Permissions");
cy.contains("Are you sure you want to unlink the data connector").should(
Expand All @@ -319,12 +316,8 @@ describe("Set up data connectors", () => {
cy.wait("@listProjectDataConnectors");

cy.contains("example storage").should("be.visible").click();
openDataConnectorMenu();
cy.getDataCy("data-connector-delete").should("be.visible").click();
cy.contains(
"You do not have the required permissions to unlink this data connector."
).should("be.visible");
cy.getDataCy("delete-data-connector-modal-button").should("not.exist");
cy.getDataCy("data-connector-credentials").should("be.visible");
cy.getDataCy("data-connector-delete").should("not.exist");
});

it("should clear state after a data connector has been created", () => {
Expand Down

0 comments on commit f3a5a57

Please sign in to comment.