Exemple #1
0
        /// <summary>
        /// Log in as a given user.
        /// </summary>
        /// <param name="userType">The user type to login as.</param>
        /// <param name="enabledFeatures">The FeatureBee features to enable.</param>
        public static void Login(iSIMSUserType userType, params string[] enabledFeatures)
        {
            if (TestSettings.Configuration.ForceTestUserLogin)
            {
                userType = iSIMSUserType.TestUser;
            }

            switch (userType)
            {
            case iSIMSUserType.TestUser:
                Login(
                    TestDefaults.Default.TestUser,
                    TestDefaults.Default.TestUserPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    true,
                    enabledFeatures);
                break;

            case iSIMSUserType.SchoolAdministrator:
                Login(
                    TestDefaults.Default.SchoolAdministratorUser,
                    TestDefaults.Default.SchoolAdministratorPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.SENCoordinator:
                Login(
                    TestDefaults.Default.SENCoordinator,
                    TestDefaults.Default.SENCoordinatorPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.AdmissionsOfficer:
                Login(
                    TestDefaults.Default.AdmissionsOfficer,
                    TestDefaults.Default.AdmissionsOfficerPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.HeadTeacher:
                Login(
                    TestDefaults.Default.HeadTeacher,
                    TestDefaults.Default.HeadTeacherPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.SystemManger:
                Login(
                    TestDefaults.Default.SystemManger,
                    TestDefaults.Default.SystemMangerPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.AssessmentCoordinator:
                Login(
                    TestDefaults.Default.AssessmentCoordinator,
                    TestDefaults.Default.AssessmentCoordinatorPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.CurricularManager:
                Login(
                    TestDefaults.Default.CurricularManager,
                    TestDefaults.Default.CurricularManagerPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.SeniorManagementTeam:
                Login(
                    TestDefaults.Default.SeniorManagementTeam,
                    TestDefaults.Default.SeniorManagementTeamPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.ClassTeacher:
                Login(
                    TestDefaults.Default.ClassTeacher,
                    TestDefaults.Default.ClassTeacherPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.ReturnsManager:
                Login(
                    TestDefaults.Default.ReturnsManager,
                    TestDefaults.Default.ReturnsManagerPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            case iSIMSUserType.PersonnelOfficer:
                Login(
                    TestDefaults.Default.PersonnelOfficer,
                    TestDefaults.Default.PersonnelOfficerPassword,
                    TestDefaults.Default.TenantId,
                    TestDefaults.Default.SchoolName,
                    Configuration.GetSutUrl(),
                    false,
                    enabledFeatures);
                break;

            default:
                throw new ArgumentOutOfRangeException("userType");
            }
        }
Exemple #2
0
 //Method to sign in through specific user and enable featureBee
 public static void LoginWithFeatureBee(string[] featureList, iSIMSUserType userType = iSIMSUserType.TestUser)
 {
     Login(userType, featureList);
 }