Ejemplo n.º 1
0
        public void systemPickListSalutation()
        {
            string[] username = null;
            string[] password = null;
            var      oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");
            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog           = new ExecutionLog();
            var loginHelper            = new LoginHelper(GetWebDriver());
            var system_PicklistsHelper = new System_PicklistsHelper(GetWebDriver());

            // Variable
            var    AddressType = "Test" + RandomNumber(100, 500);
            var    Test        = "New" + GetRandomNumber();
            String JIRA        = "";
            String Status      = "Pass";

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

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

                executionLog.Log("SystemPickListAddressType", "Redirect To PickList");
                VisitOffice("pick-lists");
                system_PicklistsHelper.WaitForWorkAround(5000);

                executionLog.Log("SystemPickListAddressType", "Verify Page title");
                VerifyTitle("Picklists");

                executionLog.Log("SystemPickListAddressType", "Enter Salutation into field");
                system_PicklistsHelper.TypeText("SearchName", "Salutation");
                system_PicklistsHelper.WaitForWorkAround(3000);

                executionLog.Log("SystemPickListAddressType", "Enter corp into field");
                system_PicklistsHelper.TypeText("SearchModule", "Corporates");
                system_PicklistsHelper.WaitForWorkAround(3000);

                executionLog.Log("SystemPickListSalutation", "Click On Link Address Type");
                system_PicklistsHelper.ClickElement("Salutation");

                executionLog.Log("SystemPickListSalutation", "Click On Add New Item");
                system_PicklistsHelper.ClickElement("AddNewItem");

                executionLog.Log("SystemPickListSalutation", "Add New Item");
                system_PicklistsHelper.TypeText("PicklistItem", AddressType);

                executionLog.Log("SystemPickListSalutation", "Click on Save ");
                system_PicklistsHelper.ClickElement("Save");
                system_PicklistsHelper.WaitForWorkAround(2000);

                executionLog.Log("SystemPickListSalutation", "Click On cancel");
                system_PicklistsHelper.ClickJs("Cancel");
                system_PicklistsHelper.WaitForWorkAround(8000);

                executionLog.Log("SystemPickListSalutation", "Verfiy Text");
                system_PicklistsHelper.VerifyPageText(AddressType);

                executionLog.Log("SystemPickListSalutation", "Click delete Button");
                system_PicklistsHelper.ClickJs("DeletePick");
                system_PicklistsHelper.WaitForWorkAround(3000);

                executionLog.Log("SystemPickListSalutation", "Click on item to deleted");
                system_PicklistsHelper.DeletePickList(AddressType);

                executionLog.Log("SystemPickListSalutation", "Selelct replace with item.");
                system_PicklistsHelper.SelectText("ReplacePiclist", "Mr");

                executionLog.Log("SystemPickListSalutation", "Click PickList Save Button");
                system_PicklistsHelper.ClickElement("PickListSaveBtn");

                executionLog.Log("SystemPickListSalutation", "Accept alert message.");
                system_PicklistsHelper.AcceptAlert();
                system_PicklistsHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SystemPickListSalutation");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("System Pick List Salutation");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("System Pick List Salutation", "Bug", "Medium", "System Pick page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("System Pick List Salutation");
                        TakeScreenshot("SystemPickListSalutation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SystemPickListSalutation.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("SystemPickListSalutation");
                        string id            = loginHelper.getIssueID("System Pick List Salutation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SystemPickListSalutation.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("System Pick List Salutation"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("System Pick List Salutation");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SystemPickListSalutation");
                executionLog.WriteInExcel("System Pick List Salutation", Status, JIRA, "Pick List Management");
            }
        }
Ejemplo n.º 2
0
        public void editPickListStatuses()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog          = new ExecutionLog();
            var loginHelper           = new LoginHelper(GetWebDriver());
            var System_PicklistHelper = new System_PicklistsHelper(GetWebDriver());

            // Random Variables
            var    name   = "Test Pick" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("EditPickListStatuses", "Redirect To Admin");
                VisitOffice("admin");

                executionLog.Log("EditPickListStatuses", "Redirect To PickList");
                VisitOffice("pick-lists");

                executionLog.Log("EditPickListStatuses", "Verify page title");
                VerifyTitle("Picklists");

                executionLog.Log("EditPickListStatuses", "Enter Picklist To Seacrch");
                System_PicklistHelper.TypeText("EnterNamePicklist", "Statuses");
                System_PicklistHelper.WaitForWorkAround(2000);

                executionLog.Log("EditPickListStatuses", "Enter Module to search");
                System_PicklistHelper.TypeText("EnterModule", "Merchants");
                System_PicklistHelper.WaitForWorkAround(3000);

                executionLog.Log("EditPickListStatuses", "Click On Statuses");
                System_PicklistHelper.ClickElement("ClickOnStatuses");

                executionLog.Log("EditPickListStatuses", "Clcik on Add button");
                System_PicklistHelper.ClickElement("AddPick");
                System_PicklistHelper.WaitForWorkAround(3000);

                executionLog.Log("EditPickListStatuses", "Enter PickList Value");
                System_PicklistHelper.TypeText("EnterPickListValue", name);

                executionLog.Log("EditPickListStatuses", "Click PickList Save Button");
                System_PicklistHelper.ClickElement("PickListSaveBtn");

                executionLog.Log("EditPickListStatuses", "Click PickList Save Button");
                System_PicklistHelper.ClickElement("Cancel");
                System_PicklistHelper.WaitForWorkAround(3000);

                executionLog.Log("EditPickListStatuses", "Verify page title");
                VerifyTitle("Add/Edit Picklist Items");

                executionLog.Log("EditPickListStatuses", "Click delete Button");
                System_PicklistHelper.ClickElement("DeletePick");

                executionLog.Log("EditPickListStatuses", "Click on item to deleted");
                System_PicklistHelper.DeletePickList(name);

                executionLog.Log("EditPickListStatuses", "Selelct replace with item.");
                System_PicklistHelper.SelectText("ReplacePiclist", "Declined");

                executionLog.Log("EditPickListStatuses", "Click PickList Save Button");
                System_PicklistHelper.ClickElement("PickListSaveBtn");

                executionLog.Log("EditPickListStatuses", "Accept alert message.");
                System_PicklistHelper.AcceptAlert();
                System_PicklistHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EditPickListStatuses");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Edit Pick List Statuses");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Edit Pick List Statuses", "Bug", "Medium", "Pick Lists Page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Edit Pick List Statuses");
                        TakeScreenshot("EditPickListStatuses");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditPickListStatuses.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EditPickListStatuses");
                        string id            = loginHelper.getIssueID("Edit Pick List Statuses");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditPickListStatuses.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Edit Pick List Statuses"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Edit Pick List Statuses");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EditPickListStatuses");
                executionLog.WriteInExcel("Edit Pick List Statuses", Status, JIRA, "Office Systems");
            }
        }
Ejemplo n.º 3
0
        public void createPickList()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog           = new ExecutionLog();
            var loginHelper            = new LoginHelper(GetWebDriver());
            var system_PicklistsHelper = new System_PicklistsHelper(GetWebDriver());

            // Variables
            var    Picklist = "Pick" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("CreatePickList", "Go to picklist page");
                VisitOffice("pick-lists");

                executionLog.Log("CreatePickList", "Verify title");
                VerifyTitle("Picklists");

                executionLog.Log("CreatePickList", " Open the first picklist");
                system_PicklistsHelper.ClickElement("PickList1");

                for (int i = 1; i < 20; i++)
                {
                    var loc = "//table[@class='table table-bordered']//tr[" + i + "]//td[1]/span";

                    if (loc.Contains("Personal"))
                    {
                        executionLog.Log("CreatePickList", "Click on Add button");
                        system_PicklistsHelper.ClickElement("AddPick");
                        system_PicklistsHelper.WaitForWorkAround(2000);

                        executionLog.Log("CreatePickList", "Enter name");
                        system_PicklistsHelper.TypeText("PickType", Picklist);

                        executionLog.Log("CreatePickList", "Click on Save button");
                        system_PicklistsHelper.ClickElement("SavePicklist");

                        executionLog.Log("CreatePickList", "Click on Cancel");
                        system_PicklistsHelper.ClickElement("Cancel");
                        system_PicklistsHelper.WaitForWorkAround(4000);

                        executionLog.Log("CreatePickList", "Verfiy Text");
                        system_PicklistsHelper.VerifyPageText(Picklist);

                        executionLog.Log("CreatePickList", "Click delete Button");
                        system_PicklistsHelper.ClickElement("DeletePick");
                        system_PicklistsHelper.WaitForWorkAround(3000);

                        executionLog.Log("CreatePickList", "Click on item to deleted");
                        system_PicklistsHelper.DeletePickList(Picklist);
                        system_PicklistsHelper.WaitForWorkAround(3000);

                        executionLog.Log("CreatePickList", "Selelct replace with item.");
                        system_PicklistsHelper.SelectText("ReplacePiclist", "Personal");

                        executionLog.Log("CreatePickList", "Click PickList Save Button");
                        system_PicklistsHelper.ClickElement("PickListSaveBtn");

                        executionLog.Log("CreatePickList", "Accept alert message.");
                        system_PicklistsHelper.AcceptAlert();
                        system_PicklistsHelper.WaitForWorkAround(4000);
                        break;
                    }
                    else
                    {
                        executionLog.Log("CreatePickList", " Open the first picklist");
                        //  system_PicklistsHelper.ClickElement("PickList1");

                        executionLog.Log("CreatePickList", "Click on Add button");
                        system_PicklistsHelper.ClickElement("AddPick");
                        system_PicklistsHelper.WaitForWorkAround(2000);

                        executionLog.Log("CreatePickList", "Enter name");
                        system_PicklistsHelper.TypeText("PickType", "Personal");

                        executionLog.Log("CreatePickList", "Click on Save button");
                        system_PicklistsHelper.ClickElement("SavePicklist");
                        system_PicklistsHelper.WaitForWorkAround(5000);

                        executionLog.Log("CreatePickList", "Click on Cancel button");
                        system_PicklistsHelper.ClickJs("Cancel");

                        executionLog.Log("CreatePickList", "Click on Add button");
                        system_PicklistsHelper.ClickElement("AddPick");
                        system_PicklistsHelper.WaitForWorkAround(2000);

                        executionLog.Log("CreatePickList", "Enter name");
                        system_PicklistsHelper.TypeText("PickType", Picklist);

                        executionLog.Log("CreatePickList", "Click on Save button");
                        system_PicklistsHelper.ClickElement("SavePicklist");

                        executionLog.Log("CreatePickList", "Click on Cancel");
                        system_PicklistsHelper.ClickElement("Cancel");
                        system_PicklistsHelper.WaitForWorkAround(4000);

                        executionLog.Log("CreatePickList", "Click delete Button");
                        system_PicklistsHelper.ClickElement("DeletePick");
                        system_PicklistsHelper.WaitForWorkAround(3000);

                        executionLog.Log("CreatePickList", "Click on item to deleted");
                        system_PicklistsHelper.DeletePickList(Picklist);
                        system_PicklistsHelper.WaitForWorkAround(3000);

                        executionLog.Log("CreatePickList", "Selelct replace with item.");
                        system_PicklistsHelper.SelectText("ReplacePiclist", "Personal");

                        executionLog.Log("CreatePickList", "Click PickList Save Button");
                        system_PicklistsHelper.ClickElement("PickListSaveBtn");

                        executionLog.Log("CreatePickList", "Accept alert message.");
                        system_PicklistsHelper.AcceptAlert();
                        system_PicklistsHelper.WaitForWorkAround(4000);
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CreatePickList");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Create Pick List");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Pick List", "Bug", "Medium", "Pick List page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Create Pick List");
                        TakeScreenshot("CreatePickList");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreatePickList.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreatePickList");
                        string id            = loginHelper.getIssueID("Create Pick List");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreatePickList.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Create Pick List"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Create Pick List");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreatePickList");
                executionLog.WriteInExcel("Create Pick List", Status, JIRA, "System picklist");
            }
        }
Ejemplo n.º 4
0
        public void deletePickItemIssue()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog           = new ExecutionLog();
            var loginHelper            = new LoginHelper(GetWebDriver());
            var system_PicklistsHelper = new System_PicklistsHelper(GetWebDriver());

            // Variables
            var    Picklist = "Pick" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("DeletePickItemIssue", "Go to picklist page");
                VisitOffice("pick-lists");

                executionLog.Log("DeletePickItemIssue", "Verify title");
                VerifyTitle("Picklists");

                executionLog.Log("DeletePickItemIssue", " Open the Shipping picklist");
                system_PicklistsHelper.ClickElement("ShippingPick");

                executionLog.Log("DeletePickItemIssue", "Veirfy title");
                VerifyTitle("Add/Edit Picklist Items");

                executionLog.Log("DeletePickItemIssue", "Click on Add button");
                system_PicklistsHelper.ClickElement("AddPick");
                system_PicklistsHelper.WaitForWorkAround(2000);

                executionLog.Log("DeletePickItemIssue", "Enter name");
                system_PicklistsHelper.TypeText("PickType", Picklist);

                executionLog.Log("DeletePickItemIssue", "Click on Save button");
                system_PicklistsHelper.ClickElement("Save");

                executionLog.Log("DeletePickItemIssue", "Wait for text");
                //            system_PicklistsHelper.WaitForText("The picklist value is added successfully", 10);

                executionLog.Log("DeletePickItemIssue", "Veirfy title");
                VerifyTitle("Add/Edit Picklist Items");
                system_PicklistsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeletePickItemIssue", "Click on Delete button");
                system_PicklistsHelper.ClickElement("Cancel");

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

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