public void ViewUserTripsTest() { User user = UserCreator.TakeStaticCredentials(); HomePage homePage = (HomePage) new HomePage(driver).OpenPage(HOMEPAGE_URL); SearchPage sp = (SearchPage)homePage.Login(user); int expected = sp.OpenUserTripsPage(TRIPSPAGE_URL).CountUserTrips(); Console.WriteLine($"User trips: {expected}"); Assert.IsFalse(expected > 0); }
public void TestOfInvalidTimeIntervals() { User user = UserCreator.TakeStaticCredentials(); HomePage homePage = (HomePage) new HomePage(driver).OpenPage(HOMEPAGE_URL); SearchPage sp = (SearchPage)homePage.Login(user); CarSummaryPage csp = sp .SearchForTerms("9th Avenue, New York, NY, USA", false) .SelectCar(); Assert.AreEqual(INVALID_TIMERANGE_MSG, csp.PickDate("26/12/2019")); }
public void AmountOfCarsUserCanRent(int money, int durationHours) { User user = UserCreator.TakeStaticCredentials(); //return how many cars can user afford to rent HomePage homePage = (HomePage) new HomePage(driver).OpenPage(HOMEPAGE_URL); SearchPage sp = (SearchPage)homePage.Login(user); // /html/body/div[5]/div[5]/div[2]/div[1]/div[2]/div/div[1]/div[1]/div[2]/div/div/div/div/div/div/ul/li[1] Start time // /html/body/div[5]/div[5]/div[2]/div[1]/div[2]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div/ul/li[5] End time // //div[@id="search-results-list"]/div[i]/div/div[2]/div i-th price }
public void CountPickupsByMakeAndCityTest(string carMake, string loc) { User user = UserCreator.TakeStaticCredentials(); //For example to test that there are more than 1 Toyota pickups in New York for renting HomePage homePage = (HomePage) new HomePage(driver).OpenPage(HOMEPAGE_URL); SearchPage sp = (SearchPage)homePage.Login(user); int expectedSearchResultsNumber = sp .SearchForTerms(loc, true) .CountSearchResultsCategory(carMake); Assert.AreEqual(0, expectedSearchResultsNumber); }
public void CheckSearchResultsAmount() { User user = UserCreator.TakeStaticCredentials(); HomePage homePage = (HomePage) new HomePage(driver).OpenPage(HOMEPAGE_URL); SearchPage sp = (SearchPage)homePage.Login(user); int expectedSearchResultsNumber = sp .SearchForTerms("9th Avenue, New York, NY, USA", false) .CountSearchResults(); Assert.IsTrue(expectedSearchResultsNumber > 0, "Search results are empty!"); }