private void AssertImageTypeVersusEncoderMimeType(string imageFileName, string expectedMimeType) { // GIVEN var captureWebPage = new CaptureWebPageMock(Ie.DomContainer); // WHEN captureWebPage.CaptureWebPageToFile(imageFileName, true, true, 100, 100); // THEN Assert.That(captureWebPage.ImageCodecInfo.MimeType, Is.EqualTo(expectedMimeType), "Unexpected mime type"); }
private void CaptureWebPageToFileAndAssert(string imageFileName, CaptureWebPage.ImageCodecs expectedImageType) { // GIVEN var captureWebPage = new CaptureWebPageMock(Ie.DomContainer) { CallBaseCaptureWebPageToFile = false }; // WHEN captureWebPage.CaptureWebPageToFile(imageFileName, true, true, 100, 100); // THEN Assert.That(captureWebPage.ImageType, Is.EqualTo(expectedImageType), "Unexpected imagetype"); }
public void ScreenShotOfHtmlDialogShouldNotBeBlack() { // GIVEN CaptureWebPageMock captureWebPage; Ie.Button("modalid").ClickNoWait(); using (var htmlDialog = Ie.HtmlDialog(Find.ByTitle("PopUpTest"))) { captureWebPage = new CaptureWebPageMock(htmlDialog.DomContainer); // WHEN captureWebPage.CaptureWebPageToFile(@"C:\capture.jpg", true, true, 100, 100); } // THEN var bitmap = new Bitmap(captureWebPage.Image); var color = bitmap.GetPixel(150,50); Assert.That(IsNotEqualToColorBlack(color)); }
public void ScreenShotOfHtmlDialogShouldNotBeBlack() { // GIVEN CaptureWebPageMock captureWebPage; Ie.Button("modalid").ClickNoWait(); using (var htmlDialog = Ie.HtmlDialog(Find.ByTitle("PopUpTest"))) { captureWebPage = new CaptureWebPageMock(htmlDialog.DomContainer); // WHEN captureWebPage.CaptureWebPageToFile(@"C:\capture.jpg", true, true, 100, 100); } // THEN var bitmap = new Bitmap(captureWebPage.Image); var color = bitmap.GetPixel(150, 50); Assert.That(IsNotEqualToColorBlack(color)); }
public void ScreenShotOfIeShouldNotBeBlack() { // GIVEN Ie.Visible = true; try { var captureWebPage = new CaptureWebPageMock(Ie); // WHEN captureWebPage.CaptureWebPageToFile(@"C:\capture.jpg", true, true, 100, 100); // THEN var bitmap = new Bitmap(captureWebPage.Image); var color = bitmap.GetPixel(150, 50); Assert.That(IsNotEqualToColorBlack(color)); } finally { Ie.Visible = Settings.MakeNewIeInstanceVisible; } }
public void ScreenShotOfIeShouldNotBeBlack() { // GIVEN Ie.Visible = true; try { var captureWebPage = new CaptureWebPageMock(Ie); // WHEN captureWebPage.CaptureWebPageToFile(@"C:\capture.jpg", true, true, 100, 100); // THEN var bitmap = new Bitmap(captureWebPage.Image); var color = bitmap.GetPixel(150,50); Assert.That(IsNotEqualToColorBlack(color)); } finally { Ie.Visible = Settings.MakeNewIeInstanceVisible; } }