public void HideUnvisitedSyncSuccessful() { PplFeatures.SynchronizeAgenda(); // Duplicate template slide and delete original template slide. It should use the duplicate as the new template slide. Microsoft.Office.Interop.PowerPoint.Slide firstSlide = PpOperations.SelectSlide(1); PpOperations.SelectShape("PptLabsAgenda_&^@ContentShape_&^@2015061916283877850").TextFrame2.TextRange.Paragraphs[3].Text = " "; PplFeatures.SynchronizeAgenda(); System.Collections.Generic.List <TestInterface.ISlideData> actualSlides = PpOperations.FetchCurrentPresentationData(); System.Collections.Generic.List <TestInterface.ISlideData> expectedSlides = PpOperations.FetchPresentationData( PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesTextAfterSyncHideUnvisited.pptx")); PresentationUtil.AssertEqual(expectedSlides, actualSlides); PpOperations.SelectShape("PptLabsAgenda_&^@ContentShape_&^@2015061916283877850").TextFrame2.TextRange.Paragraphs[3].Text = "Readd bullet format"; PplFeatures.SynchronizeAgenda(); actualSlides = PpOperations.FetchCurrentPresentationData(); expectedSlides = PpOperations.FetchPresentationData( PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesTextAfterSyncUnhideUnvisited.pptx")); PresentationUtil.AssertEqual(expectedSlides, actualSlides); }
private void AssertIsSame(int actualSlideIndex, int expectedSlideIndex) { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(actualSlideIndex); Microsoft.Office.Interop.PowerPoint.Slide expectedSlide = PpOperations.SelectSlide(expectedSlideIndex); SlideUtil.IsSameLooking(expectedSlide, actualSlide); SlideUtil.IsSameAnimations(expectedSlide, actualSlide); }
public void FT_AnimateInSlideFlippedTest() { PpOperations.SelectSlide(10); PpOperations.SelectShapes(new List <string> { "Arrow 1a", "Arrow 1b" }); PplFeatures.AnimateInSlide(); PpOperations.SelectShapes(new List <string> { "Arrow 2a", "Arrow 2b" }); PplFeatures.AnimateInSlide(); PpOperations.SelectShapes(new List <string> { "Bolt 1a", "Bolt 1b" }); PplFeatures.AnimateInSlide(); Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(10); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(11); // remove text "Expected" PpOperations.SelectShape("text 3")[1].Delete(); SlideUtil.IsSameAnimations(expSlide, actualSlide); SlideUtil.IsSameLooking(expSlide, actualSlide); }
public void CropMultipleShapesSuccessfully() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(7); Microsoft.Office.Interop.PowerPoint.ShapeRange shapesBeforeCrop = PpOperations.SelectShapesByPrefix("selectMe"); Assert.AreEqual(6, shapesBeforeCrop.Count); // Execute the Crop To Shape feature PplFeatures.AutoCrop(); // the result shape after crop multiple shapes will have name starts with // Group Microsoft.Office.Interop.PowerPoint.Shape resultShape = PpOperations.SelectShapesByPrefix("Group")[1]; System.IO.FileInfo resultShapeInPic = PpOperations.ExportSelectedShapes(); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(8); Microsoft.Office.Interop.PowerPoint.Shape expShape = PpOperations.SelectShapesByPrefix("Group")[1]; System.IO.FileInfo expShapeInPic = PpOperations.ExportSelectedShapes(); // remove elements that affect comparing slides // e.g. "Expected" textbox PpOperations.SelectShapesByPrefix("text").Delete(); SlideUtil.IsSameLooking(expShape, expShapeInPic, resultShape, resultShapeInPic); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void VariousMultipleShapesSuccessfully() { PpOperations.SelectSlide(8); PpOperations.SelectShapes(new List <String> { "Rectangle 3", "Flowchart: Document 5", "Freeform 17", "Group 9", "Line Callout 1 (Border and Accent Bar) 11", "Freeform 1", "Flowchart: Alternate Process 16", "Rectangle 4" }); PplFeatures.Spotlight(); Microsoft.Office.Interop.PowerPoint.Slide actualSlide1 = PpOperations.SelectSlide(8); Microsoft.Office.Interop.PowerPoint.Slide actualSlide2 = PpOperations.SelectSlide(9); Microsoft.Office.Interop.PowerPoint.Slide expSlide1 = PpOperations.SelectSlide(10); PpOperations.SelectShape("text 3")[1].Delete(); Microsoft.Office.Interop.PowerPoint.Slide expSlide2 = PpOperations.SelectSlide(11); PpOperations.SelectShape("text 3")[1].Delete(); SlideUtil.IsSameLooking(expSlide1, actualSlide1); SlideUtil.IsSameLooking(expSlide2, actualSlide2); }
protected override void Given() { this.powerpointHandle = new Microsoft.Office.Interop.PowerPoint.Application(); this.slideManager = new SlideManager(); this.presentationHandle = this.SUT.CreatePowerPointPresentation(this.powerpointHandle, false); // Add some slides to the presentation this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); // Add some shapes to slides this.shapesHandler.DrawShape( this.presentationHandle.Slides[1], MsoAutoShapeType.msoShapeRectangle, 100f, 100f, 100f, 100f); this.shapesHandler.DrawShape( this.presentationHandle.Slides[2], MsoAutoShapeType.msoShapeRectangle, 100f, 100f, 100f, 100f); }
//Export all the pages in a Wiki category into a index presentation, each page //will contain up to expPagining summaries. A summary will be composed up to //descSize characters taken from the first Header of the Page public void ExportIndex(string expCat, string outFileName, int expPaging, int descSize, WikiMedia.ExportNotify expNotify) { Microsoft.Office.Interop.PowerPoint.Slide slide = null; Microsoft.Office.Interop.PowerPoint.TextRange textRange = null; Presentation pres = new Presentation(fTemplatePath); PageList pl = wiki.GetPages(expCat); int cnt = 0; foreach (Page page in pl) { string title = GetTitle(page); if (title == null) { continue; } cnt++; if ((cnt % expPaging) == 1) { slide = pres.Add(Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutText, GetTitleName(expCat)); textRange = slide.Shapes[2].TextFrame.TextRange; } if (expNotify != null) { expNotify(page.title); } page.LoadHTML(); Document doc = HTML2Model.Convert(page.text); AddFirstHeader(textRange, doc, page, title, descSize); } pres.Save(fBasePath + outFileName); pres.Close(); }
protected override void Given() { this.powerpointHandle = new Microsoft.Office.Interop.PowerPoint.Application(); this.slideManager = new SlideManager(); this.presentationHandle = this.SUT.CreatePowerPointPresentation(this.powerpointHandle, false); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.shapesHandler = new ShapesManager(); }
private void AssertIsSame(int actualSlideNo, int expectedSlideNo, double similarityTolerance = 0.95) { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(actualSlideNo); Microsoft.Office.Interop.PowerPoint.Slide expectedSlide = PpOperations.SelectSlide(expectedSlideNo); SlideUtil.IsSameLooking(expectedSlide, actualSlide, similarityTolerance); SlideUtil.IsSameAnimations(expectedSlide, actualSlide); }
private void AssertIsSame(int actualSlideIndex, int expectedSlideIndex) { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(actualSlideIndex); Microsoft.Office.Interop.PowerPoint.Slide expectedSlide = PpOperations.SelectSlide(expectedSlideIndex); // Similarity tolerance adjusted because different machines generate slightly different slides SlideUtil.IsSameLooking(expectedSlide, actualSlide, 0.88); SlideUtil.IsSameAnimations(expectedSlide, actualSlide); }
public void FT_AutoNarrationTest() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(7); PplFeatures.AutoNarrate(); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(8); SlideUtil.IsSameAnimations(expSlide, actualSlide); }
void ApplicationOnPresentationNewSlide(Microsoft.Office.Interop.PowerPoint.Slide sld) { if (!AddTextEnabled) { return; } Microsoft.Office.Interop.PowerPoint.Shape textBox = sld.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 500, 50); textBox.TextFrame.TextRange.InsertAfter("This text was added by using code."); }
protected override void Given() { this.slideManager = new SlideManager(); this.powerpointHandle = new Microsoft.Office.Interop.PowerPoint.Application(); this.presentationHandle = this.SUT.CreatePowerPointPresentation(this.powerpointHandle, false); slide = this.slideManager.AddSlideToEnd(this.presentationHandle); slide2 = this.slideManager.AddSlideToEnd(this.presentationHandle); this.initialSlideCount = this.slideManager.GetSlideCount(this.presentationHandle); }
private void IsSame(int originalSlideNo, int expectedSlideNo, string shapeToCheck) { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(originalSlideNo); Microsoft.Office.Interop.PowerPoint.Shape actualShape = PpOperations.SelectShape(shapeToCheck)[1]; Microsoft.Office.Interop.PowerPoint.Slide expectedSlide = PpOperations.SelectSlide(expectedSlideNo); Microsoft.Office.Interop.PowerPoint.Shape expectedShape = PpOperations.SelectShape(shapeToCheck)[1]; SlideUtil.IsSameLooking(expectedSlide, actualSlide); SlideUtil.IsSameShape(expectedShape, actualShape); }
protected override void Given() { this.slideManager = new SlideManager(); this.powerpointHandle = new Microsoft.Office.Interop.PowerPoint.Application(); this.presentationHandle = this.SUT.CreatePowerPointPresentation(this.powerpointHandle, false); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.shapesHandler = new Shapes(); this.returnedShape = this.shapesHandler.AddTextBoxToSlide(this.slideHandle, MsoTextOrientation.msoTextOrientationHorizontal, 100f, 100f, 100f, 100f); }
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); }
public void NoRefSlideUnsuccessful() { Microsoft.Office.Interop.PowerPoint.Slide refSlide = PpOperations.SelectSlide(1); refSlide.Delete(); MessageBoxUtil.ExpectMessageBoxWillPopUp( "Unable to execute action", "No reference slide could be found. Either replace the reference slide or regenerate the agenda.", PplFeatures.SynchronizeAgenda); }
public void FT_AutoNarrationTest() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(7); PplFeatures.AutoNarrate(); ThreadUtil.WaitFor(5000); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(8); ThreadUtil.WaitFor(1000); // need to wait for loading SlideUtil.IsSameAnimations(expSlide, actualSlide); }
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"); }
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 TestStepBackUnsuccessful() { Microsoft.Office.Interop.PowerPoint.Slide slide = PpOperations.SelectSlide(35); slide.MoveTo(1); PpOperations.SelectShape("Zoom This Shape"); MessageBoxUtil.ExpectMessageBoxWillPopUp( "Unable to Add Animations", "No previous slide is found. Please select the correct slide.", PplFeatures.StepBack); }
public void FT_CaptionsMessageOneEmptySlide() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(6); ThreadUtil.WaitFor(1000); MessageBoxUtil.ExpectMessageBoxWillPopUp( CaptionsLabText.ErrorDialogTitle, "Captions could not be created because there are no notes entered. Please enter something in the notes and try again.", PplFeatures.AutoCaptions); }
protected override void When() { if (!System.IO.Directory.Exists(filePath)) { System.IO.Directory.CreateDirectory(filePath); } this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.slideHandle = this.slideManager.AddSlideToEnd(this.presentationHandle); this.slideManager.ExportAll(this.presentationHandle, filePath, ImageFormats.Formats.png); this.slideCount = this.slideManager.GetSlideCount(this.presentationHandle); }
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_AutoCaptionsTest() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4); ThreadUtil.WaitFor(1000); PplFeatures.AutoCaptions(); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(5); PpOperations.SelectShape("text 3").Delete(); SlideUtil.IsSameAnimations(expSlide, actualSlide); SlideUtil.IsSameLooking(expSlide, actualSlide); }
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 static void ConvertSingleObjToPicture() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(4); PpOperations.SelectShape("pic"); PplFeatures.ConvertToPic(); Shape sh = PpOperations.SelectShapesByPrefix("Picture")[1] as Shape; Assert.AreEqual(MsoShapeType.msoPicture, sh.Type); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(5); PpOperations.SelectShape("text 3")[1].Delete(); SlideUtil.IsSameLooking(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); }
public void TextSyncSuccessful() { PplFeatures.SynchronizeAgenda(); // Duplicate template slide and delete original template slide. It should use the duplicate as the new template slide. Microsoft.Office.Interop.PowerPoint.Slide firstSlide = PpOperations.SelectSlide(1); PpOperations.SelectShape("PPTTemplateMarker").Delete(); firstSlide.Duplicate(); firstSlide.Delete(); PplFeatures.SynchronizeAgenda(); System.Collections.Generic.List <TestInterface.ISlideData> actualSlides = PpOperations.FetchCurrentPresentationData(); System.Collections.Generic.List <TestInterface.ISlideData> expectedSlides = PpOperations.FetchPresentationData( PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesTextAfterSync.pptx")); PresentationUtil.AssertEqual(expectedSlides, actualSlides); }
public static void addText() { try { //addind text to the slides objSlide = objSlides.Add(1, Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutTitleOnly); objTextRng = objSlide.Shapes[1].TextFrame.TextRange; objTextRng.Text = "VDI POWER POINT TEST"; objTextRng.Font.Name = "Comic Sans MS"; objTextRng.Font.Size = 48; } catch (Exception e) { Console.WriteLine("Adding Text to " + fileName + " failed"); } }