Example #1
0
        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 BTA573_Navigator_GenerateAssembly()
        {
            ProjectBasePage basePages  = new ProjectBasePage(driverContext);
            MethodBase      method     = MethodBase.GetCurrentMethod();
            string          methodName = method.Name;

            testCase        = new TestCase(methodName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName  = "";
            string stroutput = "";

            try
            {
                #region Pre-Conditions
                Application_Nav_Util_Page  Model = new Application_Nav_Util_Page(DriverContext);
                Navigator_GenerateAssembly nav_GenerateAssembly = new Navigator_GenerateAssembly(DriverContext);
                string assemblyDev    = basePages.ConfigDownloadPath + @"\" + ProjectBasePage.Orgnization_value + ".zip";
                string assemblyXsd    = basePages.ConfigDownloadPath + @"\XSD.zip";
                string assemblyJava   = basePages.ConfigDownloadPath + @"\LWIntgr-Java.zip";
                string assemblyDotnet = basePages.ConfigDownloadPath + @"\LWIntgr-DotNet.zip";
                basePages.DeleteExistedFile(assemblyDev);
                basePages.DeleteExistedFile(assemblyXsd);
                basePages.DeleteExistedFile(assemblyJava);
                basePages.DeleteExistedFile(assemblyDotnet);
                #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 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:Generate Assembly
                stepName = "Generate Assembly in Navigator";
                testStep = TestStepHelper.StartTestStep(testStep);
                Model.OpenApplication(NavigatorEnums.ApplicationName.model);
                nav_GenerateAssembly.GenerateAssembly(out stroutput);
                testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Generate dot net client Assembly
                stepName = "Generate dot net client Assembly in Navigator";
                testStep = TestStepHelper.StartTestStep(testStep);
                Model.OpenApplication(NavigatorEnums.ApplicationName.model);
                nav_GenerateAssembly.GenerateDotNetClientAssembly(out stroutput);
                testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Generate java client Assembly
                stepName = "Generate java client Assembly in Navigator";
                testStep = TestStepHelper.StartTestStep(testStep);
                Model.OpenApplication(NavigatorEnums.ApplicationName.model);
                nav_GenerateAssembly.GenerateJavaClientAssembly(out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Generate XSD client Assembly
                stepName = "Generate XSD client Assembly in Navigator";
                testStep = TestStepHelper.StartTestStep(testStep);
                Model.OpenApplication(NavigatorEnums.ApplicationName.model);
                nav_GenerateAssembly.GenerateXSDClientAssembly(out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Verify Assembly downloaded
                stepName = "Verify Dev Assembly downloaded";
                testStep = TestStepHelper.StartTestStep(testStep);
                Thread.Sleep(3000);//This is exclusive to wait for the download time
                basePages.VerifyExistedorDownloadedFile(assemblyDev, "BTADEV File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Verify DotNet Assembly downloaded
                stepName = "Verify DotNet Assembly downloaded";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.VerifyExistedorDownloadedFile(assemblyDotnet, "DotNet File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9:Verify Java Assembly downloaded
                stepName = "Verify Java Assembly downloaded";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.VerifyExistedorDownloadedFile(assemblyJava, "Java File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10:Verify XSD Assembly downloaded
                stepName = "Verify XSD Assembly downloaded";
                testStep = TestStepHelper.StartTestStep(testStep);
                Thread.Sleep(10000);
                basePages.VerifyExistedorDownloadedFile(assemblyXsd, "XSD File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11: 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 BTA81_Navigator_GenerateKeys()
        {
            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 = "";

            try
            {
                #region :OrderExection Requirement
                string Prereq_testCase = "BTA79_Navigator_CreateKEYAdminUser_And_Login_With_KEYAdminUser";
                ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep);
                #endregion

                #region Step1:Verify Key Files Existed ,If Existed Delete Existed Files
                stepName = "Delete Existed Keystore.dat Files  and SymmetricKeystore.dat from :" + basePages.ConfigDownloadPath;
                testStep = TestStepHelper.StartTestStep(testStep);

                string keyStorefile      = basePages.ConfigDownloadPath + @"\Keystore.dat";
                string symmetricKeystore = basePages.ConfigDownloadPath + @"\SymmetricKeystore.dat";
                basePages.DeleteExistedFile(keyStorefile);
                basePages.DeleteExistedFile(symmetricKeystore);
                stepOutput = "Existed Keystore.dat Files  and SymmetricKeystore.dat from :" + basePages.ConfigDownloadPath + " Deleted Successfully"; testStep.SetOutput(stepOutput);
                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 stepOutput); testStep.SetOutput(stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Login As Key Admin User
                stepName = "Login As Key Admin User and Navigate to Keys Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_KeyUser_HomePage = new Navigator_KeysHomePage(DriverContext);
                var navigator_MangeKeysPage    = new Navigator_ManageKeysPage(DriverContext);
                login.UserName = NavigatorUsers.KEYUser;
                login.Password = NavigatorUsers.KEYUser_Password;
                navigator_LoginPage.Login(login, Users.AdminRole.KEY.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                navigator_KeyUser_HomePage.NavigatetoMangeKeys_Page(out stepName);
                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:Generate Keys file Symmetric Key file with valid Password details and Export
                stepName = "Generate Keys file  Symmetric Key file with valid Password details and Export";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_MangeKeysPage.EnterKeyStorePassword("Password1*", "512", out stepOutput); string Output1 = stepOutput;
                navigator_MangeKeysPage.ExportPrivateKey(keyStorefile, out stepOutput); string             Output2 = stepOutput;
                navigator_MangeKeysPage.ExportSymmetrickey(symmetricKeystore, out stepOutput); string      Output3 = stepOutput; testStep.SetOutput(";" + Output1 + ".;" + Output2 + ".;" + Output3);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: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 Step7: Copy Keystore file
                stepName = "Copy Keystore file to Config folder";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.CopyFile(keyStorefile, basePages.ConfigUploadPath + @"\Keystore.dat");
                basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\Keystore.dat", "Keystore.dat File uploaded Successfully to config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Copy SymmetricKeystore file
                stepName = "Copy SymmetricKeystore file to Config folder";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.CopyFile(symmetricKeystore, basePages.ConfigUploadPath + @"\SymmetricKeystore.dat");
                basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\SymmetricKeystore.dat", "SymmetricKeystore.dat File uploaded Successfully to config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: 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.SetOutput(stepName + e);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, 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 BTA83_Navigator_GenerateFrameworkCfgFile()
        {
            #region Object declaration
            string          configPath       = BnPBaseFramework.Web.Helpers.FilesHelper.GetFolder(BaseConfiguration.DownloadFolder, Directory.GetCurrentDirectory());
            ProjectBasePage basePages        = new ProjectBasePage(driverContext);
            string          FrameworkCfgFile = basePages.ConfigDownloadPath + @"\Framework.cfg";
            basePages.DeleteExistedFile(FrameworkCfgFile);
            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 = "";
            #endregion
            try
            {
                #region OrderExection Requirement
                string Prereq_testCase = "BTA79_Navigator_CreateAdminUser_And_Login_With_AdminUser";
                ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep);
                #endregion

                #region Object initilization
                var loginPage = new Navigator_LoginPage(DriverContext);
                var manageOrganizationPage    = new Navigator_Orgnizations_FrameworkConfigurationPage(DriverContext);
                var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext);
                var organizationPage          = new Navigator_Admin_OrganizationsPage(driverContext);
                #endregion

                #region Step1: Open Navigator URL
                stepName = "Open Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                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 to navigator using ADMIN
                stepName       = "Login to navigator using ADMIN";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.AdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                loginPage.Login(login, Users.AdminRole.LWADM.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3: Navigate to organization page
                stepName = "Navigate to organization page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.organization); testStep.SetOutput("Successfully navigated to Organization page");
                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);
                manageOrganizationPage.DrillDownOrg(out string Message);
                manageOrganizationPage.SelectEnvironment(out string Message1); testStep.SetOutput(Message + ";" + Message1);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Navigate to Framework Configuration tab
                stepName = "Select Organization and Environment";
                testStep = TestStepHelper.StartTestStep(testStep);
                organizationPage.NavigateToOrganizationsTabs(Navigator_Admin_OrganizationsPage.OrganizationsTabs.FrameworkConfiguration, out Message); testStep.SetOutput(Message + ";" + Message);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Update changes to the framework configuration page and file
                stepName = "Update changes to the framework configuration page and file";
                testStep = TestStepHelper.StartTestStep(testStep);
                manageOrganizationPage.ExportFrameworkCfgFile(FrameworkCfgFile);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Copy framework configuration file to configuration path
                stepName = "Copy framework configuration file to configuration path";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.CreateOrVerfiyConfigFolder();
                File.Copy(FrameworkCfgFile, basePages.ConfigUploadPath + @"\Framework.cfg", true);
                basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\Framework.cfg", "Framework.cfg File uploaded Successfully in config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Logout from USER page
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                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);
                if (!OrderTest_Status.Contains("true"))
                {
                    Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                }
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }