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 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); }