コード例 #1
0
        private void TestStepBack()
        {
            PplFeatures.SetZoomProperties(true, true);

            PpOperations.SelectSlide(17);
            PpOperations.SelectShape("Step Back This Shape");
            PplFeatures.StepBack();

            AssertIsSame(16, 20);
            AssertIsSame(17, 21);
            AssertIsSame(18, 22);
        }
コード例 #2
0
        private void TestDrillDown()
        {
            PplFeatures.SetZoomProperties(true, true);

            PpOperations.SelectSlide(4);
            PpOperations.SelectShape("Drill Down This Shape");
            PplFeatures.DrillDown();

            AssertIsSame(4, 7);
            AssertIsSame(5, 8);
            AssertIsSame(6, 9);
        }
コード例 #3
0
        private void IsClipboardRestoredPasteIntoGroup(int originalSlideNo, int expSlideNo)
        {
            CheckIfClipboardIsRestored(() =>
            {
                Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = GetShapesByPrefix(OrigIsClipboardRestoredPasteIntoGroupSlideNo, ShapeToCopyPrefix);
                // This should be restored to clipboard later
                shapes.Cut();

                PpOperations.SelectShape(GroupToPaste);
                PplFeatures.PasteIntoGroup();
            }, originalSlideNo, ShapeToCopyPrefix, expSlideNo, "", ShapeToCompareCopied);
        }
コード例 #4
0
        private void ReplaceWithClipboard(int originalSlideNo, int expSlideNo)
        {
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = GetShapesByPrefix(originalSlideNo, ShapeToCopyPrefix);
            shapes.Cut();

            PpOperations.SelectShapes(new List <string> {
                ShapeToReplace
            });
            PplFeatures.ReplaceWithClipboard();

            AssertIsSame(originalSlideNo, expSlideNo);
        }
コード例 #5
0
        private void PasteAtCursorPosition(int originalSlideNo, int expSlideNo)
        {
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = GetShapesByPrefix(originalSlideNo, ShapeToCopyPrefix);
            shapes.Cut();

            RightClick(GetShapesByPrefix(originalSlideNo, ShapeToClick)[1]);
            // wait for awhile for click to register properly
            ThreadUtil.WaitFor(500);
            PplFeatures.PasteAtCursorPosition();

            AssertIsSame(originalSlideNo, expSlideNo);
        }
コード例 #6
0
        private void TestStepBackBackground()
        {
            PplFeatures.SetZoomProperties(false, true);

            PpOperations.SelectSlide(24);
            PpOperations.SelectShape("Step Back This Shape");
            PplFeatures.StepBack();

            AssertIsSame(23, 27);
            AssertIsSame(24, 28);
            AssertIsSame(25, 29);
        }
コード例 #7
0
        private void TestDrillDownBackground()
        {
            PplFeatures.SetZoomProperties(false, true);

            PpOperations.SelectSlide(10);
            PpOperations.SelectShape("Drill Down This Shape");
            PplFeatures.DrillDown();

            AssertIsSame(10, 13);
            AssertIsSame(11, 14);
            AssertIsSame(12, 15);
        }
コード例 #8
0
        public void FT_AutoCaptionsTest()
        {
            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4);
            ThreadUtil.WaitFor(1000);

            PplFeatures.AutoCaptions();

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(5);
            PpOperations.SelectShape("text 3").Delete();

            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #9
0
        private void ReplaceWithClipboard(int originalSlideNo, int expSlideNo)
        {
            var shapes = GetShapesByPrefix(originalSlideNo, ShapeToCopyPrefix);

            shapes.Cut();

            PpOperations.SelectShapes(new List <string> {
                ShapeToReplace
            });
            PplFeatures.ReplaceWithClipboard();

            AssertIsSame(originalSlideNo, expSlideNo);
        }
コード例 #10
0
        private static void FitToWidthForRotatedShape()
        {
            var actualSlide = PpOperations.SelectSlide(8);
            var actualShape = PpOperations.SelectShape("pic")[1];

            PplFeatures.FitToWidth();

            var expSlide = PpOperations.SelectSlide(9);
            var expShape = PpOperations.SelectShape("pic")[1];

            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameShape(expShape, actualShape);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #11
0
        private void FitToHeight()
        {
            var actualSlide = PpOperations.SelectSlide(4);
            var actualShape = PpOperations.SelectShape("pic")[1];

            PplFeatures.FitToHeight();

            var expSlide = PpOperations.SelectSlide(6);
            var expShape = PpOperations.SelectShape("pic")[1];

            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameShape(expShape, actualShape);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #12
0
        private void IsClipboardRestoredReplaceWithClipboard(int originalSlideNo, int expSlideNo)
        {
            CheckIfClipboardIsRestored(() =>
            {
                Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = GetShapesByPrefix(OrigIsClipboardRestoredReplaceWithClipboardSlideNo, ShapeToCopyPrefix);
                // This should be restored to clipboard later
                shapes.Cut();

                PpOperations.SelectShapes(new List <string> {
                    ShapeToReplace
                });
                PplFeatures.ReplaceWithClipboard();
            }, originalSlideNo, ShapeToCopyPrefix, expSlideNo, "", ShapeToCompareCopied);
        }
コード例 #13
0
        public void FT_AutoCaptionsTest()
        {
            var actualSlide = PpOperations.SelectSlide(4);

            ThreadUtil.WaitFor(1000);

            PplFeatures.AutoCaptions();

            var expSlide = PpOperations.SelectSlide(5);

            PpOperations.SelectShape("text 3").Delete();

            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #14
0
        private static void ConvertSingleObjToPicture()
        {
            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4);
            PpOperations.SelectShape("pic");

            PplFeatures.ConvertToPic();

            Shape sh = PpOperations.SelectShapesByPrefix("Picture")[1] as Shape;

            Assert.AreEqual(MsoShapeType.msoPicture, sh.Type);

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(5);
            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #15
0
        private void IsDegradedAfterReplaceWithClipboard(int originalSlideNo, int replacedSlideNo, int degradedSlideNo)
        {
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = GetShapesByPrefix(replacedSlideNo, ShapeToCopyPrefix);
            shapes.Cut();

            PpOperations.SelectShapes(new List <string> {
                ShapeToReplace
            });
            PplFeatures.ReplaceWithClipboard();

            // Degradation results in subtle differences, therefore comparison threshold must be stricter
            AssertIsSame(originalSlideNo, replacedSlideNo, 0.999999999);

            // Verify that the degradation is detectable
            AssertNotSame(originalSlideNo, degradedSlideNo, 0.999999999);
        }
コード例 #16
0
        private static void AutoAnimateSuccessfully()
        {
            PpOperations.SelectSlide(4);

            PplFeatures.AutoAnimate();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(5);
            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(7);
            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #17
0
        public void TextSyncSuccessful()
        {
            PplFeatures.SynchronizeAgenda();

            // Duplicate template slide and delete original template slide. It should use the duplicate as the new template slide.
            Microsoft.Office.Interop.PowerPoint.Slide firstSlide = PpOperations.SelectSlide(1);
            PpOperations.SelectShape("PPTTemplateMarker").Delete();
            firstSlide.Duplicate();
            firstSlide.Delete();

            PplFeatures.SynchronizeAgenda();

            System.Collections.Generic.List <TestInterface.ISlideData> actualSlides   = PpOperations.FetchCurrentPresentationData();
            System.Collections.Generic.List <TestInterface.ISlideData> expectedSlides = PpOperations.FetchPresentationData(
                PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesTextAfterSync.pptx"));
            PresentationUtil.AssertEqual(expectedSlides, actualSlides);
        }
コード例 #18
0
        private static void ConvertSingleObjToPicture()
        {
            var actualSlide = PpOperations.SelectSlide(4);

            PpOperations.SelectShape("pic");

            PplFeatures.ConvertToPic();

            var sh = PpOperations.SelectShapesByPrefix("Picture")[1] as Shape;

            Assert.AreEqual(MsoShapeType.msoPicture, sh.Type);

            var expSlide = PpOperations.SelectSlide(5);

            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #19
0
        public void FT_AnimateInSlideTest()
        {
            PpOperations.SelectSlide(4);
            PpOperations.SelectShapes(new List <string> {
                "Rectangle 2", "Rectangle 5", "Rectangle 6"
            });

            PplFeatures.AnimateInSlide();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4);
            Microsoft.Office.Interop.PowerPoint.Slide expSlide    = PpOperations.SelectSlide(5);

            // remove text "Expected"
            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #20
0
        private void SettingsAndSingleShapeSuccessfully()
        {
            PplFeatures.SetSpotlightProperties(0.01f, 50f, Color.FromArgb(0x00FF00));

            // This method is commented out since it currently does not work for WPF controls.
            // VerifySpotlightSettingsDialogBox();

            PpOperations.SelectSlide(4);
            PpOperations.SelectShape("Spotlight Me");
            PplFeatures.Spotlight();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide1 = PpOperations.SelectSlide(4);
            Microsoft.Office.Interop.PowerPoint.Slide actualSlide2 = PpOperations.SelectSlide(5);
            Microsoft.Office.Interop.PowerPoint.Slide expSlide1    = PpOperations.SelectSlide(6);
            Microsoft.Office.Interop.PowerPoint.Slide expSlide2    = PpOperations.SelectSlide(7);
            SlideUtil.IsSameLooking(expSlide1, actualSlide1);
            SlideUtil.IsSameLooking(expSlide2, actualSlide2);
        }
コード例 #21
0
        public void TextSyncSuccessful()
        {
            PplFeatures.SynchronizeAgenda();

            // Duplicate template slide and delete original template slide. It should use the duplicate as the new template slide.
            var firstSlide = PpOperations.SelectSlide(1);

            PpOperations.SelectShape("PPTTemplateMarker").Delete();
            firstSlide.Duplicate();
            firstSlide.Delete();

            PplFeatures.SynchronizeAgenda();

            var actualSlides   = PpOperations.FetchCurrentPresentationData();
            var expectedSlides = PpOperations.FetchPresentationData(
                PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesTextAfterSync.pptx"));

            PresentationUtil.AssertEqual(expectedSlides, actualSlides);
        }
コード例 #22
0
        private static void AutoAnimateStraightLinesSuccessfully()
        {
            PpOperations.SelectSlide(38);

            PplFeatures.AutoAnimate();

            Slide actualSlide = PpOperations.SelectSlide(39);

            // remove elements that affect comparing slides
            PpOperations.SelectShape("Text Label Initial Slide")[1].Delete();

            Slide expSlide = PpOperations.SelectSlide(41);

            // remove elements that affect comparing slides
            PpOperations.SelectShape("Text Label Expected Output")[1].Delete();

            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #23
0
        public void FT_AnimateInSlideStraightLinesTest()
        {
            PpOperations.SelectSlide(21);
            PpOperations.SelectShapes(new List <string> {
                "Straight Arrow Connector 61",
                "Straight Arrow Connector 63",
                "Straight Arrow Connector 66"
            });

            PplFeatures.AnimateInSlide();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(21);
            Microsoft.Office.Interop.PowerPoint.Slide expSlide    = PpOperations.SelectSlide(22);

            // remove text "Expected"
            PpOperations.SelectShape("Text Label Expected Output")[1].Delete();
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #24
0
        private static void AutoAnimateWithCopyPasteShapesSuccessfully()
        {
            PpOperations.SelectSlide(8);
            ShapeRange pastingShapes = PpOperations.SelectShapes(new List <string> {
                "Notched Right Arrow", "Group"
            });

            PPLClipboard.Instance.LockAndRelease(() =>
            {
                pastingShapes.Copy();

                Slide targetSlide = PpOperations.SelectSlide(9);
                targetSlide.Shapes.Paste();
            });

            Assert.IsNotNull(PpOperations.SelectShape("Notched Right Arrow"),
                             "Copy-Paste failed, this task is flaky so please re-run.");
            Shape sh1 = PpOperations.SelectShape("Notched Right Arrow")[1];

            sh1.Rotation += 90;
            Shape sh2 = PpOperations.SelectShape("Group")[1];

            sh2.Rotation += 90;

            // go back to slide 8
            PpOperations.SelectSlide(8);

            PplFeatures.AutoAnimate();

            Slide actualSlide = PpOperations.SelectSlide(9);

            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            Slide expSlide = PpOperations.SelectSlide(11);

            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            // TODO: actually this expected slide looks a bit strange..
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #25
0
        private static void AutoAnimateWithCopyPasteShapesSuccessfully()
        {
            PpOperations.SelectSlide(8);
            PpOperations.SelectShapes(new List <string> {
                "Notched Right Arrow 3", "Group 2"
            });
            // use keyboard to copy & paste,
            // otherwise API's copy & paste won't trigger special clipboard event.
            KeyboardUtil.Copy();

            PpOperations.SelectSlide(9);
            KeyboardUtil.Paste();

            Assert.IsNotNull(PpOperations.SelectShape("Notched Right Arrow 3"),
                             "Copy-Paste failed, this task is flaky so please re-run.");
            var sh1 = PpOperations.SelectShape("Notched Right Arrow 3")[1];

            sh1.Rotation += 90;
            var sh2 = PpOperations.SelectShape("Group 2")[1];

            sh2.Rotation += 90;

            // go back to slide 8
            PpOperations.SelectSlide(8);

            PplFeatures.AutoAnimate();

            var actualSlide = PpOperations.SelectSlide(9);

            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            var expSlide = PpOperations.SelectSlide(11);

            // remove elements that affect comparing slides
            PpOperations.SelectShapesByPrefix("text").Delete();

            // TODO: actually this expected slide looks a bit strange..
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #26
0
        private static void CheckIfClipboardIsRestored()
        {
            Microsoft.Office.Interop.PowerPoint.Slide      actualSlide     = PpOperations.SelectSlide(10);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapeToBeCopied = PpOperations.SelectShape("pictocopy");
            Assert.AreEqual(1, shapeToBeCopied.Count);
            // Add "pictocopy" to clipboard
            shapeToBeCopied.Copy();

            // Normally run convert to pic function
            PpOperations.SelectShape("pic");
            PplFeatures.ConvertToPic();

            // Paste whatever in clipboard
            Microsoft.Office.Interop.PowerPoint.ShapeRange newShape = actualSlide.Shapes.Paste();

            // Check if pasted shape is also called "pictocopy"
            Assert.AreEqual("pictocopy", newShape.Name);

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(11);
            PpOperations.SelectShape("text 3")[1].Delete();
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #27
0
        public void CropAndCompare(int testSlideNo, int expectedSlideNo)
        {
            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(testSlideNo);
            PpOperations.SelectShapesByPrefix("selectMe");

            // Execute the Crop To Slide feature
            PplFeatures.CropToSlide();
            Microsoft.Office.Interop.PowerPoint.Shape resultShapes = PpOperations.SelectShapesByPrefix("selectMe")[1];
            System.IO.FileInfo resultShapesInPic = PpOperations.ExportSelectedShapes();

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(expectedSlideNo);

            Microsoft.Office.Interop.PowerPoint.Shape expShape = PpOperations.SelectShapesByPrefix("selectMe")[1];
            System.IO.FileInfo expShapeInPic = PpOperations.ExportSelectedShapes();

            // remove elements that affect comparing slides
            // e.g. "Expected" textbox
            PpOperations.SelectShapesByPrefix("text").Delete();

            SlideUtil.IsSameLooking(expShape, expShapeInPic, expShape, expShapeInPic);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #28
0
 public void FT_EffectsLabTest()
 {
     PplFeatures.BlurrinessOverlay("EffectsLabBlurBackground", true);
     TestRemainderEffect(40, PplFeatures.BlurBackgroundEffect);
     PplFeatures.BlurrinessOverlay("EffectsLabBlurRemainder", true);
     TestRemainderEffect(37, PplFeatures.BlurRemainderEffect);
     TestRemainderEffect(34, PplFeatures.SepiaBackgroundEffect);
     PplFeatures.BlurrinessOverlay("EffectsLabBlurBackground", false);
     TestRemainderEffect(31, PplFeatures.BlurBackgroundEffect);
     TestRemainderEffect(28, PplFeatures.SepiaRemainderEffect);
     TestRemainderEffect(25, PplFeatures.GothamRemainderEffect);
     TestRemainderEffect(22, PplFeatures.BlackAndWhiteBackgroundEffect);
     TestRemainderEffect(19, PplFeatures.GreyScaleRemainderEffect);
     PplFeatures.BlurrinessOverlay("EffectsLabBlurRemainder", false);
     TestRemainderEffect(16, PplFeatures.BlurRemainderEffect);
     TestEffect(14, PplFeatures.BlurSelectedEffect);
     TestEffect(12, PplFeatures.BlurSelectedEffect);
     PplFeatures.BlurrinessOverlay("EffectsLabBlurSelected", true);
     TestEffect(10, PplFeatures.BlurSelectedEffect);
     TestEffect(8, PplFeatures.BlurSelectedEffect);
     TestEffect(6, PplFeatures.MagnifyingGlassEffect);
     TestEffect(4, PplFeatures.TransparentEffect);
 }
コード例 #29
0
        private void CropRotatedShapeSuccessfully()
        {
            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(10);
            PpOperations.SelectShape("selectMe");

            // Execute the Crop To Shape feature
            PplFeatures.AutoCrop();

            Microsoft.Office.Interop.PowerPoint.Shape resultShape = PpOperations.SelectShapesByPrefix("selectMe")[1];
            System.IO.FileInfo resultShapeInPic = PpOperations.ExportSelectedShapes();

            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(11);

            Microsoft.Office.Interop.PowerPoint.Shape expShape = PpOperations.SelectShapesByPrefix("selectMe")[1];
            System.IO.FileInfo expShapeInPic = PpOperations.ExportSelectedShapes();

            // remove elements that affect comparing slides
            // e.g. "Expected" textbox
            PpOperations.SelectShapesByPrefix("text").Delete();

            SlideUtil.IsSameLooking(expShape, expShapeInPic, resultShape, resultShapeInPic);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
コード例 #30
0
        public void CropAndCompare(int testSlideNo, int expectedSlideNo)
        {
            var actualSlide = PpOperations.SelectSlide(testSlideNo);

            PpOperations.SelectShapesByPrefix("selectMe");

            // Execute the Crop To Slide feature
            PplFeatures.CropToSlide();
            var resultShapes      = PpOperations.SelectShapesByPrefix("selectMe")[1];
            var resultShapesInPic = PpOperations.ExportSelectedShapes();

            var expSlide = PpOperations.SelectSlide(expectedSlideNo);

            var expShape      = PpOperations.SelectShapesByPrefix("selectMe")[1];
            var expShapeInPic = PpOperations.ExportSelectedShapes();

            // remove elements that affect comparing slides
            // e.g. "Expected" textbox
            PpOperations.SelectShapesByPrefix("text").Delete();

            SlideUtil.IsSameLooking(expShape, expShapeInPic, expShape, expShapeInPic);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }