示例#1
0
        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");
        }
示例#2
0
        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));
        }
示例#4
0
        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));
        }
示例#5
0
        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;
            }
        }
        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");
        }
        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");
        }