Exemplo n.º 1
0
        public void pricingPlan()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var corpMasterdata_PricingPlanHelper = new CorpMasterdata_PricingPlanHelper(GetWebDriver());

            username = oXMLData.getData("settings/Credentials", "username_corp");
            password = oXMLData.getData("settings/Credentials", "password");

            // Variable
            var name       = "Test" + RandomNumber(99, 999);
            var Test       = "New" + RandomNumber(99, 999);
            var Editedname = "New Name" + RandomNumber(1, 999);

            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("PricingPlan", "Login with valid credential  Username");
                Login(username[0], password[0]);

                executionLog.Log("PricingPlan", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("CreatePricingPlan", "Redirect at create page.");
                VisitCorp("masterdata/manage_pricing_plans");
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("PricingPlan", "Verify Page title");
                VerifyTitle("Manage Master Pricing Plans");

                executionLog.Log("CreatePricingPlan", "Enter Pricing plan name");
                corpMasterdata_PricingPlanHelper.TypeText("PricingPlan", name);

                executionLog.Log("CreatePricingPlan", "Enter Processor Code");
                corpMasterdata_PricingPlanHelper.SelectByText("SelectProcessor", "First Data Omaha");

                executionLog.Log("CreatePricingPlan", "Click On Save Btn");
                corpMasterdata_PricingPlanHelper.ClickElement("Save");
                //corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("CreatePricingPlan", "Wait for success message.");
                corpMasterdata_PricingPlanHelper.WaitForText("The pricing plan is successfully created!!", 10);
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(2000);

                executionLog.Log("PricingPlan", "Search Pricing plan by name.");
                corpMasterdata_PricingPlanHelper.TypeText("SearchPricingPlan", name);
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("PricingPlan", "Click on Edit");
                corpMasterdata_PricingPlanHelper.ClickElement("ClickOnEdit");
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("PricingPlan", "Enter Processor name");
                corpMasterdata_PricingPlanHelper.TypeText("PricingPlan", Editedname);

                executionLog.Log("CreatePricingPlan", "Enter Processor Code");
                corpMasterdata_PricingPlanHelper.SelectByText("SelectProcessor", "First Data Omaha");

                executionLog.Log("PricingPlan", "Click Save");
                corpMasterdata_PricingPlanHelper.ClickElement("Save");
                //corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("PricingPlan", "Verify text present");
                corpMasterdata_PricingPlanHelper.WaitForText("The pricing plan is successfully updated!!", 50);
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(2000);

                executionLog.Log("PricingPlan", "Search");
                corpMasterdata_PricingPlanHelper.TypeText("SearchPricingPlan", Editedname);
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("PricingPlan", "Click to Delete pricing");
                corpMasterdata_PricingPlanHelper.ClickElement("DeletePricing");

                executionLog.Log("PricingPlan", "Click ok to confirm");
                corpMasterdata_PricingPlanHelper.AcceptAlert();

                executionLog.Log("PricingPlan", "Verify page text");
                corpMasterdata_PricingPlanHelper.WaitForText("The pricing plan is successfully deleted!!", 40);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PricingPlan");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Pricing Plan");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Pricing Plan", "Bug", "Medium", "Pricing page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Pricing Plan");
                        TakeScreenshot("PricingPlan");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PricingPlan.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PricingPlan");
                        string id            = loginHelper.getIssueID("Pricing Plan");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PricingPlan.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Pricing Plan"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Pricing Plan");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PricingPlan");
                executionLog.WriteInExcel("Pricing Plan", Status, JIRA, "Corp Master Data");
            }
        }
        public void corpMasterDataPricingPlanUrlChange()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_corp");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var corp_MasterData_PricingPlanHelper = new CorpMasterdata_PricingPlanHelper(GetWebDriver());


            // Variable
            var    FirstName = "Test" + GetRandomNumber();
            var    LastName  = "Tester" + GetRandomNumber();
            var    Number    = "12345678" + GetRandomNumber();
            String JIRA      = "";
            String Status    = "Pass";

            try
            {
                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Go To Corp Master Data >> Pricing Plan");
                VisitCorp("masterdata/pricing_plans");
                corp_MasterData_PricingPlanHelper.WaitForWorkAround(3000);

                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Click On any Pricing Plan");
                corp_MasterData_PricingPlanHelper.ClickElement("ClickOnMasterPricingPlan");
                corp_MasterData_PricingPlanHelper.WaitForWorkAround(2000);

                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Change the url with the url number of another Corp");
                VisitCorp("masterdata/manage_pricing_plans/107");
                corp_MasterData_PricingPlanHelper.WaitForWorkAround(1000);

                executionLog.Log("CorpMasterDataPricingPlanUrlChange", "Verify Validation");
                corp_MasterData_PricingPlanHelper.WaitForText("The pricing plan is does not exists.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CorpMasterDataPricingPlanUrlChange");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Corp Master Data Pricing Plan Url Change");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Corp Master Data Pricing Plan Url Change", "Bug", "Medium", "Master Data Corp page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Corp Master Data Pricing Plan Url Change");
                        TakeScreenshot("CorpMasterDataPricingPlanUrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpMasterDataPricingPlanUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CorpMasterDataPricingPlanUrlChange");
                        string id            = loginHelper.getIssueID("Corp Master Data Pricing Plan Url Change");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpMasterDataPricingPlanUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Corp Master Data Pricing Plan Url Change"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Corp Master Data Pricing Plan Url Change");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CorpMasterDataPricingPlanUrlChange");
                executionLog.WriteInExcel("Corp Master Data Pricing Plan Url Change", Status, JIRA, "Corp Master Data");
            }
        }
        public void verifyingPricingPlanPushtoOfficeError()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var corpMasterdata_PricingPlanHelper = new CorpMasterdata_PricingPlanHelper(GetWebDriver());

            username = oXMLData.getData("settings/Credentials", "username_corp");
            password = oXMLData.getData("settings/Credentials", "password");

            // Variable random
            var    name   = "Test" + GetRandomNumber();
            var    Test   = "New" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Login with valid credential  Username");
                Login(username[0], password[0]);

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Procing plan page");
                VisitCorp("masterdata/pricing_plans");
                VerifyTitle("Master Pricing Plans");

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Click On Push Office");
                corpMasterdata_PricingPlanHelper.ClickElement("PushOffice");
                corpMasterdata_PricingPlanHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Click Ok to Accept alert.");
                corpMasterdata_PricingPlanHelper.AcceptAlert();

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Verify 500 Interanl error not occured.");
                corpMasterdata_PricingPlanHelper.VerifyTextNotPresent("500 Internal Server Error");

                executionLog.Log("VerifyingPricingPlanPushtoOfficeError", "Verify Success message for push to office");
                corpMasterdata_PricingPlanHelper.WaitForText("Pricing Plans successfully pushed to offices.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyingPricingPlanPushtoOfficeError");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Pricing Plan Push to office error");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Pricing Plan Push to office error", "Bug", "Medium", "Corp Pricing plan page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Create Pricing Plan");
                        TakeScreenshot("VerifyingPricingPlanPushtoOfficeError");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyingPricingPlanPushtoOfficeError.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyingPricingPlanPushtoOfficeError");
                        string id            = loginHelper.getIssueID("Verify Pricing Plan Push to office error");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyingPricingPlanPushtoOfficeError.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Pricing Plan Push to office error"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Pricing Plan Push to office error");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyingPricingPlanPushtoOfficeError");
                executionLog.WriteInExcel("Verify Pricing Plan Push to Office error", Status, JIRA, "Corp Master Data");
            }
        }
Exemplo n.º 4
0
        public void pushToOffice()
        {
            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var corpMasterdata_LanguageHelper = new CorpMasterdata_LanguageHelper(GetWebDriver());
            var loginHelper = new LoginHelper(GetWebDriver());
            var corpMasterdata_MerchantTypeHelper  = new CorpMasterdata_MerchantTypeHelper(GetWebDriver());
            var corpMasterData_AmexRateHelper      = new CorpMasterData_AmexRateHelper(GetWebDriver());
            var corpMasterdata_OmahaAuthGridHelper = new CorpMasterdata_OmahaAuthGridHelper(GetWebDriver());
            var corpMasterdata_PricingPlanHelper   = new CorpMasterdata_PricingPlanHelper(GetWebDriver());

            string[] username = null;
            string[] password = null;
            username = oXMLData.getData("settings/Credentials", "username_corp");
            password = oXMLData.getData("settings/Credentials", "password");

            // Variable
            var    Num    = RandomNumber(1, 9999).ToString();
            var    Nam    = "New" + GetRandomNumber();
            var    name   = "Test" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("PushToOffice", "Login with valid credential");
                Login(username[0], password[0]);

                executionLog.Log("PushToOffice", "Verify Page title");
                VerifyTitle("Dashboard");
                corpMasterdata_LanguageHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLanguageCorp", "Redirect To Language");
                VisitCorp("languages");
                corpMasterdata_LanguageHelper.WaitForWorkAround(3000);

                executionLog.Log("PushToOffice", "Verify Page title");
                VerifyTitle("Languages");

                executionLog.Log("LanguagePushToOffice", "Click on Push To Office");
                corpMasterdata_LanguageHelper.ClickElement("PushToOfficeLang");

                executionLog.Log("LanguagePushToOffice", "Click ok To Confirm");
                corpMasterdata_LanguageHelper.AcceptAlert();

                executionLog.Log("LanguagePushToOffice", "Verify Confirmation Languges Successfully Pushed to Offices.");
                corpMasterdata_LanguageHelper.WaitForText("Languges Successfully Pushed to Offices.", 30);

                executionLog.Log("CreateMerchnatType", "Redirect to marchant type page");
                VisitCorp("masterdata/merchant_types");
                corpMasterdata_LanguageHelper.WaitForWorkAround(3000);

                executionLog.Log("PushToOffice", "Verify Page title");
                VerifyTitle("Master Merchant Types");

                executionLog.Log("CreateMerchnatType", "Click On Push Office");
                corpMasterdata_MerchantTypeHelper.ClickElement("PushOffice");

                executionLog.Log("LanguagePushToOffice", "Click ok To Confirm");
                corpMasterdata_MerchantTypeHelper.AcceptAlert();

                executionLog.Log("CreateOmahaAuthGrid", "Redirect To URL");
                VisitCorp("masterdata/omaha_auth_grids");
                corpMasterdata_LanguageHelper.WaitForWorkAround(3000);

                executionLog.Log("PushToOffice", "Verify Page title");
                VerifyTitle("Corporate Master Omaha Auth Grids");

                executionLog.Log("OmahaAuthGridPushToOffice", "Push To Office");
                corpMasterdata_OmahaAuthGridHelper.ClickElement("PushToOffice");

                executionLog.Log("OmahaAuthGridPushToOffice", "Click ok To Confirm");
                corpMasterdata_OmahaAuthGridHelper.AcceptAlert();

                executionLog.Log("OmahaAuthGridPushToOffice", "Verify Confirmation Languges Successfully Pushed to Offices.");
                corpMasterdata_OmahaAuthGridHelper.WaitForText("Omaha Auth Grids successfully pushed to offices.", 40);

                executionLog.Log("PricingPlanPushToOffice", "Procing plan page");
                VisitCorp("masterdata/pricing_plans");
                corpMasterdata_LanguageHelper.WaitForWorkAround(3000);

                executionLog.Log("PushToOffice", "Verify Page title");
                VerifyTitle("Master Pricing Plans");

                executionLog.Log("PricingPlanPushToOffice", "Click On Push Office");
                corpMasterdata_PricingPlanHelper.ClickElement("PushOffice");

                executionLog.Log("PushToOffice", "Accept alert message.");
                corpMasterdata_PricingPlanHelper.AcceptAlert();

                executionLog.Log("PushToOffice", "Wait for success message.");
                corpMasterdata_PricingPlanHelper.WaitForText("Pricing Plans successfully pushed to offices.", 40);
            }

            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PushToOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Push To Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Push To Office", "Bug", "Medium", "Master Data page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Push To Office");
                        TakeScreenshot("PushToOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PushToOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PushToOffice");
                        string id            = loginHelper.getIssueID("Push To Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PushToOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Push To Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Push To Office");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PushToOffice");
                executionLog.WriteInExcel("Push To Office", Status, JIRA, "Corp Master Data");
            }
        }