Ejemplo n.º 1
0
        public void TC02_SearchFlowFromHomePage()
        {
            _homePage.GoTo();

            Assert.IsTrue(_homePage.VerifySearchFieldDisplayed(), "Search field should be displayed.");
            Assert.IsTrue(_homePage.VerifySearchFieldEmpty(), "Search field should be empty.");

            _homePage.InputSearchTerm(_text);

            Assert.IsTrue(_homePage.VerifySearchFieldContainingText(_text), $"Search field should contain text: {_text}");
            Assert.IsTrue(_homePage.VerifyClearSearchTermDisplayed(), "[X] for clearing search term should be displayed.");

            _homePage.SearchTermClear();

            Assert.IsTrue(_homePage.VerifySearchFieldDisplayed(), "Search field should be displayed.");
            Assert.IsTrue(_homePage.VerifySearchFieldEmpty(), "Search field should be empty.");
            Assert.IsFalse(_homePage.VerifyClearSearchTermDisplayed(), "[X] for clearing search term should not be displayed.");
            Assert.IsFalse(_homePage.VerifyAutocompleteDisplayed(), "Autocomplete filed should not been displayed.");

            _homePage.InputSearchTerm(_moneyMovie);
            _homePage.EnterClick();

            Assert.IsTrue(_resultsPage.IsAt(), "Should be on Results Page.");
            Assert.IsTrue(_resultsPage.VerifySearchFieldContainingText(_moneyMovie), $"Search field should contain text: '{_moneyMovie}'");
            Assert.IsTrue(_resultsPage.VerifyFirstSearchResultTitle(_moneyMovieImdb), $"First search result should be: '{_moneyMovieImdb}");

            _homePage.GoTo();

            Assert.IsTrue(_homePage.VerifySearchFieldDisplayed(), "Search field should be displayed.");
            Assert.IsTrue(_homePage.VerifySearchFieldEmpty(), "Search field should be empty.");

            _homePage.InputSearchTerm(_moneyLyrics);
            _homePage.MagnifyingGlassClick();

            Assert.IsTrue(_resultsPage.IsAt(), "Should be on Results Page.");
            Assert.IsTrue(_resultsPage.VerifySearchFieldContainingText(_moneyLyrics), $"Search field should contain text: '{_moneyLyrics}'");
            Assert.IsTrue(_resultsPage.VerifyASearchResultTitle(_moneyLyricsMetro), $"A search result should be: '{_moneyLyricsMetro}");
        }