Пример #1
0
        public void  corpResidualIncomeCalWizardUrlChange()
        {
            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_ResidualIncome_ImportHelper = new CorpResidualIncome_ImportHelper(GetWebDriver());


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

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

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

                executionLog.Log("CorpResidualIncomeCalWizardUrlChange", "Go To Resisual Income ");
                VisitCorp("rir/imports");

                executionLog.Log("CorpResidualIncomeCalWizardUrlChange", "Click On any Calculation wizard  ");
                corp_ResidualIncome_ImportHelper.ClickElement("ClickOnCalculationwizard");
                corp_ResidualIncome_ImportHelper.WaitForWorkAround(2000);

                executionLog.Log("CorpResidualIncomeCalWizardUrlChange", "Change the url with the url number of another Corp");
                VisitCorp("rir/file_wizard/1016");

                executionLog.Log("CorpResidualIncomeCalWizardUrlChange", "Verify Validation");
                corp_ResidualIncome_ImportHelper.WaitForText("oops something went wrong.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CorpResidualIncomeCalWizardUrlChange");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("CorpResidual Income Cal Wizard UrlChange");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("CorpResidual Income Cal Wizard UrlChange", "Bug", "Medium", "Corp Residual income page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("CorpResidual Income Cal Wizard UrlChange");
                        TakeScreenshot("CorpResidualIncomeCalWizardUrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpResidualIncomeCalWizardUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CorpResidualIncomeCalWizardUrlChange");
                        string id            = loginHelper.getIssueID("CorpResidual Income Cal Wizard UrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpResidualIncomeCalWizardUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("CorpResidual Income Cal Wizard UrlChange"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("CorpResidual Income Cal Wizard UrlChange");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CorpResidualIncomeCalWizardUrlChange");
                executionLog.WriteInExcel("CorpResidual Income Cal Wizard UrlChange", Status, JIRA, "Corp Residual income");
            }
        }
Пример #2
0
        public void deletePublihedFileRI()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var corpResidualIncome_ImportHelper = new CorpResidualIncome_ImportHelper(GetWebDriver());

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


            // Variable.
            var    FileName = GetPathToFile() + "FDN_Samples.csv";
            String JIRA     = "";
            String Status   = "Pass";

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

                executionLog.Log("DeletePublihedFileRI", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("DeletePublihedFileRI", "Click on Import");
                VisitCorp("rir/imports");
                corpResidualIncome_ImportHelper.WaitForWorkAround(4000);

                executionLog.Log("DeletePublihedFileRI", "Verify Page title");
                VerifyTitle("Residual Income - Imports");

                executionLog.Log("DeletePublihedFileRI", "Click On Import New button");
                corpResidualIncome_ImportHelper.ClickElement("ImportNew");
                corpResidualIncome_ImportHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePublihedFileRI", "Verify Page title");
                VerifyTitle("Residual Income - Import New");

                executionLog.Log("DeletePublihedFileRI", "Select Processor");
                corpResidualIncome_ImportHelper.SelectByText("ProcessorType", "First Data Omaha");
                corpResidualIncome_ImportHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePublihedFileRI", "Select Reporting Period");
                corpResidualIncome_ImportHelper.SelectByText("ReportingPeriod", "October");
                //corpResidualIncome_ImportHelper.WaitForWorkAround(5000);

                executionLog.Log("DeletePublihedFileRI", "Click on File Date");
                corpResidualIncome_ImportHelper.ClickElement("FileDate");

                executionLog.Log("DeletePublihedFileRI", "Click on date");
                corpResidualIncome_ImportHelper.ClickElement("ClickDate");

                corpResidualIncome_ImportHelper.Upload("SelectBrowseCSVFile", FileName);
                corpResidualIncome_ImportHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePublihedFileRI", "Click on Import");
                corpResidualIncome_ImportHelper.ClickElement("Import");

                executionLog.Log("DeletePublihedFileRI", " Select Processor Filter");
                corpResidualIncome_ImportHelper.Select("ProcessorFiler", "First Data Omaha");
                corpResidualIncome_ImportHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePublihedFileRI", "Select Filter FileFormat");
                corpResidualIncome_ImportHelper.Select("FilterFileFormat", "First Data Omaha");
                corpResidualIncome_ImportHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePublihedFileRI", "Enter Filter File name");
                corpResidualIncome_ImportHelper.TypeText("FileName", "FDN_Samples");

                executionLog.Log("DeletePublihedFileRI", "Select Status");
                corpResidualIncome_ImportHelper.Select("SelectStatus", "Imported");
                corpResidualIncome_ImportHelper.WaitForWorkAround(4000);

                executionLog.Log("DeletePublihedFileRI", "Click on calculation.");
                corpResidualIncome_ImportHelper.ClickElement("ClickOnCalculation");

                executionLog.Log("DeletePublihedFileRI", "Wait for success message");
                corpResidualIncome_ImportHelper.WaitForText("Calculation Wizard for", 10);
                corpResidualIncome_ImportHelper.WaitForWorkAround(10000);

                executionLog.Log("DeletePublihedFileRI", "Click on Skip this step");
                corpResidualIncome_ImportHelper.ClickOnDisplayed("SkipStep");
                corpResidualIncome_ImportHelper.WaitForWorkAround(10000);

                executionLog.Log("DeletePublihedFileRI", "Click on Calculate pauout");
                corpResidualIncome_ImportHelper.ClickOnDisplayed("CalculatePayouts");
                corpResidualIncome_ImportHelper.WaitForWorkAround(10000);

                executionLog.Log("DeletePublihedFileRI", "Click on Calculate pauout");
                corpResidualIncome_ImportHelper.ClickOnDisplayed("PublishPayout");
                corpResidualIncome_ImportHelper.WaitForWorkAround(10000);

                executionLog.Log("DeletePublihedFileRI", " Select Processor Filer");
                corpResidualIncome_ImportHelper.Select("ProcessorFiler", "First Data Omaha");

                executionLog.Log("DeletePublihedFileRI", "Select Filter FileFormat");
                corpResidualIncome_ImportHelper.Select("FilterFileFormat", "First Data Omaha");

                executionLog.Log("DeletePublihedFileRI", "Enter file name");
                corpResidualIncome_ImportHelper.TypeText("FileName", "FDN_Samples");

                executionLog.Log("DeletePublihedFileRI", "Select Status");
                corpResidualIncome_ImportHelper.Select("SelectStatus", "Published");

                executionLog.Log("DeletePublihedFileRI", "Click Delete Payout");
                corpResidualIncome_ImportHelper.ClickOnDisplayed("DeletePublished");
                corpResidualIncome_ImportHelper.AcceptAlert();

                executionLog.Log("DeletePublihedFileRI", "Verify text File deleted successfully");
                corpResidualIncome_ImportHelper.WaitForText("File deleted successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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