public void SearchCurrentPupilByName(string textForSearch) { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "TestData_Pupil"); var pupilForename = Utilities.GenerateRandomString(10, "Forename_TestData_Pupil" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01)); #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.EnterSearchTextForPupilContacts(textForSearch); double millisecs = searchBox.SearchTimeInMillisecs; searchBox.Log("Results fetched in " + millisecs + " milliseconds"); Assert.Less(millisecs, AddressBookConstants.MaxAcceptableSearchTimeInMillisecs); }
public static bool KeyDownNavigationOnPupilResults(SeleniumHelper.iSIMSUserType user) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(user); SearchResultTile srt = searchBox.EnterSearchTextForPupils("ad"); int resultCount = srt.tileCount(); bool traversed = false; Actions action = new Actions(WebContext.WebDriver); action.SendKeys(Keys.Tab).Perform(); action.SendKeys(Keys.Tab).Perform(); for (var index = 0; index < resultCount; index++) { action.SendKeys(OpenQA.Selenium.Keys.Down).Perform(); String classNameForStrongTags = srt.getClassForStrongname(index); if (classNameForStrongTags.Contains("tt-selectable")) { traversed = true; } else { return(false); } } return(traversed); }
public void LinkToPupilRecordFromPupilInfo() { #region Data Pupil Setup #region Create a new pupil, so that it can be attached later to the newly created contact1 AutomationSugar.Log("Data Creation started"); Guid pupilId = Guid.NewGuid(); DataPackage dataPackage = this.BuildDataPackage(); var pupilSurname = Utilities.GenerateRandomString(10, "LinkForPupil"); var pupilForename = Utilities.GenerateRandomString(10, "LinkForPupil" + Thread.CurrentThread.ManagedThreadId); dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01)); #endregion DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage); #endregion AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(pupilForename); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); popup.ClickPupilDetailsLink(); bool value = SeleniumHelper.Get(AddressBookElements.OpenedPupilRecordTab).Displayed; Assert.IsTrue(value); }
public bool SelectObject(ISearchContext context, Action <Object, bool> selectHandler, Action <Object> trackingHandler) { var selectContext = (ObjectSelectorSearchContext)context; var viewFlags = SearchFlags.OpenPicker; if (Utils.IsRunningTests()) { viewFlags |= SearchFlags.Dockable; } SearchAnalytics.SendEvent(null, SearchAnalytics.GenericEventType.QuickSearchPickerOpens, "", "object", "ObjectSelectorEngine"); var searchQuery = string.Join(" ", context.requiredTypeNames.Select(tn => tn == null ? "" : $"t:{tn.ToLowerInvariant()}")); if (string.IsNullOrEmpty(searchQuery)) { searchQuery = ""; } else { searchQuery += " "; } var viewstate = new SearchViewState( SearchService.CreateContext(GetObjectSelectorProviders(selectContext), searchQuery, viewFlags), selectHandler, trackingHandler, selectContext.requiredTypeNames.First(), selectContext.requiredTypes.First()); qsWindow = SearchService.ShowPicker(viewstate) as QuickSearch; return(qsWindow != null); }
private async Task GetRecords() { if (QuickSearch == null) { var task = Task.Run(new Action(() => { try { SetBusy(true); SourceList = new List <Stocky.Data.Interfaces.IDataModel>(Transaction.GetTransactionList()); QuickSearch = new QuickSearch(SourceList); SetBusy(false); } catch (Exception e) { App.Current.Dispatcher.BeginInvoke((Action) delegate { ExepionLogger.Logger.LogException(e); ExepionLogger.Logger.Show(e); }); } } )); await task; } else { var task = Task.Run(new Action(() => { try { SetBusy(true); SourceList.Clear(); foreach (var Item in Transaction.GetTransactionList()) { SourceList.Add(Item); } SetBusy(false); } catch (Exception e) { App.Current.Dispatcher.BeginInvoke((Action) delegate { ExepionLogger.Logger.LogException(e); ExepionLogger.Logger.Show(e); }); } } )); await task; await App.Current.Dispatcher.BeginInvoke((Action) delegate { QuickSearch.updatelist(SourceList); }); } }
public void FindApp(AppGroup appGroup, string appNamePart) { if (_QuickSearchWnd == null) { _QuickSearchWnd = new QuickSearch(); _QuickSearchWnd.Owner = _WorkItem.MainWindow; _QuickSearchWnd.WindowStartupLocation = WindowStartupLocation.CenterOwner; _QuickSearchWnd.SearchString = appNamePart; _QuickSearchWnd.SerachStringChanged += (s, e) => FindApp(appGroup, _QuickSearchWnd.SearchString); _QuickSearchWnd.Closed += (s, e) => EndSearch(); _QuickSearchWnd.ItemSelected += (s, e) => SearchSucceded(); //_QuickSearchWnd.FoundItems = appGroup.FindApps(appNamePart); _QuickSearchWnd.Show(); _SearchTimer.IsEnabled = true; } else { _SearchTimer.Stop(); _SearchTimer.Start(); //var apps = _QuickSearchWnd.FoundItems as AppInfoCollection; var apps = appGroup.FindApps(appNamePart); if (apps != null) { _QuickSearchWnd.FoundItems = apps; } } }
public GL501000_BatchRelease() { ScreenId = "GL501000"; ScreenUrl = "/Pages/GL/GL501000.aspx"; ToolBar = new PxToolBar(null); QuickSearch = new QuickSearch("ctl00_phDS_ds_ToolBar_fb", "QuickSearch", null, null); }
public IHttpActionResult GetBusRoad(string Source, string Destination, string city) { City ncity = DB.Cities.FirstOrDefault(o => o.CityName == city); GetBuses(city); ReformateDB(); SrcDestLines(Source, Destination); FindtheRoad(); for (int i = 0; i < finalLines.Count; i++) { QuickSearch quickSearch = new QuickSearch(); quickSearch.Destination = Destination; quickSearch.Source = Source; quickSearch.RoadDesc = finalLines[i]; quickSearch.VechialType = "Bus"; quickSearch.City = ncity; DB.Quicksearch.Add(quickSearch); DB.SaveChanges(); } if (finalLines.Count == 0) { return(NotFound()); } return(Ok(finalLines)); }
public CatalogSearchViewModel(CatalogViewModel catalog) { Shell = catalog.Shell; InitFields(); Items.Value = new List <CatalogDisplayItem>(); CurrentItem #if !DEBUG .Throttle(Consts.ScrollLoadTimeout, UiScheduler) #endif .SelectMany(x => Env.RxQuery(s => { if (x == null) { return(null); } var catalogId = x.CatalogId; return(s.Query <Catalog>() .Fetch(c => c.Name) .ThenFetch(n => n.Mnn) .FirstOrDefault(c => c.Id == catalogId)); })) .Subscribe(CurrentCatalog, CloseCancellation.Token); ParentModel = catalog; QuickSearch = new QuickSearch <CatalogDisplayItem>(UiScheduler, v => Items.Value.FirstOrDefault(c => c.Name.StartsWith(v, StringComparison.CurrentCultureIgnoreCase)), CurrentItem); QuickSearch.IsEnabled = false; SearchBehavior = new SearchBehavior(this); IsLoading.Value = true; IsQuickSearchEnabled.Subscribe(v => { QuickSearch.IsEnabled = v; SearchBehavior.HandleGridKeyboardInput = !v; }); }
public ActionResult DeleteConfirmed(int id) { QuickSearch contact = db.DimondDating.Find(id); db.DimondDating.Remove(contact); db.SaveChanges(); return(RedirectToAction("Index")); }
internal static void SearchAssetStoreMenu() { var storeContext = SearchService.CreateContext(SearchService.GetProvider(k_ProviderId)); var qs = QuickSearch.Create(storeContext, topic: "asset store", saveFilters: false, multiselect: false); qs.itemIconSize = 128; qs.SetSearchText(String.Empty); qs.ShowWindow(); }
public StockAssortmentViewModel() { DisplayName = "Ассортимент товаров"; InitFields(); CatalogsSearch = new QuickSearch <Catalog>(UiScheduler, v => Catalogs.Value.FirstOrDefault(n => n.FullName.StartsWith(v, StringComparison.CurrentCultureIgnoreCase)), c => CurrentCatalog.Value = c); }
public PriceViewModel() { DisplayName = "Прайс-листы фирм"; InitFields(); Prices.Value = new List <Price>(); QuickSearch = new QuickSearch <Price>(UiScheduler, t => Prices.Value.FirstOrDefault(p => p.Name.IndexOf(t, StringComparison.CurrentCultureIgnoreCase) >= 0), CurrentPrice); }
public Interpreter(ushort[] program) { this.program = program; qs = null; group_count = ReadProgramCount(1) + 1; match_min = ReadProgramCount(3); program_start = 7; groups = new int[group_count]; }
internal static SearchProvider CreateProvider() { return(new SearchProvider(type, displayName) { priority = 25, filterId = "p:", showDetails = SearchSettings.fetchPreview, subCategories = new List <NameEntry>() { new NameEntry("guid", "guid"), new NameEntry("packages", "packages") }, onEnable = () => { if (!SearchSettings.useUberIndexing && fileIndexer == null) { var packageRoots = Utils.GetPackagesPaths().Select(p => new SearchIndexerRoot(Path.GetFullPath(p).Replace('\\', '/'), p)); var roots = new[] { new SearchIndexerRoot(Application.dataPath, "Assets") }.Concat(packageRoots); fileIndexer = new FileSearchIndexer(type, roots); fileIndexer.Build(); } }, isEnabledForContextualSearch = () => QuickSearch.IsFocusedWindowTypeName("ProjectBrowser"), fetchItems = (context, items, _provider) => SearchAssets(context, items, _provider), fetchKeywords = (context, lastToken, items) => { if (!lastToken.StartsWith("t:")) { return; } items.AddRange(typeFilter.Select(t => "t:" + t)); }, fetchDescription = (item, context) => (item.description = GetAssetDescription(item.id)), fetchThumbnail = (item, context) => Utils.GetAssetThumbnailFromPath(item.id), fetchPreview = (item, context, size, options) => Utils.GetAssetPreviewFromPath(item.id, size, options), startDrag = (item, context) => { var obj = AssetDatabase.LoadAssetAtPath <Object>(item.id); if (obj == null) { return; } DragAndDrop.PrepareStartDrag(); DragAndDrop.objectReferences = new[] { obj }; DragAndDrop.StartDrag(item.label); }, trackSelection = (item, context) => Utils.PingAsset(item.id) }); }
public ActionResult Edit([Bind(Include = "ContactId,Name,Address,City,State,Zip,Email")] QuickSearch contact) { if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contact)); }
public void SysMgrCanNotAccessCurrentPupilAddress() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsFalse(popup.IsAddressDisplayed()); }
public JunkOfferViewModel() { DisplayName = "Препараты с истекающими сроками годности"; NavigateOnShowCatalog = true; QuickSearch = new QuickSearch <Offer>(UiScheduler, t => Offers.Value.FirstOrDefault(o => o.ProductSynonym.IndexOf(t, StringComparison.CurrentCultureIgnoreCase) >= 0), CurrentOffer); IsLoading = new NotifyValue <bool>(); }
public static bool CanTabToQuickSearchOnChrome(SeleniumHelper.iSIMSUserType userType) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationOnTabChrome(userType); searchBox.ClearText(); searchBox.textSearch.SendKeys("ad"); string value = SeleniumHelper.Get(AddressBookElements.LinkAddressBook).GetAttribute("aria-expanded"); return(value == "true"); }
public void SysMgrCanNotAccessPupilGenderDetails() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.CheckPupilGenderDetailsForBlank()); }
public void DisplayCurrentPupilImage() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.EnterSearchTextForPupils("ad"); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.IsPupilImageDisplayed()); }
public SearchQueryTreeView(TreeViewState state, QuickSearch searchView) : base(state) { showBorder = false; showAlternatingRowBackgrounds = false; rowHeight = EditorGUIUtility.singleLineHeight + 4; this.searchView = searchView; Reload(); SortBy(SearchSettings.savedSearchesSortOrder); }
public ActionResult QuickSearch([FromBody] QuickSearch searchTerms) { //search terms can be comma delimited, turn them into a comma-separated list var terms = (searchTerms?.SearchTerm ?? "").Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var results = inventoryService.QuickSearch(terms); //todo: create a DTO for products for the UI side return(Json(results)); }
public void SysMgrCanAccessCurrentPupil_DOB_Name() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsTrue(popup.GetPupilBasicDetailsNameDOB()); }
internal static void SearchAssetStoreMenu() { SearchAnalytics.SendEvent(null, SearchAnalytics.GenericEventType.QuickSearchOpen, "SearchAssetStore"); var storeContext = SearchService.CreateContext(SearchService.GetProvider(k_ProviderId)); var qs = QuickSearch.Create(storeContext, topic: "asset store"); qs.itemIconSize = (int)DisplayMode.Grid; qs.SetSearchText(string.Empty); qs.ShowWindow(); }
public void CannotAccessCurrentPupilImage() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.ReturnsManager); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); Assert.IsFalse(popup.IsPupilImageDisplayed()); }
public ActionResult Create([Bind(Include = "ContactId,Name,Address,City,State,Zip,Email")] QuickSearch contact) { if (ModelState.IsValid) { db.DimondDating.Add(contact); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contact)); }
public void Setup() { var scheduler = new TestScheduler(); items = new List <string>(); result = null; search = new QuickSearch <string>(scheduler, v => items.FirstOrDefault(i => i.IndexOf(v, StringComparison.CurrentCultureIgnoreCase) >= 0), s => result = s); items.Add("Microsoft"); }
public void DynamicallyDisplayHideResultSection() //For no results { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); searchBox.ClearText(); searchBox.textSearch.SendKeys(invalidtextForSearch); searchBox.waitForPupilResultstoAppear(); String NoResultElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text; Assert.True(NoResultElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found text didn't appear"); //Assertion for title if records are not found }
public static bool canViewBasicDetailsCurrentPupil(SeleniumHelper.iSIMSUserType userType, string textForSearch) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(userType); searchBox.ClearText(); searchBox.EnterSearchTextForPupils(textForSearch); AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord(); WebContext.Screenshot(); return(popup.GetPupilBasicDetails()); }
public DataModel(MainWindow mainWindow) { MainWindow = mainWindow; ServerList = new ServerList(); ServerSession = new ServerSession(this); ServerStatus = new ServerStatus(this); Database = new Database(this); QuickSearch = new QuickSearch(this); AdvancedSearch = new AdvancedSearch(this); DatabaseView = new DatabaseView(this); StreamsCollection = new StreamsCollection(); SavedPlaylists = new SavedPlaylists(this); CurrentSong = new CurrentSong(this); Playlist = new Playlist(this); OutputCollection = new OutputCollection(this); CustomDateNormalizer = new DateNormalizer(); CustomDateNormalizer.ReadFromSettings(); YearNormalizer = new DateNormalizer(new string[] {"YYYY"}); }