public UI_Movies_With_Signed_In_User(SeleniumServerFactory <Startup> server) { Server = server; Client = Server .WithMoviesInDatabase(MoviesCatalog.GetMovies()) .WithUserLoggedIn( new MockIdentityBuilder() .WithName("Test User") .Identity) .CreateClient(); var opts = new ChromeOptions(); opts.AddArgument("--headless"); opts.SetLoggingPreference(OpenQA.Selenium.LogType.Browser, LogLevel.All); var driver = new RemoteWebDriver(opts); Browser = driver; }
public void Should_Filter_Movies_By_Title() { // Arrange var movies = MoviesCatalog.GetMovies(); var firstTitle = movies.First().Title; int justOneFilm = 1; Browser.Navigate().GoToUrl($"{Server.RootUri}/movies/Index"); var indexMoviePage = new IndexMoviePage(Browser); indexMoviePage.FilterTitle = firstTitle; // Act indexMoviePage.SendSearchRequest(); indexMoviePage = new IndexMoviePage(Browser); var elements = indexMoviePage.MoviesRendered; // Assert Assert.Equal(justOneFilm, elements.Count); }
public void Should_Filter_Movies_By_Genre() { // Arrange var movies = MoviesCatalog.GetMovies(); var firstGenre = movies.First().Genre; int expected = 1; Browser.Navigate().GoToUrl($"{Server.RootUri}/movies/Index"); var indexMoviePage = new IndexMoviePage(Browser); indexMoviePage.SelectGenre(firstGenre); // Act indexMoviePage.SendSearchRequest(); indexMoviePage = new IndexMoviePage(Browser); var genresdisplayed = indexMoviePage.MoviesRendered.Select(m => m.Title); // Assert Assert.Equal(expected, genresdisplayed.Count()); }