From c096814585d604290f0a00247d3d75e18d4865cb Mon Sep 17 00:00:00 2001 From: Arved Solth Date: Wed, 15 Feb 2023 15:01:14 +0100 Subject: [PATCH] Fix css selectors in Selenium test --- Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java | 4 +++- .../selenium/testframework/pages/MetadataEditorPage.java | 4 ++-- .../kitodo/selenium/testframework/pages/ProcessesPage.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java index fb3863a025b..c94dc77b6f8 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java @@ -79,6 +79,8 @@ public void hideStructureDataTest() throws Exception { */ @Test public void removeMetadataLockTest() throws Exception { + User metadataUser = ServiceManager.getUserService().getByLogin("verylast"); + Pages.getLoginPage().goTo().performLogin(metadataUser); // Open process in metadata editor by default user to set metadata lock for this process and user Pages.getProcessesPage().goTo().editSecondProcessMetadata(); // Leave metadata editor without explicitly clicking the 'close' button @@ -158,7 +160,7 @@ public void logout() throws Exception { * @throws DAOException when dummy processes cannot be removed from database * @throws DataException when dummy processes cannot be removed from index * @throws IOException when media references test process cannot be deleted from file system - * @throws CustomResponseException when dummy processes cannot be removed from index + * @throws CustomResponseException when temporary dummy processes cannot be removed from index */ private static void cleanup() throws DAOException, DataException, IOException, CustomResponseException { for (int processId : processHierarchyTestProcessIds) { diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java index 2edb7860db4..9b6d52da6ee 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java @@ -44,10 +44,10 @@ public class MetadataEditorPage extends Page { @FindBy(id = "logicalTree:0_1") private WebElement secondChildProcess; - @FindBy(id = "saveExit") + @FindBy(id = "buttonForm:saveExit") private WebElement saveAndExitButton; - @FindBy(id = "close") + @FindBy(id = "buttonForm:close") private WebElement closeButton; public MetadataEditorPage() { diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java index 4a5f7a53f6f..2bb1412e886 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java @@ -358,9 +358,9 @@ private void setEditMetadataLink(String processTitle) throws StaleElementReferen .ignoreExceptions().until(() -> processesTable.isDisplayed()); int index = getRowIndex(processesTable, processTitle, 3); await("Wait for 'edit metadata' link to become enabled").pollDelay(1, TimeUnit.SECONDS).atMost(5, TimeUnit.SECONDS) - .ignoreExceptions().until(() -> Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":readXML") + .ignoreExceptions().until(() -> Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":editMetadata") .isEnabled()); - editMetadataLink = Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":readXML"); + editMetadataLink = Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":editMetadata"); } private void setDownloadLogLink() {