예제 #1
0
        public void TCAdmin6_VerifyRevokeUserPermissionTest()
        {
            revokeUserPermission = TestData.GetData("TCAdmin6_RevokeUserPermission");
            string username;

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

            try
            {
                TestProgressLogger.StartTest();
                //Login as admin -> Click on "Users" menu button
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UsersTabBtn();

                ////This will get the user name from the user list under Users Tab and click on any user under Users Tab
                username = objAdminCommonFunctions.getUserNameFromUserList();
                objAdminCommonFunctions.SelectUserFromUserList(driver, username);

                //Click on "Revok" button under user permission window section and observed the message
                objAdminUsersPage.ClickOnRevokePermissionButton();

                //Click on "Add Permission" button -> verify all if selected reovked user permissions present in the list of user permission
                objAdminCommonFunctions.UserPermissionButton();
                objAdminCommonFunctions.RevokedUserPermissions(revokeUserPermission);

                //Close the permission window section
                objAdminCommonFunctions.ClosePermissionWindow();
            }

            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyRevokeUserPermissionFailed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyRevokeUserPermissionFailed), e);
                throw e;
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                TestProgressLogger.EndTest();
            }
        }
        public void TC45_VerifyAffiliateProgram()
        {
            string               userByID                = TestData.GetData("TC45_UserByID");
            string               affiliateTagID          = TestData.GetData("TC45_AffiliateTagID");
            string               verificationLevel       = TestData.GetData("TC45_VerificationLevel");
            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            UserFunctions        userFunctions           = new UserFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            UserSettingPage      userSettingsPage        = new UserSettingPage(driver, TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();
                // Login as admin
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                // Select user by entering UserID
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UserByIDText(userByID);
                objAdminCommonFunctions.OpenUserButton();
                // Create Affiliate tag for the user
                objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID);
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();

                // Login as the user mentioned above and verify Affiliate program functionality
                userFunctions.LogIn(TestProgressLogger, Const.USER12);
                Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel), LogMessage.AffiliateProgramFailureMsg);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg));
            }
            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e);
                throw e;
            }
            finally
            {
                TestProgressLogger.EndTest();
            }
        }
        public void TCAdmin5_VerifyUserPermissionConfigureTest()
        {
            submitBlockTradePermission = TestData.GetData("TCAdmin5_SubmitBlockTradePermission");

            string               username;
            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();

                //Login as admin -> Click on "Users" menu button
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UsersTabBtn();
                username = objAdminCommonFunctions.getUserNameFromUserList();
                objAdminCommonFunctions.SelectUserFromUserList(driver, username);
                objAdminCommonFunctions.UserPermissionButton();
                objAdminCommonFunctions.AddSubmitBlockTradePermissions(submitBlockTradePermission);
            }

            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserPassed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e);
                throw e;
            }
            finally
            {
                TestProgressLogger.EndTest();
            }
        }
        public void TC45_VerifyAffiliateProgram()
        {
            string userByID          = TestData.GetData("TC45_UserByID");
            string affiliateTagID    = TestData.GetData("TC45_AffiliateTagID");
            string verificationLevel = TestData.GetData("TC45_VerificationLevel");

            TestProgressLogger.StartTest();
            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            UserFunctions        userFunctions           = new UserFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            UserSettingPage      userSettingsPage        = new UserSettingPage(driver, TestProgressLogger);

            try
            {
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UserByIDText(userByID);
                objAdminCommonFunctions.OpenUserButton();
                objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID);
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                userFunctions.LogIn(TestProgressLogger, Const.USER12);
                Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel));
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg));
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e);
                throw e;
            }
            finally
            {
                TestProgressLogger.EndTest();
                UserFunctions userFunctionality = new UserFunctions(TestProgressLogger);
                userFunctionality.LogOut();
            }
        }
예제 #5
0
        public void DownloadFileTest()
        {
            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            AdminUsersPage       objAdminUsersPage       = new AdminUsersPage(TestProgressLogger);
            UserFunctions        userFunctions           = new UserFunctions(TestProgressLogger);
            GenericUtils         genericUtils            = new GenericUtils(TestProgressLogger);

            try
            {
                List <KeyValuePair <string, string> > superUsersData;
                string superUsersList = "";
                string date;
                TestProgressLogger.StartTest();

                //Login as admin -> Click on "Users" menu button
                genericUtils.DeleteAllFiles();
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UsersTabBtn();
                objAdminCommonFunctions.ClickOnExportButton();
                Thread.Sleep(2000);
                objAdminCommonFunctions.ExportSuperUsers();
                Thread.Sleep(3000);
                date = GenericUtils.GetCurrentTimeWithHyphen();
                var path = Directory.GetCurrentDirectory() + "\\DataTest\\Superusers (" + date + ").csv";
                superUsersData = genericUtils.ReadDataFromCSV(@path);
                for (int i = 0; i < superUsersData.Count; i++)
                {
                    if (superUsersData[i].Key == "UserId")
                    {
                        if (superUsersData[i].Value == "123")
                        {
                            for (int j = i; j < i + 12; j++)
                            {
                                superUsersList = superUsersList + " || " + superUsersData[j].Key + ":" + superUsersData[j].Value;
                            }
                            TestProgressLogger.LogCheckPoint(superUsersList);
                            break;
                        }
                    }
                }
                TestProgressLogger.LogCheckPoint("Passed");
            }

            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserPassed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e);
                throw e;
            }
            finally
            {
                TestProgressLogger.EndTest();
            }
        }
예제 #6
0
        // This method verifies affiliates program
        public bool VerifyAffiliateProgramFunctionality(IWebDriver driver, string verificationLevel)
        {
            var    flag = false;
            int    initialAffiliates;
            string registeredUser;
            string affiliateTagURL;
            int    affiliatesAfterUserRegistration;

            UserFunctions        userFunctions           = new UserFunctions(logger);
            AdminFunctions       objAdminFunctions       = new AdminFunctions(logger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                //  This method selects the Affiliate Program link from User Settings page
                SelectAffiliateProgram();
                // Get existing number of affilites for the logged in user
                initialAffiliates = GetnumberOfAffiliates(driver);
                logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramInitialAffiliates, initialAffiliates));
                // Copy the affiliate tag URL and navigate to the URL
                UserSetFunctions.Click(CopyAffiliateTagButton());
                affiliateTagURL = AffiliateTagDesc().Text;
                logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramURLCopied, affiliateTagURL));
                userFunctions.LogOut();
                driver.Navigate().GoToUrl(affiliateTagURL);
                // Change the server URL
                userFunctions.LogIn(logger, changeServerOnly: true);

                // Register a new user
                registeredUser = userFunctions.RegisterNewUser(driver);

                // Login as Admin and complete KYC of the registered user
                try
                {
                    objAdminFunctions.AdminLogIn(logger);
                    logger.LogCheckPoint(String.Format(LogMessage.KYCStarted, registeredUser));
                    objAdminCommonFunctions.ClickOnUsersMenuLink();
                    objAdminCommonFunctions.SelectUserFromUserList(driver, registeredUser);
                    // Edit the User Email Verified status to checked
                    objAdminCommonFunctions.EditUserEmailStatus(registeredUser);
                    // Scroll don to User Accounts section and open the user account
                    UserCommonFunctions.ScrollingDownVertical(driver);
                    objAdminCommonFunctions.OpenAccountFromUserPage();
                    // Edit the Verification Level of the user to 3
                    objAdminCommonFunctions.EditUserVerificationLevel(verificationLevel);
                    logger.LogCheckPoint(String.Format(LogMessage.KYCSuccess, registeredUser));
                    objAdminCommonFunctions.UserMenuBtn();
                    objAdminFunctions.AdminLogOut();
                }
                catch (Exception)
                {
                    logger.TakeScreenshot();
                    logger.LogCheckPoint(String.Format(LogMessage.KYCFailure, registeredUser));
                    throw;
                }

                // Login as the user and verify the number of affiliates
                userFunctions.LogIn(logger, Const.USER12);
                SelectAffiliateProgram();
                affiliatesAfterUserRegistration = GetnumberOfAffiliates(driver);
                // The number of affiliates should increase by 1 -> Return true
                if ((affiliatesAfterUserRegistration - initialAffiliates) == 1)
                {
                    flag = true;
                    logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramFinalAffiliates, affiliatesAfterUserRegistration));
                }
            }
            catch (NoSuchElementException)
            {
                logger.TakeScreenshot();
                throw;
            }
            catch (Exception)
            {
                logger.TakeScreenshot();
                throw;
            }
            return(flag);
        }
예제 #7
0
        public void TCAdmin1_VerifyAddNewUserTest()
        {
            string userLoginName;

            userName            = TestData.GetData("TCAdmin1_UserName");
            userPassword        = TestData.GetData("TCAdmin1_UserPassword");
            userConfirmPassword = TestData.GetData("TCAdmin1_UserConfirmPassword");
            depositPermission   = TestData.GetData("TCAdmin1_DepositPermission");
            tradingPermission   = TestData.GetData("TCAdmin1_DepositTrading");
            withdrawPermission  = TestData.GetData("TCAdmin1_UserWithdraw");
            verificationLevel   = TestData.GetData("TCAdmin1_VerificationLevel");

            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            AdminUsersPage       objAdminUsersPage       = new AdminUsersPage(TestProgressLogger);
            UserFunctions        userFunctions           = new UserFunctions(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();

                //Login as admin -> Click on "Users" menu button
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UsersTabBtn();

                //Verify whether new user created
                Assert.True(objAdminUsersPage.CreateNewUser(userName, userPassword, userConfirmPassword, verificationLevel));

                //Verify that the new user created is having deposit, trading and withdraw permissions
                Assert.True(objAdminUsersPage.VerifyUserCreatedWithPermission(depositPermission, tradingPermission, withdrawPermission));

                objAdminCommonFunctions.UserMenuBtn();
                userLoginName = objAdminCommonFunctions.UserNameTextValue();

                // Admin LogOut
                objAdminFunctions.AdminLogOut();

                //Login using the credentials of the User created above
                // This will change only the server URL
                userFunctions.LogIn(TestProgressLogger, changeServerOnly: true);
                Assert.True(userFunctions.LogInUsingCredsFromUI(TestProgressLogger, userLoginName, userPassword));
            }

            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e);
                throw e;
            }
            finally
            {
                userFunctions.LogOut();
                TestProgressLogger.EndTest();
            }
        }
예제 #8
0
        public void TCAdmin5_VerifyConfigureUserPermissionTest()
        {
            addUserPermission = TestData.GetData("TCAdmin5_AddUserPermission");
            string               userName;
            string               userAccountID;
            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();

                //Login as admin -> Click on "Users" menu button
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.ClickOnUsersMenuLink();
                objAdminCommonFunctions.UsersTabBtn();

                //This will get the user name and user account ID from the user list under Users Tab
                userName      = objAdminCommonFunctions.getUserNameFromUserList();
                userAccountID = objAdminCommonFunctions.getUserAccountIDFromUserList();

                objAdminCommonFunctions.SelectUserFromUserList(driver, userName);

                //Click on "Add Permission" button -> verify all permissions with checkbox
                objAdminCommonFunctions.UserPermissionButton();
                try
                {
                    Assert.True(objAdminCommonFunctions.VerifyUserPermissionsList());
                    TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyUserPermissionsListPassed));
                }
                catch (Exception)
                {
                    TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyUserPermissionsListFailed));
                    throw;
                }
                //This will configure a permission and verify the success message
                objAdminCommonFunctions.AddUserPermissions(addUserPermission);

                //Close the permission window section
                objAdminCommonFunctions.ClosePermissionWindow();
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyConfigureUserPermissionPassed));
            }

            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyConfigureUserPermissionFailed), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyConfigureUserPermissionFailed), e);
                throw e;
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                TestProgressLogger.EndTest();
            }
        }
예제 #9
0
        // This method verifies affiliates program
        public bool VerifyAffiliateProgramFunctionality(IWebDriver driver, string verificationLevel)
        {
            var    flag = false;
            int    initialAffiliates;
            string registeredUser;
            string affiliateTagURL;

            UserFunctions        userFunctions           = new UserFunctions(logger);
            AdminFunctions       objAdminFunctions       = new AdminFunctions(logger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                SelectAffiliateProgram();
                initialAffiliates = GetnumberOfAffiliates(driver);
                logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramInitialAffiliates, initialAffiliates));
                UserSetFunctions.Click(CopyAffiliateTagButton());
                affiliateTagURL = AffiliateTagDesc().Text;
                logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramURLCopied, affiliateTagURL));
                userFunctions.LogOut();
                driver.Navigate().GoToUrl(affiliateTagURL);
                userFunctions.LogIn(logger, changeServerOnly: true);

                // Register a new user
                registeredUser = userFunctions.RegisterNewUser(driver);

                // Login as Admin and complete KYC of the registered user
                try
                {
                    objAdminFunctions.AdminLogIn(logger);
                    logger.LogCheckPoint(String.Format(LogMessage.KYCStarted, registeredUser));
                    objAdminCommonFunctions.ClickOnUsersMenuLink();
                    objAdminCommonFunctions.SelectUserFromUserList(driver, registeredUser);
                    objAdminCommonFunctions.EditUserEmailStatus(registeredUser);
                    UserCommonFunctions.ScrollingDownVertical(driver);
                    objAdminCommonFunctions.OpenAccountFromUserPage();
                    objAdminCommonFunctions.EditUserVerificationLevel(verificationLevel);
                    logger.LogCheckPoint(String.Format(LogMessage.KYCSuccess, registeredUser));
                    objAdminCommonFunctions.UserMenuBtn();
                    objAdminFunctions.AdminLogOut();
                }
                catch (Exception e)
                {
                    logger.TakeScreenshot();
                    logger.LogCheckPoint(String.Format(LogMessage.KYCFailure, registeredUser));
                    throw e;
                }

                // Login as the user and verify the number of affiliates
                userFunctions.LogIn(logger, Const.USER12);
                SelectAffiliateProgram();
                int affiliatesAfterUserRegistration = GetnumberOfAffiliates(driver);
                if ((affiliatesAfterUserRegistration - initialAffiliates) == 1)
                {
                    flag = true;
                    logger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramFinalAffiliates, affiliatesAfterUserRegistration));
                }
            }
            catch (NoSuchElementException ex)
            {
                logger.TakeScreenshot();
                throw ex;
            }
            catch (Exception e)
            {
                logger.TakeScreenshot();
                throw e;
            }
            return(flag);
        }