Beispiel #1
0
        public void TCAdmin28_VerifyExportedByPermissionsDataTest()
        {
            selectByPermissionOption = TestData.GetData("TCAdmin28_SelectByPermissionOption");
            selectUserPermission     = TestData.GetData("TCAdmin28_SelectUserPermission");
            byPermissionUserIdValue  = TestData.GetData("TCAdmin28_UserId");

            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            AdminUsersPage       objAdminUsersPage       = new AdminUsersPage(TestProgressLogger);
            GenericUtils         genericUtils            = new GenericUtils(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();

                // This method is used to Delete all files from the Folder
                genericUtils.DeleteAllFiles();
                // Login as admin -> Click on "Users" menu button -> Users Tab
                objAdminUsersPage.SelectAdminUserTab();
                // Verify the "All users" exported csv file in the Admin UI
                Assert.True(objAdminUsersPage.VerifyExportByPermission(selectByPermissionOption, byPermissionUserIdValue, selectUserPermission));
            }
            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyByPermissionExportedCSVFileFailed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyByPermissionExportedCSVFileFailed), e);
                throw e;
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                TestProgressLogger.EndTest();
            }
        }