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 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); }
// [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 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); }