// [TestMethod]
        public void checkDownLoadedFileFormat()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(GetWebDriver());

            // Variable
            var Proname = "Product" + RandomNumber(100, 999);

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

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

            //Verify Title
            VerifyTitle("Clients");

            //Export as CSV
            addDocumentAdminHelper.ExportAs("CSV");

            var user = addDocumentAdminHelper.CurrentUser();

            //Get newly created file name from downloads folder
            var newfilename = addDocumentAdminHelper.Getnewfilename(new DirectoryInfo(@"C:\" + user + @"s\" + user + @"\Downloads\"));

            var filepath = @"C:\" + user + @"s\" + user + @"\Downloads\" + newfilename.ToString();

            //Verify downloaded file extention
            addDocumentAdminHelper.verifyDownloadedExtention("csv", filepath);

            //Export as Excel
            addDocumentAdminHelper.ExportAs("Excel");

            //Get newly created file name from downloads folder
            newfilename = addDocumentAdminHelper.Getnewfilename(new DirectoryInfo(@"C:\" + user + @"s\" + user + @"\Downloads\"));

            filepath = @"C:\" + user + @"s\" + user + @"\Downloads\" + newfilename.ToString();

            //Verify downloaded file extention
            addDocumentAdminHelper.verifyDownloadedExtention("xls", filepath);
        }
        public void checkProcessor()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(GetWebDriver());

            // Variable
            var Proname = "Product" + RandomNumber(100, 999);

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

            //Redirect to the master Processors page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/processor_types");

            //verify title
            VerifyTitle("Master Processors");

            //Get all processor count
            int processcount = addDocumentAdminHelper.GetProcessorCount("ProcessTable");

            //Get all processor
            string[] processor = addDocumentAdminHelper.GetAllProcessor("ProcessTable");

            //Redirect to the Create client page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients/create");

            //Verify title
            VerifyTitle("Create a Client");

            //Click on Bussiness details
            addDocumentAdminHelper.ClickElement("Bussiness");

            //Verify Count
            addDocumentAdminHelper.VerifyProcessCount("ProcessDropdown", processcount);

            //Verify all processor
            addDocumentAdminHelper.VerifyAllProcessor("ProcessDropdown", processor);
        }
        public void addDocumentAdmin()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(GetWebDriver());

            // Variable
            var name = "Testing Subject" + RandomNumber(1, 99);
            var email = "Test" + RandomNumber(1, 999) + "@gmail.com.com";

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

            //################################# Corprate TAB #############################################

            //Click on Terminal And Equipment Tab
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create");

            //verify title
            VerifyTitle("Create a New Document");

            //################################# ADD Document #############################################

            //Select displayed new window
            addDocumentAdminHelper.TypeText("Name", "TEST DOCUMENT");

            //Upload doc
            String Filename = GetPathToFile() + "index.jpg";
            addDocumentAdminHelper.Upload("ClickToUpload", Filename);

            //Enter dESCRIPTION
               // addDocumentAdminHelper.TypeText("Description", "THIS IS DOCUMENT DESCRIPTION");

            //Click on Save button
            addDocumentAdminHelper.ClickElement("ClickOnSave");
            addDocumentAdminHelper.WaitForText("Document saved successfully.", 30);
        }
        public void clientExportFileWithoutError()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(GetWebDriver());

            // Variable
            var Proname = "Product" + RandomNumber(100, 999);

            //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 client page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients");

            //Verify Title
            VerifyTitle("Clients");

            //Export as CSV
            addDocumentAdminHelper.ExportAs("CSV");

            //Verify No error displayed
            addDocumentAdminHelper.VerifyTextNotPresent("Some issues occured in this operation, Contact technical support for help");

            //Export as Excel
            addDocumentAdminHelper.ExportAs("Excel");

            //Verify No error displayed
            addDocumentAdminHelper.VerifyTextNotPresent("Some issues occured in this operation, Contact technical support for help");
        }
        public void createProcessorWithoutError()
        {
            string[] username = null;
            string[] password = null;

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

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

            var ProcessName = "Process" + RandomNumber(100, 999);

            //Initializing the objects
            LoginHelper loginHelper = new LoginHelper(GetWebDriver());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(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 Processor page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/masterdata/processor_types");

            //Verify title
            VerifyTitle("Master Processors");

            //Verify created avatar is available
            bool available = addDocumentAdminHelper.verifyAvatarAvailable(ProcessName);

            if (available)
            {
                //Delete the processor
                addDocumentAdminHelper.deleteProcessor(ProcessName);
            }

             //Go to create Processor page
                GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/masterdata/manage_processors");

             //Verify Title
                VerifyTitle("Manage Processor");

             //Enter Process name
                addDocumentAdminHelper.TypeText("ProcessName", ProcessName);

             //Enter Process Code
                addDocumentAdminHelper.TypeText("ProcessCode", RandomNumber(100, 999).ToString());

             //Click on Save button
                addDocumentAdminHelper.ClickElement("ProcessSave");

             //Verify title
                VerifyTitle("Master Processors");

             //Verify process added sussfully
                Assert.IsTrue(addDocumentAdminHelper.verifyAvatarAvailable(ProcessName));

            //Delete created processor
                addDocumentAdminHelper.deleteProcessor(ProcessName);
        }
Beispiel #6
0
        public void expandFields()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(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 create Client page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients/create");

            //Verify Title
            VerifyTitle("Create a Client");

               //Click on Company details
            addDocumentAdminHelper.ClickElement("CompanyDetailsTab");

            //Verify Company Details is already expanded
            addDocumentAdminHelper.verifyExpanded(1);

            //Click on Description text
            addDocumentAdminHelper.ClickElement("CompanyDetails");

            //Click on Description text
            addDocumentAdminHelper.ClickElement("DescriptionText");

            //Verify Field expanded
            addDocumentAdminHelper.verifyExpanded(3);

            //Click on Description text
            addDocumentAdminHelper.ClickElement("DescriptionText");

            //Click on More Company Details
            addDocumentAdminHelper.ClickElement("MoreDetails");

            //Verify Field expanded
            addDocumentAdminHelper.verifyExpanded(5);

            //Click on More Company Details
            addDocumentAdminHelper.ClickElement("MoreDetails");

            //Click on Site Survey
            addDocumentAdminHelper.ClickElement("SiteSurvay");

            //Verify Field expanded
            addDocumentAdminHelper.verifyExpanded(6);

            //Click on Site Survey
            addDocumentAdminHelper.ClickElement("SiteSurvay");
        }
        public void createDuplicateAvatarError()
        {
            string[] username = null;
            string[] password = null;

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

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

            var AvatarName = "Avatar" + RandomNumber(100, 999);

            //Initializing the objects
            LoginHelper loginHelper = new LoginHelper(GetWebDriver());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(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 Avatar page
            GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/avatars");

            //Verify title
            VerifyTitle("Avatars");

            //Verify created avatar is available
            bool available = addDocumentAdminHelper.verifyAvatarAvailable(AvatarName);
            bool flag = true;
            //Create AVATAR IS NOT AVAILABLE

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

            //Verify Title
            VerifyTitle("Create an Avatar");

            //Enter avatar name
            addDocumentAdminHelper.TypeText("AvatarName", AvatarName);

            //Select User type
            addDocumentAdminHelper.SelectByText("AvatarType", "Employee");

            //Select Status
            addDocumentAdminHelper.SelectByText("AvatarStatus", "Active");

            //Click on Save button
            addDocumentAdminHelper.ClickElement("ProSave");

            if (available)
            {
                //Verify ERROR
                addDocumentAdminHelper.VerifyPageText("Avatar exists with this name.");

                flag = false;
            }
            else
            {
                //Verify title
                VerifyTitle("Avatars");

                //Avatar is available
                Assert.IsTrue(addDocumentAdminHelper.verifyAvatarAvailable(AvatarName));
            }

            if (flag)
            {
                //Go to create Avatar page
                GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/avatars/create");

                //Verify Title
                VerifyTitle("Create an Avatar");

                //Enter avatar name
                addDocumentAdminHelper.TypeText("AvatarName", AvatarName);

                //Select User type
                addDocumentAdminHelper.SelectByText("AvatarType", "Employee");

                //Select Status
                addDocumentAdminHelper.SelectByText("AvatarStatus", "Active");

                //Click on Save button
                addDocumentAdminHelper.ClickElement("ProSave");

                //Verify ERROR
                addDocumentAdminHelper.WaitForText("Avatar exists with this name.",30);

            }
        }
        public void developProductsListing()
        {
            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());
            AddDocumentAdminHelper addDocumentAdminHelper = new AddDocumentAdminHelper(GetWebDriver());

            // Variable
            var Proname = "Product" + RandomNumber(100, 999);

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

            //################################# Create Product #############################################

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

            //Wait for text
            addDocumentAdminHelper.WaitForText("Custom Fields", 50);

            //Enter Product Name
            addDocumentAdminHelper.TypeText("ProName", Proname);

            //Select Product Category
            addDocumentAdminHelper.SelectByText("ProCate", "Test Delete");

            //Select Product View
            addDocumentAdminHelper.SelectByText("ProView", "Expanded");

            //Select Product Status
            addDocumentAdminHelper.SelectByText("ProStatus", "Active");

            //Click on Save button
            addDocumentAdminHelper.ClickElement("ProSave");

            //Wait for text
            addDocumentAdminHelper.WaitForText("Bulk Update", 50);

            //################################# Quick filter #############################################

            //Filter By name
            addDocumentAdminHelper.TypeText("SearchName", Proname);

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            //Filter By Category
            addDocumentAdminHelper.TypeText("SearchCate", "Category 1");

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            //Filter By View
            addDocumentAdminHelper.SelectByText("SearchView", "Expand");

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            //Filter By status
            addDocumentAdminHelper.SelectByText("SearchStatus", "Active");

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            //################################# Bulk Update Status #############################################
            //Select all
            addDocumentAdminHelper.ClickElement("CheckAll");

            //Click on 'Bulk update'
            addDocumentAdminHelper.ClickElement("BulkUpdate");

            //Click on Status
            addDocumentAdminHelper.ClickElement("BulkStatus");

            //Wait For text
            addDocumentAdminHelper.WaitForText("Update", 50);

            //Select Status
            addDocumentAdminHelper.SelectByText("SelectStatus", "Active");

            //Click on update
            addDocumentAdminHelper.ClickElement("UpdateStatus");

            //Accept
            addDocumentAdminHelper.AcceptAlert();

            //Verify updated successfully
            addDocumentAdminHelper.verifyUpdate("Active");
            /*
            //################################# Bulk Update Category #############################################
            //Select all
            addDocumentAdminHelper.ClickElement("CheckAll");

            //Click on 'Bulk update'
            addDocumentAdminHelper.ClickElement("BulkUpdate");

            //Click on Category
            addDocumentAdminHelper.ClickElement("BulkCate");

            //Wait For text
            addDocumentAdminHelper.WaitForText("Update", 50);

            //Select Status
            addDocumentAdminHelper.SelectByText("SelectCategory", "Test166");

            //Click on update
            addDocumentAdminHelper.ClickElement("UpdateCate");

            //Accept
            addDocumentAdminHelper.AcceptAlert();

            //Verify updated successfully
            addDocumentAdminHelper.WaitForText("Test166",30);
            */
            //################################# Copy #############################################

            //Click on created product
            addDocumentAdminHelper.ClickOnProduct(Proname);

            //Wait for text
            addDocumentAdminHelper.WaitForText("/ Edit - "+Proname, 50);

            //Click on Clone
            addDocumentAdminHelper.ClickElement("Clone");

            //Accept allert
            addDocumentAdminHelper.AcceptAlert();

            //wait for text
            addDocumentAdminHelper.WaitForText("The Product is cloned successfully", 50);

            //Click on Save
            addDocumentAdminHelper.ClickElement("ProSave");

            //Wait for text
            addDocumentAdminHelper.WaitForText("Bulk Update", 50);

            //Verify Cloned
            addDocumentAdminHelper.verifyCloned(Proname);

            //################################# Delete #############################################

            //Filter By name
            addDocumentAdminHelper.TypeText("SearchName", Proname);

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            Thread.Sleep(2000);

            //Click on delete
            addDocumentAdminHelper.ClickElement("Delete");

            //Accept alert
            addDocumentAdminHelper.AcceptAlert();

            //Filter By name
            addDocumentAdminHelper.TypeText("SearchName", Proname);

            //Verify result
            addDocumentAdminHelper.WaitForText(Proname, 50);

            Thread.Sleep(2000);

            //Click on delete
            addDocumentAdminHelper.ClickElement("Delete");

            //Accept alert
            addDocumentAdminHelper.AcceptAlert();

            //Verify deleted succefully
            addDocumentAdminHelper.VerifyTextNotPresent(Proname);
        }