示例#1
0
        private void TestCopySupportedPlaceHolders(ISyncLabController syncLab)
        {
            // Ensure that one style can be copied from placeholder objects.
            // Testing copying of all valid placeholder styles is done in unit tests.
            PpOperations.SelectSlide(HorizontalPlaceHolderSlideNo);
            PpOperations.SelectShape(HorizontalBody);
            CopyStyle(syncLab, 1, 0);
            PpOperations.SelectShape(HorizontalTitle);
            CopyStyle(syncLab, 1, 0);

            PpOperations.SelectSlide(VerticalPlaceHolderSlideNo);
            PpOperations.SelectShape(VerticalBody);
            CopyStyle(syncLab, 1, 0);
            PpOperations.SelectShape(VerticalTitle);
            CopyStyle(syncLab, 1, 0);

            PpOperations.SelectSlide(CenterPlaceHolderSlideNo);
            PpOperations.SelectShape(Subtitle);
            CopyStyle(syncLab, 1, 0);
            PpOperations.SelectShape(CenterTitle);
            CopyStyle(syncLab, 1, 0);

            PpOperations.SelectSlide(PicturePlaceHolderSlideNo);
            PpOperations.SelectShape(Picture);
            CopyStyle(syncLab, 1, 0);
        }
示例#2
0
 private void CopyStyle(ISyncLabController syncLab, int categoryPosition, int itemPosition)
 {
     int[,] dialogItems = new int[, ] {
         { categoryPosition, itemPosition }
     };
     CopyStyle(syncLab, dialogItems);
 }
示例#3
0
 private void CopyStyle(ISyncLabController syncLab)
 {
     new Task(() =>
     {
         ThreadUtil.WaitFor(1000);
         syncLab.DialogClickOk();
     }).Start();
     syncLab.Copy();
 }
示例#4
0
 private void CopyStyle(ISyncLabController syncLab, int[,] dialogItems)
 {
     WindowWatcher.Push("Copy Format", syncLab.Copy);
     for (int i = 0; i < dialogItems.GetLength(0); i++)
     {
         syncLab.DialogSelectItem(dialogItems[i, CategoryIndexPosition], dialogItems[i, FormatItemIndexPosition]);
     }
     WindowWatcher.Pop(syncLab.DialogClickOk);
 }
示例#5
0
        public void FT_SyncLabTest()
        {
            ISyncLabController syncLab = PplFeatures.SyncLab;

            syncLab.OpenPane();

            TestSync(syncLab);
            TestErrorDialogs(syncLab);
            TestCopySupportedPlaceHolders(syncLab);
            TestCopyUnsupportedPlaceHolders(syncLab);
        }
示例#6
0
        private void TestCopyUnsupportedPlaceHolders(ISyncLabController syncLab)
        {
            PpOperations.SelectSlide(ChartPlaceHolderSlideNo);
            PpOperations.SelectShape(Chart);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorCopySelectionInvalid, syncLab.Copy, "Ok");

            PpOperations.SelectSlide(TablePlaceHolderSlideNo);
            PpOperations.SelectShape(Table);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     SyncLabText.ErrorCopySelectionInvalid, syncLab.Copy, "Ok");
        }
示例#7
0
        private void Sync(ISyncLabController syncLab, int originalSlide, int expectedSlide,
                          string fromShape, string toShape, int categoryPosition, int itemPosition)
        {
            PpOperations.SelectSlide(originalSlide);
            PpOperations.SelectShape(fromShape);

            CopyStyle(syncLab, categoryPosition, itemPosition);

            PpOperations.SelectShape(toShape);
            syncLab.Sync(0);

            IsSame(originalSlide, expectedSlide, toShape);
        }
示例#8
0
 private void CopyStyle(ISyncLabController syncLab, int[,] dialogItems)
 {
     new Task(() =>
     {
         ThreadUtil.WaitFor(1000);
         for (int i = 0; i < dialogItems.GetLength(0); i++)
         {
             syncLab.DialogSelectItem(dialogItems[i, CategoryIndexPosition], dialogItems[i, FormatItemIndexPosition]);
         }
         syncLab.DialogClickOk();
     }).Start();
     syncLab.Copy();
 }
示例#9
0
        private void TestCopyCustomPerspectiveShadow(ISyncLabController syncLab)
        {
            PpOperations.SelectSlide(CustomPerspectiveShadowSlideNo);
            PpOperations.SelectShape(CustomPerspectiveShadow);

            // shadow item
            int categoryIndex = 3;
            int itemIndex     = 0;

            new Task(() =>
            {
                ThreadUtil.WaitFor(1000);
                syncLab.DialogSelectItem(categoryIndex, itemIndex);
                MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.WarningDialogTitle,
                                                         SyncLabText.WarningSyncPerspectiveShadow, syncLab.DialogClickOk, "Ok");
            }).Start();
            syncLab.Copy();
        }
示例#10
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");
        }
示例#11
0
 private void TestSync(ISyncLabController syncLab)
 {
     Sync(syncLab, OriginalSyncGroupToShapeSlideNo, ExpectedSyncGroupToShapeSlideNo, CopyFromShape, RotatedArrow, 1, 0);
     Sync(syncLab, OriginalSyncShapeToGroupSlideNo, ExpectedSyncShapeToGroupSlideNo, Line, Oval, 1, 4);
 }
示例#12
0
 private void ExpectCopyButtonDisabled(ISyncLabController syncLab)
 {
     ThreadUtil.WaitFor(500);
     Assert.IsFalse(syncLab.GetCopyButtonEnabledStatus());
 }
示例#13
0
 private void CopyStyle(ISyncLabController syncLab)
 {
     CopyStyle(syncLab, new int[0, 0]);
 }