Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-code committed Dec 8, 2024
1 parent bdbef16 commit 8492b99
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion client/src/features/dashboardV2/DashboardV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ function SessionsDashboard() {
<div className={cx("align-items-center", "d-flex")}>
<h4 className={cx("mb-0", "me-2")}>
<PlayCircle className={cx("me-1", "bi")} />
My Sessions
My sessions
</h4>
<Badge>{totalSessions}</Badge>
</div>
Expand Down
20 changes: 17 additions & 3 deletions client/src/features/projectsV2/show/ProjectShortHandDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,34 @@ export default function ProjectShortHandDisplay({
)}
data-cy="project-item"
>
<div className={cx("d-flex", "justify-content-between")}>
<div
className={cx(
"d-flex",
"justify-content-between",
"flex-column",
"flex-md-row"
)}
>
<p className={cx("m-0", "fw-bold", "text-truncate", "me-2")}>
{project.name}
</p>
<VisibilityIcon visibility={project.visibility} />
</div>

<div className={cx("d-flex", element === "card-body" && "mt-auto")}>
<div
className={cx(
"d-flex",
element === "card-body" && "mt-auto",
"flex-column",
"flex-md-row"
)}
>
<p className={cx("mb-2", "text-truncate", "text-muted")}>
{project.description}
</p>
{project.updated_at ? (
<TimeCaption
className={cx("ms-auto", "my-auto", "text-truncate")}
className={cx("ms-0", "ms-md-auto", "my-auto", "text-truncate")}
datetime={project.updated_at}
enableTooltip
prefix="Updated"
Expand Down
18 changes: 9 additions & 9 deletions tests/cypress/e2e/dashboardV2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ describe("View v2 landing page", () => {
});

it("view dashboard", () => {
cy.contains("Sessions").should("be.visible");
cy.contains("Projects").should("be.visible");
cy.contains("Groups").should("be.visible");
cy.contains("My sessions").should("be.visible");
cy.contains("My projects").should("be.visible");
cy.contains("My groups").should("be.visible");
});

it("view sessions", () => {
cy.contains("Sessions").should("be.visible");
cy.contains("My sessions").should("be.visible");
cy.getDataCy("dashboard-session-list")
.find("[data-cy=dashboard-session-list-item]")
.contains("user1-uuid/test-2-v2-project")
.contains("THEPROJECTULID26CHARACTERS")
.should("be.visible");
cy.getDataCy("dashboard-session-list")
.find("[data-cy=dashboard-session-list-item]")
Expand All @@ -57,7 +57,7 @@ describe("View v2 landing page", () => {
});

it("view projects", () => {
cy.contains("Projects").should("be.visible");
cy.contains("My projects").should("be.visible");
cy.getDataCy("dashboard-project-list").children().should("have.length", 5);
cy.getDataCy("dashboard-project-list").children().first().click();
cy.location("pathname").should(
Expand All @@ -67,15 +67,15 @@ describe("View v2 landing page", () => {
});

it("view groups", () => {
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.getDataCy("dashboard-group-list").children().should("have.length", 5);
cy.getDataCy("group-item").first().click();
cy.location("pathname").should("contain", "/v2/groups/test-0-group-v2");
});

it("list groups", () => {
cy.contains("View other groups").should("not.exist");
cy.contains("View all my groups").should("be.visible").click();
cy.contains("View all my 50 groups").should("be.visible").click();
cy.contains("Renku 2.0 Search").should("be.visible");
cy.getDataCy("search-filter-role-owner").should("be.checked");
cy.getDataCy("search-filter-role-editor").should("be.checked");
Expand All @@ -85,7 +85,7 @@ describe("View v2 landing page", () => {

it("list projects", () => {
cy.contains("View other projects").should("not.exist");
cy.contains("View all my projects").should("be.visible").click();
cy.contains("View all my 50 projects").should("be.visible").click();
cy.contains("Renku 2.0 Search").should("be.visible");
cy.getDataCy("search-filter-role-owner").should("be.checked");
cy.getDataCy("search-filter-role-editor").should("be.checked");
Expand Down
16 changes: 8 additions & 8 deletions tests/cypress/e2e/groupV2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("List v2 groups", () => {
});

it("list groups", () => {
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 1 group-v2").should("exist");
cy.getDataCy("dashboard-group-list")
.find("a")
Expand All @@ -76,7 +76,7 @@ describe("List v2 groups", () => {

it("shows groups", () => {
fixtures.readGroupV2().readGroupV2Namespace();
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("Edit v2 group", () => {
.listGroupV2Members()
.listProjectV2ByNamespace()
.listDataConnectors({ namespace: "test-2-group-v2" });
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand All @@ -118,7 +118,7 @@ describe("Edit v2 group", () => {
.getGroupV2Permissions()
.listGroupV2Members()
.updateGroupV2();
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down Expand Up @@ -155,7 +155,7 @@ describe("Edit v2 group", () => {
.readGroupV2()
.readGroupV2Namespace();

cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down Expand Up @@ -202,7 +202,7 @@ describe("Edit v2 group", () => {
.getGroupV2Permissions()
.listGroupV2Members()
.deleteGroupV2();
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down Expand Up @@ -266,7 +266,7 @@ describe("Work with group data connectors", () => {
.readProjectV2ById({ projectId: "PROJECT-ULID-1", name: "readProject1" })
.readProjectV2ById({ projectId: "PROJECT-ULID-2", name: "readProject2" })
.readProjectV2ById({ projectId: "PROJECT-ULID-3", name: "readProject2" });
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down Expand Up @@ -406,7 +406,7 @@ describe("Work with group data connectors, missing permissions", () => {
.readProjectV2ById({ projectId: "PROJECT-ULID-1", name: "readProject1" })
.readProjectV2ById({ projectId: "PROJECT-ULID-2", name: "readProject2" })
.readProjectV2ById({ projectId: "PROJECT-ULID-3", name: "readProject2" });
cy.contains("Groups").should("be.visible");
cy.contains("My groups").should("be.visible");
cy.contains("test 2 group-v2").should("be.visible").click();
cy.wait("@readGroupV2");
cy.contains("test 2 group-v2").should("be.visible");
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/e2e/projectV2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe("Edit v2 project", () => {

it("changes project metadata", () => {
fixtures.readProjectV2().updateProjectV2().listNamespaceV2();
cy.contains("Projects").should("be.visible");
cy.contains("My projects").should("be.visible");
cy.getDataCy("dashboard-project-list")
.contains("a", "test 2 v2-project")
.should("be.visible")
Expand Down Expand Up @@ -438,7 +438,7 @@ describe("Edit v2 project", () => {
fixture: "projectV2/list-projectV2-post-delete.json",
name: "listProjectV2PostDelete",
});
cy.contains("Projects");
cy.contains("My projects");
cy.contains("Project deleted").should("be.visible");
});
});
Expand Down

0 comments on commit 8492b99

Please sign in to comment.