public VirtualCard GenerateVirtualCardAboveMaxValues() { VirtualCard vc = new VirtualCard(); vc.LoyaltyIdNumber = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(255, 300)).ToString(); return(vc); }
public Member GenerateMemberBasicInfoWithAboveMaxValues() { Common common = new Common(DriverContext); Member member = new Member(); member.FirstName = "WEB" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(51, 100)) + "_" + NameGenerator.GenerateFirstName(Gender.Male); member.LastName = "WEB" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(51, 100)) + "_" + NameGenerator.GenerateFirstName(Gender.Male); member.MiddleName = "WEB" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(51, 100)) + "_" + NameGenerator.GenerateFirstName(Gender.Male); member.Username = "******" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(255, 300)); member.Password = "******"; member.PrimaryEmailAddress = "WEB" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(255, 300)) + "@test.com"; member.PrimaryPhoneNumber = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(26, 50)).ToString(); return(member); }
public MemberDetails GenerateMemberDetailsWithAboveMaxValues() { MemberDetails memberdetails = new MemberDetails(); memberdetails.AddressLineOne = "WEB_Address1_" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(101, 150)); memberdetails.AddressLineTwo = "WEB_Address2_" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(101, 150)); memberdetails.City = "Web_City_" + RandomDataHelper.RandomString(RandomDataHelper.RandomNumber(51, 100)); memberdetails.StateOrProvince = "Texas"; memberdetails.Country = "USA"; memberdetails.Gender = "Female"; memberdetails.ZipOrPostalCode = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(26, 50)).ToString(); memberdetails.MobilePhone = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(26, 50)).ToString(); memberdetails.HomePhone = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(26, 50)).ToString(); memberdetails.WorkPhone = RandomDataHelper.RandomNumber(RandomDataHelper.RandomNumber(26, 50)).ToString(); return(memberdetails); }
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_52_Navigator_Migrate_Coupon_VerifyDeselectOfIsGlobalFalgMigratedCorrectly() { #region Object Initialization CategoryFields coupon = new CategoryFields(); Migration Migration = new Migration(driverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); var couponData = 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); var navigator_Users_Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext); var navigator_CreateCoupon_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(DriverContext); string CouponName = Migration.MigrationCouponame; string randomStr = RandomDataHelper.RandomString(4); coupon.Name = CouponName + randomStr; coupon.CouponCode = ""; coupon.CategoryName = Migration.MigrationCouponCategoryName; coupon.StartDate = DateHelper.GetDate("Current"); coupon.ExpiryDate = DateHelper.GetDate("Future"); coupon.UsesAllowed = RandomDataHelper.RandomNumber(2).ToString(); coupon.CategoryTypeValue = CategoryFields.CategoryType.Coupon.ToString(); coupon.SetType = CategoryFields.Property.Name.ToString(); coupon.MultiLanguage = CategoryFields.Languages.English.ToString(); coupon.ChannelProperties = CategoryFields.Channel.Web.ToString(); coupon.IsGlobal = "unchecked"; 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 Category with Coupon if not Exists in Dev environment stepName = "Create new Category for " + coupon.CategoryTypeValue; testStep = TestStepHelper.StartTestStep(testStep); basePages.VerifyCategory_IfNotExistedCreateNew(ProjectBasePage.Env_value, coupon, CategoryFields.CategoryType.Coupon.ToString(), out string stepoutput); testStep.SetOutput(stepoutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create new Coupon in Dev environment stepName = "Create Coupon with a category " + coupon.CategoryTypeValue; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral); navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons); testStep.SetOutput(navigator_Users_Program_eCollateral_CouponsPage.CreateCoupon(coupon)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: 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 Step6:Create Category with Coupon if not Exists in QA environment stepName = "Create new Category as " + coupon.CategoryTypeValue + ", if not exists."; testStep = TestStepHelper.StartTestStep(testStep); bool CategoryAlreadyMigrated = true; if (!basePages.VerifyCategory_IfNotExistedCreateNew(Migration.MigrationEnvironment, coupon, CategoryFields.CategoryType.Coupon.ToString(), out stepoutput, true)) { CategoryAlreadyMigrated = false; } testStep.SetOutput(stepoutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: 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_Coupon_Default.ToString() + "_" + DateHelper.GetDate("Current"); _MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Coupon_Default.ToString(), out string output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: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 Step9: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.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2)); _MigrationPage.SelectItemsForCouponDef(CategoryAlreadyMigrated, coupon.CategoryName, coupon.Name, out _output); testStep.SetOutput(_output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: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 Step11: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 Step12: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 Step13:Verify Coupon Migrated on Coupon Page stepName = "Verify Coupon Migrated on Coupon Page"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral); navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons); navigator_Users_Program_eCollateral_CouponsPage.VerifyCreatedCoupon(coupon.SetType, coupon.Name, coupon.CategoryName); testStep.SetOutput(" Coupon :" + coupon.Name + " Migrated Successfully and Appeared on Coupon Page"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Verify the Is Global checkbox is unchecked stepName = "Verify the Is Global checkbox is unchecked"; testStep = TestStepHelper.StartTestStep(testStep); if (!navigator_Users_Program_eCollateral_CouponsPage.VerifyISGlobalCheckedorNot(coupon.Name)) { testStep.SetOutput("Global checkbox is unchecked for the coupon: " + coupon.Name); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15:Verify Coupon Category Migrated on Categories Page stepName = "Verify Coupon Category Migrated on Categories Page"; testStep = TestStepHelper.StartTestStep(testStep); if (!basePages.VerifyCategory_IfNotExistedCreateNew(Migration.MigrationEnvironment, coupon, CategoryFields.CategoryType.Coupon.ToString(), out stepoutput, true)) { throw new Exception("Failed to Migrate Category:" + Migration.MigrationCouponCategoryName); } testStep.SetOutput(stepoutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step16: 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); } }