예제 #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 TC33_VerifyBuyBlockTradeWithLockedInTest()
        {
            instrument                    = TestData.GetData("Instrument");
            orderType                     = TestData.GetData("OrderType");
            menuTab                       = TestData.GetData("MenuTab");
            buyTab                        = TestData.GetData("BuyTab");
            sellTab                       = TestData.GetData("SellTab");
            orderSize                     = TestData.GetData("OrderSize");
            limitPrice                    = TestData.GetData("LimitPrice");
            timeInForce                   = TestData.GetData("TimeInForce");
            counterParty                  = TestData.GetData("TC33_CounterPartyPrice");
            counterPartyPrice             = TestData.GetData("TC33_CounterPartyPrice");
            productBoughtPrice            = TestData.GetData("TC33_ProductBoughtPrice");
            productSoldPrice              = TestData.GetData("TC33_ProductSoldPrice");
            wrongCounterParty             = TestData.GetData("TC33_IncorrectCounterParty");
            blocktradeReportStatus        = TestData.GetData("TC33_TradeReportStatus");
            userWithBadge                 = TestData.GetData("TC33_UserWithBadge");
            userWithPermissions           = TestData.GetData("TC33_UserWithPermissions");
            submitBlockTradePermission    = TestData.GetData("TC33_SubmitBlockTradePermission");
            getOpenTradeReportsPermission = TestData.GetData("TC33_GetOpenTradeReportsPermission");
            userByID                      = TestData.GetData("TC33_UserByID");
            counterPartyAccountID         = TestData.GetData("TC33_CounterPartyAccountID");
            buyerAccountID                = TestData.GetData("TC33_BuyerAccountID");
            badgeIdNumber                 = TestData.GetData("TC33_BadgeNumber");
            state            = TestData.GetData("TC33_State");
            firstPermission  = TestData.GetData("TC33_GetOpenTradeReports");
            SecondPermission = TestData.GetData("TC33_SubmitBlockTrade");

            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            UserFunctions        userfuntionality        = new UserFunctions(TestProgressLogger);
            ReportBlockTradePage objReportBlockTradePage = new ReportBlockTradePage(TestProgressLogger);
            UserFunctions        objUserFunctions        = new UserFunctions(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objAdminCommonFunctions.UserByIDText(userByID);
                objAdminCommonFunctions.OpenUserButton();
                objAdminCommonFunctions.UserPermissionButton();
                objAdminCommonFunctions.AddSubmitBlockTradePermissions(submitBlockTradePermission);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.FirstPermissionGivenPassed, firstPermission));
                objAdminCommonFunctions.ClearTextBox();
                objAdminCommonFunctions.AddGetOpenTradeReportsPermissions(getOpenTradeReportsPermission);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.SecondPermissionGivenPassed, SecondPermission));
                objAdminCommonFunctions.ClosePermissionWindow();
                Thread.Sleep(2000);
                objAdminCommonFunctions.SelectAccountsMenu();
                objAdminCommonFunctions.OpenAccountByIDText(counterPartyAccountID);
                objAdminCommonFunctions.OpenAccountBtn();
                objAdminCommonFunctions.OpenAddNewBadgeButtonForUser();
                objAdminCommonFunctions.SubmitCreateAccountBadgeButton();
                Thread.Sleep(2000);
                objAdminCommonFunctions.UserBadgeIDValue(badgeIdNumber);
                objAdminCommonFunctions.CreateBadgeAccount();
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                userfuntionality.LogIn(TestProgressLogger, Const.USER6);
                Thread.Sleep(2000);
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.SelectAnExchange(driver);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                Thread.Sleep(3000);
                UserCommonFunctions.ScrollingDownVertical(driver);
                objReportBlockTradePage.ReportBlockTradeButton();
                objReportBlockTradePage.VerifyReportBlockTradeWindow();
                objReportBlockTradePage.VerifyDropdownInstrument();
                objReportBlockTradePage.VerifyCounterParty();
                objReportBlockTradePage.VerifyLockedInCheckbox();
                objReportBlockTradePage.VerifyProductBought();
                objReportBlockTradePage.VerifyProductSold();
                objReportBlockTradePage.VerifyFees();
                objReportBlockTradePage.VerifyBalances();
                objReportBlockTradePage.VerifyElementsAndSubmitBlockTradeReport(counterPartyPrice, wrongCounterParty, productBoughtPrice, productSoldPrice);
                var otherPartyBlockTradeData = objReportBlockTradePage.SubmitBuyTradeReport(instrument, buyTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus);
                objUserFunctions.LogOut();
                userfuntionality.LogIn(TestProgressLogger, Const.USER5);
                Thread.Sleep(2000);
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.SelectAnExchange(driver);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                Thread.Sleep(3000);
                UserCommonFunctions.ScrollingDownVertical(driver);
                objReportBlockTradePage.VerifyOtherPartyBlockTradeReportTab(instrument, sellTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus, otherPartyBlockTradeData);
                objUserFunctions.LogOut();
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objReportBlockTradePage.VerifyBlockTradeInAdmin(buyerAccountID, counterPartyAccountID, instrument, productBoughtPrice, productBoughtPrice);
                TestProgressLogger.EndTest();
            }
            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
            }
            catch (Exception ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.Error(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), ex);
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
            }
        }
예제 #3
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();
            }
        }
        public void TC33_VerifyBuyBlockTradeWithLockedInTest()
        {
            instrument                    = TestData.GetData("Instrument");
            orderType                     = TestData.GetData("OrderType");
            menuTab                       = TestData.GetData("MenuTab");
            buyTab                        = TestData.GetData("BuyTab");
            sellTab                       = TestData.GetData("SellTab");
            orderSize                     = TestData.GetData("OrderSize");
            limitPrice                    = TestData.GetData("LimitPrice");
            timeInForce                   = TestData.GetData("TimeInForce");
            counterParty                  = TestData.GetData("TC33_CounterPartyPrice");
            counterPartyPrice             = TestData.GetData("TC33_CounterPartyPrice");
            productBoughtPrice            = TestData.GetData("TC33_ProductBoughtPrice");
            productSoldPrice              = TestData.GetData("TC33_ProductSoldPrice");
            wrongCounterParty             = TestData.GetData("TC33_IncorrectCounterParty");
            blocktradeReportStatus        = TestData.GetData("TC33_TradeReportStatus");
            userWithBadge                 = TestData.GetData("TC33_UserWithBadge");
            userWithPermissions           = TestData.GetData("TC33_UserWithPermissions");
            submitBlockTradePermission    = TestData.GetData("TC33_SubmitBlockTradePermission");
            getOpenTradeReportsPermission = TestData.GetData("TC33_GetOpenTradeReportsPermission");
            userByID                      = TestData.GetData("TC33_UserByID");
            counterPartyAccountID         = TestData.GetData("TC33_CounterPartyAccountID");
            buyerAccountID                = TestData.GetData("TC33_BuyerAccountID");
            badgeIdNumber                 = TestData.GetData("TC33_BadgeNumber");
            state            = TestData.GetData("TC33_State");
            firstPermission  = TestData.GetData("TC33_GetOpenTradeReports");
            SecondPermission = TestData.GetData("TC33_SubmitBlockTrade");

            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            UserFunctions        userfuntionality        = new UserFunctions(TestProgressLogger);
            ReportBlockTradePage objReportBlockTradePage = new ReportBlockTradePage(TestProgressLogger);
            UserFunctions        objUserFunctions        = new UserFunctions(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();

                // The admin will create an badge to user say XYZ and provide the submitblock, getopentradereport permission to user say ABC
                // Login as Admin
                objAdminFunctions.AdminLogIn(TestProgressLogger);

                // Enter "userID"(ex. 185) in the "OpenUserbyID" textfield
                objAdminCommonFunctions.UserByIDText(userByID);

                // Click on "Open" button --> click on "Add permission" button --> provide SubmitBlockTrade and GetOpenTradeReports
                objAdminCommonFunctions.OpenUserButton();
                objAdminCommonFunctions.UserPermissionButton();
                objAdminCommonFunctions.AddSubmitBlockTradePermissions(submitBlockTradePermission);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.FirstPermissionGivenPassed, firstPermission));
                objAdminCommonFunctions.ClearTextBox();
                objAdminCommonFunctions.AddGetOpenTradeReportsPermissions(getOpenTradeReportsPermission);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.SecondPermissionGivenPassed, SecondPermission));
                objAdminCommonFunctions.ClosePermissionWindow();
                Thread.Sleep(2000);

                // Click on "Accounts" menu button --> Enter "accountID"(194) in the "OpenAccountbyID" textfield --> Click on "Open" button
                objAdminCommonFunctions.SelectAccountsMenu();
                objAdminCommonFunctions.OpenAccountByIDText(counterPartyAccountID);
                objAdminCommonFunctions.OpenAccountBtn();

                // Click on "Add New Badge" button --> provide badge number and click on create button
                objAdminCommonFunctions.OpenAddNewBadgeButtonForUser();
                objAdminCommonFunctions.SubmitCreateAccountBadgeButton();
                Thread.Sleep(2000);
                objAdminCommonFunctions.UserBadgeIDValue(badgeIdNumber);
                objAdminCommonFunctions.CreateBadgeAccount();

                //Logout from Admin
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();

                // Below will perform a submit block trade with using lockedIn(by user ABC) and verify the various functionalities
                userfuntionality.LogIn(TestProgressLogger, Const.USER6);
                Thread.Sleep(2000);

                // Click on "Dashboard" menu button --> select an exchange --> select an instrument BTCUSD
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.SelectAnExchange(driver);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                Thread.Sleep(3000);
                UserCommonFunctions.ScrollingDownVertical(driver);

                //Click on "Report Block Trade" Button
                objReportBlockTradePage.ReportBlockTradeButton();

                // Verify window for submitting block trade appears
                objReportBlockTradePage.VerifyReportBlockTradeWindow();

                // Verify drop down for "Instrument" is present
                objReportBlockTradePage.VerifyDropdownInstrument();

                // Verify "Counter Party" with locked in check box is present
                objReportBlockTradePage.VerifyCounterParty();
                objReportBlockTradePage.VerifyLockedInCheckbox();

                // Verify  "Product Bought" is present
                objReportBlockTradePage.VerifyProductBought();

                // Verify  "Product Sold" is present
                objReportBlockTradePage.VerifyProductSold();

                // Verify "Fee" is present
                objReportBlockTradePage.VerifyFees();

                // Verify balances for both products(product bought and product sold)
                objReportBlockTradePage.VerifyBalances();

                // Verify the details presen in Report block trade window and submit a Buy Block trade transaction
                objReportBlockTradePage.VerifyElementsAndSubmitBlockTradeReport(counterPartyPrice, wrongCounterParty, productBoughtPrice, productSoldPrice);

                //verify the details in Trade Report tab
                var otherPartyBlockTradeData = objReportBlockTradePage.SubmitBuyTradeReport(instrument, buyTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus);

                //Logout from user portal
                objUserFunctions.LogOut();

                // Login as "ABC" i.e. other party of block trade
                userfuntionality.LogIn(TestProgressLogger, Const.USER5);
                Thread.Sleep(2000);

                // Click on "Dashboard" menu button --> select an exchange --> select an instrument BTCUSD
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.SelectAnExchange(driver);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                Thread.Sleep(3000);
                UserCommonFunctions.ScrollingDownVertical(driver);

                // Verify the Block Trade Trade Report of Other Party
                objReportBlockTradePage.VerifyOtherPartyBlockTradeReportTab(instrument, sellTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus, otherPartyBlockTradeData);
                objUserFunctions.LogOut();

                // The admin will verify if submitted block trade report is present in block trade tab under trade menu section
                //  Login as Admin -> Trades -> Block Trades --> select BTCUSD instrument
                objAdminFunctions.AdminLogIn(TestProgressLogger);
                objReportBlockTradePage.VerifyBlockTradeInAdmin(buyerAccountID, counterPartyAccountID, instrument, productBoughtPrice, productBoughtPrice);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BlockTradeWithLockedInTestPassedMsg, buyTab));
                TestProgressLogger.EndTest();
            }
            catch (NoSuchElementException e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogError(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), e);
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                throw e;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogError(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), e);
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                throw e;
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
            }
        }