Last active
December 3, 2017 21:40
-
-
Save angelovstanton/ca841f962bf56f9627c5a3645ce21075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void TestNoLargeImages_When_NavigateToHomePage() | |
{ | |
_driver.Navigate().GoToUrl("https://automatetheplanet.com/"); | |
AssertNoLargeImagesRequested(); | |
} | |
private void AssertNoLargeImagesRequested() | |
{ | |
bool areThereLargeImages = | |
_requestsHistory.Values.Any(r => | |
r.ContentType != null | |
&& r.ContentType.StartsWith("image") | |
&& r.ContentLength < 40000); | |
Assert.IsFalse(areThereLargeImages); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment