FluentAutomation
FluentAutomation copied to clipboard
Failed Assert hangs if screenshot dir doesn't exist
This:
Config.ScreenshotOnFailedAssert(true).ScreenshotPath(screenshotsDir);
I.Open(new Uri("http://google.com")).Assert.Exists("#cute-big-panda");
will fail with an informative message:
Front\UI\FrontTests.cs(113,0): at FunctionalTests.Front.UI.FrontTests.UnitOfWork_StateUnderTest_ExpectedBehavior()
--ExternalException
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)
at OpenQA.Selenium.Screenshot.SaveAsFile(String fileName, ImageFormat format)
whereas, if I change the config to:
Config.ScreenshotOnFailedAction(true).ScreenshotPath(screenshotsDir);
the same test will just hangs forever.