Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Select Git revision
  • 3c03905bb23eaf9d1738a2d404276b4f75881e30
  • development default
  • bugfix/EDELIVERY-14172-domismp-accepts-requests-with-wrong-domain-header-value
  • EDELIVERY-15372-upgrade-libraries-and-plugins-and-update-httpclient-to-httpclient5
  • EDELIVERY-15377-migrate-to-angular-20
  • feature/EDELIVERY-15382-rest-api-jwt-authentication-for-dynamic-discovery-client
  • bugfix/EDELIVERY-14196-select-domain-select-resource-dropdown-should-be-order-alphabetically
  • feature/EDELIVERY-12753-sml-integration-migration-to-different-smp
  • feature/EDELIVERY-13757-extend-session-dialog-should-have-an-active-counter
  • EDELIVERY-15144-sql-update
  • bugfix/EDELIVERY-14326-ui-edit-resource-filters
  • feature/EDELIVERY-15144-domismp-system-notification-generalize-time-expiration-alerts
  • bugfix/EDELIVERY-15102-alert-is-not-appearing-when-adding-duplicated-certificate
  • bugfix/EDELIVERY-15203-small-left-grid-shows-no-data-found-for-1-2-seconds-before-loading-the-data
  • EDELIVERY-15219-search-filter-with-understore-char-does-not-work
  • bugfix/EDELIVERY-15226-certificates-error-when-trying-to-delete-certificates
  • bugfix/EDELIVERY-15224-error-when-trying-to-update-info-from-profile-page
  • bugfix/EDELIVERY-15225-emails-are-not-sent-in-domismp
  • release/5.1.x
  • feature/EDELIVERY-12746-external-secret-sharing-services-as-vaults
  • EDELIVERY-15229-upgrade-libraries-and-plugins
  • 5.1.1
  • 5.1
  • 5.1-TEST
  • 5.1-RC1
  • 5.0.1
  • 5.0
  • 5.0-RC1
  • 4.2
  • 4.2-RC1
  • 4.1.2
  • 4.1.1
  • 4.1.0
  • 4.1.0-RC1
  • 4.0.0
  • 4.0.0-RC1
  • 3.0.2
  • 3.0.1
  • 3.0.0
39 results

ProfilePage.java

  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ProfilePage.java 2.32 KiB
    package pages;
    
    import ddsl.dcomponents.DomiSMPPage;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.support.FindBy;
    import org.openqa.selenium.support.PageFactory;
    import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
    
    public class ProfilePage extends DomiSMPPage {
    
        @FindBy(id = "smpTheme_id")
        private WebElement themeSel;
        @FindBy(id = "moment-locale")
        private WebElement localeSel;
        @FindBy(id = "saveButton")
        private WebElement saveBtn;
        @FindBy(id = "emailAddress_id")
        private WebElement emailAddressInput;
        @FindBy(id = "fullName_id")
        private WebElement fullNameInput;
    
        public ProfilePage(WebDriver driver) {
            super(driver);
            log.debug(".... init");
            PageFactory.initElements(new AjaxElementLocatorFactory(driver, data.getTIMEOUT()), this);
        }
    
        public void changeUserProfileData(String emailValue, String fullNameValue, String selectThemeValue, String localeValue) throws Exception {
            try {
                if (!emailValue.isEmpty()) {
                    weToDInput(emailAddressInput).fill(emailValue);
                }
                if (!emailValue.isEmpty()) {
                    weToDInput(fullNameInput).fill(fullNameValue);
                }
                if (!(selectThemeValue == null)) {
                    weToDSelect(themeSel).selectValue(selectThemeValue.toString());
                }
                if (!localeValue.isEmpty()) {
                    weToDSelect(localeSel).selectValue(localeValue);
                }
    
            } catch (Exception e) {
                log.error("Cannot change User Profile Data ", e);
            }
    
            if (saveBtn.isEnabled()) {
                saveBtn.click();
            } else {
                log.debug("Save button enable is " + saveBtn.isEnabled());
            }
    
            try {
                getAlertArea().getAlertMessage();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
    
        }
    
    
        public String getSelectedTheme() {
            return weToDSelect(themeSel).getCurrentValue();
        }
    
        public String getSelectedLocale() {
            return weToDSelect(localeSel).getCurrentValue();
        }
    
        public String getEmailAddress() {
            return weToDInput(emailAddressInput).getText();
        }
    
        public String getFullName() {
            return weToDInput(fullNameInput).getText();
        }
    
    
    }