Esempio n. 1
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();

            var actualSlide1 = PpOperations.SelectSlide(4);
            var actualSlide2 = PpOperations.SelectSlide(5);
            var expSlide1    = PpOperations.SelectSlide(6);
            var expSlide2    = PpOperations.SelectSlide(7);

            SlideUtil.IsSameLooking(expSlide1, actualSlide1);
            SlideUtil.IsSameLooking(expSlide2, actualSlide2);
        }
Esempio n. 2
0
        public void TestSwapLeftToRight2()
        {
            PositionsLabMain.IsSwapByClickOrder = false;
            PositionsLabMain.SwapReferencePoint = PositionsLabMain.SwapReference.MiddleCenter;
            _shapeNames = new List <string> {
                UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);

            Action <List <PPShape>, bool> positionsAction = (shapes, isPreview) => PositionsLabMain.Swap(shapes, isPreview);

            ExecutePositionsAction(positionsAction, actualShapes, false);
            ExecutePositionsAction(positionsAction, actualShapes, false);

            PpOperations.SelectSlide(SwapLeftToRight2Slide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 3
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                                                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(57.5200043f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(107.520004f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(760.945068f, textBoxInfo.Width));
        }
Esempio n. 4
0
        public void TestDistributeHorizontalWithinSlideWithEdges()
        {
            PositionsLabMain.DistributeReferToSlide();
            PositionsLabMain.DistributeSpaceByBoundaries();
            _shapeNames = new List <string> {
                UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideWidth   = Pres.PageSetup.SlideWidth;

            Action <List <PPShape>, float> positionsAction = (shapes, width) => PositionsLabMain.DistributeHorizontal(shapes, width);

            ExecutePositionsAction(positionsAction, actualShapes, slideWidth);

            PpOperations.SelectSlide(DistributeHorizontalWithinSlideWithEdgesSlide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
        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);
        }
Esempio n. 6
0
        private static void AutoAnimateSuccessfully()
        {
            PpOperations.SelectSlide(4);

            PplFeatures.AutoAnimate();

            var actualSlide = PpOperations.SelectSlide(5);

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

            var expSlide = PpOperations.SelectSlide(7);

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

            SlideUtil.IsSameAnimations(expSlide, actualSlide);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
Esempio n. 7
0
        public void TestDistributeGridFirstAndSecondEdge6x3()
        {
            PositionsLabMain.DistributeReferToFirstTwoShapes();
            PositionsLabMain.DistributeSpaceByBoundaries();

            _shapeNames = new List <string> {
                Rect1, Rect16, Rect2, Oval3, RoundRect4, Rect5, Rect6, Oval7, RoundRect8, Rect9, Rect10, Pic11, Pic12, Pic3
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);

            Action <List <PPShape>, int, int> positionsAction = (shapes, rowLength, colLength) => PositionsLabMain.DistributeGrid(shapes, rowLength, colLength);

            ExecutePositionsAction(positionsAction, actualShapes, 3, 6);

            PpOperations.SelectSlide(DistributeGridFirstAndSecondEdge6x3Slide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
        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);
        }
        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);
        }
Esempio n. 10
0
        public void TestDistributeVerticalWithinCornerWithCenter()
        {
            PositionsLabMain.DistributeReferToExtremeShapes();
            PositionsLabMain.DistributeSpaceByCenter();
            _shapeNames = new List <string> {
                UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideHeight  = Pres.PageSetup.SlideHeight;

            Action <List <PPShape>, float> positionsAction = (shapes, height) => PositionsLabMain.DistributeVertical(shapes, height);

            ExecutePositionsAction(positionsAction, actualShapes, slideHeight);

            PpOperations.SelectSlide(DistributeVerticalWithinCornerWithCenterSlide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 11
0
        public void TestAlignCenterToRefShape()
        {
            PositionsLabSettings.AlignReference = PositionsLabSettings.AlignReferenceObject.SelectedShape;
            _shapeNames = new List <string> {
                RotatedRectangle, UnrotatedRectangle, Oval, RotatedArrow
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideHeight  = Pres.PageSetup.SlideHeight;
            var slideWidth   = Pres.PageSetup.SlideWidth;

            Action <PowerPoint.ShapeRange, float, float> positionsAction = (shapes, height, width) => PositionsLabMain.AlignCenter(shapes, height, width);

            ExecutePositionsAction(positionsAction, actualShapes, slideHeight, slideWidth);

            PpOperations.SelectSlide(AlignShapesCenterToRefShapeNo);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
        private void ConvertShapesToTooltipAndCompare(string[] shapeNames, int testSlideNo, int expectedSlideNo, bool isSuccessful)
        {
            Slide           slide          = PpOperations.SelectSlide(testSlideNo);
            PowerPointSlide currentSlide   = PowerPointSlide.FromSlideFactory(slide);
            ShapeRange      selectedShapes = PpOperations.SelectShapes(shapeNames);

            if (isSuccessful)
            {
                Assert.AreEqual(ConvertToTooltip.AddTriggerAnimation(currentSlide, selectedShapes), isSuccessful);
            }
            else
            {
                MessageBoxUtil.ExpectMessageBoxWillPopUp(
                    TooltipsLabText.ErrorTooltipsDialogTitle,
                    TooltipsLabText.ErrorLessThanTwoShapesSelected,
                    () => { ConvertToTooltip.AddTriggerAnimation(currentSlide, selectedShapes); });
            }
            AssertIsSame(testSlideNo, expectedSlideNo);
        }
Esempio n. 13
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(348.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(741.0565f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(398.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(791.0565f, textBoxInfo.Width));
        }
Esempio n. 14
0
        private void TestErrorDialogs(ISyncLabController syncLab)
        {
            PpOperations.SelectSlide(OriginalSyncGroupToShapeSlideNo);

            // no selection copy
            ExpectCopyButtonDisabled(syncLab);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorCopySelectionInvalid, syncLab.Copy, "Ok");

            // 2 item selected copy
            List <String> shapes = new List <string> {
                Line, RotatedArrow
            };

            PpOperations.SelectShapes(shapes);
            ExpectCopyButtonEnabled(syncLab);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorCopySelectionInvalid, syncLab.Copy, "Ok");

            // group selected copy
            PpOperations.SelectShape(Group);
            ExpectCopyButtonEnabled(syncLab);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorCopySelectionInvalid, syncLab.Copy, "Ok");

            // copy blank item for the paste error dialog test
            PpOperations.SelectShape(Line);
            ExpectCopyButtonEnabled(syncLab);
            CopyStyle(syncLab);

            // no selection sync
            PpOperations.SelectSlide(ExpectedSyncShapeToGroupSlideNo);
            ExpectCopyButtonDisabled(syncLab);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorPasteSelectionInvalid, () => syncLab.Sync(0), "Ok");

            // smart art
            PpOperations.SelectSlide(SmartArtSlideNo);
            PpOperations.SelectShape(SmartArt);
            ExpectCopyButtonEnabled(syncLab);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorSmartArtUnsupported, syncLab.Copy, "Ok");
        }
        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);
        }
        public void TestSnapHorizontal0Degrees()
        {
            _shapeNames = new List <string> {
                Rectangle3, Oval4, Rectangle6, Picture3, Picture4, Picture2, LeftArrow2, UpArrow10, DownArrow11,
                LeftRightArrow12, UpDownArrow13, QuadArrow14, LeftRightUpArrow15, BentArrow16, UTurnArrow17, LeftUpArrow18, BentUpArrow19,
                CurvedRightArrow20, CurvedLeftArrow21, CurvedDownArrow22, CurvedUpArrow23, StripedRightArrow24, NotchedRightArrow25, Pentagon26,
                Chevron27, RightArrowCallout28, DownArrowCallout29, LeftArrowCallout30, UpArrowCallout31, LeftRightArrowCallout32, UpArrowCallout31,
                LeftRightArrowCallout32, QuadArrowCallout33, CircularArrow34, RightArrow1
            };
            PowerPoint.ShapeRange actualShapes = GetShapes(OriginalShapes0DegreesSlideNo, _shapeNames);

            Action <IList <Shape> > positionsAction = (shapes) => PositionsLabMain.SnapHorizontal(shapes);

            ExecutePositionsAction(positionsAction, actualShapes);

            PpOperations.SelectSlide(SnapHorizontal0DegreesSlideNo);
            PowerPoint.ShapeRange expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 17
0
        public void TestDistributeHorizontalWithinSlideWithEdges()
        {
            PositionsLabSettings.DistributeReference      = PositionsLabSettings.DistributeReferenceObject.Slide;
            PositionsLabSettings.DistributeSpaceReference = PositionsLabSettings.DistributeSpaceReferenceObject.ObjectBoundary;

            _shapeNames = new List <string> {
                UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            PowerPoint.ShapeRange actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            float slideWidth = Pres.PageSetup.SlideWidth;

            Action <List <PPShape>, float> positionsAction = (shapes, width) => PositionsLabMain.DistributeHorizontal(shapes, width);

            ExecutePositionsAction(positionsAction, actualShapes, slideWidth);

            PpOperations.SelectSlide(DistributeHorizontalWithinSlideWithEdgesSlide);
            PowerPoint.ShapeRange expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 18
0
        public void TestDistributeVerticalWithinFirstAndSecondWithCenter()
        {
            PositionsLabSettings.DistributeReference      = PositionsLabSettings.DistributeReferenceObject.FirstTwoShapes;
            PositionsLabSettings.DistributeSpaceReference = PositionsLabSettings.DistributeSpaceReferenceObject.ObjectCenter;

            _shapeNames = new List <string> {
                UnrotatedRectangle, RotatedArrow, Oval, RotatedRectangle
            };
            PowerPoint.ShapeRange actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            float slideHeight = Pres.PageSetup.SlideHeight;

            Action <List <PPShape>, float> positionsAction = (shapes, height) => PositionsLabMain.DistributeVertical(shapes, height);

            ExecutePositionsAction(positionsAction, actualShapes, slideHeight);

            PpOperations.SelectSlide(DistributeVerticalWithinFirstAndSecondWithCenterSlide);
            PowerPoint.ShapeRange expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
        public void TestDistributeHorizontalWithinCornerWithCenter()
        {
            PositionsLabSettings.DistributeReference      = PositionsLabSettings.DistributeReferenceObject.ExtremeShapes;
            PositionsLabSettings.DistributeSpaceReference = PositionsLabSettings.DistributeSpaceReferenceObject.ObjectCenter;

            _shapeNames = new List <string> {
                UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideWidth   = Pres.PageSetup.SlideWidth;

            Action <List <PPShape>, float> positionsAction = (shapes, width) => PositionsLabMain.DistributeHorizontal(shapes, width);

            ExecutePositionsAction(positionsAction, actualShapes, slideWidth);

            PpOperations.SelectSlide(DistributeHorizontalWithinCornerWithCenterSlide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
        public void FT_CreateSelfExplanationTest()
        {
            PpOperations.SelectSlide(TestSyncExplanationItemSlideNo);
            IELearningLabController eLearningLab = PplFeatures.ELearningLab;

            eLearningLab.OpenPane();
            ThreadUtil.WaitFor(5000);
            eLearningLab.AddSelfExplanationItem();
            TestSyncExplanationItems(eLearningLab);

            PpOperations.SelectSlide(TestReorderExplanationItemSlideNo);
            ThreadUtil.WaitFor(5000);
            eLearningLab.AddSelfExplanationItem();
            TestReorderExplanationItems(eLearningLab);

            PpOperations.SelectSlide(TestDeleteExplanationItemSlideNo);
            ThreadUtil.WaitFor(5000);
            eLearningLab.AddSelfExplanationItem();
            TestDeleteExplanationItems(eLearningLab);
        }
Esempio n. 21
0
        private void TestEditTextColorAndDeleteSlider(ITimerLabController timerLab)
        {
            PpOperations.SelectSlide(ChangeTextColorAndRecreateSliderSlideNo);
            int expectedColor = PpOperations.SelectShape(TimerTimeMarkerGroup)[1].TextFrame.TextRange.Font.Color.RGB;

            PpOperations.SelectSlide(OriginalSlideNo);
            var timeMarkerGroup = PpOperations.SelectShape(TimerTimeMarkerGroup);

            timeMarkerGroup.TextFrame.TextRange.Font.Color.RGB = expectedColor;
            List <string> sliderComponentNames = new List <string> {
                TimerSliderHead, TimerSliderBody
            };
            var sliderComponents = PpOperations.SelectShapes(sliderComponentNames);

            sliderComponents.Delete();

            MessageBoxUtil.ExpectMessageBoxWillPopUp("Error",
                                                     "Only one timer allowed per slide.", timerLab.ClickCreateButton, "Ok");
            AssertIsSame(OriginalSlideNo, ChangeTextColorAndRecreateSliderSlideNo);
        }
        public void TestDistributeVerticalWithinFirstWithEdges()
        {
            PositionsLabSettings.DistributeReference      = PositionsLabSettings.DistributeReferenceObject.FirstShape;
            PositionsLabSettings.DistributeSpaceReference = PositionsLabSettings.DistributeSpaceReferenceObject.ObjectBoundary;

            _shapeNames = new List <string> {
                BorderRectangle, UnrotatedRectangle, Oval, RotatedArrow, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideHeight  = Pres.PageSetup.SlideHeight;

            Action <List <PPShape>, float> positionsAction = (shapes, height) => PositionsLabMain.DistributeVertical(shapes, height);

            ExecutePositionsAction(positionsAction, actualShapes, slideHeight);

            PpOperations.SelectSlide(DistributeVerticalWithinFirstWithEdgesSlide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 23
0
        public void TestDistributeCenterWithinFirstAndSecondWithEdges()
        {
            PositionsLabMain.DistributeReferToFirstTwoShapes();
            PositionsLabMain.DistributeSpaceByBoundaries();
            _shapeNames = new List <string> {
                UnrotatedRectangle, RotatedArrow, Oval, RotatedRectangle
            };
            var actualShapes = GetShapes(OriginalShapesSlideNo, _shapeNames);
            var slideWidth   = Pres.PageSetup.SlideWidth;
            var slideHeight  = Pres.PageSetup.SlideHeight;

            Action <List <PPShape>, float, float> positionsAction = (shapes, width, height) => PositionsLabMain.DistributeCenter(shapes, width, height);

            ExecutePositionsAction(positionsAction, actualShapes, slideWidth, slideHeight);

            PpOperations.SelectSlide(DistributeCenterWithinFirstAndSecondWithEdgesSlide);
            var expectedShapes = PpOperations.SelectShapes(_shapeNames);

            CheckShapes(expectedShapes, actualShapes);
        }
Esempio n. 24
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);
        }
Esempio n. 25
0
        public void TestStartBoxingWithTextWrapping()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);

            textBoxes.StartTextWrapping();

            textBoxes
                .SetAlignment(Alignment.Centre)
                .SetPosition(Position.Left)
                .StartBoxing();

            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(105.040009f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(25.00004f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(217.480042f, textBoxInfo.Top));
            // aft text wrapping, width is smaller (originally should be 710)
            Assert.IsTrue(SlideUtil.IsRoughlySame(365.47f, textBoxInfo.Width));
        }
Esempio n. 26
0
        public void OneSectionUnsuccessful(bool isTestingSynchronize)
        {
            PpOperations.DeleteSection(5, false);
            PpOperations.DeleteSection(4, false);
            PpOperations.DeleteSection(3, false);
            PpOperations.DeleteSection(2, false);

            string title   = "Unable to execute action";
            string message = "Please divide the slides into two or more sections.";

            if (isTestingSynchronize)
            {
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.SynchronizeAgenda);
            }
            else
            {
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateBeamAgenda);
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateVisualAgenda);
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateBeamAgenda);
            }
        }
Esempio n. 27
0
        private void TestOneShapeDynamic(IPositionsLabController positionsLab)
        {
            Slide actualSlide = PpOperations.SelectSlide(OriginalShapesSlideNoTestOneDynamic);

            _shapeNames = new List <string> {
                Rectangle, Triangle
            };
            Shape shapeStart = PpOperations.SelectShape(Triangle)[1];
            Shape shapeEnd   = PpOperations.SelectShape(Target)[1];

            PpOperations.SelectShapes(_shapeNames);

            positionsLab.ReorientDynamic();
            positionsLab.ToggleDuplicateAndRotateButton();

            RotateShape(shapeStart, shapeEnd);

            Slide expSlide = PpOperations.SelectSlide(ExpectedShapesSlideNoTestOneDynamic);

            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
Esempio n. 28
0
        private void TestMultipleShapesFixed(IPositionsLabController positionsLab)
        {
            var actualSlide = PpOperations.SelectSlide(OriginalShapesSlideNoTestMultipleFixed);

            _shapeNames = new List <string> {
                Rectangle, Oval, Triangle
            };
            Shape shapeStart = PpOperations.SelectShape(Oval)[1];
            Shape shapeEnd   = PpOperations.SelectShape(Target)[1];

            PpOperations.SelectShapes(_shapeNames);

            positionsLab.ReorientFixed();
            positionsLab.ToggleDuplicateAndRotateButton();

            RotateShape(shapeStart, shapeEnd);

            var expSlide = PpOperations.SelectSlide(ExpectedShapesSlideNoTestMultipleFixed);

            SlideUtil.IsSameLooking(expSlide, actualSlide);
        }
Esempio n. 29
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);
        }
Esempio n. 30
0
        public void LongSectionNameUnsuccessful(bool isTestingSynchronize)
        {
            string longName = new string('x', 200);

            PpOperations.RenameSection(2, longName);

            string title   = "Unable to execute action";
            string message = "One of the section names exceeds the maximum size allowed by Agenda Lab. Please rename the section accordingly.";

            if (isTestingSynchronize)
            {
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.SynchronizeAgenda);
            }
            else
            {
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateBeamAgenda);
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateVisualAgenda);
                MessageBoxUtil.ExpectMessageBoxWillPopUp(title, message, PplFeatures.GenerateBeamAgenda);
            }

            PpOperations.RenameSection(2, "One Slide");
        }