public void BTA_73_LN_Migration_Product_With_AttributeSet() { #region Object Initialization CategoryFields coupon = new CategoryFields(); Migration Migration = new Migration(driverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); var ProgramPage = new Navigator_Users_ProgramPage(driverContext); var componentsPage = new Navigator_Users_Program_ComponentsPage(driverContext); var attributesPage = new Navigator_Users_Program_Components_AttributesPage(driverContext); var data = new NonAdminUserData(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); CategoryFields rate = new CategoryFields(); rate.PredicateDropDown = CategoryFields.Predicates.Ne.ToString(); string stepName = ""; #endregion try { #region Step1: Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2: Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: Create attribute for Product content type stepName = "Create attribute for Product content type"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); componentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Attributes); testStep.SetOutput(attributesPage.CreateNewAttribute(Migration.MigrationSets.Migration_Product_AttributeSet.ToString())); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Switch to Migration Environment stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment; testStep = TestStepHelper.StartTestStep(testStep); navigator_UsersHomePage.Navigator_Users_SwitchEnvironment(); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Navigate to Migration Page and Delete Migration Set if any stepName = "Navigate to Migration Page and Delete Migration Set if any"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration); Navigator_MigrationPage MigrationPage = new Navigator_MigrationPage(DriverContext); Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Product_AttributeSet.ToString() + "_" + DateHelper.GetDate("Current"); MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Product_AttributeSet.ToString(), out string output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Create New Migration Set stepName = "Create New Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Edit Items and Generate Items stepName = "Edit Items and Generate Items"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.EditItems(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2)); MigrationPage.SelectItemsForProductAttribute(Migration.MigrationSets.Migration_Product_AttributeSet.ToString(), out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Initiate Migration Set stepName = "Initiate Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Approve Migration Set stepName = "Approve Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Run Migration Set stepName = "Run Now Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11: Verify Attribute Migrated on Attribute Page stepName = "Verify Attribute Migrated on Attribute Page"; application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); componentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Attributes); attributesPage.VerifyAttributeExists(Migration.MigrationSets.Migration_Product_AttributeSet.ToString()); testStep.SetOutput(" Attribute :" + Migration.MigrationSets.Migration_Product_AttributeSet.ToString() + " Migrated Successfully and appeared on Attribute Page"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1031_ST1161_SOAP_ApplyTxnCredit_MemberIdentityInvalid() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); List <string> TransactionList = new List <string>(); stepName = "Getting Transaction in the Transaction History Details Table"; testStep = TestStepHelper.StartTestStep(testStep); TransactionList = ProjectBasePage.GetTransactionDetailsFromTransationHistoryTableFromDB(out Step_Output); string transactionHeaderId = TransactionList[0]; string txnAmount = TransactionList[2]; testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + " , Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); vc = output.GetLoyaltyCards(); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Apply Transaction to a member where member identity is Invalid and validate the error code as 3302"; string memberIdentity = ""; memberIdentity = common.RandomNumber(7); string value = DatabaseUtility.GetFromSoapDB("lw_virtualcard", "LOYALTYIDNUMBER", memberIdentity, "LOYALTYIDNUMBER", string.Empty); while (value == memberIdentity) { memberIdentity = common.RandomNumber(7); value = DatabaseUtility.GetFromSoapDB("lw_virtualcard", "LOYALTYIDNUMBER", memberIdentity, "LOYALTYIDNUMBER", string.Empty); } string cardid = vc[0].LoyaltyIdNumber; string error = cdis_Service_Method.ApplyTxnCreditInvalid(memberIdentity, cardid, transactionHeaderId, "ApplyingTxnCredit_CDIS"); if (error.Contains("Error code=3302") && error.Contains("Error Message=Unable to find member with identity")) { testStep.SetOutput("The Error message from Service is received as expected. " + error); Logger.Info("The Error message from Service is received as expected. " + error); } else { throw new Exception("Error not received as expected error:2003. Actual error received is" + error); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_272_CSP_RequestCredit_Store_TransactionID() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus = true; var CSPortal_RequestCredit = new CSPortal_RequestCredit(DriverContext); var CSPMemberAccountActivityPage = new CSPortal_MemberAccountActivityPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); try { #region reading Data from DB List <string> TransactionList = new List <string>(); stepName = "Searching Transaction in the Transaction History Details Table"; testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); TransactionList = ProjectBasePage.GetTransactionDetailsFromTransationHistoryTableFromDB(out Step_Output); RequestCredit_Search_Criteria.TransactionNumber = TransactionList[0].ToString(); RequestCredit_Search_Criteria.RegisterNumber = TransactionList[1].ToString(); RequestCredit_Search_Criteria.TxnAmount = TransactionList[2].ToString(); RequestCredit_Search_Criteria.TxnDate = TransactionList[3].ToString(); RequestCredit_Search_Criteria.StoreNumber = TransactionList[4].ToString(); DateTime Txn_dateformat = DateTime.Parse(RequestCredit_Search_Criteria.TxnDate); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Precondition:Create Member One testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = basePages.CreateMemberThroughCDIS(); string LoyaltyNumber_One_Firstname = output.FirstName; string LoyaltyNumber_One = basePages.GetLoyaltyNumber(output); testStep.SetOutput("LoyaltyNumber_One:" + LoyaltyNumber_One + ",Name:" + output.FirstName + " Created Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep);; CSP_LoginPage.LaunchCSPortal(login.Csp_url, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyNumber_One, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select and Verify Loyalty ID stepName = "Select and Verify Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); CSPSearchPage.Select(LoyaltyNumber_One_Firstname); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyNumber_One, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Request Credit stepName = "Navigate to Request Credit Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.RequestCredit, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Request Credit stepName = "Navigate to Request Credit Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.RequestCredit, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Search With Transaction Number stepName = "Search With Transaction Number:" + RequestCredit_Search_Criteria.TransactionNumber; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPortal_RequestCredit.Search_Store_BasedTransactionNumber(RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Get the data from DB stepName = "Searching Transaction in the Txn_Header Table"; List <string> TransactionList_Header = new List <string>(); testStep = TestStepHelper.StartTestStep(testStep); TransactionList_Header = ProjectBasePage.GetTransactionDetailsFromTransactionHeaderTableFromDB(RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Verify the Transactions stepName = "Verifying Transaction in Txn_Header table"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = basePages.VerifyInputandOutputFromDB("Transaction Number", TransactionList_Header[0].ToString(), RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Navigate to Account Activity Page stepName = "Navigate to Account ActivityPage"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Search and Verify Purchase History of First Transaction With Specific Date Range stepName = "Search and Verify Purchase History "; testStep = TestStepHelper.StartTestStep(testStep); Txn_dateformat.ToString("MMddyyyy"); CSPMemberAccountActivityPage.SelectDate_RC(Txn_dateformat, Txn_dateformat); testStep.SetOutput(CSPMemberAccountActivityPage.VerifyPurchaseHistoryBasedonHeader(RequestCredit_Search_Criteria.TransactionNumber)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout As csadmin is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1466_ST1701_SOAP_Regression_ChangeExpirationDate_WithTransactionPointStatus() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; //double time = 0; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + " , Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); IList <VirtualCard> vc = output.GetLoyaltyCards(); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Updating Member by adding transactions"; DateTime date = DateTime.Now.AddMilliseconds(1000); string txnHeaderId = cdis_Service_Method.UpdateMember_AddTransactionRequiredDate(output, date); testStep.SetOutput("The transaction header of the transcation posted through udpatemember method is " + txnHeaderId); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get Account Summary through Service"; GetAccountSummaryOut AccountSummaryOut = cdis_Service_Method.GetAccountSummary(vc[0].LoyaltyIdNumber); testStep.SetOutput("The currencybalance for the member is: " + AccountSummaryOut.CurrencyBalance); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change the Card expiration date"; DateTime expiredDate = DateTime.Now.AddMilliseconds(1000); DateTime response = cdis_Service_Method.ChangeCardExpirationDate(vc[0].LoyaltyIdNumber, expiredDate, out elapsedTime); testStep.SetOutput("The LoyaltyCard's: " + vc[0].LoyaltyIdNumber + " new expiration date is : " + response); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get Account Summary through Service"; GetAccountSummaryOut AccountSummaryOut1 = cdis_Service_Method.GetAccountSummary(vc[0].LoyaltyIdNumber); testStep.SetOutput("The currencybalance for the member is: " + AccountSummaryOut1.CurrencyBalance); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Verifying the Currency Balance of the Card"; Assert.AreEqual("0", AccountSummaryOut1.CurrencyBalance.ToString(), "Expected value is :0", "Actual value is" + AccountSummaryOut1.CurrencyBalance.ToString()); testStep.SetOutput("The Currency Balance of the Card :" + AccountSummaryOut1.CurrencyBalance); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_263_LN_Migration_Email() { #region Object Initialization Migration Migration = new Migration(driverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var EmailPage = new Navigator_EmailMessagePage(DriverContext); var navigator_Users_EmailAWSPage = new Navigator_AWSEmail_EmailsPage(DriverContext); bool StepStatus = true; string randomStr = RandomDataHelper.RandomString(4); string EmailMessageName = ProjectBasePage.Orgnization_value + WebsiteData.EmailMessageName + randomStr; string Description = "Description"; string DMCCode = WebsiteData.DMCCode; testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; #endregion try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: Create new email message stepName = "Create new email message"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email); StepStatus = EmailPage.CreateNewEmailMessage(EmailMessageName, Description, DMCCode, out string outMessage); testStep.SetOutput(outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Switch to Migration Environment stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment; testStep = TestStepHelper.StartTestStep(testStep); navigator_UsersHomePage.Navigator_Users_SwitchEnvironment(); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Navigate to Migration Page and Delete Migration Set if any stepName = "Navigate to Migration Page and Delete Migration Set if any"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration); Navigator_MigrationPage _MigrationPage = new Navigator_MigrationPage(DriverContext); Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Email.ToString() + "_" + DateHelper.GetDate("Current"); _MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Email.ToString(), out string output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Create New Migration Set stepName = "Create New Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); _MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Edit Items and Generate Items stepName = "Edit Items and Generate Items"; testStep = TestStepHelper.StartTestStep(testStep); _MigrationPage.EditItems(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2)); _MigrationPage.SelectItemsForAWSEMail(false, "", EmailMessageName, out _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Initiate Migration Set stepName = "Initiate Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); _MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Approve Migration Set stepName = "Approve Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); _MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Run Migration Set stepName = "Run Now Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); _MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Verify migrated email message displayed on Email Messages page stepName = "Verify migrated email message displayed on Email Messages page"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email); StepStatus = EmailPage.VerifyMailingNameMessageDetails(EmailMessageName, DMCCode); if (StepStatus) { testStep.SetOutput(" Email :" + EmailMessageName + " Migrated Successfully and Appeared on Mails Page"); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA375_REST_PostMemberToTargetedPromotion_POSITIVE() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; Common common = new Common(this.DriverContext); REST_Service_Methods rest_Service_Method = new REST_Service_Methods(common); JObject response; try { Logger.Info("Test Method Started"); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member through rest service"; JObject member = (JObject)rest_Service_Method.PostMembergeneral(); var k = member.Value <string>("isError"); Logger.Info(k.GetType()); Logger.Info(member.Value <string>("isError")); if (member.Value <string>("isError") == "False") { testStep.SetOutput("Member is added through PostMember service and following are the details, IPCODE:= " + member["data"].Value <int>("id") + "; Name= " + member["data"].Value <string>("firstName"));; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); } else { testStep.SetOutput("PostMember service call failed with following developer message: \"" + member.Value <string>("developerMessage") + "\""); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); Logger.Info("test failed"); throw new Exception(member.Value <string>("developerMessage")); } testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding targeted promotion through rest service by providing the member.firstName and options.promotionCode as parameter"; response = (JObject)rest_Service_Method.PostMemberToTargetedPromotion(member["data"].Value <string>("firstName"), DatabaseUtility.GETRecentPromotionfromDBREST()); if (response.Value <string>("isError") == "False") { testStep.SetOutput("The following promotion with ; memberpromotionID: " + response["data"].Value <int>("id") + "; Promotion ID : " + response.SelectToken("data.promotion").Value <string>("id") + "; Promotion name: " + response.SelectToken("data.promotion").Value <string>("name") + "; has been added to the member : " + member["data"].Value <string>("firstName")); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validating data with data from database"; string dbresponse = DatabaseUtility.GetMemberPromotionsUsingIpcodefromDBREST(member["data"].Value <int>("id") + ""); testStep.SetOutput("Response from DB memberpromotionID " + dbresponse); Assert.AreEqual(response["data"].Value <int>("id") + "", dbresponse, "Expected value is " + response["data"].Value <int>("id") + " and actual value is " + dbresponse); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } else { Logger.Info("test failed"); testStep.SetOutput(response.Value <string>("developerMessage")); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); throw new Exception(response.Value <string>("developerMessage")); } } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_508_MP_RequestCredit_Online_TransactionDate() { #region Objects ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus = true; var Mp_RequestCredit = new MemberPortal_RequestCredit(DriverContext); var MP_LoginPage = new MemberPortal_LoginPage(DriverContext); var Mp_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext); var CSPortal_RequestCredit = new CSPortal_RequestCredit(driverContext); var MPAccountActivityPage = new MemberPortal_AccountActivityPage(DriverContext); #endregion try { #region reading Data from dB List <string> TransactionList = new List <string>(); stepName = "Searching Transaction in the Transaction History Details Table"; testStep = TestStepHelper.StartTestStep(testStep); TransactionList = ProjectBasePage.GetTransactionDetailsFromTransationHistoryTableFromDB(out Step_Output); RequestCredit_Search_Criteria.TransactionNumber = TransactionList[0].ToString(); RequestCredit_Search_Criteria.RegisterNumber = TransactionList[1].ToString(); RequestCredit_Search_Criteria.TxnAmount = TransactionList[2].ToString(); RequestCredit_Search_Criteria.TxnDate = TransactionList[3].ToString(); RequestCredit_Search_Criteria.StoreNumber = TransactionList[4].ToString(); if (RequestCredit_Search_Criteria.StoreNumber.Equals("")) { throw new Exception("Store Number Not Avaialble for Transaction:" + RequestCredit_Search_Criteria.TransactionNumber); } DateTime Txn_dateformat = DateTime.Parse(RequestCredit_Search_Criteria.TxnDate); string transactionDate = Txn_dateformat.ToString("MM/dd/yyyy"); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, ""); listOfTestSteps.Add(testStep); #endregion #region Precondition:Create Member One testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member member = basePages.CreateMemberThroughCDIS(); testStep.SetOutput("LoyaltyNumber_One:" + basePages.GetLoyaltyNumber(member) + ",Name:" + member.FirstName + "Created Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch MPPortal Portal stepName = "Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Message); testStep.SetOutput("Launch Member Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As Newely Created Member stepName = "Login As Newely Created Member "; testStep = TestStepHelper.StartTestStep(testStep); string userName = member.Username; login.Password = MemberPortalData.MP_password; MP_LoginPage.LoginMemberPortal(userName, login.Password, out Message); testStep.SetOutput(Message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to Request Credit stepName = "Navigate to Request Credit Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = Mp_MyAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.RequestCredit, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Search With Transaction Date stepName = "Select Online and Search With Transaction Date:" + RequestCredit_Search_Criteria.TxnDate; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = Mp_RequestCredit.Search_BasedOnTransactionDate(RequestCredit_Search_Criteria.TransactionNumber, transactionDate, MemberPortal_RequestCredit.TransactionType.Online.ToString(), out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Get the data from DB stepName = "Searching Transaction in the Txn_Header Table"; List <string> TransactionList_Header = new List <string>(); testStep = TestStepHelper.StartTestStep(testStep); TransactionList_Header = ProjectBasePage.GetTransactionDetailsFromTransactionHeaderTableFromDB(RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Verify the Transactions stepName = "Verifying Transaction in Txn_Header table"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = basePages.VerifyInputandOutputFromDB("Transaction Number", TransactionList_Header[0].ToString(), RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Navigate to Account Activity Page stepName = "Navigate to Account ActivityPage"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = Mp_MyAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.AccountActivity, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Search and Verify Sales Transactions With Specific Date Range stepName = "Search and Verify Sales Transactions"; testStep = TestStepHelper.StartTestStep(testStep); MPAccountActivityPage.SelectDate_RC(Txn_dateformat, Txn_dateformat.AddDays(1)); MPAccountActivityPage.VerifySalesTransactionsSection("Header Id", RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Logout from Member Portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1229_ST1555_SOAP_GetCsNotes_PassEndDateEarlierThanStartDate() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); long value; double elapsedTime = 0; try { testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + ", Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Create CS Note for an Existing member"; IList <VirtualCard> vc = output.GetLoyaltyCards(); string csNote = "CSNOTES SOAP AUTOMATION"; value = cdis_Service_Method.CreateCsNote(vc[0].LoyaltyIdNumber, csNote, out elapsedTime); testStep.SetOutput("Created CS Note successfully for the member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + csNote); Logger.Info("Created CS Note successfully for an existing member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + csNote); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get CSNotes for an Existing member by passing enddate earlier than start date"; string error = cdis_Service_Method.getCsNotesNegative(vc[0].LoyaltyIdNumber, DateTime.Now, DateTime.Now.AddDays(-1)); if (error.Contains("Error code=3204")) { testStep.SetOutput("The Error message from Service is received as expected. " + error); Logger.Info("The Error message from Service is received as expected. " + error); } else { throw new Exception("Error not received as expected error: 3204. Actual error received is" + error); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); Logger.Info("Test Failed: " + testCase.GetTestCaseName() + "Reason: " + e.Message); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA141_MP_RegisterMemberAndVerifyPage() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region Object Initialization Login login = new Login(); var MP_LoginPage = new MemberPortal_LoginPage(driverContext); MP_Registration memberData = new MP_Registration(driverContext); MemberPortal_LoginPage loginPage = new MemberPortal_LoginPage(driverContext); MemberPortal_MyAccountPage myAccountPage = new MemberPortal_MyAccountPage(driverContext); MemberPortal_MyProfilePage myProfilePage = new MemberPortal_MyProfilePage(driverContext); MemberPortal_MyWalletPage myWalletPage = new MemberPortal_MyWalletPage(driverContext); MemberPortal_AccountActivityPage accountActivityPage = new MemberPortal_AccountActivityPage(driverContext); #endregion #region Step1:Launch Member Service Portal URL stepName = "Launch Member Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Navigate to Member Registration page stepName = "Navigate to Member Registration page "; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(MP_LoginPage.NavigateToMemberRegistrationPage()); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Create new member stepName = "Create new member"; testStep = TestStepHelper.StartTestStep(testStep); var memberRegistrationPage = new MemberPortal_MemberRegistrationPage(DriverContext); memberRegistrationPage.CreateNewMember(memberData, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Verify successful navigation to Member Portal home page stepName = "Verify successful navigation to Member Portal home page"; testStep = TestStepHelper.StartTestStep(testStep); Step_Output = loginPage.VerifyMemberPortalLoginSuccessfulForUser(memberData.FirstName, memberData.LastName); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Verify My Profile page stepName = "Verify My Profile page"; testStep = TestStepHelper.StartTestStep(testStep); myAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyProfile, out Step_Output); var strStatus = Step_Output; testStep.SetStatus(myProfilePage.VerifyMyProfilePage(MemberPortal_MyProfilePage.Sections.MyProfile.ToString(), out Step_Output)); strStatus = strStatus + ". " + Step_Output; testStep.SetOutput(strStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Verify My Wallet page stepName = "Verify My Wallet page"; testStep = TestStepHelper.StartTestStep(testStep); myAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyWallet, out Step_Output); strStatus = Step_Output; testStep.SetStatus(myWalletPage.VerifyMyWalletPage(out Step_Output)); strStatus = strStatus + ". " + Step_Output; testStep.SetOutput(strStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify Account Activity page stepName = "Verify Account Activity page"; testStep = TestStepHelper.StartTestStep(testStep); myAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.AccountActivity, out Step_Output); strStatus = Step_Output; testStep.SetStatus(accountActivityPage.VerifyAccountActivityPage(out Step_Output)); strStatus = strStatus + ". " + Step_Output; testStep.SetOutput(strStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Logout from member portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); loginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA266_CSP_VerifyActiveandInActiveStatusofAgents() { ProjectBasePage basePages = new ProjectBasePage(driverContext); AgentRegistration agent_admin = new AgentRegistration(); AgentRegistration agent_Sradmin = new AgentRegistration(); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var agentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); var userAdministration = new CSPortal_UserAdministration(DriverContext); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Edit AdminAgent status Active to Inactive stepName = "Edit AdminAgent status Active to Inactive"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out string output); userAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); agent_admin.FistName = "AdminFirstName"; agent_admin.LastName = "AdminLastName"; agent_admin.Role = RoleValue.Admin.ToString(); agent_admin.UserName = AgentValues.AdminAgent; agent_admin.Password = AgentValues.Agentpassword; agent_admin.Status = AgentRegistration.AgentStatus.Active.ToString(); var status = agentPage.EditAgentStatus(agent_admin, AgentRegistration.AgentStatus.InActive.ToString(), out string result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Edit SrAdminAgent status Active to Inactive stepName = "Edit SrAdminAgent status Active to Inactive"; testStep = TestStepHelper.StartTestStep(testStep); agent_Sradmin.FistName = "SrFirstName"; agent_Sradmin.LastName = "SrLastName"; agent_Sradmin.Role = RoleValue.SrAdmin.ToString(); agent_Sradmin.UserName = AgentValues.SrAdminAgent; agent_Sradmin.Password = AgentValues.Agentpassword; agent_Sradmin.Status = AgentRegistration.AgentStatus.Active.ToString(); status = agentPage.EditAgentStatus(agent_Sradmin, AgentRegistration.AgentStatus.InActive.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Verify AdminAgent login in inactive state. stepName = "Verify AdminAgent login in Inactive state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.AdminAgent; login.Password = AgentValues.Agentpassword; var testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.InActive.ToString(), out output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify SrAdminAgent login in inactive state. stepName = "Verify SrAdminAgent login in Inactive state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.SrAdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.InActive.ToString(), out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Edit AdminAgent status Inactive to Active stepName = "Edit AdminAgent status Inactive to Active"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out output); userAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); status = agentPage.EditAgentStatus(agent_admin, AgentRegistration.AgentStatus.Active.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Edit SrAdminAgent status Inactive to Active stepName = "Edit SrAdminAgent status Inactive to Active"; testStep = TestStepHelper.StartTestStep(testStep); agent_Sradmin.Status = AgentRegistration.AgentStatus.Active.ToString(); status = agentPage.EditAgentStatus(agent_Sradmin, AgentRegistration.AgentStatus.Active.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Verify AdminAgent login in active state. stepName = "Verify AdminAgent login in active state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.AdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.Active.ToString(), out result); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Verify SrAdminAgent login in active state. stepName = "Verify SrAdminAgent login in active state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.SrAdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.Active.ToString(), out output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Logout stepName = "Logout"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1229_ST1553_SOAP_GetCsNotes_PassMandatoryFields() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); long value; double elapsedTime = 0; try { testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + ", Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Create CS Note for an Existing member"; IList <VirtualCard> vc = output.GetLoyaltyCards(); string csNote = "CSNOTES SOAP AUTOMATION"; value = cdis_Service_Method.CreateCsNote(vc[0].LoyaltyIdNumber, csNote, out elapsedTime); testStep.SetOutput("Created CS Note successfully for the member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + csNote); Logger.Info("Created CS Note successfully for an existing member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + csNote); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get CSNotes for an Existing member who already has CSNotes"; var getCSNotes = cdis_Service_Method.GetCsNotes(vc[0].LoyaltyIdNumber, null, null, out elapsedTime); testStep.SetOutput("CSNotes for an Existing member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + getCSNotes[0].Note); Logger.Info("CSNotes for an existing member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + getCSNotes[0].Note); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validate CSNOTE with the DB value for the numericalID received from the response"; string note = DatabaseUtility.GetFromSoapDB("Lw_Csnote", "Id", value.ToString(), "NOTE", string.Empty); testStep.SetOutput("Created CS Note successfully for the member with member identity: " + vc[0].LoyaltyIdNumber + " and the CSNOTE is: " + getCSNotes[0].Note); Assert.AreEqual(getCSNotes[0].Note, note, "The Expected value is : " + getCSNotes[0].Note + " and the Actual value is: " + note); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); Logger.Info("Test Failed: " + testCase.GetTestCaseName() + "Reason: " + e.Message); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA117_Navigator_CreatMailingNames() { ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData EmailInfo = new NonAdminUserData(driverContext); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool StepStatus; login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; string EmailMessageName = ProjectBasePage.Orgnization_value + EmailInfo.EmailMessageName; string Description = "Description"; string DMCCode = EmailInfo.DMCCode; try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigating Email Page stepName = "Navigating Email Page"; testStep = TestStepHelper.StartTestStep(testStep); var Website = new Application_Nav_Util_Page(DriverContext); Website.OpenApplication(NavigatorEnums.ApplicationName.email); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Verify if the Mailing Name Exists, if the MailingName is not existed Create new MailingName Messsage testStep = TestStepHelper.StartTestStep(testStep); var EmailPage = new Navigator_EmailMessagePage(DriverContext); StepStatus = EmailPage.CreateNewEmailMessage(EmailMessageName, Description, DMCCode, out stepName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: LogOut stepName = "Logout as USER Admin With All roles"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_224_LN_Regression_Navigator_Store_CreateAndEditStore() { #region Object Initialization bool stepstatus = true; ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var navigator_Users_Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var StorePage = new Navigator_Users_Program_Components_StoresPage(driverContext); Store store = new Store { StoreNumber = RandomDataHelper.RandomNumber(4), StoreName = "Auto_Store" + RandomDataHelper.RandomString(4), PhoneNumber = RandomDataHelper.RandomNumber(10), City = "TestCity", State = "TestState", Country = "TestCountry", Address = "TestAddress" }; testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; #endregion try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Select the program application and verify the program configuration panel displayed stepName = "Select the program application and verify the program configuration panel displayed"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); testStep.SetOutput("Program configuration panel opened successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create new Store stepName = "Create new Store"; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Stores); StorePage.CreateStore(store, out string msg); testStep.SetOutput(msg); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Verify the presence of newly created store in the grid stepName = "Verify the presence of newly created store in the grid"; testStep = TestStepHelper.StartTestStep(testStep); StorePage.VerifyTheExistanceOfStore(store, out msg); testStep.SetOutput(msg); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Edit and Verify the updated store details stepName = "Edit and Verify the updated store details"; testStep = TestStepHelper.StartTestStep(testStep); StorePage.EditAndVerify_StoreDetails(store, out msg); testStep.SetOutput(msg); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_76_LN_Migrate_Product_And_VerifyProductMigrated() { #region Object Declaration testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); CategoryFields product = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData data = new NonAdminUserData(driverContext); Migration Migration = new Migration(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var rewardCatlog_productImagePage = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_CreateProduct_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext); var RewardCatalog_ProductsPage = new Navigator_Users_Program_RewardCatalog_ProductsPage(DriverContext); var Program_RewardCatalogPage = new Navigator_Users_Program_RewardCatalogPage(DriverContext); var RewardCatalog_RewardsPage = new Navigator_Users_Program_RewardCatalog_RewardsPage(DriverContext); var RewardCatalog_ProductVariantsPage = new Navigator_Users_Program_RewardCatalog_ProductVariantsPage(DriverContext); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); product.Name = Migration.MigrationSets.Migration_Product.ToString() + RandomDataHelper.RandomString(4); string stepName = ""; #endregion try { #region Object Initialization product.SetType = "Product Name"; var attName = data.AttributeAllContentType; #endregion #region Step1: Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2: Login As User Admin stepName = "Login As User Admin and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: Verify the existence of category and create category if doesn't exist stepName = "Verify the existence of category and create category if doesn't exist"; product.CategoryTypeValue = CategoryFields.CategoryType.Product.ToString(); product.CategoryName = data.ProductCategoryName; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories); testStep.SetOutput(navigator_CreateProduct_Category.CreateCategory(product)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create new product and Verify var contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Product; product.AttributeName = attName + contentType.ToString(); product.ValueToSetInAttribute = "ValueGivenForAttributeSetProduct"; stepName = "Create New Product with Category as " + product.Name + ""; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog); Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products); testStep.SetOutput(RewardCatalog_ProductsPage.CreateProduct_With_ProductCategory(product)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Switch to Migration Environment stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment; testStep = TestStepHelper.StartTestStep(testStep); navigator_UsersHomePage.Navigator_Users_SwitchEnvironment(); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Navigate to Migration Page and Delete Migration Set if any stepName = "Navigate to Migration Page and Delete Migration Set if any"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration); Navigator_MigrationPage MigrationPage = new Navigator_MigrationPage(DriverContext); Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Product.ToString() + "_" + DateHelper.GetDate("Current"); MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Product.ToString(), out string output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Create New Migration Set stepName = "Create New Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Edit Items and Generate Items stepName = "Edit Items and Generate Items"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2)); MigrationPage.SelectItemsForProductCategoryAndProduct(product.Name, product.CategoryName, out _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Initiate Migration Set stepName = "Initiate Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Approve Migration Set stepName = "Approve Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Run Migration Set stepName = "Run Now Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11: Verify Product Migrated on Product Page stepName = "Verify Product Migrated on Product Page"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog); Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products); RewardCatalog_ProductsPage.VerifyCreatedProduct(product.SetType, product.Name, product.CategoryName); testStep.SetOutput(" Product :" + Migration.MigrationSets.Migration_Product.ToString() + " Migrated Successfully and appeared on Product Page"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA281_Navigator_Create_New_Message() { var navigator_LoginPage = new Navigator_LoginPage(DriverContext); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region Object initialization var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); var programPage = new Navigator_Users_ProgramPage(driverContext); var componentsPage = new Navigator_Users_Program_ComponentsPage(driverContext); var eCollateralPage = new Navigator_Users_Program_eCollateralPage(driverContext); var eCollateralTab = Navigator_Users_Program_eCollateralPage.eCollateralTabs.Messages; var messagesPage = new Navigator_Users_Program_eCollateral_MessagesPage(driverContext); CategoryFields messageData = new CategoryFields(); messageData.Name = ProjectBasePage.Orgnization_value + NonAdminUserData.MessageName; var date = DateTime.Now; date = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time"); messageData.StartDate = date.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); messageData.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); bool status; #endregion #region Step 1 : Open Navigator URL stepName = "Open Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 2 : Login to navigator using USER_WithAllRoles stepName = "Login to navigator using USER_WithAllRoles"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = userName; login.Password = password; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 3 : Select organization and environment on USER Home page stepName = "Select organization and environment on USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 4 : Navigate to program -> eCollateralTab stepName = "Navigate to program -> eCollateralTab"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); programPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral); eCollateralPage.NavigateToProgramECollateralTab(eCollateralTab); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 5 : Create new message if message does not exist already testStep = messagesPage.CreateNewMessage(messageData, out string messageStatus); listOfTestSteps.Add(testStep); #endregion #region Step 6 : Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA115_Navigator_Create_BonusCategory_And_BonusWithExtendedAttributeSet() { #region Object Declaration MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List<TestStep>(); testStep = new TestStep(); string Prereq_testCase1 = "BTA119_Navigator_VerifyAttributes_On_ExtendedAttributesPage"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep); CategoryFields bonus = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); var bonusData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var navigator_Users_Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext); var navigator_CreateBonus_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext); string stepName = ""; #endregion try { #region Object Initialization string BonusName = bonusData.BonusName; string randomStr = RandomDataHelper.RandomString(4); bonus.Name = BonusName + randomStr; bonus.CategoryName = bonusData.BonusCategoryName; var date = DateTime.Now; bonus.StartDate = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); bonus.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); bonus.Logo_Img_Hero = "Null"; bonus.CategoryTypeValue = CategoryFields.CategoryType.Bonus.ToString(); bonus.ValueToSetInAttribute = "ValueGivenForAttribute"; bonus.SetType = CategoryFields.Property.Name.ToString(); bonus.MultiLanguage = CategoryFields.Languages.English.ToString(); bonus.ChannelProperties = CategoryFields.Channel.Web.ToString(); #endregion #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Create New Category with Bonus stepName = "Create new Category as " + bonus.CategoryName; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories); testStep.SetOutput(navigator_CreateBonus_Category.CreateCategory(bonus)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create new bonus with Attribute Set stepName = "Create bonus with Category " + bonus.CategoryName + " with Attribute set"; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral); navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Bonuses); testStep.SetOutput(navigator_CreateBonus.CreateBonusWithAttributeSet(bonus).ToString()); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA375_REST_PostMemberToTargetedPromotion_NEGATIVE() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; Common common = new Common(this.DriverContext); REST_Service_Methods rest_Service_Method = new REST_Service_Methods(common); JObject response; try { Logger.Info("Test Method Started"); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding invalid promotion by providing the invalid firstName and promotionCode details"; response = (JObject)rest_Service_Method.PostMemberToTargetedPromotion(common.RandomString(6), common.RandomString(4)); if (response.Value <string>("isError") == "True") { testStep.SetOutput("The response code if an invalid details (firstname, promotioncode) are passed is: " + response.Value <int>("responseCode") + ""); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validating developer message for the response code 10504"; if (response.Value <int>("responseCode") == 10504) { testStep.SetOutput("Developer message from response code 10504 is \"" + response.Value <string>("developerMessage") + "\""); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } else { Logger.Info("test failed"); testStep.SetOutput("Developer message is" + response.Value <string>("developerMessage") + "and response code is" + response.Value <int>("responseCode")); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); throw new Exception("Developer message is" + response.Value <string>("developerMessage") + "and response code is" + response.Value <int>("responseCode")); } } else { Logger.Info("test failed"); testStep.SetOutput(response.Value <string>("developerMessage")); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); throw new Exception(response.Value <string>("developerMessage")); } } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA82_Navigator_GenerateDBConfig() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testStep = new TestStep(); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; string StepOutput = ""; bool stepstatus; try { #region :OrderExection Requirement string Prereq_testCase = "BTA79_Navigator_CreateDBAAdminUser_And_Login_With_DBAAdminUser"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep); #endregion #region Step1:Verify Key Files Existed ,If Existed Delete Existed Files stepName = "Delete Existed DBConfig.dat File From :" + basePages.ConfigDownloadPath; testStep = TestStepHelper.StartTestStep(testStep); string dbFile = basePages.ConfigDownloadPath + @"\DBConfig.dat"; basePages.DeleteExistedFile(dbFile); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Login As DB Admin User stepName = "Login As DB Admin User and Navigate to Keys Page"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.DBAUser; login.Password = NavigatorUsers.DBAUser_Password; navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_DBUser_HomePage = new Navigator_DBHomePage(DriverContext); navigator_DBUser_HomePage.NavigatetoDatabases_Page(out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select Organization and Environment stepName = "Select Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_DBDevHomePage = new Navigator_DBFramework_Page(DriverContext); string Org_Output; string Env_Output; navigator_DBDevHomePage.DrillDownOrg(out Org_Output); navigator_DBDevHomePage.SelectEnvironment(out Env_Output); testStep.SetOutput(Org_Output + ";" + Env_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Creating DB Connection is not existed ,Generate DBConfig stepName = "Creating DB Connection"; testStep = TestStepHelper.StartTestStep(testStep); navigator_DBDevHomePage.CreatingDBConnection(db.Name, db.DataBasesType, db.UserID, db.Password, db.DefaultSchema, db.Server, db.Database, db.ConnectionProps, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Generate DBConfig file and Download stepName = "Generate DBConfig file and Download"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = navigator_DBDevHomePage.Download_DBConfigFile(dbFile, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Create Config Folder for Organization if not existed stepName = "Create Config Folder for Organization if not existed"; testStep = TestStepHelper.StartTestStep(testStep); basePages.CreateOrVerfiyConfigFolder(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Copy DB file stepName = "Copy DBConfig file to Config folder"; testStep = TestStepHelper.StartTestStep(testStep); basePages.CopyFile(dbFile, basePages.ConfigUploadPath + @"\DBConfig.dat"); stepstatus = basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\DBConfig.dat", "DBConfig.datFile uploaded Successfully in config path:" + basePages.ConfigUploadPath, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Initialize DB Framework if the DB is not Initialized stepName = "Initialize DB Framework if the DB is not Initialized"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = navigator_DBDevHomePage.InitializeFrameworkDB(true, true, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: LogOut testStep = TestStepHelper.StartTestStep(testStep); if (StepOutput.Contains("New DB Initialization is Completed")) { stepName = "Verfiying intialization"; //navigator_LoginPage.Logout(); //navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput); navigator_DBUser_HomePage.NavigatetoDatabases_Page(out StepOutput); navigator_DBDevHomePage.DrillDownOrg(out Org_Output); navigator_DBDevHomePage.SelectEnvironment(out Env_Output); stepstatus = navigator_DBDevHomePage.InitializeFrameworkDB(true, true, out StepOutput); testStep.SetOutput(StepOutput); } stepName = "Logout User"; navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA142_MP_LoginUserCreatedFromCsPortalInMemberPortal() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; string stepOutput = ""; try { Common common = new Common(DriverContext); #region Generating Test Data to Create new user with loyalty card MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfo(); MemberDetails details = MP_Model.GenerateMemberDetails(); VirtualCard vc = MP_Model.GenerateVirtualCard(); var MP_LoginPage = new MemberPortal_LoginPage(DriverContext); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to Member Registration stepName = "Navigate to Member Registration"; var CSP_HomePage = new CSPortal_HomePage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Enter Basic Info stepName = "Enter Basic Info Details on Member Registration page"; var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterBasicInfo_Details(member.FirstName, member.LastName, member.MiddleName, details.Gender, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Enter Address stepName = "Enter Address Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterAddress_Details(details.AddressLineOne, details.AddressLineTwo, details.Country, details.StateOrProvince, details.City, details.ZipOrPostalCode, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Enter ContactInfo stepName = "Enter Contact Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterContactInfo_Details(member.PrimaryEmailAddress, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Enter login Credentials stepName = "Enter login Credentials Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterLoginCredentials_Details(member.Username, member.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Select All Opt In/Out Check boxes stepName = "Select All Opt In/Out Check boxes"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterOptIn_Out_Details("DirectMailOptIn", "EmailOptIn", "SmsOptIn", out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Save Registration stepName = "Save Registration"; testStep = TestStepHelper.StartTestStep(testStep); CSP_RegistrationPage.SaveRegistration(); testStep.SetOutput("Registration Completed Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Logout from CSPortal stepName = "Logout from CSPortal"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout from CSPortal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Launch Member Portal stepName = "Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion # region Step12: Login with the user Created from CSPortal stepName = "Login with the user Created from CSPortal"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LoginMemberPortal(member.Username, member.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Login to Member Portal should be successful stepName = "Verify Login to Member Portal should be successful"; testStep = TestStepHelper.StartTestStep(testStep); Step_Output = MP_LoginPage.VerifyMemberPortalLoginSuccessfulForUser(member.FirstName, member.LastName); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14: Logout from Member Portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); }
public void BTA236_CDIS_GetMemberMessages_PositiveCase() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + ", Name: " + output.FirstName); Logger.Info("IpCode:" + output.IpCode + ",Name:" + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); IList <VirtualCard> vc = output.GetLoyaltyCards(); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Issue Message using Trigger event method"; TriggerUserEventOut userEventOut = cdis_Service_Method.UserTriggerEvent(vc[0].LoyaltyIdNumber); testStep.SetOutput("Member Message Id:" + userEventOut.MemberMessage[0].Id + " and Member MessageDefId:" + userEventOut.MemberMessage[0].MessageDefId + " from " + " the response of TrigggerEvent method"); Logger.Info("Member MessageID: " + userEventOut.MemberMessage[0].Id + "Member MessageDefID: " + userEventOut.MemberMessage[0].MessageDefId + " from " + " the response of TrigggerEvent method"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get member messageID and MessagedDefID from GetMemberMessages method"; GetMemberMessagesOut memberMessagesOut = cdis_Service_Method.GetMemberMessages(vc[0].LoyaltyIdNumber); testStep.SetOutput("Member MessageID:" + memberMessagesOut.MemberMessage[0].Id + " and Member MessageDefID:" + memberMessagesOut.MemberMessage[0].MessageDefId + " from the GetMemberMessages response"); Assert.AreEqual(userEventOut.MemberMessage[0].Id, memberMessagesOut.MemberMessage[0].Id, "Expected Value is :" + userEventOut.MemberMessage[0].Id, "Actual Value is :" + memberMessagesOut.MemberMessage[0].Id); Assert.AreEqual(userEventOut.MemberMessage[0].MessageDefId, memberMessagesOut.MemberMessage[0].MessageDefId, "Expected Value is :" + userEventOut.MemberMessage[0].MessageDefId, "Actual Value is :" + memberMessagesOut.MemberMessage[0].MessageDefId); Logger.Info("Member MessageID: " + memberMessagesOut.MemberMessage[0].Id + " and Member MessageDefID: " + memberMessagesOut.MemberMessage[0].MessageDefId); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validating MessageDefID of the user with data from DB"; string dbresponse = DatabaseUtility.GetMemberMessageDefIDfromDBUsingIdSOAP(memberMessagesOut.MemberMessage[0].Id + ""); testStep.SetOutput("Message Def ID feteched from DB is : " + dbresponse); Assert.AreEqual(memberMessagesOut.MemberMessage[0].MessageDefId + "", dbresponse, "Expected Value is " + memberMessagesOut.MemberMessage[0].MessageDefId + " Actual Value is " + dbresponse); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message.ToString()); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA830_SOAP_UnredeemMemberCouponByCertNmbr() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; double time = 0; Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); try { IList <JToken> JsonData = ProjectBasePage.GetJSONData("CommonSqlStatements"); string sqlstmt = (string)JsonData.FirstOrDefault()["Get_CertNumber_From_LWMemberCouponTable_With_EmptyDateRedeemed"]; Logger.Info("Test Method Started: " + testCase.GetTestCaseName()); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get a valid certificateNumber from LW_MemberCoupon table"; string validCertNumber = DatabaseUtility.GetFromSoapDB(string.Empty, string.Empty, string.Empty, "CERTIFICATENMBR", sqlstmt); testStep.SetOutput("The valid certNumbr from LW_MemberCoupon table is: " + validCertNumber); Logger.Info("The valid certNumbr from LW_MemberCoupon table is: " + validCertNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Redeem the member coupon using certNumber using RedeemMemberCouponByCertNumber method"; var certDetails = cdis_Service_Method.RedeemMemberCouponByCertNumber(validCertNumber); string dbRedemptionDate = DatabaseUtility.GetFromSoapDB("LW_MEMBERCOUPON", "CERTIFICATENMBR", validCertNumber, "DATEREDEEMED", string.Empty); string dbStatus = DatabaseUtility.GetFromSoapDB("LW_MEMBERCOUPON", "CERTIFICATENMBR", validCertNumber, "STATUS", string.Empty); Assert.AreEqual(System.DateTime.Now.ToString("MM/dd/yyyy"), Convert.ToDateTime(dbRedemptionDate).ToString("MM/dd/yyyy"), "Expected value is" + System.DateTime.Now.ToString("MM/dd/yyyy") + " and Actual value is" + Convert.ToDateTime(dbRedemptionDate).ToString("MM/dd/yyyy")); testStep.SetOutput("The Coupon name from the response of RedeemMemberCouponByCertNumber method is: " + certDetails.CouponDefinition.Name + "; the redemption date is: " + dbRedemptionDate + "; and coupon status is:" + dbStatus); Logger.Info("TestStep: " + stepName + " ##Passed## The Coupon name from the response of RedeemMemberCouponByCertNumber method is: " + certDetails.CouponDefinition.Name + " and; the redemption date is: " + dbRedemptionDate + " and coupon status is:" + dbStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Unredeem the above member coupon using certNumber using UnRedeemMemberCouponByCertNumber method"; cdis_Service_Method.UnRedeemMemberCouponByCertNumber(validCertNumber, out time); string dbRedemptionDateAfterUnRedeem = DatabaseUtility.GetFromSoapDB("LW_MEMBERCOUPON", "CERTIFICATENMBR", validCertNumber, "DATEREDEEMED", string.Empty); string dbStatusAfterUnRedeem = DatabaseUtility.GetFromSoapDB("LW_MEMBERCOUPON", "CERTIFICATENMBR", validCertNumber, "STATUS", string.Empty); Assert.AreEqual("", dbRedemptionDateAfterUnRedeem, "Expected value is [] Actual value is" + dbRedemptionDateAfterUnRedeem); Assert.AreEqual("Active", dbStatusAfterUnRedeem, "Expected value is Active" + " and Actual value is" + dbStatusAfterUnRedeem); testStep.SetOutput("After unredeeming the coupon:; the redemption date is: [NULL]" + dbRedemptionDateAfterUnRedeem + ";coupon status is:" + dbStatusAfterUnRedeem); Logger.Info("TestStep: " + stepName + " ##Passed## After unredeeming the coupon:; the redemption date is: " + dbRedemptionDateAfterUnRedeem + ";coupon status is:" + dbStatusAfterUnRedeem); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); Logger.Info("###Test Execution Ends### Test Passed: " + testCase.GetTestCaseName()); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); Logger.Info("Test Failed: " + testCase.GetTestCaseName() + "Reason: " + e.Message); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA233_CDIS_GetMemberRewardsSummary_PositiveCase() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + ", Name: " + output.FirstName); Logger.Info("IpCode:" + output.IpCode + ",Name:" + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get \"Reward Definition\" from GetRewardCatalog method"; //RewardCatalogSummaryStruct[] rewardCatalog = cdis_Service_Method.GetRecentRewardCatalog(0,0,0); //RewardCatalogSummaryStruct reward = new RewardCatalogSummaryStruct(); //foreach (RewardCatalogSummaryStruct r in rewardCatalog) //{ // if (r.CurrencyToEarn == 0) // { // reward = r; // break; // } //} var reward = cdis_Service_Method.getReward(); testStep.SetOutput("The following reward is fetched from GetRewardCatalog method; RewardID: " + reward.RewardID + ";Rewardname: " + reward.RewardName); Logger.Info("RewardID:" + reward.RewardID); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); IList <VirtualCard> vc = output.GetLoyaltyCards(); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Add Reward to the above Member"; AddMemberRewardsOut memberRewardsOut = (AddMemberRewardsOut)cdis_Service_Method.AddMemberRewards(vc[0].LoyaltyIdNumber, vc[0].LoyaltyIdNumber, reward); testStep.SetOutput("Reward added sucessfully and the; membersRewardID : " + memberRewardsOut.MemberRewardID); Logger.Info("RewardID:" + memberRewardsOut.MemberRewardID); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Verify MemberRewardID, RewardDefID and RewardName from response of the GetMemberRewardsSummary method matches with the reward added through AddMemberreward method"; MemberRewardSummaryStruct[] memberRewardSummaryStruct = cdis_Service_Method.GetMemberRewardsSummary(vc[0].LoyaltyIdNumber); Assert.AreEqual(memberRewardSummaryStruct[0].MemberRewardID, memberRewardsOut.MemberRewardID, "Expected Value is " + memberRewardSummaryStruct[0].MemberRewardID + " Actual Value is " + memberRewardsOut.MemberRewardID); Assert.AreEqual(memberRewardSummaryStruct[0].RewardDefID, reward.RewardID, "Expected Value is " + memberRewardSummaryStruct[0].RewardDefID + " Actual Value is " + reward.RewardID); Assert.AreEqual(memberRewardSummaryStruct[0].RewardName, reward.RewardName, "Expected Value is " + memberRewardSummaryStruct[0].RewardName + " Actual Value is " + reward.RewardName); testStep.SetOutput("GetMemberRewardsSumamry's MemberRewardID: " + memberRewardSummaryStruct[0].MemberRewardID + " and the AddMemberReward's MemberRewardsID : " + memberRewardsOut.MemberRewardID + " are matching"); Logger.Info("Member RewardID:" + memberRewardSummaryStruct[0].MemberRewardID); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validate membersrewardID in lw_memberrewards table"; string dbresponse = DatabaseUtility.GetMemberRewardIDfromDBUsingIdSOAP(output.IpCode + "", reward.RewardID + ""); Assert.AreEqual(memberRewardSummaryStruct[0].MemberRewardID + "", dbresponse, "Expected Value is " + memberRewardSummaryStruct[0].MemberRewardID + " Actual Value is " + dbresponse); testStep.SetOutput("Response from database [MemberRewardID]: " + dbresponse); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get Reward Catalog Item with CDIS service"; RewardCatalogItemStruct rewardCatalogItem = cdis_Service_Method.GetRewardCatalogItem(reward.RewardID); testStep.SetOutput("The reward details from RewardCatalogItem for the Reward with ID " + reward.RewardID + " are: ; Reward Name: " + rewardCatalogItem.RewardName + "; Reward ID: " + rewardCatalogItem.RewardID); Logger.Info("Reward ID: " + rewardCatalogItem.RewardID); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validate reward details of RewardCatalogItem response with GetMemberRewardsSumamry method details"; Assert.AreEqual(memberRewardSummaryStruct[0].RewardDefID + "", rewardCatalogItem.RewardID + "", "Expected Value is " + memberRewardSummaryStruct[0].RewardDefID + " Actual Value is " + rewardCatalogItem.RewardID); Assert.AreEqual(memberRewardSummaryStruct[0].RewardName + "", rewardCatalogItem.RewardName, "Expected Value is " + memberRewardSummaryStruct[0].RewardName + " Actual Value is " + rewardCatalogItem.RewardName); testStep.SetOutput("The Reward details from GetRewardCatalogItem are " + "; RewardID: " + rewardCatalogItem.RewardID + ";RewardName: " + rewardCatalogItem.RewardName + "; and Reward details from GetMemberRewardsSumamry are: " + "; RewardID : " + memberRewardSummaryStruct[0].RewardDefID + "; RewardName: " + memberRewardSummaryStruct[0].RewardName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message.ToString()); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1466_ST1705_SOAP_Regression_ChangeExpirationDate_AddTransactionsAfterExpiration() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + " , Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change the Card expiration date"; IList <VirtualCard> vc = output.GetLoyaltyCards(); DateTime expiredDate = DateTime.Now.AddMilliseconds(2000); string response = cdis_Service_Method.ChangeCardExpirationDate_Negative(vc[0].LoyaltyIdNumber, expiredDate); testStep.SetOutput(response); Logger.Info(response); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change the Card expiration date"; DateTime expiredDatenew = DateTime.Now.AddDays(-2); string responsenew = cdis_Service_Method.ChangeCardExpirationDate_Negative(vc[0].LoyaltyIdNumber, expiredDatenew); string[] errors = responsenew.Split(';'); string[] errorssplit = errors[0].Split('='); string[] errorsnew = errors[1].Split('='); testStep.SetOutput(responsenew); Logger.Info(responsenew); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validating the error code and the ErrorMessage for the Error Code"; Assert.AreEqual("1", errorssplit[1], "Expected value is" + "1" + "Actual value is" + errorssplit[1]); testStep.SetOutput("The ErrorMessage from Service is: " + errorsnew[1]); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1467_ST1896_SOAP_DeactivateCard_WithTranscations() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); try { testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); Logger.Info("IpCode: " + output.IpCode + ", Name: " + output.FirstName); IList <VirtualCard> vc = output.GetLoyaltyCards(); testStep.SetOutput("The member details are IpCode: " + output.IpCode + " , Name: " + output.FirstName + ", LoyaltyCardID is: " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding points to members by posting transactions using UpdateMember method"; DateTime date = DateTime.Now.AddMilliseconds(2000); var txnHeader = cdis_Service_Method.UpdateMember_PostTransactionRequiredDate(output, date); var pointBalanceBeforeCancelCard = cdis_Service_Method.GetAccountSummary(vc[0].LoyaltyIdNumber); testStep.SetOutput("The transaction header of the ID is " + txnHeader.TxnHeaderId + "and Currency Balance is : " + pointBalanceBeforeCancelCard.CurrencyBalance); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Deactivating card for the member"; vc = output.GetLoyaltyCards(); string message = cdis_Service_Method.DeActivateCardUsingLoyaltyID(vc[0].LoyaltyIdNumber, DateTime.Now, "Automation - Deactivate Card"); Assert.AreEqual("pass", message, "Card: " + vc[0].LoyaltyIdNumber + " has been not deactivated"); testStep.SetOutput("Card is deactivated: " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "validate the card is deactivated and points are expired"; string dbresponse = DatabaseUtility.GetLoyaltyCardStatusfromDbSOAP(vc[0].LoyaltyIdNumber); testStep.SetOutput("Response from DB: LoyaltyCardId NewStatus is : \"" + dbresponse + "\" which means the card is : " + (LoyaltyCard_Status)Int32.Parse(dbresponse)); string value = (LoyaltyCard_Status)Int32.Parse(dbresponse) + ""; Assert.AreEqual(LoyaltyCard_Status.Inactive.ToString(), value, "Expected value is" + LoyaltyCard_Status.Inactive.ToString() + "Actual value is" + value); var pointBalanceAfterDeactivateCard = cdis_Service_Method.GetAccountSummary(vc[0].LoyaltyIdNumber); Assert.AreEqual("0", pointBalanceAfterDeactivateCard.CurrencyBalance.ToString(), "Expected value is \"0\" and the Actual value is: " + pointBalanceAfterDeactivateCard.CurrencyBalance.ToString()); testStep.SetOutput("Card is deactivated and the points are expired and the Card number is: " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA121_CSP_LoginAsCsAdmins() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep);; var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Verify First Name and Last Name stepName = "Verify First Name and Last Name"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_HomePage = new CSPortal_HomePage(DriverContext); Step_Output = CSP_HomePage.VerifyFirstNameAndLastName("csadmin", "csadmin"); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout As csadmin is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1467_ST1894_SOAP_DeActivate_InactiveCard() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode: " + output.IpCode + ", Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + ", Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Deactivating the card for the member"; IList <VirtualCard> vc = output.GetLoyaltyCards(); string message = cdis_Service_Method.DeActivateCardUsingLoyaltyID(vc[0].LoyaltyIdNumber, DateTime.Now, "Automation - Deactivate Card"); Assert.AreEqual("pass", message, "Card: " + vc[0].LoyaltyIdNumber + " has been deactivated"); testStep.SetOutput("Card is deactivated: " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Deactivating the card which is already deactivated for the member"; string message1 = cdis_Service_Method.DeActivateCardUsingLoyaltyID(vc[0].LoyaltyIdNumber, DateTime.Now, "Automation - Deactivate Card"); Assert.AreEqual("pass", message1, "Card: " + vc[0].LoyaltyIdNumber + " has been deactivated"); testStep.SetOutput("Card is deactivated: " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "validate the card status from database"; string dbresponse = DatabaseUtility.GetLoyaltyCardStatusfromDbSOAP(vc[0].LoyaltyIdNumber); Assert.AreEqual("Inactive", (LoyaltyCard_Status)Convert.ToInt32(dbresponse) + "", "Expected value is Inactive and the Actual value is" + (LoyaltyCard_Status)Convert.ToInt32(dbresponse)); testStep.SetOutput("Card status is validated as Deactivated and the card number is " + vc[0].LoyaltyIdNumber); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA1031_ST1215_SOAP_ApplyTxnCreditToMemberCardIdNull_VerifyElapsedTime() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); List <string> TransactionList = new List <string>(); stepName = "Getting Transaction in the Transaction History Details Table"; testStep = TestStepHelper.StartTestStep(testStep); TransactionList = ProjectBasePage.GetTransactionDetailsFromTransationHistoryTableFromDB(out Step_Output); string transactionHeaderId = TransactionList[0]; string txnAmount = TransactionList[2]; testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); vc = output.GetLoyaltyCards(); testStep.SetOutput("IpCode: " + output.IpCode + " , Name: " + output.FirstName); Logger.Info("IpCode: " + output.IpCode + " , Name: " + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Apply transaction to a member with Cardid as null "; string memberIdentity = vc[0].LoyaltyIdNumber; decimal pointsEarned = cdis_Service_Method.ApplyTxnCredit(memberIdentity, null, transactionHeaderId, "ApplyingTxnCredit_CDIS", out elapsedTime); if (pointsEarned == Convert.ToDecimal(txnAmount)) { testStep.SetOutput("Applied transaction to a member where Cardid is null with MemberIdentity: " + memberIdentity + " TransactionHeaderId: " + transactionHeaderId + " TransactionAmount: " + txnAmount); } else { throw new Exception("Failed to apply Transaction to a member"); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validate the transaction is added in database "; string txnHeaderIdFromDB = DatabaseUtility.GetFromSoapDB("ats_txndetailitem", "A_TXNHEADERID", transactionHeaderId, "A_TXNHEADERID", string.Empty); Assert.AreEqual(transactionHeaderId, txnHeaderIdFromDB, "Expected value is" + transactionHeaderId + "Actual Value is" + txnHeaderIdFromDB); testStep.SetOutput("Transaction is added successfully in txndetailitem table with transactionHeaderId: " + transactionHeaderId); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validate the elapsed time is greater than Zero"; if (elapsedTime > 0) { testStep.SetOutput("Elapsed time is greater than zero and the elapsed time is " + elapsedTime); } else { throw new Exception("Elapsed time is not greater than Zero"); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA221_CDIS_AddMemberCoupon_Positive() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; double time = 0; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); testStep.SetOutput("IpCode:" + output.IpCode + ",Name:" + output.FirstName); Logger.Info("IpCode:" + output.IpCode + ",Name:" + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); IList <VirtualCard> vc = output.GetLoyaltyCards(); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Getting Coupon Definitions from Service"; GetCouponDefinitionsOut def = cdis_Service_Method.GetCouponDefinitions(); // var reqCoupon = cdis_Service_Method.GetCouponDefinition(1010, null, null, null, string.Empty, out time); CouponDefinitionStruct[] coupondefintions = def.CouponDefinition; CouponDefinitionStruct reqCoupon = null; foreach (var coupon in coupondefintions) { if (coupon.UsesAllowed > 10) { reqCoupon = coupon; break; } } testStep.SetOutput("Coupon Name CertNumbers: " + reqCoupon.Name); Logger.Info("Coupon Name CertNumbers: " + reqCoupon.Name); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding Coupon to a member from Service"; long memberCouponId = cdis_Service_Method.AddMemberCoupon(vc[0].LoyaltyIdNumber, reqCoupon.Id); testStep.SetOutput("MemberCoupon Id : " + memberCouponId); Logger.Info("MemberCoupon Id : " + memberCouponId); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Validating the response from database"; String dbresponse = DatabaseUtility.GetMemberCouponIdUsingVCKeyFromDBSOAP(output.IpCode + ""); testStep.SetOutput("Member coupon id from database:" + dbresponse); Assert.AreEqual(memberCouponId + "", dbresponse, "Expected value is" + memberCouponId + "Actual value is" + dbresponse); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_104_LN_Programa_Components_Tier_CreateTierWithMultipleContentAttributes() { #region Object Initialization bool stepstatus = true; CategoryFields product = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_Users_Program_Components_TiersPage = new Navigator_Users_Program_Components_TiersPage(DriverContext); var attributesPage = new Navigator_Users_Program_Components_AttributesPage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; #endregion try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Select the program application and verify the program configuration panel displayed stepName = "Select the program application and verify the program configuration panel displayed"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); testStep.SetOutput("Program configuration panel opened successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select the attributes application under components and verify and create a tier type attribute if not exists stepName = "Select the attributes application under components and verify and create a tier type attribute if not exists"; testStep = TestStepHelper.StartTestStep(testStep); var attName = WebsiteData.AttributeAllContentType; string attributeName = attName + Navigator_Users_Program_Components_AttributesPage.ContentTypes.Tier.ToString(); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Attributes); testStep.SetOutput(attributesPage.CreateNewAttribute(attributeName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Select the tier application under components and verify the tiers panel displayed stepName = "Select the tier application under components and verify the tiers panel displayed"; testStep = TestStepHelper.StartTestStep(testStep); Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Tiers); testStep.SetOutput("Tiers panel opened successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Create a new tier with extended attribute and verify it is present in the grid string TierName = CategoryFields.TierType.Tier_Defaults.ToString() + RandomDataHelper.RandomAlphanumericString(4); string attributeValue = attributeName + "_Value_" + RandomDataHelper.RandomAlphanumericString(4); stepName = "Create a new tier with extended attribute and verify it is present in the grid"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = navigator_Users_Program_Components_TiersPage.CreateTierWithAttributeAndVerify(TierName, attributeName, attributeValue, out string outMessage); testStep.SetOutput(outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_75_LN_VerifyFinishedWithErrorsMessageShownWhileMigratingProductImage() { #region Object Initialization bool stepstatus = true; CategoryFields product = new CategoryFields(); Migration Migration = new Migration(driverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var Program_RewardCatalogPage = new Navigator_Users_Program_RewardCatalogPage(DriverContext); var rewardCatlog_productImagePage = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext); product.CategoryName = WebsiteData.ProductCategoryName; product.Name = WebsiteData.ProductName; string imageName = Migration.MigrationSets.Migration_ProductImage.ToString() + RandomDataHelper.RandomString(5); string imageOrder = WebsiteData.ProductImageOrder; testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string Status = "FinishedWithErrors"; string stepName = ""; #endregion try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: Select the program application and verify the program configuration panel displayed stepName = "Select the program application and verify the program configuration panel displayed"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); testStep.SetOutput("Program configuration panel opened successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Click on reward catalog and verify product images tab displayed stepName = "Click on reward catalog and verify product images tab displayed"; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog); testStep.SetOutput("Reward catalog panel opened successfully with all the tabs including product image"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Click on product images tab and verify product images panel displayed stepName = "Click on product images tab and verify product images panel displayed"; testStep = TestStepHelper.StartTestStep(testStep); Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.ProductImages); testStep.SetOutput("Product images panel Openedsuccessfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Verify the existence of category and create category if doesn't exist stepName = "Verify the existence of category and create category if doesn't exist"; testStep = TestStepHelper.StartTestStep(testStep); rewardCatlog_productImagePage.VerifyCategoryExistanceAndCreateIfNotExists(product, out string outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Verify the existence of product and create product if doesn't exist stepName = "Verify the existence of product and create product if doesn't exist"; testStep = TestStepHelper.StartTestStep(testStep); rewardCatlog_productImagePage.VerifyProductExistanceAndCreateIfNotExists(product, out outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Click on create new product image button and verify new product image panel opened successfully stepName = "Click on create new product image button and verify new product image panel opened successfully"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = rewardCatlog_productImagePage.ClickOnCreateNewProductImageAndVerifyNewProductImagePanel(out outMessage); testStep.SetOutput(outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Create a new product image stepName = "Create a new product image"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = rewardCatlog_productImagePage.CreateProductImage(product, imageName, imageOrder, out outMessage); testStep.SetOutput(outMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Verify the product image displayed in the table stepName = "Verify the product image displayed in the Product Image Grid"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = rewardCatlog_productImagePage.VerifyProductImageExists(imageName); testStep.SetOutput("ProductImage :" + imageName + " in the Product Image Grid"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11: Switch to Migration Environment stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment; testStep = TestStepHelper.StartTestStep(testStep); navigator_UsersHomePage.Navigator_Users_SwitchEnvironment(); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12: Navigate to Migration Page and Delete Migration Set if any stepName = "Navigate to Migration Page and Delete Migration Set if any"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration); Navigator_MigrationPage MigrationPage = new Navigator_MigrationPage(DriverContext); Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_ProductImage.ToString() + "_" + DateHelper.GetDate("Current"); MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_ProductImage.ToString(), out string output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13: Create New Migration Set stepName = "Create New Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14: Edit Items and Generate Items stepName = "Edit Items and Generate Items"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2)); MigrationPage.SelectItemsForProductImage(imageName, out _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15: Initiate Migration Set stepName = "Initiate Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step16: Approve Migration Set stepName = "Approve Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step17: Run Migration Set stepName = "Run Now Migration Set"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step18: Verify that the Finished with Errors status is displayed while migrating the image to an environment that doesn't have the associated product stepName = "Verify that the Finished with Errors status is displayed while migrating the image to an environment that doesn't have the associated product"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.VerifyErrorStatusInMigrationPage(Migration.BuildMigrationSetName, Status, out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step19: "Verify The product no longer exists in the destination database error message while migrating product image"; stepName = "Verify The product with name " + imageName + " no longer exists in the destination database error message while migrating product image"; testStep = TestStepHelper.StartTestStep(testStep); MigrationPage.VerifyProductNoLongerExistsExceptionInMigrationViewItemsPage(Migration.BuildMigrationSetName, Status, out output, imageName); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step20: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }