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
  • 7052d8b908ed8b43f43ae136bd375fe82241d1fb
  • feat/1061_vtp
  • fix/1058_maxwindowsize
  • fix/1065_vehicle_co2_group
  • release/5_0_3
  • prepare/release_5_0_1
  • fix/1067_fchv_conditioning
  • fix/b100_density
  • fix/ngtank_reader_fchv
  • fix/1058_op_point_v5
  • fix/1047_g10_range
  • fix/fchv_adapter_develop
  • feat/1044_add_fuel_b100_single_july
  • feat/1044_add_fuel_b100_single
  • fix/h2_storage_tech
  • amdm3/develop
  • fix/aux_fchv
  • feat/1044_add_fuel_b100
  • fix/fchv_run
  • prepare/5_0_0_rc
  • fix/not_calculate_weights_fchv
  • 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
  • Release/v4.1.0.3392-RC
  • Release/v4.0.3.3330
  • Release/v4.0.2.3275
  • Release/v4.0.2.3273
  • Release/v0.11.1.3228-DEV
  • Project_VECTO_FD_II/FMI/HybridController
  • Project_VECTO_FD_II/FMI/AMTShiftStrategy
  • Release/v4.0.1.3217
  • Release/v4.0.0.3211
  • Release/v0.11.0.3193-DEV
  • Release/v4.0.0.3161-RC
  • Release/v4.0.0.3106-RC
  • Release/v3.3.15.3102
  • Release/v4.0.0.3078-RC
  • Release/v3.3.15.3073-RC
41 results

VectoCoreTest.csproj

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();
        }
    
    
    }