public void fieldDictionarySection()
        {
            string[] username = null;
            string[] password = null;
            string[] log = null;
            var oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

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

            //Initializing the objects
            var loginHelper = new LoginHelper(GetWebDriver());
            var clientHelper = new ClientsHelper(GetWebDriver());
            var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //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.");

            //Go to Field Dictionary Section page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/sections");

            //Verify Title
            VerifyTitle("Section Management");

            //Click on Change tab button
            partnerAgentHelperNewSkin.ClickElement("FSChangeTab");

            //Verify error not displayed
            partnerAgentHelperNewSkin.VerifyTextNotPresent("An Internal Error Has Occurred");

            //Click on Save button
            partnerAgentHelperNewSkin.ClickElement("FSSave");

            //Accept alert
            partnerAgentHelperNewSkin.AcceptAlert();

            //Verify error not displayed
            partnerAgentHelperNewSkin.VerifyTextNotPresent("An Internal Error Has Occurred");

            //Verify page text
            partnerAgentHelperNewSkin.VerifyPageText("The section sucessfully added to the selected tab");

            //Log out from the application
            GetWebDriver().Navigate().GoToUrl(log[0]);
        }
        public void vendorEmailVerification()
        {
            string[] username = null;
            string[] password = null;
            string[] log = null;
            var oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

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

            //Initializing the objects
            var loginHelper = new LoginHelper(GetWebDriver());
            var clientHelper = new ClientsHelper(GetWebDriver());
            var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //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.");

            //Visit to create vendor page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/vendors/create");

            //Verify title
            VerifyTitle("Create a New Vendor");

            //Click on 'Save' button without entering details
            partnerAgentHelperNewSkin.ClickElement("OfficeSave");

            //Verify Validation message displayed for email
            partnerAgentHelperNewSkin.verifyElementPresent("EmailVerification");

            //Enter invalid email
            partnerAgentHelperNewSkin.TypeText("EmailVendor", "INVALID");

            //Click on 'Save' button after entering invalid email
            partnerAgentHelperNewSkin.ClickElement("OfficeSave");

            //Verify email validate
            partnerAgentHelperNewSkin.verifyElementPresent("EmailVerification");
            partnerAgentHelperNewSkin.VerifyPageText("Please enter a valid email address");

            //Log out from the application
            GetWebDriver().Navigate().GoToUrl(log[0]);
        }
        public void revenueShareButtonForPartnerAssociation()
        {
            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 partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //Variable
            var name = "TestAgent" + 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
            partnerAgentHelperNewSkin.MouseHover("ClickOnAgentTab");

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

            //Click on Click On Partner Agent
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/partners/associations");

            //ClickOnRevenueShare
            partnerAgentHelperNewSkin.ClickElement("RevenueSahrnepartneragent");
            partnerAgentHelperNewSkin.WaitForWorkAround(6000);

            //Verify
            partnerAgentHelperNewSkin.VerifyPageText("Partner Associations");
            partnerAgentHelperNewSkin.WaitForWorkAround(3000);
        }
Пример #4
0
        public void verifyRecycleBin()
        {
            string[] username = null;
            string[] password = null;
            string[] log = null;
            var oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

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

            //Initializing the objects
            var loginHelper = new LoginHelper(GetWebDriver());
            var clientHelper = new ClientsHelper(GetWebDriver());
            var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //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.");

            //Go to Client export page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients/export");

            //Verify Title
            VerifyTitle("Client");

            //Mouse hover on the Ticks
            partnerAgentHelperNewSkin.MouseHover("TicHover");

            //Verify 'RecycleBin' not available
            partnerAgentHelperNewSkin.VerifyTextNotPresent("RecycleBin");

            //Verify Recycle Bin available
            partnerAgentHelperNewSkin.VerifyPageText("Recycle Bin");
        }
        public void createPartnerAgentAndUserAccount()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

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

            //Initializing the objects
            LoginHelper loginHelper = new LoginHelper(GetWebDriver());
            ClientsHelper clientHelper = new ClientsHelper(GetWebDriver());
            CreateAgentHelper createAgentHelper = new CreateAgentHelper(GetWebDriver());
            var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //Variable
            String name = "TestAgent" + 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
            partnerAgentHelperNewSkin.MouseHover("ClickOnAgentTab");

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

            //Click on Click On Partner Agent
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/partners/agents");

            //Click On Create
            partnerAgentHelperNewSkin.ClickElement("ClickOnCreatebtnAdjmnt");

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

            //Enter FirstNAME
            partnerAgentHelperNewSkin.TypeText("FirstNAME", "Test Agent");

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

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

            //Click on Middle name
            partnerAgentHelperNewSkin.ClickElement("ClickMiddleName");

            //Enter DBAName
            partnerAgentHelperNewSkin.TypeText("DBAName", "Test DBA");

            //Enter LinkedInUrl
            partnerAgentHelperNewSkin.TypeText("LinkedInUrl", "LinkedIn.con");

            //Enter FaceBook Url
            partnerAgentHelperNewSkin.TypeText("FaceBookUrl", "Facebook.com");

            //Enter TwitterURL
            partnerAgentHelperNewSkin.TypeText("TwitterURL", "Twitter.com");

            //Enter DBAName
            partnerAgentHelperNewSkin.Select("SelectLanguage", "English");

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

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

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

            //Enter eAddressType
            var Email = "P.Agent" + RandomNumber(1, 999) + "@yopmail.com";
            partnerAgentHelperNewSkin.TypeText("eAddress", Email);

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

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

            //Enter PhoneNumber
            partnerAgentHelperNewSkin.TypeText("PhoneNumber", "1212121212");

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

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

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

            //Enter City
            partnerAgentHelperNewSkin.TypeText("PostalCode", "60601");
            partnerAgentHelperNewSkin.WaitForWorkAround(2000);

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

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

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

            //Click On Avatar
            partnerAgentHelperNewSkin.ClickElement("ClickOnAvatar");

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

            //CLICK Save AGENT btn
            partnerAgentHelperNewSkin.ClickElement("ClickSaveNskin");
            partnerAgentHelperNewSkin.WaitForWorkAround(5000);

            //Verify
            partnerAgentHelperNewSkin.VerifyPageText("The user is successfully added");
        }
        public void revenueAdjustmentPartnerAgentRemoveFlatAmount()
        {
            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 partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //Variable
            var name = "TestAgent" + 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
            partnerAgentHelperNewSkin.MouseHover("ClickOnAgentTab");

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

            //Click on Click On Partner Agent
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/partners/agents");

             //###########  Search and click
            //Enter
             //   partnerAgentHelperNewSkin.TypeText("EnterAgentName", "Partner Agent Tester");

              //  partnerAgentHelperNewSkin.Select("SelectStatusAdjtmnt", "");
            partnerAgentHelperNewSkin.WaitForWorkAround(3000);

            var loc = "//table[@id='list1']/tbody/tr[2]";
            if (partnerAgentHelperNewSkin.IsElementPresent(loc))
            {

                //Click On Sale Agent
                partnerAgentHelperNewSkin.ClickElement("ClikOnPartnerAgent");

                //scroll to element
                partnerAgentHelperNewSkin.scrollToElement("ClickOnCreatebtnAdjmnt");

                //Click On Create btn Adjmnt
                partnerAgentHelperNewSkin.ClickElement("ClickOnCreatebtnAdjmnt");

                //EnterAdjustmentName
                partnerAgentHelperNewSkin.TypeText("EnterAdjustmentName", "SaleAdjustment");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectAdjustmentFor", "Agent");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("AdjustmentType", "Transaction");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectReportingPeriod", "00");

                //SelectProcessor
                partnerAgentHelperNewSkin.Select("SelectProcessor", "Any");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectRuleType", "1");

                //Enter Amount
                partnerAgentHelperNewSkin.TypeText("EnterAmount", "20");

                //AddRemove
                partnerAgentHelperNewSkin.Select("AddRemove", "Add");

                //ClickOnSaveBtnAdjustmnet
                partnerAgentHelperNewSkin.ClickElement("ClickOnSaveBtnAdjustmnet");
                partnerAgentHelperNewSkin.WaitForWorkAround(3000);

                //Verify
                partnerAgentHelperNewSkin.VerifyPageText("Master Adjustment Rules Created Successfully.");

            }
            else
            {

                //Click On Create
                partnerAgentHelperNewSkin.ClickElement("ClickOnCreateBtn");

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

                //Enter FirstNAME
                partnerAgentHelperNewSkin.TypeText("FirstNAME", "Partner Agent");

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

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

                //Click on Middle name
                partnerAgentHelperNewSkin.ClickElement("ClickMiddleName");

                //Enter DBAName
                partnerAgentHelperNewSkin.TypeText("DBAName", "Test DBA");

                //Enter LinkedInUrl
                partnerAgentHelperNewSkin.TypeText("LinkedInUrl", "LinkedIn.con");

                //Enter FaceBook Url
                partnerAgentHelperNewSkin.TypeText("FaceBookUrl", "Facebook.com");

                //Enter TwitterURL
                partnerAgentHelperNewSkin.TypeText("TwitterURL", "Twitter.com");

                //Enter DBAName
                partnerAgentHelperNewSkin.Select("SelectLanguage", "English");

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

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

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

                //Enter eAddressType
                var Email = "P.Agent" + RandomNumber(1, 999) + "@yopmail.com";
                partnerAgentHelperNewSkin.TypeText("eAddress", Email);

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

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

                //Enter PhoneNumber
                partnerAgentHelperNewSkin.TypeText("PhoneNumber", "1212121212");

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

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

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

                //Enter City
                partnerAgentHelperNewSkin.TypeText("PostalCode", "60601");
                partnerAgentHelperNewSkin.WaitForWorkAround(2000);

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

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

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

                //Click On Avatar
                partnerAgentHelperNewSkin.ClickElement("ClickOnAvatar");

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

                //CLICK Save AGENT btn
                partnerAgentHelperNewSkin.ClickElement("ClickSaveNskin");
                partnerAgentHelperNewSkin.WaitForWorkAround(5000);

                //Verify Text
                partnerAgentHelperNewSkin.VerifyPageText("The user is successfully added");
                partnerAgentHelperNewSkin.WaitForWorkAround(5000);

                //Crearte Adjustment

            /*            //Enter
                partnerAgentHelperNewSkin.TypeText("EnterAgentName", "Partner Agent Tester");
                partnerAgentHelperNewSkin.WaitForWorkAround(3000);

                //Click On Sale Agent
                partnerAgentHelperNewSkin.ClickElement("ClikOnPartnerAgent");  */

                //Click On Create btn Adjmnt
                partnerAgentHelperNewSkin.ClickElement("ClickOnCreatebtnAdjmnt");

                //EnterAdjustmentName
                partnerAgentHelperNewSkin.TypeText("EnterAdjustmentName", "SaleAdjustment");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectAdjustmentFor", "Agent");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("AdjustmentType", "Transaction");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectReportingPeriod", "00");

                //SelectProcessor
                partnerAgentHelperNewSkin.Select("SelectProcessor", "Any");

                //SelectAdjustmentFor
                partnerAgentHelperNewSkin.Select("SelectRuleType", "1");

                //Enter Amount
                partnerAgentHelperNewSkin.TypeText("EnterAmount", "200");

                //AddRemove
                partnerAgentHelperNewSkin.Select("AddRemove", "Remove");

                //ClickOnSaveBtnAdjustmnet
                partnerAgentHelperNewSkin.ClickElement("ClickOnSaveBtnAdjustmnet");
                partnerAgentHelperNewSkin.WaitForWorkAround(3000);

                //Verify
                partnerAgentHelperNewSkin.VerifyPageText("Master Adjustment Rules Created Successfully.");

            }
        }
        public void languageNameValidation()
        {
            string[] username = null;
            string[] password = null;
            string[] log = null;
            var oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

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

            //Initializing the objects
            var loginHelper = new LoginHelper(GetWebDriver());
            var clientHelper = new ClientsHelper(GetWebDriver());
            var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver());

            //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");

            //Go to Language page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/languages");

            //Verify title
            VerifyTitle("Languages");

            //Click on 'Create' button
            partnerAgentHelperNewSkin.ClickElement("LanguageCreate");

            //Wait for text
            partnerAgentHelperNewSkin.WaitForText("Add New Language", 30);
            partnerAgentHelperNewSkin.WaitForWorkAround(3000);

            //Enter language name
            partnerAgentHelperNewSkin.TypeText("LanguageName", "Test");

            //Click on Save button
            partnerAgentHelperNewSkin.ClickElement("LanguageSave");

            //Wait for text
            partnerAgentHelperNewSkin.WaitForText("Language Created Successfully",40);

            //Click on Edit button
            partnerAgentHelperNewSkin.ClickElement("LanguageEdit");

            //Remove text from the field
            partnerAgentHelperNewSkin.removeText("LanguageBlank");

            //Click on box
            partnerAgentHelperNewSkin.Click("//div[@class='ibox-title']");

            //Click on Save button
            partnerAgentHelperNewSkin.ClickElement("LanguageSave1");

            //Verify error message
            partnerAgentHelperNewSkin.VerifyPageText("Name: Field is required");

            //Click on Close button
            partnerAgentHelperNewSkin.ClickElement("LanguageClose");

            //Click on Cancel button
            partnerAgentHelperNewSkin.ClickElement("LanguageCancel");

            //Click on Delete button
            partnerAgentHelperNewSkin.ClickElement("LanguageDelete");

            //Click on OK button
            partnerAgentHelperNewSkin.ClickElement("LanguageOK");

            //verify language deleted
            //partnerAgentHelperNewSkin.

            //Logout from the application
            GetWebDriver().Navigate().GoToUrl(log[0]);
        }