protected void ButtonSearch_Click(object sender, EventArgs e)
        {
            string        sortName      = DropDownListSort.SelectedValue;
            SearchActions searchActions = new SearchActions();

            switch (DropDownListConditions.SelectedValue)
            {
            case "inTheName":
                string searchingName = TextBoxName.Text;

                IList <Goods> iListSearchedByName = searchActions.SearchByName(searchingName, sortName, 10);
                GridView1.DataSource = iListSearchedByName;
                GridView1.DataBind();
                break;

            case "inTheCategory":
                break;

            case "inTheDateTime":

                if (ViewState["start"] != null && ViewState["end"] != null)
                {
                    DateTime      start = (DateTime)ViewState["start"];
                    DateTime      end   = (DateTime)ViewState["end"];
                    IList <Goods> IListSearchedByDateTime = searchActions
                                                            .SearchByDateTime(start, end, sortName, 10);
                    GridView1.DataSource = IListSearchedByDateTime;
                    GridView1.DataBind();
                }
                break;
            }
        }
Beispiel #2
0
        public void placeholder_pic()
        {
            SearchActions.search_setup(_session);
            var backgroundImage = _session.FindElementByClassName("Image");

            Assert.IsNotNull(backgroundImage);
        }
        public void SearchForAGivenArticleName()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, articleName);

            Assert.IsTrue(surgeryPage.Article(articleName).Displayed);
        }
        public void TrickySearchForAGivenWordAllNumberOfArticles()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, searchWord);

            int trickyNum = SearchActions.GetNumberOfArticles(surgeryPage.TrickyNumberOfArticles);

            Assert.True(trickyNum > 100);
        }
        public void SearchForAGivenWordNumberOfArticlesOnPage()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, searchWord);

            IList <IWebElement> listOfArticles = surgeryPage.FoundArticles();

            Assert.AreEqual(60, listOfArticles.Count());
        }
        public void SearchForAGivenWordResultsAreNotEmpty()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, searchWord);

            IList <IWebElement> listOfWords = surgeryPage.FoundWords(searchWord);

            Assert.True(listOfWords.Count() > 0);
        }
        public void VerifyIfSearchSaved()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);
            FavouritesPage favouritesPage = new FavouritesPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, articleName);
            SearchActions.SaveSearch(surgeryPage.SaveSearchButton, surgeryPage.SearchNametextBox, surgeryPage.SaveSearchButtonForm, searchName);
            Navigation.Navigate(driver, favouritesPageUrl);
            favouritesPage.ElementInFavourites("Saved Searches").Click();

            Assert.IsTrue(favouritesPage.ElementInFavourites(searchName).Displayed);
        }
Beispiel #8
0
        public void not_found_cont()
        {
            SearchActions.search_setup(_session);
            _session.FindElementByClassName("TextBlock").SendKeys("kjdhfsoklhjosrg");
            string text = _session.FindElementByName("Ничего не нашлось").Text;

            Console.WriteLine(text);
            string text2 = _session.FindElementByName("Попробуйте как-нибудь по-другому").Text;

            Console.WriteLine(text2);

            Assert.IsNotNull(text);
            Assert.IsNotNull(text2);
        }
        public void SearchForAGivenNumberOfArticlesOnSpecialPage()
        {
            PlasticAndReconstructiveSurgeryPage surgeryPage = new PlasticAndReconstructiveSurgeryPage(driver);

            SearchActions.SearchForWord(surgeryPage.SearchBox, surgeryPage.SearchButton, searchWord);

            var buttons = surgeryPage.PageButton(numOfPage);

            while (buttons.Count() == 0)
            {
                surgeryPage.NextLink.Click();
                buttons = surgeryPage.PageButton(numOfPage);
            }
            surgeryPage.PageButton(numOfPage).ElementAt(0).Click();
            Assert.AreEqual(60, surgeryPage.FoundArticles().Count());
        }
Beispiel #10
0
        //не удалось найти по названию в окне Поиска и пришлось писать с переходом на страницу
        public void SearchContent()
        {
            SearchActions.search_setup(_session);
            _session.FindElementByClassName("TextBlock").SendKeys("Фиксики");
            _session.FindElementByClassName("TextBlock").SendKeys(Keys.Tab);
            _session.FindElementByClassName("Button").SendKeys(Keys.Enter);
            var pagename = _session.FindElementByName("Фиксики").Text;

            Console.WriteLine(pagename);

            Assert.IsNotNull(pagename);

            //var thefoundcontent = _session.FindElementById("_textBlockTitle");
            //Console.WriteLine(thefoundcontent);
            //Assert.IsNotNull(thefoundcontent);
        }
Beispiel #11
0
        public void safe_search()
        {
            SearchActions.search_setup(_session);
            _session.FindElementByClassName("TextBlock").SendKeys("Голограмма");
            _session.FindElementByClassName("TextBlock").SendKeys(Keys.Tab);
            var a = _session.FindElementByClassName("TextBlock").Text;

            Console.WriteLine(a);
            if (a.Equals("18+"))
            {
                _session.FindElementByClassName("TextBlock").SendKeys(Keys.Meta + Keys.Backspace);
                _session.FindElementByName("myivi").Click();
                _session.FindElementByName("Настройки").Click();
                _session.FindElementByName("_safesearch").Click();
                _session.FindElementByClassName("TextBlock").SendKeys("Голограмма");
                var b = _session.FindElementByClassName("TextBlock").Text;
            }
            //додумать
        }
Beispiel #12
0
 public SearchVM()
 {
     searchaction = new SearchActions(this);
 }
        // **************************************
        // LogUserEvent: ContentActionEvent
        // **************************************
        public static void LogSearchEvent(SearchActions action, string searchTerms, int resultsCount)
        {
            var actionEvent = new SearchEvent() {
                SearchActionId = (int)action,
                UserId = Account.User().UserId,
                SearchEventDate = DateTime.Now,
                SessionId = CurrentSessionId(),
                QueryString = searchTerms,
                ResultCount = resultsCount
            };

            LogActionEventDelegate<SearchEvent> logActionEventDelegate = new LogActionEventDelegate<SearchEvent>(LogEvent);

            logActionEventDelegate.BeginInvoke(actionEvent, null, null);
        }