protected override void Because_of() { var bobSmith = new EnergyTrading.Mdm.Contracts.SourceSystem() { Details = new EnergyTrading.Mdm.Contracts.SourceSystemDetails() { Name = "Bob" } }; var fredJones = new EnergyTrading.Mdm.Contracts.SourceSystem() { Details = new EnergyTrading.Mdm.Contracts.SourceSystemDetails() { Name = "Fred" } }; var personList = new List <EnergyTrading.Mdm.Contracts.SourceSystem>() { bobSmith, fredJones }; var cacheSearchResultPage = new CacheSearchResultPage(new List <int>() { 1, 2 }, DateTime.Now, null, this.currentSearch.ToString()); var searchResultPage = new SearchResultPage <EnergyTrading.Mdm.Contracts.SourceSystem>(cacheSearchResultPage, personList); this.response = this.Sut.WithEntityName("SourceSystem").WithItems(searchResultPage.Contracts).Build(); }
public void WhenSearchForACarType() { homepage.WhenIEnterValidPostcode(); homepage.AndISelectDistanceToPostcode(); homepage.AndISelectACarMake(); searchResultPage = homepage.AndIClickOnSearchCarButton(); }
private async System.Threading.Tasks.Task SearchCityAsync() { // https://papapi.se/json/?s=Birger+Jarlsgatan&c=Stockholm&token=DIN_TOKEN var fetch = await ApiService.GetProductAsync("https://papapi.se/json/?s=" + Address.Value + "&c=" + Cityname.Value + "&token=" + _token); if (fetch.Length < 1) { MessagingCenter.Send <object>(this, "Arrived"); Cityname.Value = ""; Address.Value = ""; return; } _cityDtO.City = fetch[0].City; _cityDtO.ZipCode = fetch[0].ZipCode; _cityDtO.Street = fetch[0].Street; _cityDtO.Code = fetch[0].Code; _cityDtO.Municipality = fetch[0].Municipality; _cityDtO.State = fetch[0].State; var resultPage = new SearchResultPage(); resultPage.BindingContext = _cityDtO; Cityname.Value = ""; Address.Value = ""; await Application.Current.MainPage.Navigation.PushAsync(resultPage); //await Application.Current.MainPage.Navigation.PushModalAsync(resultPage); }
/// <summary> /// Helper method to query a worklist. /// </summary> /// <typeparam name="TItem"></typeparam> /// <typeparam name="TSummary"></typeparam> /// <param name="request"></param> /// <param name="mapCallback"></param> /// <returns></returns> protected QueryWorklistResponse <TSummary> QueryWorklistHelper <TItem, TSummary>(QueryWorklistRequest request, Converter <TItem, TSummary> mapCallback) { IWorklist worklist = GetWorklist(request); IList results = null; var page = new SearchResultPage(request.Page.FirstRow, request.Page.MaxRows); var workingFacility = GetWorkingFacility(request); if (request.QueryItems) { // get the first page, up to the default max number of items per page results = worklist.GetWorklistItems(new WorklistQueryContext(this, workingFacility, page, request.DowntimeRecoveryMode)); } var count = -1; if (request.QueryCount) { // if the items were already queried, and the number returned is less than the max per page, and this is the first page // then there is no need to do a separate count query if (results != null && results.Count < page.MaxRows && page.FirstRow == 0) { count = results.Count; } else { count = worklist.GetWorklistItemCount(new WorklistQueryContext(this, workingFacility, null, request.DowntimeRecoveryMode)); } } return(new QueryWorklistResponse <TSummary>( request.QueryItems ? CollectionUtils.Map(results, mapCallback) : null, count)); }
public void SearchBookTextClickBookResult() { try { // Initialize the page by calling its reference homePage = new HomePage(this.wdriver); ExcelLib.PopulateInCollection(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data.xlsx")); string text = ExcelLib.ReadData(1, Constants.column1); string linkName = ExcelLib.ReadData(1, Constants.column2); SearchResultPage resultPage = homePage.SearchTextInGoogleSearchBar(text); homePage.SearchBoxName.SendKeys(Keys.Enter); // Verifying if pagesource contains the searched text Assert.That(this.wdriver.PageSource.Contains(text), Is.EqualTo(true), "pagesource does not contant" + text); resultPage.ClickElement(linkName, Constants.BookResultNo); } catch (Exception ex) { Assert.Fail(ex.Message); } }
/// <summary> /// Constructor /// </summary> /// <param name="baseHql"></param> /// <param name="conditions"></param> /// <param name="sorts"></param> /// <param name="page"></param> public HqlQuery(string baseHql, IEnumerable <HqlCondition> conditions, IEnumerable <HqlSort> sorts, SearchResultPage page) { _baseQuery = baseHql; _page = page; _where = new HqlAnd(conditions); _sorts = new List <HqlSort>(sorts); }
public void WhenISelectTheItem() { SearchResultPage searchResultPage = new SearchResultPage(); searchResultPage.ClickMore(); Wait.Until(condition => condition.FindElement(By.ClassName("exclusive"))); }
public static void SerachProduct(IWebDriver driver) { try { HomePage homePage = new HomePage(driver); homePage.SearchBar.SendKeys("wireless charger" + Keys.Enter); Thread.Sleep(5000); IList <IWebElement> items = driver.FindElements(By.XPath("//a[@class='a-link-normal a-text-normal']")); Thread.Sleep(5000); Console.WriteLine(items[0].Text); items[0].Click(); string last_window = driver.WindowHandles.Last(); Thread.Sleep(5000); driver.SwitchTo().Window(last_window); SearchResultPage searchResultPage = new SearchResultPage(driver); searchResultPage.AddToCart.Click(); Thread.Sleep(2000); searchResultPage.CartPage.Click(); Thread.Sleep(5000); } catch { throw new CustomException(CustomException.TypeOfException.NO_SUCH_ELEMENT_FOUND, "Check Network"); } }
protected override void Because_of() { var bobSmith = new EnergyTrading.MDM.Contracts.Sample.Person() { Details = new EnergyTrading.MDM.Contracts.Sample.PersonDetails() { Forename = "Bob", Surname = "Smith" } }; var fredJones = new EnergyTrading.MDM.Contracts.Sample.Person() { Details = new EnergyTrading.MDM.Contracts.Sample.PersonDetails() { Forename = "Fred", Surname = "Jones" } }; var personList = new List <EnergyTrading.MDM.Contracts.Sample.Person>() { bobSmith, fredJones }; var cacheSearchResultPage = new CacheSearchResultPage(new List <int>() { 1, 2 }, DateTime.Now, null, this.currentSearch.ToString()); var searchResultPage = new SearchResultPage <EnergyTrading.MDM.Contracts.Sample.Person>(cacheSearchResultPage, personList); this.response = this.Sut.CreateFeed(searchResultPage, "Person", this.baseUri); }
public void ThenUserVerifiedThatMatchingToTheFirstSearchQueryResult(string result) { var searchResultPG = new SearchResultPage(); string firstResult = searchResultPG.FirstResult(); Assert.AreEqual(result, firstResult); }
public void AddingProductToCart() { // Search for "Harry Potter" page.HeaderPanel.Value.SearchFor("Harry Potter"); // Filter products SearchResultPage searchResultPage = new SearchResultPage(); searchResultPage.ProductsFilter.ClickOnText("See All 36 Departments"); searchResultPage.ProductsFilter.ClickOnText("Toys & Games"); searchResultPage.ProductsFilter.SetPriceRange(10, 150); searchResultPage.ProductsFilter.ClickOnText("14 Years & Up"); //Click on the first result searchResultPage.OpenProduct(1); //Add product to cart ProductDetailsPage productPage = new ProductDetailsPage(); productPage.Quantity.Text = "4"; productPage.AddToCartButton.Click(); //Open cart CartPage cartPage = new CartPage(); cartPage.CartButton.Value.Click(); //Assert product's details Assert.AreEqual(productPage.Title, cartPage.CartProduct.Value.Title.Text); Assert.AreEqual(productPage.Price, cartPage.CartProduct.Value.Price.Text); Assert.AreEqual("4", cartPage.CartProduct.Value.CurrentQuantity); }
public void WhenISearchForACarFromAOfRange(string make, string postcode, string distance) { homepage.WhenIEnterValidPostcode(postcode); homepage.AndISelectDistanceToPostcode(distance); homepage.AndISelectACarMake(make); searchResultPage = homepage.AndIClickOnSearchCarButton(); }
public void WomenPresetSearch() { HomePage homePage = new HomePage(driver); SearchResultPage resultPage = homePage.WomenSearchClick(); resultPage.ValidateReturnedResultCounts(); }
static void Main(string[] args) { try { string selectedBrand = args[0]; IWebDriver driver = new FirefoxDriver(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(11)); Console.WriteLine("Selected car brand: " + selectedBrand); HomePageLocators homePageLocators = new HomePageLocators(); HomePage homePage = new HomePage(driver); homePage.GotoHomePage(driver); SearchResultPage searchResultPage = homePage.FindInterestBrand(driver, homePageLocators, wait, selectedBrand); SearchResultPageLocators searchResultPageLocators = new SearchResultPageLocators(); searchResultPage.OutputSortedCars(searchResultPage.SortedCarsList(searchResultPage.GetCarsAllPages(driver, searchResultPageLocators, wait))); driver.Quit(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public ListExternalPractitionersRequest(string surname, string givenname, SearchResultPage page) : this(surname, givenname, VerifiedState.All, null, null, true, false, false, false, false, false, page) { this.LastName = surname; this.FirstName = givenname; this.Page = page; }
public void ThenISeeOnlyResultsPerPage(int numberOfResultsPerPage) { var searchResultPage = new SearchResultPage(); // searchResultList = ListOfElements(By.CssSelector("#search-results>li>div")); IList<IWebElement> searchResultList = ListOfElements(searchResultPage.SearchResultRowLocator); Assert.IsTrue(searchResultList.Count == numberOfResultsPerPage); }
public void CheckEmptySearch() { mainPage.SearchEmpty(); var searchPage = new SearchResultPage(Driver); Assert.IsTrue(searchPage.ErorMessage.Text.Contains("Ooops")); }
/// <summary> /// Initializes this object. /// </summary> /// <param name="procedureStepClasses"></param> /// <param name="criteria"></param> /// <param name="projection"></param> /// <param name="page"></param> protected void Initialize(Type[] procedureStepClasses, WorklistItemSearchCriteria[] criteria, WorklistItemProjection projection, SearchResultPage page) { this.Criteria = criteria; this.Projection = projection; this.Page = page; this.ProcedureStepClasses = procedureStepClasses; }
public void ThenTheNumberOfSearchResultsWillBe(int expNumOfResults) { SearchResultPage = new SearchResultPage(); var actualNumOfResults = SearchResultPage.SearchResults.Count; Assert.AreEqual(actualNumOfResults, expNumOfResults); }
/// <summary> /// Constructor. /// </summary> /// <param name="service"></param> /// <param name="workingFacility"></param> /// <param name="page"></param> /// <param name="downtimeRecoveryMode"></param> public WorklistQueryContext(ApplicationServiceBase service, Facility workingFacility, SearchResultPage page, bool downtimeRecoveryMode) { _applicationService = service; WorkingFacility = workingFacility; Page = page; DowntimeRecoveryMode = downtimeRecoveryMode; }
public void BeforeTest() { Driver.InitializeDriver(); Driver.CurrentDriver.Url = "https://www.sena.lt/"; homePage = new HomePage(); searchResultPage = new SearchResultPage(); }
/// <summary> /// Constructor /// </summary> /// <param name="froms"></param> /// <param name="selectors"></param> /// <param name="conditions"></param> /// <param name="sorts"></param> /// <param name="page"></param> public HqlProjectionQuery(IEnumerable <HqlFrom> froms, IEnumerable <HqlSelect> selectors, IEnumerable <HqlCondition> conditions, IEnumerable <HqlSort> sorts, SearchResultPage page) : base("", conditions, sorts, page) { _froms = new List <HqlFrom>(froms); _selects = new List <HqlSelect>(selectors); }
private void InternalTestLogic(string cityFrom, string CityTo, bool needVerifyQvt, bool isInland) { FirefoxDriver driver = new FirefoxDriver(); driver.Navigate().GoToUrl("http://flight.qunar.com/"); PageObjectFactory.UIMapFilePath = @"..\..\..\QunaWebTestFramework\UIMaps"; HomePage homePage = PageObjectFactory.InitPage <HomePage>(driver); DateTime serverDaysAfter = DateTime.Now.AddDays(7); homePage.OneWaySearch(cityFrom, CityTo, serverDaysAfter.ToString("yyyy-MM-dd")); Thread.Sleep(1000 * 10); SearchResultPage searchResultPage = PageObjectFactory.InitPage <SearchResultPage>(driver); int maxRetryTimes = 0; while (searchResultPage.ResultInfo != null) { if (maxRetryTimes == 60) { Assert.Fail("Fail to get search result!!"); } Thread.Sleep(1000); try { if (searchResultPage.ResultInfo.Text.Contains("搜索结束")) { break; } } catch (Exception) { } searchResultPage = PageObjectFactory.InitPage <SearchResultPage>(driver); maxRetryTimes++; } if (isInland) { searchResultPage.ClickOrderButtonForInland(0); } else { searchResultPage.ClickOrderButton(0); } if (needVerifyQvt) { Assert.IsTrue(searchResultPage.QvtWarning(0, isInland)); Assert.IsTrue(searchResultPage.VerifyTransfer(0, isInland)); } else { Assert.IsTrue(searchResultPage.VerifyPriceRange(0)); } this.AddTestCleanup("Close Browser", () => { driver.Close(); }); }
public ListExternalPractitionersRequest( string surname, string givenname, VerifiedState verifiedState, DateTime? lastVerifiedRangeFrom, DateTime? lastVerifiedRangeUntil, bool queryItems, bool queryCount, bool sortByLastVerifiedTime, bool sortByLastEditedTime, bool sortAscending, bool includeMerged, SearchResultPage page) { this.LastName = surname; this.FirstName = givenname; this.VerifiedState = verifiedState; this.LastVerifiedRangeFrom = lastVerifiedRangeFrom; this.LastVerifiedRangeUntil = lastVerifiedRangeUntil; this.QueryItems = queryItems; this.QueryCount = queryCount; this.SortByLastVerifiedTime = sortByLastVerifiedTime; this.SortByLastEditedTime = sortByLastEditedTime; this.SortAscending = sortAscending; this.IncludeMerged = includeMerged; this.Page = page; }
public SearchResultPage searchbook(string bookName ) { textbox.SendKeys(bookName); searchBox.Click(); SearchResultPage rsPage = new SearchResultPage(_driver); PageFactory.InitElements(_driver,rsPage); return rsPage; }
public void SearchforNothing() { string searchTerm = "nothing"; HomePage homePage = new HomePage(driver); SearchResultPage resultPage = homePage.Search(searchTerm); resultPage.ValidateReturnsNoResults(); }
public async Task <SearchResultPage> Search( string terms, string author, string parentAuthor, string category, int page, bool oldestFirst = false) { if (string.IsNullOrEmpty(category)) { category = "all"; } var query = HttpUtility.ParseQueryString(""); query.Add("chatty", "1"); query.Add("type", "4"); query.Add("chatty_term", terms); query.Add("chatty_user", author); query.Add("chatty_author", parentAuthor); query.Add("chatty_filter", category); query.Add("page", $"{page}"); query.Add("result_sort", oldestFirst ? "postdate_asc" : "postdate_desc"); var html = await _downloadService.DownloadWithSharedLogin( "http://www.shacknews.com/search?" + query.ToString()); var p = new Parser(html); var searchResultPage = new SearchResultPage { Results = new List <SearchResult>(), CurrentPage = page }; if (p.Peek(1, "<h2 class=\"search-num-found\"") != -1) { searchResultPage.TotalResults = int.Parse(p.Clip( new[] { "<h2 class=\"search-num-found\"", ">" }, " ").Replace(",", "")); } while (p.Peek(1, "<li class=\"result") != -1 && p.Peek(1, "<span class=\"chatty-author\">") != -1) { var result = new SearchResult(); result.Author = p.Clip( new[] { "<span class=\"chatty-author\">", "<a class=\"more\"", ">" }, ":</a></span>"); result.Date = DateParser.Parse(p.Clip( new[] { "<span class=\"postdate\"", ">", " " }, "</span>")); result.Id = int.Parse(p.Clip( new[] { "<a href=\"/chatty", "chatty/", "/" }, "\"")); result.Preview = p.Clip( new[] { ">" }, "</a>"); searchResultPage.Results.Add(result); } return(searchResultPage); }
public SearchResultPage ChooseMeal(string city) { searchResultPage = new SearchResultPage(driver); Search(city); new WebDriverWait(driver, TimeSpan.FromSeconds(50)).Until(ExpectedConditions .ElementExists(By.XPath(XPATH_RATING_BUTTON))); log.Info("Choose breakfast"); return(new SearchResultPage(driver)); }
public void Selenium_dev_site_lookup(Browsers browser, string lang) { Driver = WebDriverFactory.GetLocalWebDriver(browser, lang); BasePage StartPage = new BasePage(Driver); GooglePage Google = StartPage.Navigate <GooglePage>("https://www.google.com/"); SearchResultPage SearchResult = Google.Search("webdriver documentation for selenium"); SearchResult.FirstLinkOfSearchResult.Should().Be("https://www.selenium.dev/documentation/en/webdriver/"); }
public void GoogleSearchTest() { var mainPage = new GoogleMainPage(_driver, _webDriverWait); SearchResultPage searchResultPage = mainPage.GetSearchResult("Wikipedia"); searchResultPage.OpenLink("Вікіпедія"); TimeSpan.FromSeconds(2); Assert.AreEqual("Вікіпедія", _driver.Title); }
protected override IList <PublicationStep> GetNextEntityBatch(int batchSize) { // Get scheduled steps, where the "publishing cool-down" has elapsed // eg LastFailureTime is more than a specified number of seconds ago var page = new SearchResultPage(0, batchSize); return(PersistenceScope.CurrentContext.GetBroker <IPublicationStepBroker>().FindUnprocessedSteps(_settings.FailedItemRetryDelay, page)); }
public void ThenIShouldNavigateOnResultPages(string CityName) { SearchResultPage searchResult = new SearchResultPage(); // Wait untill page links presents searchResult.WaitUntillHeaderlinkPresent(); // Verify page title with city name Assert.IsTrue(searchResult.GetSearchResultPageTitle().Contains(CityName)); }
public void ThenISeeResultPerPageIsSetTo(string resultPerPage) { var searchResultpage = new SearchResultPage(); string s = FindElement(searchResultpage.ResultPerPagelocator).Text; Assert.IsTrue(s.Contains(resultPerPage)); }
public static void Register() { // Workspace root (Launchpad) Handle.GET("/useradmin", () => { return Self.GET("/useradmin/admin/users"); }); Handle.GET("/useradmin/standalone", () => { Session session = Session.Current; if (session != null && session.Data != null) { return session.Data; } MasterPage masterPage = new MasterPage(); if (session == null) { session = new Session(SessionOptions.PatchVersioning); masterPage.Html = "/useradmin/viewmodels/launcher/StandalonePage.html"; } else { masterPage.Html = "/useradmin/viewmodels/launcher/LauncherWrapperPage.html"; } masterPage.Session = session; return masterPage; }); Handle.GET("/useradmin/app-name", () => { return new AppName(); }); // App name required for Launchpad Handle.GET("/useradmin/app-icon", () => { return new Page() { Html = "/UserAdmin/viewmodels/launcher/AppIconPage.html" }; }); // Menu Handle.GET("/useradmin/menu", () => { MasterPage master = GetMaster(); master.Menu = new AdminMenu() { Html = "/UserAdmin/viewmodels/launcher/AppMenuPage.html", IsAdministrator = MasterPage.IsAdmin() }; return master.Menu; //return new UserSessionPage() { Html = "/UserAdmin/viewmodels/launcher/AppMenuPage.html" }; //return new Page() { Html = "/UserAdmin/viewmodels/launcher/AppMenuPage.html" }; //UserSessionPage userSessionPage = new UserSessionPage(); //var menuPage = new AdminMenu() { // Html = "/UserAdmin/viewmodels/launcher/AppMenuPage.html", // IsAdministrator = UserSessionPage.IsAdmin() //}; //userSessionPage.Menu = menuPage; //userSessionPage.Session = Session.Current; //return menuPage; }); // TODO: // Not sure where to put this. Handle.GET("/useradmin/search/{?}", (string query) => { var result = new SearchResultPage(); result.Html = "/UserAdmin/viewmodels/launcher/AppSearchPage.html"; // If not authorized we don't return any results. if (!string.IsNullOrEmpty(query) && MasterPage.IsAdmin()) { result.Users = Db.SQL<Simplified.Ring3.SystemUser>("SELECT o FROM Simplified.Ring3.SystemUser o WHERE o.Username LIKE ? FETCH ?", "%" + query + "%", 5); result.Groups = Db.SQL<Simplified.Ring3.SystemUserGroup>("SELECT o FROM Simplified.Ring3.SystemUserGroup o WHERE o.Name LIKE ? FETCH ?", "%" + query + "%", 5); } return result; }); UriMapping.Map("/useradmin/menu", "/sc/mapping/menu"); UriMapping.Map("/useradmin/app-name", "/sc/mapping/app-name"); UriMapping.Map("/useradmin/app-icon", "/sc/mapping/app-icon"); UriMapping.Map("/useradmin/search/@w", "/sc/mapping/search?query=@w"); }
public void GivenISearchTheText(string keyword) { var searchResultPage = new SearchResultPage(); searchResultPage.Search(keyword); }
public void ThenIShouldSeeSearchResultsFor(string keyword) { var searchResultPage = new SearchResultPage(); IList<IWebElement> searchResultList = ListOfElements(searchResultPage.SearchResultRowLocator); foreach (IWebElement element in searchResultList) { Assert.IsTrue(element.Text.ToLower().Contains(keyword.ToLower())); } }
public ListAuthorityGroupsRequest() { Page = new SearchResultPage(); }
public void ThenISeeLinkNextForPagination() { var searchResultpage = new SearchResultPage(); AssertElementDisplayed(searchResultpage.NextLinkLocator); }
public void GivenISetResultsPerPageTo(string resultsPerPage) { var searchResultpage = new SearchResultPage(); searchResultpage.ChangeResultPerPage(resultsPerPage); }