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
  • aa9ad7edf1ce3d5cc6a8e87502ab7546a5e434df
  • stable default
  • feat-fchv-bus
  • fix-h2-ice-bus
  • powertrains-multiple-axles
  • amdm3/develop
  • issue-1039
  • amdm3/main
  • test/nuget_publish
  • IEPC-experiments
  • amdm2/main
  • amdm2/develop
  • aptngearbox-not-auto
  • playground
  • official/main
  • official/develop
  • issue-templates
  • pdf-reports
  • HEV-timeruns-dev
  • timerun-empower-hybrids
  • timerun-pwheel-hybrids
  • Release/v5.0.3
  • Release/v5.0.1
  • Release/5.0.0-RC
  • Nuget/v0.11.4-DEV
  • Release/v0.11.4-DEV
  • Release/4.3.4-DEV
  • Release/4.3.3
  • Release/4.3.2-RC
  • Release/v4.3.0-DEV
  • Release/4.2.7
  • XMLConverterTool/4.2.6.0
  • Release/4.2.6-RC
  • Release/v4.2.5
  • Release/v4.2.3
  • Release/v4.2.2.3539-RC
  • Release/v4.2.1.3469
  • Release/v0.11.2.3456-DEV
  • Release/v4.2.0.3448-RC
  • Release/v4.1.3.3415
  • Release/v4.1.1.3413
41 results

MainForm.vb

Blame
  • Forked from VECTO / VECTO Sim
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    UsersPage.java 2.46 KiB
    package pages.systemSettings;
    
    import ddsl.CommonPageWithTabsAndGrid;
    import ddsl.dcomponents.commonComponents.UserDataCommonComponent;
    import ddsl.dobjects.DButton;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.support.FindBy;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import rest.models.UserModel;
    
    public class UsersPage extends CommonPageWithTabsAndGrid {
        /**
         * Page object for the Users page. This contains the locators of the page and the methods for the behaviour of the page
         */
        private final static Logger LOG = LoggerFactory.getLogger(UsersPage.class);
    
        public UserDataCommonComponent userData;
        @FindBy(id = "username_id")
        private WebElement usernameInput;
        @FindBy(id = "role_id")
        private WebElement applicationRoleDdl;
        @FindBy(id = "active_id")
        private WebElement isActive;
    
    
        public UsersPage(WebDriver driver) {
            super(driver);
            userData = new UserDataCommonComponent(driver);
            LOG.debug("Loading Users page.");
        }
    
        public DButton getCreateUserBtn() {
            return new DButton(driver, addBtn);
        }
    
        public String fillNewUserDataAndSave(UserModel newUserData) {
            LOG.debug("Filling user data...");
            try {
                weToDInput(usernameInput).fill(newUserData.getUsername());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            weToDSelect(applicationRoleDdl).selectValue(newUserData.getRole());
    
            String alertMessage = userData.fillUserProfileData(newUserData.getEmailAddress(), newUserData.getFullName(), newUserData.getSmpTheme(), newUserData.getSmpLocale());
            LOG.debug("User {} was created", newUserData.getUsername());
            return alertMessage;
        }
    
        public String getApplicationRoleValue() {
            return weToDSelect(applicationRoleDdl).getCurrentValue();
        }
    
        public String getFullNameValue() {
            return userData.getFullName();
        }
    
        public Boolean isSelectedUserActive() {
            try {
                return weToDInput(isActive).getAttribute("class").contains("checked");
    
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    
        public String getEmailValue() {
            return userData.getEmailAddress();
        }
    
        public String getSelectedThemeValue() {
            return userData.getSelectedTheme();
        }
    
        public String getSelectedLocaleValue() {
            return userData.getSelectedLocale();
        }
    
    
    }