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); }
private void CopyStyle(ISyncLabController syncLab, int categoryPosition, int itemPosition) { int[,] dialogItems = new int[, ] { { categoryPosition, itemPosition } }; CopyStyle(syncLab, dialogItems); }
private void CopyStyle(ISyncLabController syncLab) { new Task(() => { ThreadUtil.WaitFor(1000); syncLab.DialogClickOk(); }).Start(); syncLab.Copy(); }
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); }
public void FT_SyncLabTest() { ISyncLabController syncLab = PplFeatures.SyncLab; syncLab.OpenPane(); TestSync(syncLab); TestErrorDialogs(syncLab); TestCopySupportedPlaceHolders(syncLab); TestCopyUnsupportedPlaceHolders(syncLab); }
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"); }
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); }
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(); }
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(); }
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"); }
private void TestSync(ISyncLabController syncLab) { Sync(syncLab, OriginalSyncGroupToShapeSlideNo, ExpectedSyncGroupToShapeSlideNo, CopyFromShape, RotatedArrow, 1, 0); Sync(syncLab, OriginalSyncShapeToGroupSlideNo, ExpectedSyncShapeToGroupSlideNo, Line, Oval, 1, 4); }
private void ExpectCopyButtonDisabled(ISyncLabController syncLab) { ThreadUtil.WaitFor(500); Assert.IsFalse(syncLab.GetCopyButtonEnabledStatus()); }
private void CopyStyle(ISyncLabController syncLab) { CopyStyle(syncLab, new int[0, 0]); }