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); }
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."); }
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"); }
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."); }
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"); }
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); }
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); }
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); }
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"); }
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); }
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); }
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); }
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); }
private void ExpectAddShapeButtonDisabled(IShapesLabController shapesLab) { ThreadUtil.WaitFor(1000); Assert.IsFalse(shapesLab.GetAddShapeButtonStatus()); }
private void IsClipboardRestoredAfterAddShape(IShapesLabController shapesLab, int actualSlideNum, int testSlideNum, int expSlideNum) { CheckIfClipboardIsRestored(() => SaveShapesToShapesLabWithAddShapesButton(shapesLab, actualSlideNum, testSlideNum), actualSlideNum, "copyMe", expSlideNum, "Expected", "compareMe"); }