Ejemplo n.º 1
0
        public void editPDFImportWizard()
        {
            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());
            PDFImportWizardHelper pDFImportWizardHelper = new PDFImportWizardHelper(GetWebDriver());

            // Variable
            String pdf = "sample" + RandomNumber(1, 99) + ".pdf";


            //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  Admin
            pDFImportWizardHelper.RedirectToAdmin();

            //Redirect
            pDFImportWizardHelper.RedirectToPage();

            //Verify title
            VerifyTitle("PDF Import Wizard");

            //Click on Import  button
            pDFImportWizardHelper.ClickElement("ClickOnImport");

            //Choose Module
            pDFImportWizardHelper.Select("ChooseModule", "20");

            //Upload PDF File\
            String filename = GetPathToFile() + "2.PDF";

            pDFImportWizardHelper.upload("SelectFile", filename);

            //Click On Import
            pDFImportWizardHelper.ClickElement("ClickOnImport");
            pDFImportWizardHelper.WaitForWorkAround(10000);

            //Click On Next
            pDFImportWizardHelper.ClickElement("ClickOnNext");

            //verify title
            VerifyTitle("PDF Import Wizard");

            //Select Category
            pDFImportWizardHelper.Select("SelectCategory", "338");

            //Click on Save button
            pDFImportWizardHelper.ClickElement("ClickOnSaveBtn");

            //wait for text
            pDFImportWizardHelper.WaitForText("PDF Template options saved successfully.", 30);

            //Click On Edit
            pDFImportWizardHelper.ClickElement("ClickOnEdit");

            //Verify title
            VerifyTitle("Edit PDF Template");

            //Enter Name
            pDFImportWizardHelper.TypeText("EnterName", "Test.pdf");

            //Click Edit Save
            pDFImportWizardHelper.ClickElement("ClickEditSave");

            pDFImportWizardHelper.WaitForText("PDF Template Updated Successfully.", 30);

            //Click on Flag To make Inactive
            pDFImportWizardHelper.ClickElement("ClickOnMakeInactiveBtn");
            pDFImportWizardHelper.WaitForWorkAround(6000);
        }
Ejemplo n.º 2
0
        public void clonePDFTemplate()
        {
            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());
            PDFImportWizardHelper pDFImportWizardHelper = new PDFImportWizardHelper(GetWebDriver());

            // Variable
            String name = "Test" + RandomNumber(1, 99);


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


            //Redirect to PDF Template
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/pdf_templates");
            pDFImportWizardHelper.WaitForWorkAround(6000);

            var Click = "//table[@id='list1']/tbody/tr[2]";

            if (pDFImportWizardHelper.IsElementPresent(Click))
            {
                Console.WriteLine(pDFImportWizardHelper.IsElementPresent(Click));

                pDFImportWizardHelper.ClickElement("ClickOnPDFToClone");
                pDFImportWizardHelper.ClickElement("ClickOnCloneBtn");
                pDFImportWizardHelper.AcceptAlert();
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.VerifyPageText("PDF Template is cloned successfully");
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.VerifyPageText("View - Clone of ID");
                pDFImportWizardHelper.WaitForWorkAround(2000);
            }

            else
            {
                //Click On PDF Package
                pDFImportWizardHelper.ClickElement("ClickOnPDFPackage");

                //Enter PDF Name
                pDFImportWizardHelper.TypeText("EnterPDFName", "New PDF");

                //Select Module
                pDFImportWizardHelper.Select("SelectModule", "20");
                pDFImportWizardHelper.WaitForWorkAround(2000);

                //Select Module
                pDFImportWizardHelper.Select("SelectPDFTemplate", "6031");

                //SelectCatory
                pDFImportWizardHelper.Select("SelectCatory", "290");

                //Click Checkbox
                pDFImportWizardHelper.ClickElement("DisplayeInTabs");

                //Click on  Can Share
                pDFImportWizardHelper.ClickElement("CanShare");

                //CanEmail
                pDFImportWizardHelper.ClickElement("CanEmail");

                //Click on Save button
                pDFImportWizardHelper.ClickElement("ClickOnSave");
                pDFImportWizardHelper.VerifyPageText("PDF Package Template Created Successfully.");
                pDFImportWizardHelper.WaitForWorkAround(4000);

                //###################  CLone
                pDFImportWizardHelper.ClickElement("ClickOnPDFTemplates");

                //Redirect to PDF Template
                GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selenium_corp/selenium_office/pdf_templates");

                //Enter Name To search
                pDFImportWizardHelper.TypeText("EnterPDFNameToSrch", "New PDF");
                pDFImportWizardHelper.ClickElement("ClickOnPDFToClone");
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.ClickElement("ClickOnCloneBtn");
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.AcceptAlert();
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.VerifyPageText("PDF Template is cloned successfully");
                pDFImportWizardHelper.WaitForWorkAround(2000);
                pDFImportWizardHelper.VerifyPageText("View - Clone of ID");
                pDFImportWizardHelper.WaitForWorkAround(2000);
            }
        }