From c4c332b3d21e4d50b009e1ba3c2b3c96d5c1a533 Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Thu, 19 Dec 2024 17:39:08 +0100 Subject: [PATCH] Add test --- src/client/cypress/e2e/detailPage/boreholeform.cy.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/cypress/e2e/detailPage/boreholeform.cy.js b/src/client/cypress/e2e/detailPage/boreholeform.cy.js index 7b0b73774..65ba3af27 100644 --- a/src/client/cypress/e2e/detailPage/boreholeform.cy.js +++ b/src/client/cypress/e2e/detailPage/boreholeform.cy.js @@ -3,6 +3,7 @@ import { clickOnRowWithText, showTableAndWaitForData, sortBy } from "../helpers/ import { evaluateInput, evaluateSelect, isDisabled, setInput, setSelect } from "../helpers/formHelpers"; import { createBorehole, + getElementByDataCy, goToRouteAndAcceptTerms, handlePrompt, newEditableBorehole, @@ -102,14 +103,18 @@ describe("Test for the borehole form.", () => { setInput("remarks", "This is a test remark"); // navigate away is blocked before saving - cy.get('[data-cy="location-menu-item"]').click(); + getElementByDataCy("location-menu-item").click(); const messageUnsavedChanges = "There are unsaved changes. Do you want to discard all changes?"; handlePrompt(messageUnsavedChanges, "cancel"); saveWithSaveBar(); - cy.get('[data-cy="location-menu-item"]').click(); + getElementByDataCy("location-menu-item").click(); cy.contains("Boreholes.swissgeol.ch ID"); + + getElementByDataCy("borehole-menu-item"); + evaluateSelect("lithostratigraphyTopBedrockId", "Bodensee-Nagelfluh"); + evaluateSelect("chronostratigraphyTopBedrockId", "Phanerozoic"); }); });