public void  corpOfficeUrlChange()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());


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

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

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

                executionLog.Log("CorpOfficeUrlChange", "Go To office");
                VisitCorp("offices");

                executionLog.Log("CorpOfficeUrlChange", "Click On any  Office");
                corp_Office_OfficeHelper.ClickElement("ClickOnAnyCorp");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("CorpOfficeUrlChange", "Change the url with the url number of another Corp");
                VisitCorp("offices/view/117");

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


            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Office = "Test" + GetRandomNumber();
            var    User   = "******" + GetRandomNumber();
            var    Email  = "addressTest" + RandomNumber(1, 99) + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Redirect at Craete Office page");
                VisitCorp("offices/create");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter office name.");
                corp_Office_OfficeHelper.TypeText("Name", Office);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Select Address type.");
                corp_Office_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter AddressLine1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter Zip Code.");
                corp_Office_OfficeHelper.TypeText("ZIpCode", "60601");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter a invalid user name.");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", "tes");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter First name.");
                corp_Office_OfficeHelper.TypeText("FirstName", "User");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "Test");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", Email);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on Add email");
                corp_Office_OfficeHelper.ClickElement("AddEmail");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Enter email in added email field.");
                corp_Office_OfficeHelper.TypeText("EnterEmail2", "*****@*****.**");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on Add phone");
                corp_Office_OfficeHelper.ClickElement("AddPhone");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Enter added phone .");
                corp_Office_OfficeHelper.TypeText("Phone2", "1234554321");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on Save button.");
                corp_Office_OfficeHelper.ClickElement("Save");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Verify page title as create an office.");
                VerifyTitle("Create an Office");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter a avalid user name.");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", User);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on add email button.");
                corp_Office_OfficeHelper.ClickElement("AddEmail");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Enter added email.");
                corp_Office_OfficeHelper.TypeText("EnterEmail2", "*****@*****.**");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on add phone button.");
                corp_Office_OfficeHelper.ClickElement("AddPhone");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Enter added phone.");
                corp_Office_OfficeHelper.TypeText("Phone2", "1234554321");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", " Click on Save button.");
                corp_Office_OfficeHelper.ClickElement("Save");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Verify text on the page");
                corp_Office_OfficeHelper.WaitForText("Wait for success message.", 10);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Enter office name to be Searched.");
                corp_Office_OfficeHelper.TypeText("EnterSelenium", Office);
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Click on Delete icon");
                corp_Office_OfficeHelper.ClickElement("DeleteOffice");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Click Delete to confirm");
                corp_Office_OfficeHelper.ClickElement("ConfirmDelete");

                executionLog.Log("CreateOfficeIssueWithMultipleEmailPhone", "Wait for success message.");
                corp_Office_OfficeHelper.WaitForText("Office deleted successfully", 30);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CreateOfficeIssueWithMultipleEmailPhone");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Create Office Issue With Multiple Email Phone");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Office Issue With Multiple Email Phone", "Bug", "Medium", "Office corp", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Create Office Issue With Multiple Email Phone");
                        TakeScreenshot("CreateOfficeIssueWithMultipleEmailPhone");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateOfficeIssueWithMultipleEmailPhone.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreateOfficeIssueWithMultipleEmailPhone");
                        string id            = loginHelper.getIssueID("Create Office Issue With Multiple Email Phone");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateOfficeIssueWithMultipleEmailPhone.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Create Office Issue With Multiple Email Phone"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Create Office Issue With Multiple Email Phone");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreateOfficeIssueWithMultipleEmailPhone");
                executionLog.WriteInExcel("Create Office Issue With Multiple Email Phone", Status, JIRA, "Corp Office");
            }
        }
        public void verifyAddEmailButtonForOffice()
        {
            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", "password2");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyAddEmailButtonForOffice", "Redirect to office page.");
                VisitCorp("offices");

                executionLog.Log("VerifyAddEmailButtonForOffice", "Click on create button.");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyAddEmailButtonForOffice", "Verify add email butto present on page.");
                corpOffice_OfficeHelper.IsElementPresent("AddEmail");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyAddEmailButtonForOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Add Email Button For Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Add Email Button For Office", "Bug", "Medium", "Corp Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Add Email Button For Office");
                        TakeScreenshot("VerifyAddEmailButtonForOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAddEmailButtonForOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyAddEmailButtonForOffice");
                        string id            = loginHelper.getIssueID("Verify Add Email Button For Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAddEmailButtonForOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Add Email Button For Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Add Email Button For Office");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyAddEmailButtonForOffice");
                executionLog.WriteInExcel("Verify Add Email Button For Office", Status, JIRA, "Corp Office");
            }
        }
示例#4
0
        public void verifyOfficeWithAllModules()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper           = new YopMailHelper(GetWebDriver());
            var office_Common_Layout     = new OfficeCommonLayoutHelper(GetWebDriver());
            var office_Admin_Layout      = new OfficeAdminCommonLayoutHelper(GetWebDriver());


            //  Variable random

            String JIRA       = "";
            String Status     = "Pass";
            var    officename = "Office" + RandomNumber(1, 999999999);
            var    username1  = "user" + RandomNumber(1, 9999);

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

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Page title");
            VerifyTitle("Dashboard");
            Console.WriteLine("Redirected to Dashboard");

            executionLog.Log("VerifyOfficeWithAllModules", "Create Office");
            VisitCorp("offices");
            Console.WriteLine("Redirected to All Office page");

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Create button");
            corp_Office_OfficeHelper.ClickElement("Create");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify page title");
            VerifyTitle("Create an Office");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Office name");
            corp_Office_OfficeHelper.TypeText("Name", officename);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Address Line 1");
            corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Zip Code");
            corp_Office_OfficeHelper.TypeText("ZIpCode", "20001");
            corp_Office_OfficeHelper.WaitForWorkAround(3000);

            executionLog.Log("VerifyOfficeWithAllModules", "Deselect Auto generate password check box");
            corp_Office_OfficeHelper.ClickElement("AutoGenPassword");
            corp_Office_OfficeHelper.WaitForWorkAround(1000);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Username");
            corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Password");
            corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter First Name");
            corp_Office_OfficeHelper.TypeText("FirstName", "Test");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name");
            corp_Office_OfficeHelper.TypeText("LastName", "User");

            executionLog.Log("VerifyOfficeWithAllModules", "Select eAddress label");
            corp_Office_OfficeHelper.Select("EaddressLabel", "Home");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress");
            corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**");
            Console.WriteLine("Entered eAddress");


            executionLog.Log("VerifyOfficeWithAllModules", "Click on Save");
            try
            {
                corp_Office_OfficeHelper.ClickElement("Save");
            }
            catch (OpenQA.Selenium.WebDriverException)
            { }

            Console.WriteLine("Office Created");

            executionLog.Log("VerifyOfficeWithAllModules", "Go to yopmail.com");
            GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
            Console.WriteLine("Redirected to yopmail.com");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress in yopmail");
            yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

            executionLog.Log("VerifyOfficeWithAllModules", "Check Inbox");
            yopmail_Helper.ClickElement("YopmailClick");

            yopmail_Helper.switchFrame("ifmail");

            yopmail_Helper.VerifyText("MailSecondPoint", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Office Link");
            yopmail_Helper.ClickElement("OfficeLink");
            corp_Office_OfficeHelper.SwitchToWindow();

            yopmail_Helper.WaitForWorkAround(5000);

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Profile Icon");
            corp_Office_OfficeHelper.ClickElement("ProfileIcon");

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Logout");
            corp_Office_OfficeHelper.ClickElement("Logout");
            Console.WriteLine("Redirected to Login Screen");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Username");
            loginHelper.TypeText("Login/Username", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name");
            loginHelper.TypeText("Login/Password", "123456");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Office");
            loginHelper.ClickElement("Login/Enter");
            Console.WriteLine("Logged into new office");

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

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Hamburger Icon");
            office_Common_Layout.ClickElement("HamburgerIcon");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Home Module");
            office_Common_Layout.ElementVisible("HomeTab");
            Console.WriteLine("Home Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Opportunities Module");
            office_Common_Layout.ElementVisible("OpportunitiesTab");
            Console.WriteLine("Opportunity Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Leads Module");
            office_Common_Layout.ElementVisible("LeadsTab");
            Console.WriteLine("Leads Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Merchants Module");
            office_Common_Layout.ElementVisible("ClientsTab");
            Console.WriteLine("Merchants Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Contacts Module");
            office_Common_Layout.ElementVisible("ContactsTab");
            Console.WriteLine("Contacts Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Activities Module");
            office_Common_Layout.ElementVisible("ActivitiesTab");
            Console.WriteLine("Activities Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module");
            office_Common_Layout.ElementVisible("TicketsTab");
            Console.WriteLine("Tickets Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Agents Module");
            office_Common_Layout.ElementVisible("AgentsTab");
            Console.WriteLine("Agents Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Residual Income Module");
            office_Common_Layout.ElementVisible("ResidualIncomeTab");
            Console.WriteLine("Residual Income Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Reports Module");
            office_Common_Layout.ElementVisible("ReportsTab");
            Console.WriteLine("Reports Module is present");

            office_Common_Layout.ScrollDown("//ul[@id='menu']/li[13]");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Dashboards Module");
            office_Common_Layout.ElementVisible("Dashboards");
            Console.WriteLine("Dashboards Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Redirect To Admin");
            VisitOffice("admin");
            office_Common_Layout.WaitForWorkAround(4000);
            Console.WriteLine("Redirected to Admin Site");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Office Module");
            office_Admin_Layout.ElementVisible("Office");
            Console.WriteLine("Office Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Corporate Module");
            office_Admin_Layout.ElementVisible("Corporate");
            Console.WriteLine("Corporate Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Master Data Module");
            office_Admin_Layout.ElementVisible("MasterDataTab");
            Console.WriteLine("Master Data Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Statistics Module");
            office_Admin_Layout.ElementVisible("StatisticsTab");
            Console.WriteLine("Statistics Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module");
            office_Admin_Layout.ElementVisible("TicketsTab");
            Console.WriteLine("Tickets Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify System Module");
            office_Admin_Layout.ElementVisible("System");
            Console.WriteLine("System Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Integrations Module");
            office_Admin_Layout.ElementVisible("IntegrationsTab");
            Console.WriteLine("Integrations Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Products Module");
            office_Admin_Layout.ElementVisible("ProductsTab");
            Console.WriteLine("Products Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify PDF Templates Module");
            office_Admin_Layout.ElementVisible("PDFTemplatesTab");
            Console.WriteLine("PDF Templates Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Equipment Module");
            office_Admin_Layout.ElementVisible("EquipmentTab");
            Console.WriteLine("Equipment Module is present");

            office_Admin_Layout.ScrollDown("//ul[@id='menu']/li[13]");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Field Dictionary Module");
            office_Admin_Layout.ElementVisible("FieldDicTab");
            Console.WriteLine("Field Dictionary Module is present");


            //}
            //catch (Exception e)
            //{
            //}
        }
示例#5
0
        public void verifyPrimaryBtnAppearWhileCreatingOffice()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());



            //  Variable random

            String JIRA       = "";
            String Status     = "Pass";
            var    officename = "Office" + RandomNumber(1, 999999999);
            var    username1  = "user" + RandomNumber(1, 9999);

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

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected to Dashboard");

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Create Office");
                VisitCorp("offices");
                Console.WriteLine("Redirected to All Office page");

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Click on Create button");
                corp_Office_OfficeHelper.ClickElement("Create");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.Select("EaddressType", "IM");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.verifyElementPresent("PrimaryRadioEmail1");

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.Select("EaddressType", "Social Media");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.verifyElementPresent("PrimaryRadioEmail1");

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.Select("EaddressType", "Web Links");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyPrimaryBtnAppearWhileCreatingOffice", "Select eAddress Type to IM");
                corp_Office_OfficeHelper.verifyElementPresent("PrimaryRadioEmail1");
                Console.WriteLine("Primary radio button does not disappear on selecting eAddress Type other than Email");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyPrimaryBtnAppearWhileCreatingOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Primary Btn Appear While Creating Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Primary Btn Appear While Creating Office", "Bug", "Medium", "Create Office", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Primary Btn Appear While Creating Office");
                        TakeScreenshot("VerifyPrimaryBtnAppearWhileCreatingOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPrimaryBtnAppearWhileCreatingOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyPrimaryBtnAppearWhileCreatingOffice");
                        string id            = loginHelper.getIssueID("Verify Primary Btn Appear While Creating Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPrimaryBtnAppearWhileCreatingOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Primary Btn Appear While Creating Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Primary Btn Appear While Creating Office");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyPrimaryBtnAppearWhileCreatingOffice");
                executionLog.WriteInExcel("Verify Primary Btn Appear While Creating Office", Status, JIRA, "Create Office");
            }
        }
        public void officeEaddressLabelIssue()
        {
            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("OfficeEaddressLabelIssue", "Redirect to office page.");
                VisitCorp("offices");

                executionLog.Log("OfficeEaddressLabelIssue", "Click on edit office icon");
                corpOffice_OfficeHelper.ClickElement("EditOffice");

                executionLog.Log("OfficeEaddressLabelIssue", "Select eAddress Type");
                corpOffice_OfficeHelper.Select("EaddressType", "Web Links");

                executionLog.Log("OfficeEaddressLabelIssue", "Enter e Address");
                corpOffice_OfficeHelper.TypeText("eAddress", "https://www.mypegasuscrm.com/newthemecorp/offices/edit/1649");

                executionLog.Log("OfficeEaddressLabelIssue", "Save updated details");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeEaddressLabelIssue", "Click Edit Again");
                corpOffice_OfficeHelper.ClickElement("EditLink");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeEaddressLabelIssue", "Verify eAddress Label text.");
                corpOffice_OfficeHelper.VerifyText("EaddressLabel", "Web Link");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

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

                executionLog.Log("UserVerifyCountryCorp", "Click on Menu Icon");
                corpOffice_OfficeHelper.ClickElement("MenuIcon");

                executionLog.Log("UserVerifyCountryCorp", "Click on Agent in Topmenu");
                corpOffice_OfficeHelper.MouseOverAndWait("OfficeTabCorp", 5);

                executionLog.Log("UserVerifyCountryCorp", "Click on Office button");
                corpOffice_OfficeHelper.ClickJS("OfficeBtn");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("UserVerifyCountryCorp", "click on Create Button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("UserVerifyCountryCorp", "Verify Page title");
                VerifyTitle("Create an Office");

                executionLog.Log("UserVerifyCountryCorp", "Select Mailing Country");
                corpOffice_OfficeHelper.Select("SelectCountryCorp", "Canada");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

            try
            {
                executionLog.Log("VerifyingOfficeEadressIssues", "Login with valid username and password");
                Login("newthemecorp", "pegasus");

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

                executionLog.Log("VerifyingOfficeEadressIssues", "Go to office page");
                VisitCorp("offices");

                executionLog.Log("VerifyingOfficeEadressIssues", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("VerifyingOfficeEadressIssues", "Click On Create button");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyingOfficeEadressIssues", "Verify title");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyingOfficeEadressIssues", "Verify title");
                corpOffice_OfficeHelper.ClickElement("AddEmail");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyingOfficeEadressIssues", "Verifies first eaddress label a drop down.");
                corpOffice_OfficeHelper.Select("EaddressLabel", "Home");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyingOfficeEadressIssues", "Select eAddress type as social media.");
                corpOffice_OfficeHelper.Select("Eadresstype2", "Social Media");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyingOfficeEadressIssues", "Verify eAddress label contains social media options.");
                corpOffice_OfficeHelper.VerifySocialMedia();
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Office = "Test" + GetRandomNumber();
            var    User   = "******" + GetRandomNumber();
            var    Email  = "addressTest" + RandomNumber(1, 99) + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ResetPasswordLinkIssue", "Redirect at Craete Office page");
                VisitCorp("offices");

                executionLog.Log("ResetPasswordLinkIssue", "Verify page title");
                VerifyTitle("Offices");

                executionLog.Log("ResetPasswordLinkIssue", "Click on any office");
                corp_Office_OfficeHelper.ClickElement("ClickOnAnyCorp");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Click on reset password link.");
                corp_Office_OfficeHelper.ClickElement("ResetPassword");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Verify success text for link sent.");
                corp_Office_OfficeHelper.VerifyPageText("Reset password link sent to");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Verify error message not present on page");
                corp_Office_OfficeHelper.VerifyTextNot("Error while sending mail.");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ResetPasswordLinkIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Reset Password Link Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Reset Password Link Issue", "Bug", "Medium", "Office corp", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Reset Password Link Issue");
                        TakeScreenshot("ResetPasswordLinkIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ResetPasswordLinkIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ResetPasswordLinkIssue");
                        string id            = loginHelper.getIssueID("Reset Password Link Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ResetPasswordLinkIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Reset Password Link Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Reset Password Link Issue");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ResetPasswordLinkIssue");
                executionLog.WriteInExcel("Reset Password Link Issue", Status, JIRA, "Corp Office");
            }
        }
示例#10
0
        public void fDNRequirement()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

            username = oXMLData.getData("settings/Credentials", "username_corp");
            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());


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

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

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

                executionLog.Log("FDNRequirement", "Go to Create office page");
                VisitCorp("offices/create");

                executionLog.Log("FDNRequirement", "Verify title");
                VerifyTitle("Create an Office");

                executionLog.Log("FDNRequirement", "Click on 'Save' button");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("FDNRequirement", "Verify FDN field is not mandatory");
                corpOffice_OfficeHelper.verifyElementNotPresent("OfficeFDN");

                executionLog.Log("FDNRequirement", "Logout from the application");
                VisitCorp("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("FDNRequirement");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("FDN Requirement");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("FDN Requirement", "Bug", "Medium", "Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("FDN Requirement");
                        TakeScreenshot("FDNRequirement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FDNRequirement.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("FDNRequirement");
                        string id            = loginHelper.getIssueID("FDN Requirement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FDNRequirement.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("FDN Requirement"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("FDN Requirement");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("FDNRequirement");
                executionLog.WriteInExcel("FDN Requirement", Status, JIRA, "Corp Office");
            }
        }
        public void authenticateWithGoogleCalendar()
        {
            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 corpOffice_OfficeHelper        = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper                 = new YopMailHelper(GetWebDriver());
            var gmailHelper                    = new GmailHelper(GetWebDriver());
            var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver());

            // Variable random
            var    username1 = "GoogleAuth" + RandomNumber(44, 99999);
            var    name      = "Test" + RandomNumber(999, 999999);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("AuthenticateWithGoogleCalendar", "Visit Corp offices");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on create office button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TESTDBA");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", username1);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "123456");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                //corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on save button.");
                try
                {
                    corpOffice_OfficeHelper.ClickElement("Save");
                }
                catch (OpenQA.Selenium.WebDriverException)
                { }
                yopmail_Helper.WaitForWorkAround(7000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Go to yopmail.com");
                GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
                Console.WriteLine("Redirected to yopmail.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress in yopmail");
                yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Check Inbox");
                yopmail_Helper.ClickElement("YopmailClick");

                yopmail_Helper.switchFrame("ifmail");

                yopmail_Helper.VerifyText("MailSecondPoint", username1);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Office Link");
                yopmail_Helper.ClickElement("OfficeLink");
                corpOffice_OfficeHelper.SwitchToWindow();

                yopmail_Helper.WaitForWorkAround(5000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Profile Icon");
                VisitCorp("logout");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Login to office");
                Login(username1, "123456");

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

                executionLog.Log("AuthenticateWithGoogleCalendar", "Redirect at My Calendar page");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/meetings/calendar/my");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Authenticate with Google button");
                officeActivities_MeetingHelper.ClickElement("GoogleAuth");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                if (gmailHelper.IsElementPresent("//div[@id='identifierLink']/div[2]/p"))
                {
                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Use Another Account");
                    gmailHelper.ClickElement("UseAnotherAccBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address");
                    gmailHelper.TypeText("EnterEmail", "*****@*****.**");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address");
                    gmailHelper.TypeText("EnterPswrd", "selenium123456");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button");
                    gmailHelper.ClickElement("AllowBtn");
                    gmailHelper.WaitForWorkAround(4000);
                }

                else
                {
                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address");
                    gmailHelper.TypeText("EnterEmail", "*****@*****.**");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address");
                    gmailHelper.TypeText("EnterPswrd", "selenium123456");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button");
                    gmailHelper.ClickElement("AllowBtn");
                    gmailHelper.WaitForWorkAround(4000);
                }

                executionLog.Log("AuthenticateWithGoogleCalendar", "Verify successfully Google Calendar Synced");
                officeActivities_MeetingHelper.VerifyPageText("Last Sync Time");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AuthenticateWithGoogleCalendar");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Authenticate With Google Calendar");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Authenticate With Google Calendar", "Bug", "Medium", "Create Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Authenticate With Google Calendar");
                        TakeScreenshot("AuthenticateWithGoogleCalendar");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AuthenticateWithGoogleCalendar.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AuthenticateWithGoogleCalendar");
                        string id            = loginHelper.getIssueID("Authenticate With Google Calendar");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AuthenticateWithGoogleCalendar.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Authenticate With Google Calendar"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Authenticate With Google Calendar");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AuthenticateWithGoogleCalendar");
                executionLog.WriteInExcel("Authenticate With Google Calendar", Status, JIRA, "Corp Office");
            }
        }
示例#12
0
        public void corporatePortal1()
        {
            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 799999977);
            var    Office  = "Office" + RandomNumber(1, 99999);
            var    name    = "Test" + GetRandomNumber();
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("CorporatePortal1", "Redircet to office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Click On Create New Button");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("CorporatePortal1", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", Office);

                executionLog.Log("CorporatePortal1", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("CorporatePortal1", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("CorporatePortal1", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("CorporatePortal1", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("CorporatePortal1", "Enter Vender code");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("CorporatePortal1", "Enter office phone number");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter BusinessPhoneNumber");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter FaxNumber");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter LinkedURL");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("CorporatePortal1", "Enter FacebookURL");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("CorporatePortal1", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("CorporatePortal1", "Enter Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("CorporatePortal1", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("CorporatePortal1", "Enter Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", usernme);

                executionLog.Log("CorporatePortal1", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("CorporatePortal1", "Enter Primary Password");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "1qaz!QAZ");

                executionLog.Log("CorporatePortal1", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("CorporatePortal1", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("CorporatePortal1", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("CorporatePortal1", "Save");
                corpOffice_OfficeHelper.ClickElement("Save");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Wait for Confirmation");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 50);

                executionLog.Log("CorporatePortal1", "Visit Office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Enter Name To Search");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", Office);

                executionLog.Log("CorporatePortal1", "Click on Edit Icon");
                corpOffice_OfficeHelper.ClickElement("EditOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CorporatePortal1", "Click on Save");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CorporatePortal1", "Wait for Confirmation");
                corpOffice_OfficeHelper.WaitForText("Office updated successfully.", 50);

                executionLog.Log("CorporatePortal1", "Goto Office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Enter Name To Search");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", Office);

                executionLog.Log("CorporatePortal1", "Click On Office");
                corpOffice_OfficeHelper.ClickElement("ClickOnOffice");

                executionLog.Log("CorporatePortal1", "Click On Send Email");
                corpOffice_OfficeHelper.ClickElement("ClickOnSendEmail");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Email");
                corpOffice_OfficeHelper.TypeText("EnterToEmail", "*****@*****.**");

                executionLog.Log("CorporatePortal1", "Enter Email Subject");
                corpOffice_OfficeHelper.TypeText("EnterSubjectEmail", "Test Subject");

                executionLog.Log("CorporatePortal1", "Click On Send Email Pop Up");
                corpOffice_OfficeHelper.ClickElement("ClickOnSendEmailPopUp");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Verify Confirmation");
                corpOffice_OfficeHelper.WaitForText("Email Sent Successfully.", 20);

                executionLog.Log("CorporatePortal1", "Click On Add Notes");
                corpOffice_OfficeHelper.ClickElement("ClickOnAddNotes");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Notes Subject");
                corpOffice_OfficeHelper.TypeText("EnterNoteSubject", "Test Subject");

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickElement("SaveNotesOffice");

                executionLog.Log("CorporatePortal1", "Enter Notes Subject");
                corpOffice_OfficeHelper.WaitForText("Note Created Successfully", 10);

                executionLog.Log("CorporatePortal1", "Click on Add Documnet");
                corpOffice_OfficeHelper.ClickElement("AddDocumentOff");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Subject");
                corpOffice_OfficeHelper.TypeText("NameDocumentOff", "Test Doc Name");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Add attachment.");
                var FileName = GetPathToFile() + "index.jpg";
                corpOffice_OfficeHelper.UploadFile("//*[@id='DocumentFiles']", FileName);

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickDisplayed("//a[@title='Save']");

                executionLog.Log("CorporatePortal1", "Verify");
                corpOffice_OfficeHelper.WaitForText("Documents successfully Added.", 10);

                executionLog.Log("CorporatePortal1", "Add Meeting");
                corpOffice_OfficeHelper.ClickElement("ClickOnMeeting");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Subject");
                corpOffice_OfficeHelper.TypeText("EnterSubjectMeeting", "Test Subject");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Meeting");
                corpOffice_OfficeHelper.TypeText("EnterMeetingStartDate", "2015-11-03");

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickDisplayed("//a[@title='Save']");

                executionLog.Log("CorporatePortal1", "Verify");
                corpOffice_OfficeHelper.WaitForText("Meeting Created Successfully.", 20);

                executionLog.Log("CorporatePortal1", "Go to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("CorporatePortal1", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("CorporatePortal1", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", Office);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("CorporatePortal1", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Verify page text");
                corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Accept alert message. ");
                corpOffice_OfficeHelper.AcceptAlert();
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Wait for delete message. ");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 50);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CorporatePortal1");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("CorporatePortal1");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("CorporatePortal1", "Bug", "Medium", "Corp Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("CorporatePortal1");
                        TakeScreenshot("CorporatePortal1");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorporatePortal1.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CorporatePortal1");
                        string id            = loginHelper.getIssueID("CorporatePortal1");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorporatePortal1.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("CorporatePortal1"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("CorporatePortal1");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CorporatePortal1");
                executionLog.WriteInExcel("CorporatePortal1", Status, JIRA, "Corp Offices");
            }
        }
示例#13
0
        public void deleteOffice()
        {
            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            //Variable random
            var    usernme = "TESTUSER" + RandomNumber(676, 99999);
            var    name    = "DeleteOffice" + GetRandomNumber();
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("DeleteOffice", "Redirect at office page.");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("DeleteOffice", "Click on create button.");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("DeleteOffice", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("DeleteOffice", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("DeleteOffice", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("DeleteOffice", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("DeleteOffice", "Enter Vendor code");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("DeleteOffice", "Enter Phone number ");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Business number");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Fax number");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Linked URL");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("DeleteOffice", "Enter Facebook url");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("DeleteOffice", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("DeleteOffice", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("DeleteOffice", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("DeleteOffice", "Enter Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteOffice", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", usernme);

                executionLog.Log("DeleteOffice", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("DeleteOffice", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "1qaz!QAZ");

                executionLog.Log("DeleteOffice", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteOffice", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("DeleteOffice", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("DeleteOffice", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("DeleteOffice", "Click on save");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("DeleteOffice", "Verify text on the page");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 70);

                executionLog.Log("DeleteOffice", "Search office by name.");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", name);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("DeleteOffice", "Click on delete.");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteOffice", "Click on confirm delete.");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteOffice", "verify messsage Office deleted successfully.");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 70);
            }
            catch (Exception e)
            {
                Console.WriteLine("ERRROROOR");
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("DeleteOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Delete Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Delete Office", "Bug", "Medium", "Corp office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Delete Office");
                        TakeScreenshot("DeleteOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\DeleteOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("DeleteOffice");
                        string id            = loginHelper.getIssueID("Delete Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\DeleteOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Delete Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Delete Office");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("DeleteOffice");
                executionLog.WriteInExcel("Delete Office", Status, JIRA, "Corp Offices");
            }
        }
示例#14
0
        public void officeDocumentValidationExe()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("OfficeDocumentValidationExe", "Redirect To URL");
                VisitCorp("offices");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("OfficeDocumentValidationExe", "Click On Any Corp");
                corp_Office_OfficeHelper.ClickElement("ClickOnAnyCorp");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("OfficeDocumentValidationExe", "Click On Add Document");
                corp_Office_OfficeHelper.ClickElement("AddDocumentOff");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("OfficeDocumentValidationExe", "Enter Document Name");
                corp_Office_OfficeHelper.TypeText("NameDocumentOff", DocName);
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("OfficeDocumentValidationExe", "Browse Doc");
                corp_Office_OfficeHelper.Upload("BrowseDoc", fileUpl);
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeDocumentValidationExe", "Click Save Of Doc PopUp");
                corp_Office_OfficeHelper.ClickDisplayed("//a[@title='Save']");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                corp_Office_OfficeHelper.WaitForText("This field is required.", 10);
                corp_Office_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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


            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            //Variable random
            var    usernme = "TESTUSER" + RandomNumber(676, 99999);
            var    name    = "Meeting" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Redirect at office page.");
                VisitCorp("offices");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Verify Page title.");
                VerifyTitle("Offices");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on any office..");
                corpOffice_OfficeHelper.ClickElement("ClickOnAnyCorp");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on add meeting.");
                corpOffice_OfficeHelper.ClickElement("NewMeeting");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter meeting subject.");
                corpOffice_OfficeHelper.TypeText("MeetingSubject", name);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter start date.");
                corpOffice_OfficeHelper.TypeText("StartDate", "2015-03-25");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter same due date as start date..");
                corpOffice_OfficeHelper.TypeText("DueDate", "2015-03-25");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select start time");
                corpOffice_OfficeHelper.Select("StartHour", "02");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select start minute");
                corpOffice_OfficeHelper.Select("StartMinute", "00");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);


                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select due hour");
                corpOffice_OfficeHelper.Select("DueHour", "01");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on save meeting.");
                corpOffice_OfficeHelper.ClickElement("SaveMeeting");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Verify alert text for lesser start date and time.");
                corpOffice_OfficeHelper.VerifyAlertText("Start Date & Time should lesser than or equal to End Date & Time.");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click ok to accept alert.");
                corpOffice_OfficeHelper.AcceptAlert();
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyMeetingTImeIssueForOffices");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Meeting TIme Issue For Offices");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Meeting TIme Issue For Offices", "Bug", "Medium", "Corp office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                        TakeScreenshot("VerifyMeetingTImeIssueForOffices");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyMeetingTImeIssueForOffices.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyMeetingTImeIssueForOffices");
                        string id            = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyMeetingTImeIssueForOffices.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Meeting TIme Issue For Offices"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyMeetingTImeIssueForOffices");
                executionLog.WriteInExcel("Verify Meeting TIme Issue For Offices", Status, JIRA, "Corp Office");
            }
        }
        public void verifyEadressLabelNotChangedAutomatically()
        {
            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", "password2");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Visit Corp offices");
                VisitCorp("offices");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click on create office button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Select Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", usernme);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "1qaz!QAZ");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Select eAddress type as e-mail.");
                corpOffice_OfficeHelper.Select("EaddressType", "E-Mail");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Select e-Address label as home.");
                corpOffice_OfficeHelper.Select("EaddressLabel", "Home");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click on save button.");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Wait for success message");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 10);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Go to office page");
                VisitCorp("offices");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", name);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click on edit icon.");
                corpOffice_OfficeHelper.ClickElement("EditOffice");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Wait for locator to present.");
                corpOffice_OfficeHelper.WaitForElementPresent("EaddressLabel", 10);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Verify eaddress label not changed to work.");
                corpOffice_OfficeHelper.VerifyText("EaddressLabel", "Home");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click on save.");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Wait for updation success text.");
                corpOffice_OfficeHelper.WaitForText("Office updated successfully.", 10);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Go to office page");
                VisitCorp("offices");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", name);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Verify page text");
                corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Accept alert message. ");
                corpOffice_OfficeHelper.AcceptAlert();

                executionLog.Log("VerifyEadressLabelNotChangedAutomatically", "Wait for delete message. ");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyEadressLabelNotChangedAutomatically");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Eadress Label Not Changed Automatically");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Eadress Label Not Changed Automatically", "Bug", "Medium", "Create Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Eadress Label Not Changed Automatically");
                        TakeScreenshot("VerifyEadressLabelNotChangedAutomatically");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEadressLabelNotChangedAutomatically.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyEadressLabelNotChangedAutomatically");
                        string id            = loginHelper.getIssueID("Verify Eadress Label Not Changed Automatically");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEadressLabelNotChangedAutomatically.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Eadress Label Not Changed Automatically"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Eadress Label Not Changed Automatically");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyEadressLabelNotChangedAutomatically");
                executionLog.WriteInExcel("Verify Eadress Label Not Changed Automatically", Status, JIRA, "Corp Office");
            }
        }
        public void verifyRemoveIconForAddressInOffice()
        {
            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", "password2");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";


            try
            {
                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Login with valid credential  Username");
                Login("newthemecorp", "pegasus");


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

                executionLog.Log("VerifyStateCountryAutoPopulate", "Redirect to office page.");
                VisitCorp("offices");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Click on create buttton");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Verify title as create an office.");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Click on add address button.");
                corpOffice_OfficeHelper.ClickElement("ClickAddAddressBtn");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Enter a valid zip code.");
                corpOffice_OfficeHelper.TypeText("ZipCode2", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.TypeText("AddressLine2", "test");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.ClickElement("EditLink");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.VerifyText("ZIpCode", "60601");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.VerifyText("AddressLine1", "test");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.ClickElement("RemoveAddress");

                executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
                corpOffice_OfficeHelper.clickByText("SaveEdit");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyStateCountryAutoPopulate");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify State Country Auto Populate");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify State Country Auto Populate", "Bug", "Medium", "Corp Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify State Country Auto Populate");
                        TakeScreenshot("VerifyStateCountryAutoPopulate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStateCountryAutoPopulate.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyStateCountryAutoPopulate");
                        string id            = loginHelper.getIssueID("Verify State Country Auto Populate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStateCountryAutoPopulate.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify State Country Auto Populate"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify State Country Auto Populate");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyStateCountryAutoPopulate");
                executionLog.WriteInExcel("Verify State Country Auto Populate", Status, JIRA, "Corp Office");
            }
        }
示例#18
0
        public void verifyFieldsInheritedForNewOffice()
        {
            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_Office_OfficeHelper            = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper                      = new YopMailHelper(GetWebDriver());
            var office_LeadsHelper                  = new Office_LeadsHelper(GetWebDriver());
            var office_FieldDictionary_FieldsHelper = new Office_FieldDictionary_FieldsHelper(GetWebDriver());


            //  Variable random

            String JIRA       = "";
            String Status     = "Pass";
            var    officename = "Office" + RandomNumber(1, 999999999);
            var    username1  = "user" + RandomNumber(1, 9999);

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

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected to Dashboard");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Create Office");
                VisitCorp("offices");
                Console.WriteLine("Redirected to All Office page");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Create button");
                corp_Office_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Office name");
                corp_Office_OfficeHelper.TypeText("Name", officename);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Address Line 1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Zip Code");
                corp_Office_OfficeHelper.TypeText("ZIpCode", "20001");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Deselect Auto generate password check box");
                corp_Office_OfficeHelper.ClickElement("AutoGenPassword");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Password");
                corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter First Name");
                corp_Office_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "User");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select eAddress label");
                corp_Office_OfficeHelper.Select("EaddressLabel", "Home");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**");
                Console.WriteLine("Entered eAddress");


                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Save");
                try
                {
                    corp_Office_OfficeHelper.ClickElement("Save");
                }
                catch (OpenQA.Selenium.WebDriverException)
                { }

                Console.WriteLine("Office Created");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Go to yopmail.com");
                GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
                Console.WriteLine("Redirected to yopmail.com");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress in yopmail");
                yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Check Inbox");
                yopmail_Helper.ClickElement("YopmailClick");

                yopmail_Helper.switchFrame("ifmail");

                yopmail_Helper.VerifyText("MailSecondPoint", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Office Link");
                yopmail_Helper.ClickElement("OfficeLink");
                corp_Office_OfficeHelper.SwitchToWindow();

                yopmail_Helper.WaitForWorkAround(5000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Profile Icon");
                corp_Office_OfficeHelper.ClickElement("ProfileIcon");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Logout");
                corp_Office_OfficeHelper.ClickElement("Logout");
                Console.WriteLine("Redirected to Login Screen");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username");
                loginHelper.TypeText("Login/Username", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name");
                loginHelper.TypeText("Login/Password", "123456");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Office");
                loginHelper.ClickElement("Login/Enter");
                Console.WriteLine("Logged into new office");

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

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at create Leads page");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Company Name field appearing");
                office_LeadsHelper.verifyElementPresent("CompanyName");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at Field Properties");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/fields");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select Module");
                office_FieldDictionary_FieldsHelper.SelectByText("FSModule", "Clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify fields available");
                Assert.IsFalse(GetWebDriver().PageSource.Contains("No Fields Available."));
                //office_LeadsHelper.WaitForWorkAround(3000);
            }

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyFieldsInheritedForNewOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Fields Inherited For New Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Fields Inherited For New Office", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                        TakeScreenshot("VerifyFieldsInheritedForNewOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyFieldsInheritedForNewOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyFieldsInheritedForNewOffice");
                        string id            = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyFieldsInheritedForNewOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Fields Inherited For New Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyFieldsInheritedForNewOffice");
                executionLog.WriteInExcel("Verify Fields Inherited For New Office", Status, JIRA, "Corp Employees");
            }
        }
示例#19
0
        public void verifyAddedAddressForOffice()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

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

            //        try
            //      {

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Login with valid credential  Username");
            Login("newthemecorp", "pegasus");

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

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Redirect at offices page.");
            VisitCorp("offices");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Enter Invalid phone Number");
            corpOffice_OfficeHelper.TypeText("EnterNameToSearch", "Aslam Office");
            corpOffice_OfficeHelper.WaitForWorkAround(4000);

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Wait for locator to be present.");
            corpOffice_OfficeHelper.ClickElement("EditOffice");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.ClickElement("ClickAddAddressBtn");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.TypeText("ZipCode2", "test");
            corpOffice_OfficeHelper.WaitForWorkAround(3000);

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.TypeText("AddressLine2", "test");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.ClickElement("SaveEdit");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.ClickElement("EditLink");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.VerifyText("AddressLine1", "test");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.ClickElement("RemoveAddress");

            executionLog.Log("CorpOfficeSearchWithInvalidPhone", "Verify Page title");
            corpOffice_OfficeHelper.ClickElement("SaveEdit");
        }
示例#20
0
        public void officeVerifyFND()
        {
            string[] username = null;
            string[] password = null;

            XMLParse 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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

            try
            {
                executionLog.Log("OfficeVerifyFND", "Login with valid credential  Username");
                Login(username[0], password[0]);
                //corpOffice_OfficeHelper.WaitForWorkAround(3000);

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

                executionLog.Log("OfficeVerifyFND", "Redirect to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeVerifyFND", "Verify Page title");
                VerifyTitle("Offices");

                executionLog.Log("OfficeVerifyFND", "Enter office Name");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", "newthemeoffice");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeVerifyFND", "Click on Office");
                corpOffice_OfficeHelper.ClickElement("ClickOnOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeVerifyFND", "Verify Page title");
                VerifyTitle("Details");

                executionLog.Log("OfficeVerifyFND", "Verify codes Present on page");
                corpOffice_OfficeHelper.VerifyPageText("5021");
                corpOffice_OfficeHelper.VerifyPageText("3423");

                executionLog.Log("OfficeVerifyFND", "Redirect to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeVerifyFND", "Verify Page title");
                VerifyTitle("Offices");

                executionLog.Log("OfficeVerifyCodes", "Enter Sel Name");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", "Office90335");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeVerifyFND", "Click on Office");
                corpOffice_OfficeHelper.ClickElement("ClickOnOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeVerifyFND", "Verify Page title");
                VerifyTitle("Details");

                executionLog.Log("OfficeVerifyFND", "Verify codes Present on page");
                corpOffice_OfficeHelper.VerifyPageText("123456");
                corpOffice_OfficeHelper.VerifyPageText("4534354");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("OfficeVerifyFND");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Office Verify FND");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Office Verify FND", "Bug", "Medium", "Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Office Verify FND");
                        TakeScreenshot("OfficeVerifyFND");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\OfficeVerifyFND.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("OfficeVerifyFND");
                        string id            = loginHelper.getIssueID("Office Verify FND");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\OfficeVerifyFND.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Office Verify FND"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Office Verify FND");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("OfficeVerifyFND");
                executionLog.WriteInExcel("Office Verify FND", Status, JIRA, "Corp Office");
            }
        }
        public void corpOfficeAddressCollapse()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());



            //  Variable random
            var    name   = "Test" + RandomNumber(1, 99);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("CorpOfficeAddressCollapse", "Craete Office");
                VisitCorp("offices/create");

                executionLog.Log("CorpOfficeAddressCollapse", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("CorpOfficeAddressCollapse", "Click Add Addresses Button");
                corp_Office_OfficeHelper.ClickElement("ClickAddAddressBtn");

                executionLog.Log("CorpOfficeAddressCollapse", "Verify text");
                corp_Office_OfficeHelper.VerifyText("VerifyLabelAddressType", "Address Type");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CorpOfficeAddressCollapse");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Corp Office Address Collapse");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Corp Office Address Collapse", "Bug", "Medium", "Corp Office", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Corp Office Address Collapse");
                        TakeScreenshot("CorpOfficeAddressCollapse");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpOfficeAddressCollapse.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CorpOfficeAddressCollapse");
                        string id            = loginHelper.getIssueID("Corp Office Address Collapse");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CorpOfficeAddressCollapse.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Corp Office Address Collapse"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Corp Office Address Collapse");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CorpOfficeAddressCollapse");
                executionLog.WriteInExcel("Corp Office Address Collapse", Status, JIRA, "Office Corp");
            }
        }
示例#22
0
        public void editOffice()
        {
            string[] username1 = null;
            string[] password1 = null;
            var      oXMLData  = new XMLParse();

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

            // Variable random
            var    username = "******" + GetRandomNumber();
            var    name     = "Test" + RandomNumber(99, 999);
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("EditOffice", "Redirect to Office");
                VisitCorp("offices");

                executionLog.Log("EditOffice", "Verify Page title");
                VerifyTitle("Offices");

                executionLog.Log("EditOffice", "Click on Edit");
                corpOffice_OfficeHelper.ClickElement("EditOffice");

                executionLog.Log("EditOffice", "Verify Page title");
                VerifyTitle("Edit");

                executionLog.Log("EditOffice", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("EditOffice", "Enter VendorName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("EditOffice", "Enter VendorCode");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("EditOffice", "Enter office phone number");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("EditOffice", "Enter Business Phone Number");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("EditOffice", "Enter FaxNumber");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("EditOffice", "Enter LinkedURL");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("EditOffice", "Enter FacebookURL");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("EditOffice", " Click on save button");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");

                executionLog.Log("EditOffice", " Wait for success message");
                corpOffice_OfficeHelper.WaitForText("Office updated successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EditOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Edit Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Edit Office", "Bug", "Medium", "Office page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Edit Office");
                        TakeScreenshot("EditOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EditOffice");
                        string id            = loginHelper.getIssueID("Edit Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Edit Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Edit Office");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EditOffice");
                executionLog.WriteInExcel("Edit Office", Status, JIRA, "Corp Office");
            }
        }
示例#23
0
        public void editOfficeSaveInvalidWebLink()
        {
            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", "password2");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

            //          try
            //        {

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

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

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Redirect to office page.");
            VisitCorp("offices");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Enter Name To Search Office");
            corpOffice_OfficeHelper.TypeText("EnterSelenium", "Aslam Office");
            corpOffice_OfficeHelper.WaitForWorkAround(2000);

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Click on edit office icon");
            corpOffice_OfficeHelper.ClickElement("EditOffice");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Select eAddress Type as web link");
            corpOffice_OfficeHelper.Select("EaddressType", "Web Links");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Enter an invalid web link");
            corpOffice_OfficeHelper.TypeText("eAddress", "Test");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Save updated details");
            corpOffice_OfficeHelper.ClickElement("SaveEdit");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Verify validation for invalid eAddress.");
            corpOffice_OfficeHelper.VerifyText("WeblinkValidation", "Please enter a valid email address.");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Enter a valid eaddress.");
            corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Save updated details");
            corpOffice_OfficeHelper.ClickElement("SaveEdit");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Verify validation for invalid eAddress.");
            corpOffice_OfficeHelper.VerifyText("WeblinkValidation", "Please enter a valid email address.");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Enter a valid web link.");
            corpOffice_OfficeHelper.TypeText("eAddress", "https://www.google.com");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Save updated details");
            corpOffice_OfficeHelper.ClickElement("SaveEdit");

            executionLog.Log("EditOfficeSaveInvalidWebLink", "Wait for success message.");
            corpOffice_OfficeHelper.WaitForText("Office updated successfully.", 10);
        }
        public void verifyOfficeCreatedSuccessfully()
        {
            string[] username1 = null;
            string[] password1 = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random

            var    username = "******" + GetRandomNumber();
            var    name     = "Test" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

            try
            {
                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Login with valid username and password");
                Login("newthemecorp", "pegasus");

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

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Go to office page");
                VisitCorp("offices");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Click On Create button");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify title");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter ZipCode");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", username);

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "pegasus");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", " Click on save button");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify text on the page");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 10);

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify unexpected text not present.");
                corpOffice_OfficeHelper.VerifyTextNot("Array  ....");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Go to office page");
                VisitCorp("offices");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", name);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Verify page text");
                corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Accept alert message. ");
                corpOffice_OfficeHelper.AcceptAlert();

                executionLog.Log("VerifyOfficeCreatedSuccessfully", "Wait for delete message. ");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyOfficeCreatedSuccessfully");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Office Created Successfully");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Office Created Successfully", "Bug", "Medium", "Office page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Office Created Successfully");
                        TakeScreenshot("VerifyOfficeCreatedSuccessfully");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyOfficeCreatedSuccessfully.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyOfficeCreatedSuccessfully");
                        string id            = loginHelper.getIssueID("Verify Office Created Successfully");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyOfficeCreatedSuccessfully.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Office Created Successfully"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Office Created Successfully");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyOfficeCreatedSuccessfully");
                executionLog.WriteInExcel("Verify Office Created Successfully", Status, JIRA, "Corp Office");
            }
        }
示例#25
0
        public void officeStateVerifyCorp()
        {
            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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Email  = "addressTest" + GetRandomNumber() + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("OfficeStateVerifyCorp", "Craete Office");
                VisitCorp("offices/create");

                executionLog.Log("OfficeStateVerifyCorp", "Verify Page title");
                VerifyTitle("Create an Office");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Name");
                corp_Office_OfficeHelper.TypeText("Name", "Office OFFICE");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Address");
                corp_Office_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("OfficeStateVerifyCorp", "Enter AddressLine1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "FC-89");

                corp_Office_OfficeHelper.TypeText("ZIpCode", "60601");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeStateVerifyCorp", "Enter Username");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", "Tes");

                executionLog.Log("OfficeStateVerifyCorp", "Enter First NAME");
                corp_Office_OfficeHelper.TypeText("FirstName", "User");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "Test");

                executionLog.Log("OfficeStateVerifyCorp", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", Email);

                executionLog.Log("OfficeStateVerifyCorp", " Click on Save");
                corp_Office_OfficeHelper.ClickElement("Save");
                corp_Office_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("OfficeStateVerifyCorp", "Verify text on the page");
                corp_Office_OfficeHelper.VerifyText("SelectState", "IL");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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