示例#1
0
        public void bulkUpdateSaleAgent()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var loginHelper     = new LoginHelper(GetWebDriver());
            var clientHelper    = new ClientsHelper(GetWebDriver());
            var saleAgentHelper = new SaleAgentHelper(GetWebDriver());
            var filePath        = @"D:\pegqa\TestAutomationProject\PegasusTests\Screenshots\EXLFile\AgentImport.xlsx";

            Console.WriteLine("FILE = " + filePath);

            //Variable random
            var name = "TESTCLIENT" + GetRandomNumber();


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

            //Verify Page title
            VerifyTitle("Dashboard");
            Console.WriteLine("Redirected at Dashboard screen.");

            //Click on Click On Partner Agent
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/sales_agents");
            saleAgentHelper.WaitForWorkAround(3000);

            //Click On Sale Agnet ChkBox
            saleAgentHelper.ClickElement("ClickOnSaleAgnetChkBox");

            //ClickOnBulkUpdate
            saleAgentHelper.ClickElement("ClickOnBulkUpdate");


//############ ChangeDepartment

            saleAgentHelper.ClickElement("ChangeDepartment");

            //Select Department
            saleAgentHelper.Select("SelectDepartmentSaleAgnet", "IT");


            //ClickOnBulkUpdate
            saleAgentHelper.ClickDisplayed("//a[@title='Update']");
            saleAgentHelper.AcceptAlert();



//############ Change  Role

            //ClickOnBulkUpdate
            saleAgentHelper.ClickElement("ClickOnSaleAgnetChkBox");
            saleAgentHelper.ClickElement("ClickOnBulkUpdate");

            saleAgentHelper.ClickElement("ChangeRole");

            //Select Department
            //   saleAgentHelper.Select("SelectRoleSaleAgent", "Manager");


            //ClickOnBulkUpdate
            saleAgentHelper.ClickDisplayed("//a[@title='Update']");
            saleAgentHelper.AcceptAlert();

            //############ Change Team

            //ClickOnBulkUpdate
            saleAgentHelper.ClickElement("ClickOnSaleAgnetChkBox");
            saleAgentHelper.ClickElement("ClickOnBulkUpdate");

            //
            saleAgentHelper.ClickElement("ChangeTeam");

            //Select Department
            //    saleAgentHelper.Select("SelectTeam","A Team");


            //ClickOnBulkUpdate
            saleAgentHelper.ClickDisplayed("//a[@title='Update']");
            saleAgentHelper.AcceptAlert();

            //############ ChangeDepartment

            //ClickOnBulkUpdate
            saleAgentHelper.ClickElement("ClickOnSaleAgnetChkBox");
            saleAgentHelper.ClickElement("ClickOnBulkUpdate");


            saleAgentHelper.ClickElement("ChangeStatus");

            //Select Department
            saleAgentHelper.Select("SelectStatus", "Active");

            //ClickOnBulkUpdate
            saleAgentHelper.ClickDisplayed("//a[@title='Update']");
            saleAgentHelper.AcceptAlert();
            saleAgentHelper.WaitForWorkAround(3000);
        }
示例#2
0
        public void saleAgentWithUser()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var loginHelper     = new LoginHelper(GetWebDriver());
            var clientHelper    = new ClientsHelper(GetWebDriver());
            var saleAgentHelper = new SaleAgentHelper(GetWebDriver());

            //Variable random
            var name = "TESTCLIENT" + GetRandomNumber();


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

            //Verify Page title
            VerifyTitle("Dashboard");
            Console.WriteLine("Redirected at Dashboard screen.");

            //Click on Agent in Topmenu
            saleAgentHelper.ClickElement("ClickAgentTab");


//################################# CREATE A agent   #############################################

            //Click on Click On Partner Agent
            saleAgentHelper.redirectToPage();

            //Click On Click On Create SaleBtn
            saleAgentHelper.ClickElement("ClickOnaCreateSaleBtn");

            //Select Salutation
            saleAgentHelper.Select("SelectSalutation", "Mr");

            //Enter FirstNAME
            saleAgentHelper.TypeText("FirstNAME", "Test Sale gent");

            //Enter LastName
            saleAgentHelper.TypeText("LastName", "Tester");

            //Enter Date Of Birth
            saleAgentHelper.TypeText("BirthDay", "1991-03-02");


            //############### CONTACT INFORMATION ###################################

            //Enter eAddressType
            saleAgentHelper.Select("eAddressType", "E-Mail");

            //Enter eAddressLebel
            saleAgentHelper.Select("eAddressLebel", "Work");

            //Enter eAddressType
            var Email = "Sale" + RandomNumber(1, 999) + "@yopmail.com";

            saleAgentHelper.TypeText("eAddress", Email);

            //################## PHONE ###########################

            //Enter SelectPhoneType
            saleAgentHelper.Select("SelectPhoneType", "Work");

            //Enter PhoneNumber
            saleAgentHelper.TypeText("PhoneNumber", "1214122121");

            //##################### ADDRESS TYPE

            //Enter Address Type
            saleAgentHelper.Select("AddressType", "Office");

            //Enter AddressLine1
            saleAgentHelper.TypeText("AddressLine1", "FC 89");

            //Enter City
            saleAgentHelper.TypeText("City", "Test City");

            //Enter PhoneNumber
            saleAgentHelper.TypeText("PostalCode", "60601");


            //########################## DEPARTMENT ROLE   ###############################

            //Click On Department
            saleAgentHelper.ClickElement("ClickOnDeppartmentTeam");

            //Select Department
            saleAgentHelper.Select("SelectDepartment", "78");

            //Select Select Role
            saleAgentHelper.Select("SelectRole", "76");

            //Select Primary  Team
            saleAgentHelper.Select("PrimaryTeam", "40");


            //################### CREATE USER ACCOUNT

            //Click On Checkbox
            saleAgentHelper.ClickElement("ClickONcheckBox");

            //Enter UserName
            saleAgentHelper.TypeText("UserName", name);

            //Click On Avatar
            saleAgentHelper.ClickElement("ClickOnSAvatarBtn");


//##############    click on Save Contact

            //CLICK DoNotSolicit
            saleAgentHelper.ClickElement("SaveAGENTbtn");

            //Click on Move over
            saleAgentHelper.ClickElement("MoveHover");

            //Redirect To Admin
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selenium_corp/selenium_office/admin");
            saleAgentHelper.WaitForWorkAround(3000);

            //Click on Office
            saleAgentHelper.ClickElement("ClickOnOffice");

            //Redirect To User
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selenium_corp/selenium_office/users");
            saleAgentHelper.WaitForWorkAround(2000);

            //Enter Email
            saleAgentHelper.Select("SelectStatus1", "");
            saleAgentHelper.WaitForWorkAround(3000);
            saleAgentHelper.TypeText("EnterEmail", Email);
            saleAgentHelper.WaitForWorkAround(4000);
            saleAgentHelper.VerifyPageText(Email);
            saleAgentHelper.WaitForWorkAround(2000);
        }
        public void saleAgentWithoutUser()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var loginHelper     = new LoginHelper(GetWebDriver());
            var clientHelper    = new ClientsHelper(GetWebDriver());
            var saleAgentHelper = new SaleAgentHelper(GetWebDriver());

            //Variable random
            var name = "TESTCLIENT" + GetRandomNumber();


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

            //Verify Page title
            VerifyTitle("Dashboard");
            Console.WriteLine("Redirected at Dashboard screen.");

            //Click on Agent in Topmenu
            saleAgentHelper.ClickElement("ClickAgentTab");


//################################# CREATE A agent   #############################################

            //Click on Click On Partner Agent
            saleAgentHelper.redirectToPage();

            //Click On Click On Create SaleBtn
            saleAgentHelper.ClickElement("ClickOnaCreateSaleBtn");

            //Select Salutation
            saleAgentHelper.Select("SelectSalutation", "Mr");

            //Enter FirstNAME
            saleAgentHelper.TypeText("FirstNAME", "Test Sale gent");

            //Enter LastName
            saleAgentHelper.TypeText("LastName", "Tester");

            //Enter Date Of Birth
            saleAgentHelper.TypeText("BirthDay", "1991-03-02");


            //############### CONTACT INFORMATION ###################################

            //Enter eAddressType
            saleAgentHelper.Select("eAddressType", "E-Mail");

            //Enter eAddressLebel
            saleAgentHelper.Select("eAddressLebel", "Work");

            //Enter eAddressType
            saleAgentHelper.TypeText("eAddress", "*****@*****.**");

            //################## PHONE ###########################

            //Enter SelectPhoneType
            saleAgentHelper.Select("SelectPhoneType", "Work");

            //Enter PhoneNumber
            saleAgentHelper.TypeText("PhoneNumber", "1214122121");

            //##################### ADDRESS TYPE

            //Enter Address Type
            saleAgentHelper.Select("AddressType", "Office");

            //Enter AddressLine1
            saleAgentHelper.TypeText("AddressLine1", "FC 89");


            //Enter PhoneNumber
            saleAgentHelper.TypeText("PostalCode", "60601");

            //########################## DEPARTMENT ROLE   ###############################

            //Click On Department
            saleAgentHelper.ClickElement("ClickOnDeppartmentTeam");

            //Select Department
            saleAgentHelper.Select("SelectDepartment", "78");

            //Select Select Role
            saleAgentHelper.Select("SelectRole", "76");

            //Select Primary  Team
            saleAgentHelper.Select("PrimaryTeam", "40");

            //CLICK On Save
            saleAgentHelper.ClickElement("SaveAGENTbtn");
            saleAgentHelper.WaitForWorkAround(3000);
            saleAgentHelper.VerifyPageText("The employee is successfully added");
            saleAgentHelper.WaitForWorkAround(3000);
        }