Пример #1
0
        public void  emailUrlChange()
        {
            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());

            // Variable

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

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

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

                executionLog.Log("EmailUrlChange", "Goto User Activities >> Email");
                VisitOffice("mails/sent");

                executionLog.Log("EmailUrlChange", "Click On Email");
                officeActivities_EmailHelper.ClickElement("ClickonAnySentEmail");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("EmailUrlChange", "Change the url with the url number of another office");
                VisitOffice("mails/view/14024");

                executionLog.Log("EmailUrlChange", "Verify Validation");
                officeActivities_EmailHelper.WaitForText("You don't have privileges to view this E-Mail.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmailUrlChange");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("EmailUrlChange");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("EmailUrlChange", "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("EmailUrlChange");
                        TakeScreenshot("EmailUrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmailUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmailUrlChange");
                        string id            = loginHelper.getIssueID("EmailUrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmailUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("EmailUrlChange"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("EmailUrlChange");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmailUrlChange");
                executionLog.WriteInExcel("EmailUrlChange", Status, JIRA, "Office Activities");
            }
        }
Пример #2
0
        public void attachMultpleFilesInEmail()
        {
            string[] username = null;
            string[] password = null;

            XMLParse 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("AttachMultpleFilesInEmail", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("AttachMultpleFilesInEmail", "Activeities >> Email");
                VisitOffice("mails/compose");

                var File = GetPathToFile() + "index.jpg";
                Console.WriteLine("file is jpg " + File);
                executionLog.Log("AttachMultpleFilesInEmail", "Upload a file");
                officeActivities_EmailHelper.UploadFile("//*[@id='EmailFiles']", File);
                officeActivities_EmailHelper.WaitForWorkAround(5000);

                executionLog.Log("AttachMultpleFilesInEmail", "Verify file name");
                officeActivities_EmailHelper.VerifyText("VefifyUploadedFileName", "index.jpg");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                var File2 = GetPathToFile() + "Up.jpg";
                executionLog.Log("AttachMultpleFilesInEmail", "Upload a file");
                officeActivities_EmailHelper.UploadFile("//*[@id='EmailFiles_F1']", File2);
                officeActivities_EmailHelper.WaitForWorkAround(5000);

                executionLog.Log("AttachMultpleFilesInEmail", "Verify file name");
                officeActivities_EmailHelper.VerifyText("VerifyUploaded2Pdf", "Up.jpg");
                officeActivities_EmailHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AttachMultpleFilesInEmail");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Attach Multple Files In Email");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Attach Multple Files In Email", "Bug", "Medium", "Activity email", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Attach Multple Files In Email");
                        TakeScreenshot("AttachMultpleFilesInEmail");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AttachMultpleFilesInEmail.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AttachMultpleFilesInEmail");
                        string id            = loginHelper.getIssueID("Attach Multple Files In Email");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AttachMultpleFilesInEmail.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Attach Multple Files In Email"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Attach Multple Files In Email");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AttachMultpleFilesInEmail");
                executionLog.WriteInExcel("Attach Multple Files In Email", Status, JIRA, "Office Activities");
            }
        }
Пример #3
0
        public void clientEmailUrlChange()
        {
            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 office_ClientsHelper         = new Office_ClientsHelper(GetWebDriver());
            var officeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());

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

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

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

                executionLog.Log("ClientEmailUrlChange", "Goto User Agent >> Client");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientEmailUrlChange", "Click On Any Client");
                office_ClientsHelper.ClickElement("ClickOnAnyClient");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientEmailUrlChange", "Click On Send Email button");
                office_ClientsHelper.ClickElement("AddEmail");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientEmailUrlChange", "Enter Email Id");
                officeActivities_EmailHelper.TypeText("To", SendTo);

                var EmailName = "Email Subj Test" + GetRandomNumber();
                executionLog.Log("ClientEmailUrlChange", "Enter  Subject");
                officeActivities_EmailHelper.TypeText("EmailName", EmailName);
                //officeActivities_EmailHelper.WaitForWorkAround(4000);

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

                executionLog.Log("ClientEmailUrlChange", "Select Activity >> Email");
                officeActivities_EmailHelper.Select("SelectActivityType", "E-Mails");

                executionLog.Log("ClientEmailUrlChange", "Click on Email in Activity");
                officeActivities_EmailHelper.ClickJS("ClickEmail1");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

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

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

                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(3000);

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

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

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

            XMLParse 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());

            // Random Variable.
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyDraftsSectionForMyTeamEmail", "Redirect at Emails page");
                VisitOffice("mails");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyDraftsSectionForMyTeamEmail", "Select My Team Emails");
                officeActivities_EmailsHelper.SelectByText("EmailAccount", "My Team E-Mails");
                officeActivities_EmailsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyDraftsSectionForMyTeamEmail", "Verify Drafts section present");
                officeActivities_EmailsHelper.VerifyText("SecondTile", "Drafts");
                //officeActivities_EmailsHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyDraftsSectionForMyTeamEmail");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Drafts Section For My Team Email");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Drafts Section For My Team Email", "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("Verify Drafts Section For My Team Email");
                        TakeScreenshot("VerifyDraftsSectionForMyTeamEmail");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyDraftsSectionForMyTeamEmail.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyDraftsSectionForMyTeamEmail");
                        string id            = loginHelper.getIssueID("Verify Drafts Section For My Team Email");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyDraftsSectionForMyTeamEmail.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Drafts Section For My Team Email"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Drafts Section For My Team Email");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyDraftsSectionForMyTeamEmail");
                executionLog.WriteInExcel("Verify Drafts Section For My Team Email", Status, JIRA, "Emails");
            }
        }
        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");
            }
        }
Пример #6
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");
            }
        }
Пример #7
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");
            }
        }
Пример #8
0
        public void addMultipleContact()
        {
            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());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("AddMultipleContact", "Go to compose email page");
                VisitOffice("mails/compose");

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

                executionLog.Log("AddMultipleContact", "Click on select employee");
                officeActivities_EmailsHelper.ClickElement("ToAddress");

                executionLog.Log("AddMultipleContact", "Select 1st employee");
                officeActivities_EmailsHelper.ClickElement("FEmployee");

                executionLog.Log("AddMultipleContact", "Select 2nd employee");
                officeActivities_EmailsHelper.ClickElement("SEmployee");

                executionLog.Log("AddMultipleContact", "Select 3rd employee");
                officeActivities_EmailsHelper.ClickElement("TEmployee");

                executionLog.Log("AddMultipleContact", "Click on Add button");
                officeActivities_EmailsHelper.ClickElement("AddEmployee");
                officeActivities_EmailsHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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