Exemplo n.º 1
0
        public void IsAddToFavoriteWork()
        {
            #region TestData
            string phoneName  = "huawei p10 plus";
            bool   testResult = false;
            #endregion

            HeaderPageFragment headerPageFragment = new HeaderPageFragment(webDriver);
            headerPageFragment.serachObject(phoneName);

            SearchResultPage searchResultPage = new SearchResultPage(webDriver);
            searchResultPage.addToFavorite(0);
            var favoriteTitle = searchResultPage.getTitle(searchResultPage.favoriteElement);

            headerPageFragment.navToFavourites();

            FavoritePage favoritePage = new FavoritePage(webDriver);
            favoritePage.createSnippedCardTitlesList();


            foreach (var title in favoritePage.snippetCardTitles)
            {
                if (title.Contains(favoriteTitle))
                {
                    testResult = true;
                    break;
                }
            }

            Assert.IsTrue(testResult);
        }
Exemplo n.º 2
0
        public void IsSearchResult()
        {
            #region TestData
            string phoneName  = "huawei p10 plus";
            bool   testResult = false;
            #endregion

            HeaderPageFragment headerPageFragment = new HeaderPageFragment(webDriver);
            headerPageFragment.serachObject(phoneName);

            SearchResultPage searchResultPage = new SearchResultPage(webDriver);
            searchResultPage.createSnippedCardTitlesList();
            foreach (var title in searchResultPage.snippetCardTitles)
            {
                if (title.Contains(phoneName.ToLower()))
                {
                    testResult = true;
                    break;
                }
            }
            Assert.IsTrue(testResult);
        }