public void OpenUsesLastClosedSettings()
        {
            m_app.GoToDraftView();
            m_app.SendKeys("{PGDN}");
            m_app.SendKeys("{PGDN}");
            m_app.SendKeys("{PGDN}");
            m_app.SendKeys("{PGDN}");

            string firstWindowInfo = m_app.InfoBarValue;

            // now open duplicate window
            m_app.SendKeys("%WN");             // Window/New Window

            // go to a different section, than a different view
            m_app.SendKeys("^{HOME}");
            m_app.GoToConcordanceView();

            // switch to first window
            m_app.SendKeys("%{TAB}");

            AccessibilityHelper parent = m_app.MainAccessibilityHelper.Parent;
            int nWhich = 2;
            AccessibilityHelper secondWindow = parent.FindNthChild("Translation Editor",
                                                                   AccessibleRole.None, ref nWhich, 0);
            AccessibilityHelper infoBar =
                secondWindow.FindChild("InfoBarLabel", AccessibleRole.None);

            string secondWindowInfo = infoBar.Value;

            // close first window
            m_app.SendKeys("%{F4}");

            // then close second window
            m_app.Exit(true);

            m_app.Start();

            // Now compare view
            Assert.AreEqual(secondWindowInfo, m_app.InfoBarValue);
        }
Beispiel #2
0
        private AccessibilityHelper findFromPath(AccessibilityHelper ancestor, string path)
        {
            // break the path into typed tokens of the form type:name[#]
            AccessibilityHelper ah          = ancestor;
            ArrayList           typedTokens = SplitPath(path);

            foreach (string typedToken in typedTokens)
            {
                string name, type;
                int    duplicate;
                SplitTypedToken(typedToken, out name, out type, out duplicate);
                AccessibleRole role = TypeToRole(type);
                if (duplicate == 1)
                {
                    ah = ah.FindChild(name, role);
                }
                else
                {
                    ah = ah.FindNthChild(name, role, duplicate, 10);
                }
            }
            return(ah);
        }