public void BTA_165_Navigator_Migrate_Website() { #region Object Initialization Migration Migration = new Migration(driverContext); var Website_Modules = new Navigator_Users_Website_ModulesPage(DriverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); var websitePage = new Navigator_Users_WebsitePage(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_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(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, 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 Member portal website if it does not exists stepName = "Navigate to Website application and Create org_env_MP website if it does not exists "; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website); Portal portalMP = new Portal { WebSiteName = WebsiteData.MemberPortal_WebSiteName, WebSiteType = Navigator_Users_WebsitePage.PortalType.MP.ToString(), DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.MemberFacing.ToString() }; testStep.SetOutput(websitePage.Create_MP(portalMP)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Search and Drag Account Status Attribute name into CFUpdateProfile_Config Configuration file stepName = "Search and Drag Account Status Attribute name into CFUpdateProfile_Config Configuration file "; testStep = TestStepHelper.StartTestStep(testStep); websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg); var webSiteName = WebsiteData.MemberPortal_WebSiteName; var moduleType = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.MemberProfile); Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType); AttributeSet attribute = new AttributeSet(); string source = "Account Status", target = "SmsOptIn"; testStep.SetOutput(Website_Modules.AddAttributeInCFUpdateProfile_Config(source, target)); Website_Modules.SaveConfigSetting(); 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:Verify Website Module In QA Env and Delete existing stepName = "Verify Website Module In QA Env and Delete existing"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website); websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg_Outpu); Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType); string stepOutput = Website_Modules.VerifyAttributeInQAEnv(source); testStep.SetOutput(stepOutput); if (stepOutput.Equals(source + " is exists in CFUpdateProfile_Config file")) { Website_Modules.DeleteAttributeFromFile(source); } 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 isf 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_Website_Set.ToString(); _MigrationPage.DeleteIfMigrationSetExists(Migration.BuildMigrationSetName, 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); Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Website_Set.ToString() + "_" + DateHelper.GetDate("Current"); _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)); string ModuleName = "BrierleyPortal:MemberProfile:CFUpdateProfile_Config"; _MigrationPage.SelectItemsForWebsiteModuleMigration(ModuleName, 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 Website Module Migrated with Added attribute name in CFUpdateProfile_Config file stepName = "Verify Website Module Migrated with Added attribute name in CFUpdateProfile_Config file"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website); websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg1); Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType); testStep.SetOutput(Website_Modules.VerifyAttributeInQAEnv("Account Status")); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14: 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 BTA86_Navigator_Create_CSPortal_MemberPortal() { #region :OrderExection Requirement MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string Prereq_testCase1 = "BTA84_Navigator_CreateUserWithAllPermissions"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep); #endregion var navigator_LoginPage = new Navigator_LoginPage(DriverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); testStep = new TestStep(); string stepName = ""; try { #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 = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; 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); 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 Step 4 : Create CS portal website stepName = "Navigate to Website application and Create org_env_CS website"; var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext); var websitePage = new Navigator_Users_WebsitePage(driverContext); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website); Portal portal = new Portal { WebSiteName = WebsiteData.CSPortal_WebSiteName, WebSiteType = Navigator_Users_WebsitePage.PortalType.CS.ToString(), DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.CSDefaultSkin.ToString() }; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(websitePage.Create_CS(portal)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 5 : Create Member portal website stepName = "Navigate to Website application and Create org_env_MP website"; Portal portalMP = new Portal { WebSiteName = WebsiteData.MemberPortal_WebSiteName, WebSiteType = Navigator_Users_WebsitePage.PortalType.MP.ToString(), DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.MemberFacing.ToString() }; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(websitePage.Create_MP(portalMP)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); 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(); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }