コード例 #1
0
        /// <summary>
        /// Postpones the process startup to have better control on waiting for the process to
        /// finish starting up.
        /// </summary>
        /// <param name="process">Process that windows will eventually reside on</param>
        /// <param name="childProcess">Process to be started</param>
        private void InitWhiteList()
        {
            string fileName = GetTestingSlideName().After("\\");

            WindowWatcher.AddToWhitelist(fileName + " - Microsoft PowerPoint");
            WindowWatcher.AddToWhitelist(fileName + " - PowerPoint");
            WindowWatcher.AddToWhitelist("PowerPointLabs FT");
            WindowWatcher.AddToWhitelist("Loading...");
        }
コード例 #2
0
        public void FT_LimitOpenPanesTest()
        {
            WindowWatcher.AddToWhitelist("Presentation1 - PowerPoint");
            WindowWatcher.AddToWhitelist("Presentation1 - Microsoft PowerPoint");
            // start clean
            StartWithNumWindows(2);

            // opening <= 2 panes should work as per normal
            Open(Pane.ColorsLabPane);
            Open(Pane.SyncPane);
            SwitchToWindow(2);

            // Check if old pane is removed
            SwitchToWindow(1);
            Open(Pane.PositionsPane);
            SwitchToWindow(2);

            // Test panes across windows
            Open(Pane.ELearningLabTaskpane);
            Open(Pane.CustomShapePane);
            Open(Pane.PositionsPane);
            SwitchToWindow(1);
        }
コード例 #3
0
        public void FT_QuickPropertyTest()
        {
            PpOperations.SelectSlide(4);

            Microsoft.Office.Interop.PowerPoint.Shape shape = PpOperations.SelectShape("ffs")[1];

            int x = PpOperations.PointsToScreenPixelsX(shape.Left + shape.Width / 2);
            int y = PpOperations.PointsToScreenPixelsY(shape.Top + shape.Height / 2);

            WindowWatcher.AddToWhitelist("Format Shape");
            MouseUtil.SendMouseDoubleClick(x, y);
            ThreadUtil.WaitFor(2000);

            if (PpOperations.IsOffice2010())
            {
                // AKA property handle
                IntPtr formatObjHandle = NativeUtil.FindWindow("NUIDialog", "Format Shape");
                Assert.AreNotEqual(IntPtr.Zero, formatObjHandle, "Failed to find Property handle.");

                NativeUtil.SendMessage(formatObjHandle, 0x10 /*WM_CLOSE*/, IntPtr.Zero, IntPtr.Zero);
            }
            else // for Office 2013 or higher
            {
                // Spy++ helps to look into the handles
                IntPtr pptHandle = NativeUtil.FindWindow("PPTFrameClass", null);
                Assert.AreNotEqual(IntPtr.Zero, pptHandle, "Failed to find PowerPoint handle.");

                IntPtr dockRightHandle =
                    NativeUtil.FindWindowEx(pptHandle, IntPtr.Zero, "MsoCommandBarDock", "MsoDockRight");
                Assert.AreNotEqual(IntPtr.Zero, dockRightHandle, "Failed to find Dock Right handle.");

                // AKA property handle
                IntPtr formatObjHandle =
                    NativeUtil.FindWindowEx(dockRightHandle, IntPtr.Zero, "MsoCommandBar", "Format Object");
                Assert.AreNotEqual(IntPtr.Zero, formatObjHandle, "Failed to find Property handle.");
            }
        }