Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Last active December 3, 2017 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/ca841f962bf56f9627c5a3645ce21075 to your computer and use it in GitHub Desktop.
Save angelovstanton/ca841f962bf56f9627c5a3645ce21075 to your computer and use it in GitHub Desktop.
[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