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 emailNoteWithRelatedTo() { 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."); //ClickOnPdfTab activitiesHelperNewSkin.ClickElement("ClickOnActivitiesTab"); //Redirect To GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/notes"); activitiesHelperNewSkin.WaitForWorkAround(2000); //Clcik Create activitiesHelperNewSkin.ClickElement("ClickOnCreate"); activitiesHelperNewSkin.WaitForWorkAround(3000); //NoteSubject activitiesHelperNewSkin.TypeText("NoteSubject","Testing Subject"); //Select Client activitiesHelperNewSkin.SelectDropDownByText("//*[@id='NoteParentType']", "Client"); activitiesHelperNewSkin.WaitForWorkAround(4000); //cClickIconToSelectClient activitiesHelperNewSkin.ClickElement("ClickIconToSelectClient"); activitiesHelperNewSkin.WaitForWorkAround(4000); //ClickONClientNS activitiesHelperNewSkin.ClickElement("ClickONClientNS"); activitiesHelperNewSkin.WaitForWorkAround(4000); //SaveNoteNS activitiesHelperNewSkin.ClickElement("SaveNoteNS"); activitiesHelperNewSkin.WaitForWorkAround(4000); //ClickOnNotes activitiesHelperNewSkin.ClickElement("ClickOnNotes"); activitiesHelperNewSkin.WaitForWorkAround(4000); //ClickEmailNoteC activitiesHelperNewSkin.ClickElement("ClickEmailNoteC"); activitiesHelperNewSkin.WaitForWorkAround(4000); //vERIFYcLIENTsELECTED activitiesHelperNewSkin.VerifyText("vERIFYcLIENTsELECTED", "Client"); activitiesHelperNewSkin.WaitForWorkAround(4000); }