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 TCAdmin37_VerifyUserAPIKeysCreationDeletionTest() { string username; accountIdText = TestData.GetData("TCAdmin19_AccountIdTextValue"); entereAccountId = TestData.GetData("TCAdmin19_EnterAccountId"); 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 -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Select an user from the user list and click on it username = objAdminCommonFunctions.getUserNameFromUserList(); objAdminCommonFunctions.SelectUserFromUserList(driver, username); //Verify if entered value in accountId textfield loads the values in userTable dynamically and load the page Assert.True(objAdminUsersPage.VerifyAPIKeys()); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyCreationDeletionUserKeyFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyCreationDeletionUserKeyFailed), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }
public void TCAdmin16_VerifyFilterByUserId() { enterUserId = TestData.GetData("TCAdmin16_EnterUserId"); userIdText = TestData.GetData("TCAdmin16_UserIdTextValue"); EmailText = TestData.GetData("TCAdmin16_EmailTextValue"); AccountIdText = TestData.GetData("TCAdmin16_AccountIdTextValue"); 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 -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Click on "ViewAll" button objAdminUsersPage.ClickOnViewAllButton(); //Verify if entered value in userId textfield loads the values in userTable dynamically and load the page Assert.True(objAdminUsersPage.VerifyUserIdResultsLoad(enterUserId, userIdText)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyFilteredByFailed, userIdText), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyFilteredByFailed, userIdText), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }
public void TCAdmin12_VerifyAllTradesTakenPlaceUnderTradesTabTest() { accountId = TestData.GetData("TCAdmin12_AccountIdValue"); userId = TestData.GetData("TCAdmin12_UserIdValue"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); AdminTradePage objAdminTradePage = new AdminTradePage(TestProgressLogger); try { //Login as admin -> Click on "Trades" menu button objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.SelectTradeMenu(); // This method with will verify the AccountId textfield //Assert.True(objAdminTradePage.VerifySearchByAccountId(accountId)); // This method with will verify the UserId textfield Assert.True(objAdminTradePage.VerifySearchByUserId(userId)); } 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 RegisterUserInChrome() { AdminLoginPage adminLoginPage = new AdminLoginPage(driver, wait); AdminMyStorePage adminMyStorePage = new AdminMyStorePage(driver, wait); AdminUsersPage adminUsersPage = new AdminUsersPage(); AdminCreateNewUserPage adminCreateNewUserPage = new AdminCreateNewUserPage(); ////general = new GeneralPage(); User user = new User(); //general.GoToPage(driver, "http://localhost/litecart/admin", wait, "My Store"); adminLoginPage.Open(); adminLoginPage.Login("admin", "admin"); adminMyStorePage.GoToSection("Users"); adminUsersPage.ClickCreateNewUser(driver, wait); adminCreateNewUserPage.CreateUser(driver, wait, user, "user" + DateTime.Now.ToString("hhmmss"), "12345"); adminMyStorePage.Logout(); adminLoginPage.Login(user.username, user.password); adminMyStorePage.Logout(); }
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(); } }
public void OneTimeSetUp() { _adminUsersPage = new AdminUsersPage(Driver); _adminUsersPage.LoginAsAdmin(); }
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(); } }
public void TCAdmin11_VerifyTradesUnderTradesTabTest() { instrument = TestData.GetData("Instrument"); marketOrder = TestData.GetData("MarketOrder"); menuTab = TestData.GetData("MenuTab"); sellTab = TestData.GetData("SellTab"); buyTab = TestData.GetData("BuyTab"); buyOrderSize = TestData.GetData("TC9_BuyOrderSize"); sellOrderSize = TestData.GetData("TC9_SellOrderSize"); limitPrice = TestData.GetData("TC9_LimitPrice"); timeInForce = TestData.GetData("TC9_TimeInForce"); tradeIdValueTextValue = TestData.GetData("TCAdmin11_TradeIdValueTextValue"); productPairValueTextValue = TestData.GetData("TCAdmin11_ProductPairValueTextValue"); sideValueTextValue = TestData.GetData("TCAdmin11_SideValueTextValue"); qantityValueTextValue = TestData.GetData("TCAdmin11_QantityValueTextValue"); executionIdValueTextValue = TestData.GetData("TCAdmin11_ExecutionIdValueTextValue"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); AdminTradePage objAdminTradePage = new AdminTradePage(TestProgressLogger); try { TestProgressLogger.StartTest(); // Create Buy and Sell Order to set the last price //TestProgressLogger.LogCheckPoint(String.Format(LogMessage.PlaceOrderToSetMarketBegin, limitPrice)); //userCommonFunction.PlaceOrdersToSetLastPrice(driver, instrument, buyTab, sellTab, buyOrderSize, limitPrice, timeInForce, Const.USER10, Const.USER11); //TestProgressLogger.LogCheckPoint(String.Format(LogMessage.PlaceOrderToSetMarketEnd, limitPrice)); //Login as admin -> Click on "Trades" menu button objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.SelectTradeMenu(); //Select an instrument under trade tab Assert.True(objAdminTradePage.VerifyTradeOrderUnderTradesTab()); } 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 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(); } }
public void TCAdmin2_VerifyUsersAccountAssignedOrUnassignedTest() { userPassword = TestData.GetData("TCAdmin2_UserPassword"); invalidAccountID = TestData.GetData("TCAdmin2_InvalidAccountID"); userName = TestData.GetData("TCAdmin1_UserName"); newUserPassword = TestData.GetData("TCAdmin1_UserPassword"); userConfirmPassword = TestData.GetData("TCAdmin1_UserConfirmPassword"); verificationLevel = TestData.GetData("TCAdmin1_VerificationLevel"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserFunctions userfuntionality = new UserFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); try { TestProgressLogger.StartTest(); ////Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //pre-requites of creating new user to perform assign and unassign test case TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NewUserCreationInitiated)); objAdminUsersPage.CreateNewUser(userName, newUserPassword, userConfirmPassword, verificationLevel); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NewUserCreationCompleted, userName)); //Click on "Users" Tab button objAdminCommonFunctions.UsersTabBtn(); //Verify the login after unassign account ID to user Assert.True(objAdminUsersPage.VerifyLoginUsingUnassignedAccount(userPassword)); Thread.Sleep(2000); //Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Verify the login after assign account ID to user Assert.True(objAdminUsersPage.VerifyLoginUsingAssignedAccount(userPassword)); Thread.Sleep(2000); //Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Verify the login after assign invalid account ID to user Assert.True(objAdminUsersPage.VerifyNonexistentAccount(invalidAccountID)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAssignedOrUnassignedAccountFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAssignedOrUnassignedAccountFailed), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }