Skip to content

Commit

Permalink
Replace 'getAttribute' with 'getDomProperty' in some classes
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Jan 27, 2025
1 parent d07af17 commit 5cfd047
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions Kitodo/src/test/java/org/kitodo/selenium/ImportingST.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ private static void setupServer() throws IOException {
public void checkDefaultValuesTest() throws Exception {
projectsPage.createNewProcess();
Select catalogSelectMenu = new Select(importPage.getCatalogMenu());
assertEquals(TestConstants.K10PLUS, catalogSelectMenu.getFirstSelectedOption().getDomAttribute("label"), "Wrong default catalog selected");
assertEquals(TestConstants.K10PLUS, catalogSelectMenu.getFirstSelectedOption().getDomProperty("label"), "Wrong default catalog selected");

importPage.selectGBV();
Select searchFieldSelectMenu = new Select(importPage.getSearchFieldMenu());
assertEquals(TestConstants.PPN, searchFieldSelectMenu.getFirstSelectedOption().getDomAttribute("label"), "Wrong default search field selected");
assertEquals(TestConstants.PPN, searchFieldSelectMenu.getFirstSelectedOption().getDomProperty("label"), "Wrong default search field selected");
}

/**
Expand Down Expand Up @@ -142,7 +142,7 @@ public void checkDefaultChildProcessImportConfiguration() throws Exception {
.untilAsserted(() -> assertEquals(1, processesPage.getProcessTitles().size(), "Wrong number of filtered processes"));
processesPage.createChildProcess();
Select templateProcessMenu = new Select(importPage.getTemplateProcessMenu());
assertEquals(TEST_VOLUME, templateProcessMenu.getFirstSelectedOption().getDomAttribute("label"), "Wrong default child import configuration selected");
assertEquals(TEST_VOLUME, templateProcessMenu.getFirstSelectedOption().getDomProperty("label"), "Wrong default child import configuration selected");
}

@Test
Expand All @@ -161,10 +161,10 @@ public void checkOrderOfImportConfigurations() throws Exception {
public void checkHierarchyImport() throws Exception {
projectsPage.createNewProcess();
Select catalogSelectMenu = new Select(importPage.getCatalogMenu());
assertEquals(TestConstants.K10PLUS, catalogSelectMenu.getFirstSelectedOption().getDomAttribute("label"), "Wrong default catalog selected");
assertEquals(TestConstants.K10PLUS, catalogSelectMenu.getFirstSelectedOption().getDomProperty("label"), "Wrong default catalog selected");
importPage.selectKalliope();
Select searchFieldSelectMenu = new Select(importPage.getSearchFieldMenu());
assertEquals(TestConstants.IDENTIFIER, searchFieldSelectMenu.getFirstSelectedOption().getDomAttribute("label"), "Wrong default search field selected");
assertEquals(TestConstants.IDENTIFIER, searchFieldSelectMenu.getFirstSelectedOption().getDomProperty("label"), "Wrong default search field selected");
importPage.enterTestSearchValue(TestConstants.KALLIOPE_PARENT_ID);
importPage.activateChildProcessImport();
importPage.decreaseImportDepth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void save() throws InstantiationException, IllegalAccessException {

private void selectCatalogSearch() {
clickElement(configurationTypeMenu.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(configurationTypeMenu.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(configurationTypeMenu.getDomProperty("id") + "_1")));
}

private void selectCustomInterfaceType() {
Expand All @@ -137,7 +137,7 @@ private void selectCustomInterfaceType() {
.atMost(4, TimeUnit.SECONDS)
.until(() -> interfaceTypeMenu.isEnabled());
clickElement(interfaceTypeMenu.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(interfaceTypeMenu.getAttribute("id") + "_4")));
clickElement(Browser.getDriver().findElement(By.id(interfaceTypeMenu.getDomAttribute("id") + "_4")));
}

private void selectIdSearchField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,25 @@ public LdapGroupEditPage insertLdapGroupData(LdapGroup ldapGroup) {
public LdapGroup readLdapGroup() {
LdapGroup ldapGroup = new LdapGroup();
String attributeName = "value";
ldapGroup.setTitle(titleInput.getAttribute(attributeName));
ldapGroup.setDescription(descriptionInput.getAttribute(attributeName));
ldapGroup.setDisplayName(displayNameInput.getAttribute(attributeName));
ldapGroup.setGecos(gecosInput.getAttribute(attributeName));
ldapGroup.setGidNumber(gidNumberInput.getAttribute(attributeName));
ldapGroup.setHomeDirectory(homeDirectoryInput.getAttribute(attributeName));
ldapGroup.setLoginShell(loginShellInput.getAttribute(attributeName));
ldapGroup.setObjectClasses(objectClassesInput.getAttribute(attributeName));
ldapGroup.setSambaAcctFlags(sambaAcctFlagsInput.getAttribute(attributeName));
ldapGroup.setSambaKickoffTime(sambaKickoffTimeInput.getAttribute(attributeName));
ldapGroup.setSambaLogonHours(sambaLogonHoursInput.getAttribute(attributeName));
ldapGroup.setSambaLogonScript(sambaLogonScriptInput.getAttribute(attributeName));
ldapGroup.setSambaPasswordHistory(sambaPasswordHistoryInput.getAttribute(attributeName));
ldapGroup.setSambaPrimaryGroupSID(sambaPrimaryGroupSidInput.getAttribute(attributeName));
ldapGroup.setSambaPwdMustChange(sambaPwdMustChangeInput.getAttribute(attributeName));
ldapGroup.setSambaSID(sambaSidInput.getAttribute(attributeName));
ldapGroup.setSn(snInput.getAttribute(attributeName));
ldapGroup.setUid(uidInput.getAttribute(attributeName));
ldapGroup.setUserDN(userDnInput.getAttribute(attributeName));
ldapGroup.setTitle(titleInput.getDomProperty(attributeName));
ldapGroup.setDescription(descriptionInput.getDomProperty(attributeName));
ldapGroup.setDisplayName(displayNameInput.getDomProperty(attributeName));
ldapGroup.setGecos(gecosInput.getDomProperty(attributeName));
ldapGroup.setGidNumber(gidNumberInput.getDomProperty(attributeName));
ldapGroup.setHomeDirectory(homeDirectoryInput.getDomProperty(attributeName));
ldapGroup.setLoginShell(loginShellInput.getDomProperty(attributeName));
ldapGroup.setObjectClasses(objectClassesInput.getDomProperty(attributeName));
ldapGroup.setSambaAcctFlags(sambaAcctFlagsInput.getDomProperty(attributeName));
ldapGroup.setSambaKickoffTime(sambaKickoffTimeInput.getDomProperty(attributeName));
ldapGroup.setSambaLogonHours(sambaLogonHoursInput.getDomProperty(attributeName));
ldapGroup.setSambaLogonScript(sambaLogonScriptInput.getDomProperty(attributeName));
ldapGroup.setSambaPasswordHistory(sambaPasswordHistoryInput.getDomProperty(attributeName));
ldapGroup.setSambaPrimaryGroupSID(sambaPrimaryGroupSidInput.getDomProperty(attributeName));
ldapGroup.setSambaPwdMustChange(sambaPwdMustChangeInput.getDomProperty(attributeName));
ldapGroup.setSambaSID(sambaSidInput.getDomProperty(attributeName));
ldapGroup.setSn(snInput.getDomProperty(attributeName));
ldapGroup.setUid(uidInput.getDomProperty(attributeName));
ldapGroup.setUserDN(userDnInput.getDomProperty(attributeName));
return ldapGroup;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public String createProcess() throws Exception {
.atMost(3, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)).isEnabled());
clickElement(docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getAttribute("id") + "_2")));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getDomProperty("id") + "_2")));
await("Page ready").pollDelay(150, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> isDisplayed.test(processFromTemplateTabView));

Expand All @@ -192,7 +192,7 @@ public String createProcess() throws Exception {
generateTitleButton.click();
await("Wait for title generation").pollDelay(3, TimeUnit.SECONDS).atMost(10, TimeUnit.SECONDS)
.ignoreExceptions().until(() -> isInputValueNotEmpty.test(processTitleInput));
String generatedTitle = processTitleInput.getAttribute(TestConstants.VALUE);
String generatedTitle = processTitleInput.getDomProperty(TestConstants.VALUE);
save();
return generatedTitle;
}
Expand All @@ -218,7 +218,7 @@ public String createProcessAsChild(String parentProcessTitle) throws Exception {
.atMost(3, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)).isEnabled());
clickElement(docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getAttribute("id") + "_0")));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getDomProperty("id") + "_0")));
await("Page ready").pollDelay(150, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> isDisplayed.test(processFromTemplateTabView));

Expand All @@ -227,15 +227,15 @@ public String createProcessAsChild(String parentProcessTitle) throws Exception {
generateTitleButton.click();
await("Wait for title generation").pollDelay(3, TimeUnit.SECONDS).atMost(10, TimeUnit.SECONDS)
.ignoreExceptions().until(() -> isInputValueNotEmpty.test(processTitleInput));
final String generatedTitle = processTitleInput.getAttribute(TestConstants.VALUE);
final String generatedTitle = processTitleInput.getDomProperty(TestConstants.VALUE);

switchToTabByIndex(1);
searchForParentInput.sendKeys(parentProcessTitle);
searchParentButton.click();
await("Wait for search").pollDelay(500, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> isDisplayed.test(chooseParentSelect));
clickElement(chooseParentSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(chooseParentSelect.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(chooseParentSelect.getDomProperty("id") + "_1")));
await("Wait for tree shows").pollDelay(500, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS)
.ignoreExceptions().until(() -> isDisplayed.test(logicalStructureTree));
save();
Expand All @@ -253,7 +253,7 @@ public boolean createProcessAsChildNotPossible() throws Exception {
.atMost(3, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)).isEnabled());
clickElement(docTypeSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(docTypeSelect.getDomProperty("id") + "_1")));
await("Page ready").pollDelay(150, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> isDisplayed.test(processFromTemplateTabView));

Expand All @@ -272,7 +272,7 @@ public boolean createProcessAsChildNotPossible() throws Exception {
await("Wait for search").pollDelay(500, TimeUnit.MILLISECONDS).atMost(10, TimeUnit.SECONDS).ignoreExceptions()
.until(() -> isDisplayed.test(chooseParentSelect));
clickElement(chooseParentSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(chooseParentSelect.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(chooseParentSelect.getDomProperty("id") + "_1")));
try {
await("Wait for error message").pollDelay(100, TimeUnit.MILLISECONDS).atMost(4, TimeUnit.SECONDS)
.ignoreExceptions().until(() -> isDisplayed.test(errorMessages));
Expand Down Expand Up @@ -308,7 +308,7 @@ public String createProcessFromCatalog() throws Exception {
generateTitleButton.click();
await("Wait for title generation").pollDelay(3, TimeUnit.SECONDS).atMost(10, TimeUnit.SECONDS)
.ignoreExceptions().until(() -> isInputValueNotEmpty.test(processTitleInput));
String generatedTitle = processTitleInput.getAttribute(TestConstants.VALUE);
String generatedTitle = processTitleInput.getDomProperty(TestConstants.VALUE);
save();
return generatedTitle;
}
Expand All @@ -318,7 +318,7 @@ public String createProcessFromCatalog() throws Exception {
* @return process title input field value
*/
public String getProcessTitle() {
return processTitleInput.getAttribute(TestConstants.VALUE);
return processTitleInput.getDomProperty(TestConstants.VALUE);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public TemplateEditPage insertTemplateData(Template template) {
titleInput.sendKeys(template.getTitle());
Browser.getDriver().findElements(By.className("ui-chkbox")).get(0).click();
clickElement(workflowSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(workflowSelect.getAttribute("id") + "_0")));
clickElement(Browser.getDriver().findElement(By.id(workflowSelect.getDomProperty("id") + "_0")));

clickElement(rulesetSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(rulesetSelect.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(rulesetSelect.getDomProperty("id") + "_1")));

clickElement(docketSelect.findElement(By.cssSelector(CSS_SELECTOR_DROPDOWN_TRIGGER)));
clickElement(Browser.getDriver().findElement(By.id(docketSelect.getAttribute("id") + "_1")));
clickElement(Browser.getDriver().findElement(By.id(docketSelect.getDomProperty("id") + "_1")));
return this;
}

Expand Down

0 comments on commit 5cfd047

Please sign in to comment.