Skip to content

Commit

Permalink
Fix cy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Aug 13, 2024
1 parent 52d31db commit 7961642
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/client/cypress/e2e/editor/boreholeTable.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ describe("Borehole editor table tests", () => {

// navigate to page 4
cy.get('[aria-label="next page"]').click();
cy.wait("@edit_list");
cy.get('[aria-label="next page"]').click();
cy.wait("@edit_list");
cy.get('[aria-label="next page"]').click();
cy.wait("@edit_list");
cy.get('[aria-label="next page"]').click();

cy.wait("@edit_list");

// verify current page is 4
Expand All @@ -132,6 +134,7 @@ describe("Borehole editor table tests", () => {

// verify current page is still 4
cy.get('[data-cy="showTableButton"]').click();
cy.get(".MuiDataGrid-row").should("have.length.greaterThan", 0);
cy.get(".MuiTablePagination-displayedRows").should("have.text", "401 - 500 of 1627");
cy.get(".MuiDataGrid-row")
.eq(0)
Expand Down
16 changes: 9 additions & 7 deletions src/client/cypress/e2e/editor/bulkedit.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createBorehole, loginAsAdmin, startBoreholeEditing } from "../helpers/testHelpers";
import { createBorehole, loginAsAdmin, startBoreholeEditing, stopBoreholeEditing } from "../helpers/testHelpers";
import adminUser from "../../fixtures/adminUser.json";

beforeEach(() => {
Expand Down Expand Up @@ -132,12 +132,14 @@ describe("Test the borehole bulk edit feature.", () => {
cy.get("@borehole_id").then(id => {
cy.visit(`/${id}/borehole`);
startBoreholeEditing();
cy.visit("/");
cy.get('[data-cy="showTableButton"]').click();
cy.get(".MuiDataGrid-row").should("have.length.greaterThan", 0);
cy.contains(".MuiDataGrid-row", "AAA_JUNIORSOUFFLE")
.find('.MuiCheckbox-root input[type="checkbox"]')
.should("be.disabled");
cy.visit(`/${id}/borehole`);
stopBoreholeEditing();
});
cy.visit("/");
cy.get('[data-cy="showTableButton"]').click();
cy.get(".MuiDataGrid-row").should("have.length.greaterThan", 0);
cy.contains(".MuiDataGrid-row", "AAA_JUNIORSOUFFLE")
.find('.MuiCheckbox-root input[type="checkbox"]')
.should("be.disabled");
});
});
7 changes: 1 addition & 6 deletions src/client/cypress/e2e/filters/filter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ describe("Search filter tests", () => {
cy.wait("@edit_list");

// check content of table
cy.get('[data-cy="showTableButton"]').click();
cy.get(".MuiTablePagination-displayedRows").should("have.text", "1 - 39 of 39");
cy.get(".MuiDataGrid-row")
.eq(2)
.within(() => {
cy.contains("Darion Rowe").should("exist");
});
cy.get(".MuiDataGrid-row").contains("Darion Rowe").should("exist");
});

function filterByOriginalLithology() {
Expand Down

0 comments on commit 7961642

Please sign in to comment.