public void sendEmailFromActivity()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var    executionLog = new ExecutionLog();
            var    loginHelper  = new LoginHelper(GetWebDriver());
            var    officeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());
            var    SendTo = "Test" + RandomNumber(1, 99) + "@yopmail.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("SendEmailFromActivity", "Redirect to URL");
                VisitOffice("mails/compose");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("SendEmailFromActivity", "Enter email in 'To' Field");
                officeActivities_EmailHelper.TypeText("To", SendTo);

                executionLog.Log("SendEmailFromActivity", "Enter CC");
                officeActivities_EmailHelper.TypeText("EnterCCMuliple", "[email protected],[email protected],[email protected]");
                //officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("SendEmailFromActivity", "Enter Subject ");
                officeActivities_EmailHelper.TypeText("Subject", "This is Subject");
                //officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("SendEmailFromActivity", "Click send Button");
                officeActivities_EmailHelper.ClickElement("ClickSendBtn");

                executionLog.Log("SendEmailFromActivity", "Verify Email sent successfully");
                officeActivities_EmailHelper.WaitForText("E-Mail Sent Successfully.", 15);

                executionLog.Log("SendEmailFromActivity", "Redirect to URL");
                VisitOffice("mails/sent");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("SendEmailFromActivity", "Verify page title");
                VerifyTitle("Sent");

                executionLog.Log("SendEmailFromActivity", "Enter Send to in search ");
                officeActivities_EmailHelper.TypeText("SearchMailInput", SendTo);

                executionLog.Log("SendEmailFromActivity", "Click on search btn");
                officeActivities_EmailHelper.ClickElement("SearchBtn");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("SendEmailFromActivity", "Select searched email.");
                officeActivities_EmailHelper.ClickElement("CheckBox1");

                executionLog.Log("SendEmailFromActivity", "Click on delete btn");
                officeActivities_EmailHelper.ClickElement("Delete");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("SendEmailFromActivity", "Verify Email Deleted successfully");
                officeActivities_EmailHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());
            var office_LeadsHelper           = new Office_LeadsHelper(GetWebDriver());

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

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

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

                executionLog.Log("LeadsEmailUrlChange", "Go to Leads page");
                VisitOffice("leads");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Click On Send Email");
                office_LeadsHelper.ClickElement("SendEmail");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter Email Id");
                officeActivities_EmailHelper.TypeText("Sendto", SendTo);
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter  Subject");
                officeActivities_EmailHelper.TypeText("EmailName", "Email Subject");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on Send button");
                officeActivities_EmailHelper.ClickElement("SendEmailActivity");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                //executionLog.Log("LeadsEmailUrlChange", "Wait for element to present.");
                //officeActivities_EmailHelper.WaitForText("Description", 10);

                executionLog.Log("LeadsEmailUrlChange", "Select Activity >> Emails");
                officeActivities_EmailHelper.Select("SelectActivityType", "E-Mails");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Click On E-mail");
                officeActivities_EmailHelper.PressEnter("ClickOnNoteOppSubj");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Change the url with the url number of another office");
                VisitOffice("mails/view/57");
                officeActivities_EmailHelper.WaitForWorkAround(4000);

                executionLog.Log("LeadsEmailUrlChange", "Verify Validation");
                officeActivities_EmailHelper.WaitForText("You don't have privileges to view this E-Mail.", 10);
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Redirect to URL");
                VisitOffice("mails/sent");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Verify page title");
                VerifyTitle("Sent");
                //officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter Send to in search ");
                officeActivities_EmailHelper.TypeText("SearchMailInput", SendTo);
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on search btn");
                officeActivities_EmailHelper.ClickElement("SearchBtn");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Select searched email.");
                officeActivities_EmailHelper.ClickJS("CheckBox1");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on delete btn");
                officeActivities_EmailHelper.ClickElement("Delete");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Verify Email Deleted successfully");
                officeActivities_EmailHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 05);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var    executionLog = new ExecutionLog();
            var    loginHelper  = new LoginHelper(GetWebDriver());
            var    OfficeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ForwardEmailFromSent", "Redirect to URL");
                VisitOffice("mails/compose");

                executionLog.Log("ForwardEmailFromSent", "Enter details in to field.");
                OfficeActivities_EmailHelper.TypeText("To", "*****@*****.**");

                executionLog.Log("ForwardEmailFromSent", "Enter Subject ");
                OfficeActivities_EmailHelper.TypeText("EmailName", "This is Subject");

                executionLog.Log("ForwardEmailFromSent", "Click Send Button");
                OfficeActivities_EmailHelper.ClickElement("Send");

                executionLog.Log("ForwardEmailFromSent", "Verify Email sent successfully");
                OfficeActivities_EmailHelper.WaitForText("E-Mail Sent Successfully.", 10);

                executionLog.Log("ForwardEmailFromSent", "Redirect Mails");
                VisitOffice("mails/sent");
                OfficeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("ForwardEmailFromSent", "Click On Sent To Forward");
                OfficeActivities_EmailHelper.ClickElement("ClickAnyEmail");
                OfficeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("ForwardEmailFromSent", "Click on Forward");
                OfficeActivities_EmailHelper.ClickElement("ClickOnForward");
                OfficeActivities_EmailHelper.WaitForWorkAround(4000);

                executionLog.Log("ForwardEmailFromSent", "Enter Email To Search ");
                OfficeActivities_EmailHelper.TypeText("EnterToEmailRI", "*****@*****.**");

                executionLog.Log("ForwardEmailFromSent", "Click on Send Button");
                OfficeActivities_EmailHelper.ClickElement("Send");
                OfficeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("ForwardEmailFromSent", "Wait for success message.");
                OfficeActivities_EmailHelper.WaitForText("E-Mail Sent Successfully.", 10);
                OfficeActivities_EmailHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_EmailsHelper = new OfficeActivities_EmailsHelper(GetWebDriver());


            // Variable
            var    to_email = "Automation_sent" + GetRandomNumber() + "@yopmail.com";
            var    subject  = "Automation_subject" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("VerifySentMailInSentItems", "Navigate to Compose Email page");
                VisitOffice("mails/compose");
                officeActivities_EmailsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifySentMailInSentItems", "Select From Email");
                officeActivities_EmailsHelper.SelectByText("From", "Howard Tang ([email protected])");
                //officeActivities_EmailsHelper.ClickElement("From");
                //officeActivities_EmailsHelper.ClickElement("//select[@id='EmailEmailAccounts']/optgroup/option[contains(text(),'Howard Tang')]");
                officeActivities_EmailsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifySentMailInSentItems", "Enter To email");
                officeActivities_EmailsHelper.TypeText("To", to_email);

                executionLog.Log("VerifySentMailInSentItems", "Enter Subject");
                officeActivities_EmailsHelper.TypeText("Subject", subject);

                executionLog.Log("VerifySentMailInSentItems", "Click on Send button");
                officeActivities_EmailsHelper.ClickJS("Send");
                officeActivities_EmailsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifySentMailInSentItems", "Verify confirmation message");
                officeActivities_EmailsHelper.WaitForText("E-Mail Sent Successfully.", 05);

                executionLog.Log("VerifySentMailInSentItems", "Navigate to Sent Email page");
                VisitOffice("mails/sent");
                officeActivities_EmailsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifySentMailInSentItems", "Enter To email in search field");
                officeActivities_EmailsHelper.TypeText("Searchbox", to_email);

                executionLog.Log("VerifySentMailInSentItems", "Click on Search button");
                officeActivities_EmailsHelper.ClickJS("SearchBtn");
                officeActivities_EmailsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifySentMailInSentItems", "Verify email present");
                officeActivities_EmailsHelper.VerifyText("SentEmail1", to_email);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifySentMailInSentItems");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Sent Mail In Sent Items");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Sent Mail In Sent Items", "Bug", "Medium", "Emails page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Sent Mail In Sent Items");
                        TakeScreenshot("VerifySentMailInSentItems");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySentMailInSentItems.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifySentMailInSentItems");
                        string id            = loginHelper.getIssueID("Verify Sent Mail In Sent Items");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySentMailInSentItems.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Sent Mail In Sent Items"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Sent Mail In Sent Items");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifySentMailInSentItems");
                executionLog.WriteInExcel("Verify Sent Mail In Sent Items", Status, JIRA, "Office Activities");
            }
        }
Example #5
0
        public void deleteDraft()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");
            String JIRA   = "";
            String Status = "Pass";

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");
            log      = oXMLData.getData("settings/URL", "logout");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_EmailsHelper = new OfficeActivities_EmailsHelper(GetWebDriver());

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

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

                executionLog.Log("DeleteDraft", "Visit to Compose page");
                VisitOffice("mails/compose");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteDraft", "Verify title");
                VerifyTitle("Compose");

                executionLog.Log("DeleteDraft", "Enter TO field");
                officeActivities_EmailsHelper.TypeText("To", "Test" + RandomNumber(1, 9999) + "@yopmail.com");

                executionLog.Log("DeleteDraft", "Enter subject");
                officeActivities_EmailsHelper.TypeText("Subject", "Subject" + RandomNumber(1, 9999));

                executionLog.Log("DeleteDraft", "Click on Draft button");
                officeActivities_EmailsHelper.ClickElement("Draft");

                executionLog.Log("DeleteDraft", "Wait for text");
                officeActivities_EmailsHelper.WaitForText("E-Mail Drafted Successfully.", 10);

                executionLog.Log("DeleteDraft", "Redirect at drafts page.");
                VisitOffice("mails/draft");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteDraft", "Verify title");
                VerifyTitle("Draft");

                executionLog.Log("DeleteDraft", "Select First draft");
                officeActivities_EmailsHelper.ClickElement("Draft1");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteDraft", "Click on Delete button");
                officeActivities_EmailsHelper.ClickElement("DeleteDraft");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteDraft", "Verify draft deleted successfully");
                officeActivities_EmailsHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 10);

                executionLog.Log("DeleteDraft", "Log out from the application");
                VisitOffice("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

            username1 = oXMLData.getData("settings/Credentials", "username_office");
            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_MerchantHelper           = new Corp_MerchantHelper(GetWebDriver());
            var office_ClientsHelper          = new Office_ClientsHelper(GetWebDriver());
            var officeActivities_EmailsHelper = new OfficeActivities_EmailsHelper(GetWebDriver());


            var DBA   = "ClientDBA" + RandomNumber(111, 999999);
            var email = DBA + "@yopmail.com";

            // Variable random
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to office portal with valid username and password");
                Login(username1[0], password[0]);

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

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter DBA name");
                office_ClientsHelper.TypeText("ClientDBAName", DBA);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Select the client status");
                office_ClientsHelper.SelectByText("Status", "New");

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "select the responsibility");
                office_ClientsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on save btn");
                office_ClientsHelper.ClickElement("Save");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Go to Company Details tab");
                office_ClientsHelper.ClickElement("CompanyDetailsTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter Legal Name");
                office_ClientsHelper.TypeText("ClientLegalName", DBA);
                //office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Save button");
                office_ClientsHelper.ClickElement("CDSave");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send Email button");
                office_ClientsHelper.ClickElement("CDSendEmailBtn");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter email in To");
                officeActivities_EmailsHelper.TypeText("To", email);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send button");
                officeActivities_EmailsHelper.ClickElement("Send");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from office portal");
                VisitOffice("logout");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to corp portal with valid username and password");
                Login(username[0], password[0]);

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

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to All Merchant page");
                VisitCorp("merchants");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page");
                corp_MerchantHelper.TypeText("EnterClinentToSearch", DBA);
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open created merchant");
                corp_MerchantHelper.ClickElement("OpenMerchant");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open sent email");
                corp_MerchantHelper.ClickElement("ClickOnActivityAny");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Legal Name");
                corp_MerchantHelper.VerifyText("LegalName", DBA);
                Console.WriteLine("Legal Name is appearing on View Email page");

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from the corp portal");
                VisitCorp("logout");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login with valid username and password");
                Login(username1[0], password[0]);

                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Search the company Name");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on check box");
                office_ClientsHelper.ClickElement("ClickOnCheckBox");

                executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Delete the client");
                office_ClientsHelper.ClickJS("DeleteClient");
                office_ClientsHelper.AcceptAlert();
                office_ClientsHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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