public void uniqueDocError() { 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 activitiesHelperNewSkin = new ActivitiesHelperNewSkin(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."); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create"); //Verify title VerifyTitle("Create a New Document"); //ClickOnCreate activitiesHelperNewSkin.TypeText("DocumentName", "Doc1"); string pathtofile = GetPathToFile() + "Upload1.pdf"; //Attach File activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", pathtofile); //Select releted to activitiesHelperNewSkin.selectByText("ReletedTo", "Client"); //Select Client activitiesHelperNewSkin.ClickElement("Assign"); activitiesHelperNewSkin.WaitForWorkAround(4000); activitiesHelperNewSkin.ClickElement("AssignUser"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Click on Save activitiesHelperNewSkin.ClickElement("ClickOnSave"); activitiesHelperNewSkin.WaitForText("Document saved successfully.", 30); VerifyTitle("Documents"); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create"); //Verify title VerifyTitle("Create a New Document"); //ClickOnCreate activitiesHelperNewSkin.TypeText("DocumentName", "Doc2"); pathtofile = GetPathToFile() + "Upload2.pdf"; //Attach File activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", pathtofile); //Select releted to activitiesHelperNewSkin.selectByText("ReletedTo", "Client"); //Select Client activitiesHelperNewSkin.ClickElement("Assign"); activitiesHelperNewSkin.WaitForWorkAround(4000); activitiesHelperNewSkin.ClickElement("AssignUser"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Click on Save activitiesHelperNewSkin.ClickElement("ClickOnSave"); activitiesHelperNewSkin.WaitForText("Document saved successfully.", 30); VerifyTitle("Documents"); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create"); //Verify title VerifyTitle("Create a New Document"); //ClickOnCreate activitiesHelperNewSkin.TypeText("DocumentName", "Doc3"); pathtofile = GetPathToFile() + "Upload3.pdf"; //Attach File activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", pathtofile); //Select releted to activitiesHelperNewSkin.selectByText("ReletedTo", "Client"); //Select Client activitiesHelperNewSkin.ClickElement("Assign"); activitiesHelperNewSkin.WaitForWorkAround(4000); activitiesHelperNewSkin.ClickElement("AssignUser"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Click on Save activitiesHelperNewSkin.ClickElement("ClickOnSave"); activitiesHelperNewSkin.WaitForText("Document saved successfully.", 30); VerifyTitle("Documents"); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create"); //Verify title VerifyTitle("Create a New Document"); //ClickOnCreate activitiesHelperNewSkin.TypeText("DocumentName", "Doc4"); pathtofile = GetPathToFile() + "Upload4.pdf"; //Attach File activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", pathtofile); //Select releted to activitiesHelperNewSkin.selectByText("ReletedTo", "Client"); //Select Client activitiesHelperNewSkin.ClickElement("Assign"); activitiesHelperNewSkin.WaitForWorkAround(4000); activitiesHelperNewSkin.ClickElement("AssignUser"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Click on Save activitiesHelperNewSkin.ClickElement("ClickOnSave"); activitiesHelperNewSkin.WaitForText("Document saved successfully.", 30); VerifyTitle("Documents"); //Go to client page GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients"); //Verify title VerifyTitle("Clients"); //Open the chy client activitiesHelperNewSkin.ClickElement("Chy"); //Verify title VerifyTitle("- Details"); //Click on info activitiesHelperNewSkin.ClickElement("Info"); //Verify title VerifyTitle("- Details"); }
public void documentVersionError() { 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 activitiesHelperNewSkin = new ActivitiesHelperNewSkin(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."); //ClickOnActivitiesTab activitiesHelperNewSkin.ClickElement("ClickOnActivitiesTab"); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents/create"); //Verify title VerifyTitle("Create a New Document"); //Verify version is set to 1 string value = activitiesHelperNewSkin.getFiledText("DocVersion"); Assert.IsTrue(value.Contains("1")); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents"); //Verify title VerifyTitle("Documents"); //Edit first doc activitiesHelperNewSkin.ClickElement("EditDoc"); //Verify title VerifyTitle("Edit Document"); //Verify document version is not user editable Console.WriteLine("CHECK = " + activitiesHelperNewSkin.GetAtrributeByLocator("//*[@id='DocumentVersion']", "readonly")); Assert.IsTrue(activitiesHelperNewSkin.GetAtrributeByLocator("//*[@id='DocumentVersion']", "readonly").Contains("true")); //Click on Add new version activitiesHelperNewSkin.ClickElement("NewVersion"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Upload file activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", GetPathToFile() + "2.pdf"); //Enter comment activitiesHelperNewSkin.TypeText("DocCommnet", "Comment"); //Click on Save button activitiesHelperNewSkin.ClickElement("DocSave"); activitiesHelperNewSkin.WaitForWorkAround(3000); //Verify one is not deletable activitiesHelperNewSkin.verifyOneNotDeletable(); }
public void permanentlyDeleteDocumentNewSkin() { 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 activitiesHelperNewSkin = new ActivitiesHelperNewSkin(GetWebDriver()); //Variable random var name = "TESTCLIENT" + RandomNumber(1, 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."); //ClickOnActivitiesTab activitiesHelperNewSkin.ClickElement("ClickOnActivitiesTab"); //Redirect To Document GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/documents"); activitiesHelperNewSkin.WaitForWorkAround(4000); //Click On Create activitiesHelperNewSkin.ClickElement("ClickOnDoc"); activitiesHelperNewSkin.WaitForWorkAround(3000); //ClickOnCreate activitiesHelperNewSkin.TypeText("DocumentName", "DELETE DOCUMENT"); string pathtofile = GetPathToFile() + "index.jpg"; //Attach File activitiesHelperNewSkin.UploadFile("//*[@id='DocumentFile']", pathtofile); activitiesHelperNewSkin.WaitForWorkAround(3000); //Click on Save activitiesHelperNewSkin.ClickElement("ClickOnSave"); //Verify activitiesHelperNewSkin.WaitForText("Document saved successfully.", 30); //Search Documet activitiesHelperNewSkin.TypeText("SearchDocumet", "DELETE DOCUMENT"); activitiesHelperNewSkin.WaitForWorkAround(4000); //Click on Checkbox activitiesHelperNewSkin.ClickElement("ClickOnCheckBox"); //Click On delete activitiesHelperNewSkin.ClickElement("ClickOndelete"); activitiesHelperNewSkin.AcceptAlert(); activitiesHelperNewSkin.WaitForWorkAround(3000); //Verify Document deleted successfully. activitiesHelperNewSkin.VerifyPageText("Document deleted successfully."); //Click on Recycle bin activitiesHelperNewSkin.ClickElement("ClickOnReycleBin"); activitiesHelperNewSkin.WaitForWorkAround(4000); //Search Documet activitiesHelperNewSkin.TypeText("SearchDocumet", "DELETE DOCUMENT"); activitiesHelperNewSkin.WaitForWorkAround(4000); //ClickOnDeletePer activitiesHelperNewSkin.ClickElement("ClickOnDeletePer"); activitiesHelperNewSkin.AcceptAlert(); activitiesHelperNewSkin.WaitForWorkAround(3000); //verify Document Permanently Deleted. activitiesHelperNewSkin.VerifyPageText("Document Permanently Deleted."); activitiesHelperNewSkin.WaitForWorkAround(3000); }