示例#1
0
        private void TestSaveShapesToShapesLabWithAddShapesButton(IShapesLabController shapesLab, int shapesSlideNum, int testSlideNum, int expSlideNum)
        {
            SaveShapesToShapesLabWithAddShapesButton(shapesLab, shapesSlideNum, testSlideNum);
            Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(expSlideNum);

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(testSlideNum);
            SlideUtil.IsSameLooking(expSlide, actualSlide);
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
        }
示例#2
0
        private void AddShapesToSlideFromShapesLab(IShapesLabController shapesLab, string shapeName, string expectedShapePrefix)
        {
            Point point = shapesLab.GetShapeForClicking(shapeName);

            // Add shapes from Shapes Lab to slide by double clicking
            DoubleClick(point);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix(expectedShapePrefix);
            Assert.IsTrue(shapes.Count > 0, "Failed to add shapes from Shapes Lab.");
        }
示例#3
0
        private void SaveShapesToShapesLab(IShapesLabController shapesLab, int shapesSlideNum, int testSlideNum)
        {
            PpOperations.SelectSlide(shapesSlideNum);
            PpOperations.SelectShapesByPrefix("selectMe");
            // save shapes
            shapesLab.SaveSelectedShapes();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(testSlideNum);
            AddShapesToSlideFromShapesLab(shapesLab, "selectMe1", "Group selectMe1");
        }
示例#4
0
        private void AddShapesToSlideFromShapesLab(IShapesLabController shapesLab, string shapeThumbnail, string expectedShapePrefix)
        {
            IShapesLabLabeledThumbnail thumbnail = shapesLab.GetLabeledThumbnail(shapeThumbnail);

            thumbnail.FinishNameEdit();
            // Add shapes from Shapes Lab to slide by double clicking
            DoubleClick(thumbnail as Control);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix(expectedShapePrefix);
            Assert.IsTrue(shapes.Count > 0, "Failed to add shapes from Shapes Lab.");
        }
示例#5
0
        private void SaveShapesToShapesLabWithAddShapesButton(IShapesLabController shapesLab, int shapesSlideNum, int testSlideNum)
        {
            PpOperations.SelectSlide(shapesSlideNum);
            PpOperations.SelectShapesByPrefix("selectMeNow");

            shapesLab.ClickAddShapeButton();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(testSlideNum);
            AddShapesToSlideFromShapesLab(shapesLab, "selectMeNow1", "Group selectMeNow1");
        }
示例#6
0
        public void FT_ShapesLabTest()
        {
            PpOperations.MaximizeWindow();
            IShapesLabController shapesLab = PplFeatures.ShapesLab;

            shapesLab.OpenPane();

            TestSaveShapesToShapesLab(shapesLab);
            TestImportLibraryAndShape(shapesLab);
            TestSaveShapesToShapesLabWithAddShapesButton(shapesLab);
        }
 private void TestImportLibraryAndShape(IShapesLabController shapesLab)
 {
     shapesLab.ImportLibrary(
         PathUtil.GetDocTestPresentationPath("LibraryToImport.pptlabsshapes"));
     shapesLab.ImportLibrary(
         PathUtil.GetDocTestPresentationPath("ShapeToImport.pptlabsshape"));
     var actualShapeDataAfterImport = shapesLab.FetchShapeGalleryPresentationData();
     var expShapeDataAfterImport = PpOperations.FetchPresentationData(
         PathUtil.GetDocTestPresentationPath(ExpectedShapeGalleryFileName()));
     PresentationUtil.AssertEqual(expShapeDataAfterImport, actualShapeDataAfterImport);
 }
示例#8
0
        private void TestSavePlaceholderToShapesLabWithAddShapesButton(IShapesLabController shapesLab, int shapesSlideNum)
        {
            PpOperations.SelectSlide(shapesSlideNum);
            ExpectAddShapeButtonDisabled(shapesLab);
            PpOperations.SelectShapesByPrefix("Placeholder");
            ExpectAddShapeButtonDisabled(shapesLab);

            MessageBoxUtil.ExpectMessageBoxWillPopUp(
                ShapesLabText.ErrorDialogTitle, ShapesLabText.ErrorAddSelectionInvalid,
                shapesLab.ClickAddShapeButton);
        }
示例#9
0
 private void TestImportLibraryAndShape(IShapesLabController shapesLab)
 {
     shapesLab.ImportLibrary(
         PathUtil.GetDocTestPresentationPath("ShapesLab\\LibraryToImport.pptlabsshapes"));
     shapesLab.ImportLibrary(
         PathUtil.GetDocTestPresentationPath("ShapesLab\\ShapeToImport.pptlabsshape"));
     System.Collections.Generic.List <ISlideData> actualShapeDataAfterImport = shapesLab.FetchShapeGalleryPresentationData();
     System.Collections.Generic.List <ISlideData> expShapeDataAfterImport    = PpOperations.FetchPresentationData(
         PathUtil.GetDocTestPresentationPath(ExpectedShapeGalleryFileName()));
     PresentationUtil.AssertEqual(expShapeDataAfterImport, actualShapeDataAfterImport);
 }
示例#10
0
        private void SaveShapesToShapesLabWithAddShapesButton(IShapesLabController shapesLab, int shapesSlideNum, int testSlideNum)
        {
            PpOperations.SelectSlide(shapesSlideNum);
            PpOperations.SelectShapesByPrefix("selectMeNow");
            ExpectAddShapeButtonEnabled(shapesLab);

            MessageBoxUtil.ExpectMessageBoxWillNotPopUp(
                ShapesLabText.ErrorDialogTitle, ShapesLabText.ErrorAddSelectionInvalid,
                shapesLab.ClickAddShapeButton);

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(testSlideNum);
            AddShapesToSlideFromShapesLab(shapesLab, "selectMeNow1", "Group selectMeNow1");
        }
示例#11
0
        public void FT_ShapesLabTest()
        {
            PpOperations.MaximizeWindow();
            IShapesLabController shapesLab = PplFeatures.ShapesLab;

            shapesLab.OpenPane();

            TestSaveShapesToShapesLab(shapesLab, SaveShapesShapesSlide, SaveShapesTestSlide, SaveShapesExpSlide);
            TestImportLibraryAndShape(shapesLab);
            TestSaveShapesToShapesLabWithAddShapesButton(shapesLab, AddShapesShapesSlide, AddShapesTestSlide, AddShapesExpSlide);
            IsClipboardRestoredAfterSaveShape(shapesLab, SaveShapesClipboardRestoredActualSlide, SaveShapesClipboardRestoredTestSlide, SaveShapesClipboardRestoredExpSlide);
            IsClipboardRestoredAfterAddShape(shapesLab, AddShapesClipboardRestoredActualSlide, AddShapesClipboardRestoredTestSlide,
                                             AddShapesClipboardRestoredExpSlide);
        }
示例#12
0
        private void TestSaveShapesToShapesLab(IShapesLabController shapesLab)
        {
            PpOperations.SelectSlide(3);
            PpOperations.SelectShapesByPrefix("selectMe");
            // save shapes
            shapesLab.SaveSelectedShapes();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4);
            AddShapesToSlideFromShapesLab(shapesLab, "selectMe1", "Group selectMe1");

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

            SlideUtil.IsSameLooking(expSlide, actualSlide);
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
        }
示例#13
0
        private void TestSaveShapesToShapesLabWithAddShapesButton(IShapesLabController shapesLab)
        {
            PpOperations.SelectSlide(6);
            PpOperations.SelectShapesByPrefix("selectMeNow");

            shapesLab.ClickAddShapeButton();

            Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(7);
            AddShapesToSlideFromShapesLab(shapesLab, "selectMeNow1", "Group selectMeNow1");

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

            SlideUtil.IsSameLooking(expSlide, actualSlide);
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
        }
示例#14
0
        private void TestSaveShapesToShapesLab(IShapesLabController shapesLab)
        {
            PpOperations.SelectSlide(3);
            PpOperations.SelectShapesByPrefix("selectMe");
            // save shapes
            shapesLab.SaveSelectedShapes();

            var actualSlide = PpOperations.SelectSlide(4);
            var addedThumbnail = shapesLab.GetLabeledThumbnail("My Shape Untitled");
            addedThumbnail.FinishNameEdit();
            // add shapes back
            DoubleClick(addedThumbnail as Control);
            var shapes = PpOperations.SelectShapesByPrefix("Group My Shape");
            Assert.IsTrue(shapes.Count > 0, "Failed to add shapes from Shapes Lab." +
                                            "UI test is flaky, pls re-run.");

            var expSlide = PpOperations.SelectSlide(5);

            SlideUtil.IsSameLooking(expSlide, actualSlide);
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
        }
示例#15
0
        private void TestSaveShapesToShapesLab(IShapesLabController shapesLab)
        {
            PpOperations.SelectSlide(3);
            PpOperations.SelectShapesByPrefix("selectMe");
            // save shapes
            shapesLab.SaveSelectedShapes();

            var actualSlide    = PpOperations.SelectSlide(4);
            var addedThumbnail = shapesLab.GetLabeledThumbnail("My Shape Untitled");

            addedThumbnail.FinishNameEdit();
            // add shapes back
            DoubleClick(addedThumbnail as Control);
            var shapes = PpOperations.SelectShapesByPrefix("Group My Shape");

            Assert.IsTrue(shapes.Count > 0, "Failed to add shapes from Shapes Lab." +
                          "UI test is flaky, pls re-run.");

            var expSlide = PpOperations.SelectSlide(5);

            SlideUtil.IsSameLooking(expSlide, actualSlide);
            SlideUtil.IsSameAnimations(expSlide, actualSlide);
        }
示例#16
0
 private void ExpectAddShapeButtonDisabled(IShapesLabController shapesLab)
 {
     ThreadUtil.WaitFor(1000);
     Assert.IsFalse(shapesLab.GetAddShapeButtonStatus());
 }
示例#17
0
 private void IsClipboardRestoredAfterAddShape(IShapesLabController shapesLab, int actualSlideNum, int testSlideNum, int expSlideNum)
 {
     CheckIfClipboardIsRestored(() => SaveShapesToShapesLabWithAddShapesButton(shapesLab, actualSlideNum, testSlideNum),
                                actualSlideNum, "copyMe", expSlideNum, "Expected", "compareMe");
 }