Skip to content

Commit

Permalink
Fix css selectors in Selenium test
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Feb 15, 2023
1 parent ee378dc commit c096814
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public class MetadataEditorPage extends Page<MetadataEditorPage> {
@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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c096814

Please sign in to comment.