public void CreateOfficeFund() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //select Funding Tab HtmlHyperlink offFund = new HtmlHyperlink(browserWindow); offFund.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Funding", HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.TagInstance, "22"); offFund.WaitForControlReady(); Assert.AreEqual(true, offFund.Exists); Mouse.Click(offFund); //Add Outgoing Funding Item*** // //TestPropertyAttribute? var config = new AddFundConfig(); config.FiscalYear = DateTime.Now.Year; config.SourceRecipientTypeName = MoneyFlowSourceRecipientType.Project.Value; config.SearchRecipient = "Cultural Heritage Center"; OutgoingFund.AddFundOut(browserWindow, config); IncomingFund.AddFundIn(browserWindow); }
public void ViewHomepage() { //KMT Login with ECATest1 user and pw var browserWindow = AuthHelper.KMTLogin(); //check content menu ContentMenu.AccessMenu(browserWindow); //check hyperlinks for Your Shortcuts, Notifications and Timeline, and News //shortcuts HtmlHyperlink yourShortcuts = new HtmlHyperlink(browserWindow); yourShortcuts.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Your Shortcuts", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "13"); yourShortcuts.WaitForControlReady(); Assert.AreEqual(true, yourShortcuts.Exists); //notifications and timeline HtmlHyperlink notifications = new HtmlHyperlink(browserWindow); notifications.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Notifications & Timeline", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "14"); notifications.WaitForControlReady(); Assert.AreEqual(true, notifications.Exists); //news HtmlHyperlink news = new HtmlHyperlink(browserWindow); news.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "News (3)", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "15"); news.WaitForControlReady(); Assert.AreEqual(true, news.Exists); //Verify bookmarks section of Your Shortcuts tab HtmlDiv bookmarks = new HtmlDiv(browserWindow); bookmarks.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "star Bookmarks"); bookmarks.WaitForControlReady(); Assert.AreEqual(true, bookmarks.Exists); //Verify bookmark display - Taylor Test (Person) HtmlDiv bookDiv1 = new HtmlDiv(browserWindow); bookDiv1.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "delete Person Taylor Test Unknown 09 / 28 / 2015 Added: ", HtmlDiv.PropertyNames.TagInstance, "23"); bookDiv1.WaitForControlReady(); Assert.AreEqual(true, bookDiv1.Exists); HtmlHyperlink bookHyp = new HtmlHyperlink(browserWindow); bookHyp.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Taylor Test", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink"); bookHyp.WaitForControlReady(); Assert.AreEqual(true, bookHyp.Exists); //old code /*this.UIMap.LogintoQA_ExistingUser(); * this.UIMap.OpenBrowserEnterCreds(); * this.UIMap.SignInButton(); * this.UIMap.SignIn(); * this.UIMap.Notifications_ActivityLink(); * this.UIMap.SelectNotifications_ActivityLink(); * this.UIMap.NewsLink(); * this.UIMap.SelectNewsLink(); * this.UIMap.YourShortcutsLink(); * this.UIMap.SelectYourShortcutsLink(); * this.UIMap.CloseBrowserButton(); * this.UIMap.CloseBrowser();*/ //end old code }
public void ViewOfficesPage() { /* var defaultSorter = new ExpressionSorter<SimpleOfficeDTO>(x => x.Name, SortDirection.Ascending); * var nameFilter = new ExpressionFilter<SimpleOfficeDTO>(x => x.Name, ComparisonType.Like, "Cultural Heritage"); * var queryOperator = new QueryableOperator<SimpleOfficeDTO>(0, 100, defaultSorter, new List<IFilter> { nameFilter }, null); * * var dtos = officeService.GetOffices(queryOperator); * var testOffice = dtos.Results.First(); * var searchText = testOffice.Name; * var linkText = testOffice.Name; * var total = dtos.Total; */ var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //showingOff DB Verify-- use sql connection for verifying the office count var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False"; using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var start = 0; var limit = 25; var defaultSorter = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending); var queryOperator = new QueryableOperator <SimpleOfficeDTO>(0, 25, defaultSorter); var results = service.GetOffices(queryOperator); var expectedString = String.Format("Showing {0} - {1} of {2} offices", start + 1, limit, results.Total); //showing count HtmlDiv showingOff = new HtmlDiv(browserWindow); showingOff.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 - 25 of 56 offices"); showingOff.WaitForControlReady(); Assert.AreEqual(true, showingOff.Exists); Assert.AreEqual(expectedString, showingOff.InnerText); } //verify the view count of Offices with Cultural in the name using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var defaultSorter = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending); var set = new HashSet <string>(); set.Add("Cultural"); var keywordfilter = new SimpleKeywordFilter <SimpleOfficeDTO>(set, x => x.Name, x => x.Description, x => x.OfficeSymbol); var queryOperator = new QueryableOperator <SimpleOfficeDTO>(0, 10, defaultSorter, new List <IFilter> { keywordfilter }); var results = service.GetOffices(queryOperator); Assert.AreEqual(results.Total, 9); } //old code /* this.UIMap.LogintoQA_ExistingUser(); * //this.UIMap.LogintoQA(); * this.UIMap.AssertContentMenuButton(); * this.UIMap.SelectContentMenuButton(); * this.UIMap.AssertOfficesContentMenuLink(); * this.UIMap.SelectOfficesContentMenuLink(); * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.SelectContentMenuButton(); * this.UIMap.SelectOfficesContentMenu_Link(); * //this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.AssertECAOfficeDirectoryPage(); * this.UIMap.AssertSearchOffices(); * this.UIMap.InputSearchOfficeText(); * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.InputSearchOfficeText(); * this.UIMap.AssertSearchOfficesTextResults(); * this.UIMap.AssertAvailableOfficeinList(); * //this.UIMap.AssertOfficeAvailableinList(); * this.UIMap.CloseBrowserWindow(); */ //end old code }
public void ViewOffices_ProgramsandBranches() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //verify chcOffice overview HtmlDiv chcOffHeader = new HtmlDiv(browserWindow); chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15"); chcOffHeader.WaitForControlReady(); Assert.AreEqual(true, chcOffHeader.Exists); //verify description HtmlDiv chcOffDescription = new HtmlDiv(browserWindow); chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31"); chcOffDescription.WaitForControlReady(); Assert.AreEqual(true, chcOffDescription.Exists); //verify themes HtmlDiv chcOffThemes = new HtmlDiv(browserWindow); chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffThemes.WaitForControlReady(); Assert.AreEqual(true, chcOffThemes.Exists); //Html chcOffThemes = new HtmlPane(browserWindow); //chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane"); //chcOffThemes.WaitForControlReady(); //Assert.AreEqual(true, chcOffThemes.Exists); //verify goals HtmlDiv chcOffGoals = new HtmlDiv(browserWindow); chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights", HtmlDiv.PropertyNames.TagInstance, "38", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffGoals.WaitForControlReady(); Assert.AreEqual(true, chcOffGoals.Exists); //verify POC(s) HtmlDiv chcOffPoc = new HtmlDiv(browserWindow); chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffPoc.WaitForControlReady(); Assert.AreEqual(true, chcOffPoc.Exists); //select branches and programs tab HtmlHyperlink chcBranchProgTab = new HtmlHyperlink(browserWindow); chcBranchProgTab.SearchProperties.Add(HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.InnerText, "Branches & Programs", HtmlHyperlink.PropertyNames.TagInstance, "19"); chcBranchProgTab.WaitForControlReady(); Assert.AreEqual(true, chcBranchProgTab.Exists); Mouse.Click(chcBranchProgTab); //Identify Showing # - # of ## //HtmlDiv showBPList = new HtmlDiv(browserWindow); //showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 -", PropertyExpressionOperator.Contains, HtmlDiv.PropertyNames.TagInstance, "33"); //showBPList.WaitForControlReady(); //Assert.AreEqual(true, showBPList.Exists); //verify branches and programs tab section var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False"; using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var start = 0; var limit = 10; //var officeId = 1036; var defaultSorter = new ExpressionSorter <OrganizationProgramDTO>(x => x.Name, SortDirection.Ascending); var queryOperator = new QueryableOperator <OrganizationProgramDTO>(start, limit, defaultSorter); var results = service.GetPrograms(1036, queryOperator); var expectedString = String.Format("Showing {0} - {1} of {2} programs", start + 1, limit, results.Total); //Identify Showing # - # of ## HtmlDiv showBPList = new HtmlDiv(browserWindow); showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, expectedString, HtmlDiv.PropertyNames.TagInstance, "33"); showBPList.WaitForControlReady(); Assert.AreEqual(true, showBPList.Exists); Assert.AreEqual(expectedString, showBPList.InnerText); } }
public void ViewOfficesOverviewCodedUITestMethod1() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //verify chcOffice overview HtmlDiv chcOffHeader = new HtmlDiv(browserWindow); chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15"); chcOffHeader.WaitForControlReady(); Assert.AreEqual(true, chcOffHeader.Exists); //verify description HtmlDiv chcOffDescription = new HtmlDiv(browserWindow); chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31"); chcOffDescription.WaitForControlReady(); Assert.AreEqual(true, chcOffDescription.Exists); //verify themes HtmlDiv chcOffThemes = new HtmlDiv(browserWindow); chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Arts Arts & Culture Civilian Security Conflict Prevention, Mitigation, and Response Democracy / Good Governance / Rule of Law Diversity Entrepreneurship / Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well - Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35"); chcOffThemes.WaitForControlReady(); Assert.AreEqual(true, chcOffThemes.Exists); //verify goals HtmlDiv chcOffGoals = new HtmlDiv(browserWindow); chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights Economic Development Global Economic Growth", HtmlDiv.PropertyNames.TagInstance, "38"); chcOffGoals.WaitForControlReady(); Assert.AreEqual(true, chcOffGoals.Exists); //verify POC(s) HtmlDiv chcOffPoc = new HtmlDiv(browserWindow); chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45"); chcOffPoc.WaitForControlReady(); Assert.AreEqual(true, chcOffPoc.Exists); //old code //this.UIMap.LogintoQA_existing(); //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu(); ////this.UIMap.NavigatetoECAOfficeDirectory(); //this.UIMap.RefreshBrowser(); //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu(); //this.UIMap.AssertAllOfficesBanner(); //this.UIMap.AssertSearchOfficesTextBox(); //this.UIMap.SearchBox_textinput(); //this.UIMap.RefreshBrowser(); //this.UIMap.SearchBox_textinput(); //this.UIMap.AssertSearchShowingResults(); //this.UIMap.AssertSearchResultTopList(); //this.UIMap.CloseBrowserWindow(); //// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. }