コード例 #1
0
        [Fact]      //Admin_3
        public void UpdateAccountInformation()
        {
            try
            {
                string accountId;
                string updatedAccountName;
                string actualUpdatedAccountName;
                string accountNameOnAccontDetails;

                accountId = TestData.GetData("TCAdmin4_UserAccountID");

                AdminFunctions       adminfunctions       = new AdminFunctions(TestProgressLogger);
                AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger);
                AdminAccountsPage    adminAccountPage     = new AdminAccountsPage(TestProgressLogger);
                AdminFunctions       adminFunctions       = new AdminFunctions(TestProgressLogger);
                UserFunctions        userFunctions        = new UserFunctions(TestProgressLogger);

                // login in admin
                adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1);

                // Navigate on Accounts page.
                admincommonfunctions.SelectAccountsMenu();
                admincommonfunctions.SelectAccountsTab();
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage));

                // Double click on particular user and edit account name.
                adminAccountPage.ClickOnViewAll(driver);
                adminAccountPage.SearchByAccountID(driver, accountId);
                adminAccountPage.DoubleClickOnAccountName(driver, accountId);
                adminAccountPage.EditAccountInformation(driver);
                updatedAccountName = adminAccountPage.EditAccountName(driver);
                adminAccountPage.ClickOnSaveButton(driver);

                // Verify updated account name on account details.
                accountNameOnAccontDetails = adminAccountPage.GetAccountNameOnAccountDetails(driver);
                Assert.Equal(updatedAccountName, accountNameOnAccontDetails);
                admincommonfunctions.UserMenuBtn();
                adminFunctions.AdminLogOut();

                // Log in user portal
                userFunctions.LogIn(TestProgressLogger, Const.USER17);

                // Verify update account name on user portal.
                actualUpdatedAccountName = userFunctions.GetTextOfLoggedInUser();
                Assert.Equal(updatedAccountName, actualUpdatedAccountName);
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.Error("", e);
                throw e;
            }
        }