orca r3798 - in trunk: . test/keystrokes/gtk-demo



Author: richb
Date: Wed Apr  2 22:14:22 2008
New Revision: 3798
URL: http://svn.gnome.org/viewvc/orca?rev=3798&view=rev

Log:
        * src/orca/test/keystrokes/gtk-demo/role_text_multiline_navigation.py:
          src/orca/test/keystrokes/gtk-demo/role_text_multiline_navigation2.py:
          Fix for bug #523238 - gtk-demo role_text_multiline_navigation.py 
          regression tests 89, 90, 91 and 93 produce the wrong results.


Added:
   trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation2.py
Modified:
   trunk/ChangeLog
   trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py

Modified: trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py	Wed Apr  2 22:14:22 2008
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
-"""Test of backspacing over characters in gedit.
+"""Test of general text navigation using caret navigation and flat review 
+techniques.
 """
 
 from macaroon.playback import *
@@ -1129,193 +1130,6 @@
      "BRAILLE LINE:  'This is only  $l'",
      "     VISIBLE:  'This is only  $l', cursor=11"]))
 
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift><Control>Page_Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Ctrl+Page_Up to select text to beginning of line",
-    ["BRAILLE LINE:  'This is only  $l'",
-     "     VISIBLE:  'This is only  $l', cursor=1",
-     "SPEECH OUTPUT: 'This '",
-     "SPEECH OUTPUT: 'selected'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift><Control>Page_Down"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Ctrl+Page_Down to select text to end of line",
-    ["BRAILLE LINE:  'This is only  $l'",
-     "     VISIBLE:  'This is only  $l', cursor=4",
-     "SPEECH OUTPUT: 'Thi'",
-     "SPEECH OUTPUT: 'unselected'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift>Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Up to select text",
-    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane  a test.  $l'",
-     "     VISIBLE:  ' a test.  $l', cursor=5",
-     "SPEECH OUTPUT: 'est. ",
-     "Thi'",
-     "SPEECH OUTPUT: 'selected'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift>Down"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Down to deselect text",
-    ["BRAILLE LINE:  'This is only  $l'",
-     "     VISIBLE:  'This is only  $l', cursor=4",
-     "SPEECH OUTPUT: 'est. ",
-     "Thi'",
-     "SPEECH OUTPUT: 'unselected'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Control>Page_Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Ctrl+Page_Up to beginning of line",
-    ["BRAILLE LINE:  'This is only  $l'",
-     "     VISIBLE:  'This is only  $l', cursor=1",
-     "SPEECH OUTPUT: 'T'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Control>Page_Down"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Ctrl+Page_Down to end of line",
-    ["BRAILLE LINE:  'This is only  $l'",
-     "     VISIBLE:  'This is only  $l', cursor=4",
-     "SPEECH OUTPUT: 'This is only '"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("Page_Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Page up",
-    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane  a test.  $l'",
-     "     VISIBLE:  ' a test.  $l', cursor=1",
-     "SPEECH OUTPUT: ' a test. '"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("Page_Down"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Page down",
-    ["BRAILLE LINE:  'I'm just going to keep on typing. $l'",
-     "     VISIBLE:  'I'm just going to keep on typing', cursor=1",
-     "SPEECH OUTPUT: 'I'm just going to keep on typing.'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift>Page_Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Page_Up to select text",
-    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane  a test.  $l'",
-     "     VISIBLE:  ' a test.  $l', cursor=1",
-     "SPEECH OUTPUT: ' a test. '",
-     "SPEECH OUTPUT: 'page selected to cursor position'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Shift>Page_Down"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Shift+Page_Down to deselect text",
-    ["BRAILLE LINE:  'I'm just going to keep on typing. $l'",
-     "     VISIBLE:  'I'm just going to keep on typing', cursor=1",
-     "SPEECH OUTPUT: 'I'm just going to keep on typing.'",
-     "SPEECH OUTPUT: 'page selected from cursor position'"]))
-
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("Page_Up"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "Page_Up",
-    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane  a test.  $l'",
-     "     VISIBLE:  ' a test.  $l', cursor=1",
-     "SPEECH OUTPUT: ' a test. '"]))
-
-########################################################################
-# Do a SayAll
-#
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("KP_Add"))
-sequence.append(WaitAction("object:text-caret-moved",
-                           None,
-                           None,
-                           pyatspi.ROLE_TEXT,
-                           5000))
-sequence.append(utils.AssertPresentationAction(
-    "KP_Add to do a SayAll",
-    ["SPEECH OUTPUT: ' a test.'",
-     "SPEECH OUTPUT: ' ",
-     "This is only '",
-     "SPEECH OUTPUT: '",
-     "",
-     "PLEASE DO NOT PANIC.'",
-     "SPEECH OUTPUT: '",
-     " ",
-     "I'm just going to keep on typing.'",
-     "SPEECH OUTPUT: '",
-     "Then, I'm going to type some'",
-     "SPEECH OUTPUT: '",
-     "more.'",
-     "SPEECH OUTPUT: '  I just do not know when to'",
-     "SPEECH OUTPUT: '",
-     "quit typing.'",
-     "SPEECH OUTPUT: '",
-     "",
-     "I think I might have spent too much'",
-     "SPEECH OUTPUT: '",
-     "time in the lab and not enough time'",
-     "SPEECH OUTPUT: '",
-     "in the wild.'"]))
-
 ########################################################################
 # Dismiss the menu and close the Application Window demo window
 #

Added: trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation2.py
==============================================================================
--- (empty file)
+++ trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation2.py	Wed Apr  2 22:14:22 2008
@@ -0,0 +1,266 @@
+#!/usr/bin/python
+
+"""Test of general text navigation using caret navigation and flat review 
+techniques.
+"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+########################################################################
+# We wait for the demo to come up and for focus to be on the tree table
+#
+sequence.append(WaitForWindowActivate("GTK+ Code Demos"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_TREE_TABLE))
+
+########################################################################
+# Once gtk-demo is running, invoke the Application Main Window demo
+#
+sequence.append(KeyComboAction("<Control>f"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_TEXT))
+sequence.append(TypeAction("Application main window", 1000))
+sequence.append(KeyComboAction("Return", 500))
+
+########################################################################
+# When the demo comes up, go to the text area and type.
+#
+#sequence.append(WaitForWindowActivate("Application Window",None))
+sequence.append(WaitForFocus("Open", acc_role=pyatspi.ROLE_PUSH_BUTTON))
+sequence.append(KeyComboAction("Tab"))
+
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_TEXT))
+
+sequence.append(TypeAction("This is a test. "))
+sequence.append(KeyComboAction("Return"))
+sequence.append(TypeAction("This is only a test."))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(PauseAction(3000))
+
+########################################################################
+# Position the cursor on the second line, just after the first space.
+#
+sequence.append(KeyComboAction("Up"))
+sequence.append(KeyComboAction("Right"))
+sequence.append(KeyComboAction("Right"))
+sequence.append(KeyComboAction("Right"))
+sequence.append(KeyComboAction("Right"))
+sequence.append(KeyComboAction("Right"))
+
+########################################################################
+# Test #1 - Shift+Ctrl+Page_Up to select text to beginning of line.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift><Control>Page_Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Ctrl+Page_Up to select text to beginning of line",
+    ["BRAILLE LINE:  'This is only a test. $l'",
+     "     VISIBLE:  'This is only a test. $l', cursor=1",
+     "SPEECH OUTPUT: 'This '",
+     "SPEECH OUTPUT: 'selected'"]))
+
+########################################################################
+# Test #2 - Shift+Ctrl+Page_Down to select text to end of line.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift><Control>Page_Down"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Ctrl+Page_Down to select text to end of line",
+    ["BRAILLE LINE:  'This is only a test. $l'",
+     "     VISIBLE:  'This is only a test. $l', cursor=21",
+     "SPEECH OUTPUT: 'This is only a test.'"]))
+
+########################################################################
+# Test #3 - Shift+Up to select text.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Up to select text",
+    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane This is a test.  $l'",
+     "     VISIBLE:  'This is a test.  $l', cursor=17",
+     "SPEECH OUTPUT: '",
+     "This is only a test.'"]))
+
+########################################################################
+# Test #4 - Shift+Down to deselect text.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Down"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Down to deselect text",
+    ["BRAILLE LINE:  'This is only a test. $l'",
+     "     VISIBLE:  'This is only a test. $l', cursor=21",
+     "SPEECH OUTPUT: '",
+     "This is only a test.'"]))
+
+########################################################################
+# Test #5 - Ctrl+Page_Up to beginning of line.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Page_Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Ctrl+Page_Up to beginning of line",
+    ["BRAILLE LINE:  'This is only a test. $l'",
+     "     VISIBLE:  'This is only a test. $l', cursor=1",
+     "SPEECH OUTPUT: 'T'"]))
+
+########################################################################
+# Test #6 - Ctrl+Page_Down to end of line.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Page_Down"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Ctrl+Page_Down to end of line",
+    ["BRAILLE LINE:  'This is only a test. $l'",
+     "     VISIBLE:  'This is only a test. $l', cursor=21",
+     "SPEECH OUTPUT: 'This is only a test.'"]))
+
+########################################################################
+# Test #7 - Page up.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Page_Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Page up",
+    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane This is a test.  $l'",
+     "     VISIBLE:  'This is a test.  $l', cursor=1",
+     "SPEECH OUTPUT: 'This is a test. '"]))
+
+########################################################################
+# Test #8 - Page down.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Page_Down"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Page down",
+    ["BRAILLE LINE:  ' $l'",
+     "     VISIBLE:  ' $l', cursor=1"]))
+
+########################################################################
+# Test #9 - Shift+Page_Up to select text.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Page_Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Page_Up to select text",
+    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane This is a test.  $l'",
+     "     VISIBLE:  'This is a test.  $l', cursor=1",
+     "SPEECH OUTPUT: 'This is a test. '",
+     "SPEECH OUTPUT: 'page selected to cursor position'"]))
+
+########################################################################
+# Test #10 - Shift+Page_Down to deselect text.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Page_Down"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Shift+Page_Down to deselect text",
+    ["BRAILLE LINE:  ' $l'",
+     "     VISIBLE:  ' $l', cursor=1"]))
+
+########################################################################
+# Test #11 - Page_Up.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Page_Up"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "Page_Up",
+    ["BRAILLE LINE:  'gtk-demo Application Application Window Frame ScrollPane This is a test.  $l'",
+     "     VISIBLE:  'This is a test.  $l', cursor=1",
+     "SPEECH OUTPUT: 'This is a test. '"]))
+
+########################################################################
+# Test #12 - KP_Add to do a SayAll.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_Add"))
+sequence.append(WaitAction("object:text-caret-moved",
+                           None,
+                           None,
+                           pyatspi.ROLE_TEXT,
+                           5000))
+sequence.append(utils.AssertPresentationAction(
+    "KP_Add to do a SayAll",
+    ["SPEECH OUTPUT: 'This is a test.'",
+     "SPEECH OUTPUT: ' ",
+     "This is only a test.'",
+     "SPEECH OUTPUT: '",
+     "'"]))
+
+########################################################################
+# Dismiss the menu and close the Application Window demo window
+#
+sequence.append(KeyComboAction("<Alt>F4"))
+
+########################################################################
+# Go back to the main gtk-demo window and reselect the
+# "Application main window" menu.  Let the harness kill the app.
+#
+#sequence.append(WaitForWindowActivate("GTK+ Code Demos",None))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_TREE_TABLE))
+
+# Just a little extra wait to let some events get through.
+#
+sequence.append(PauseAction(3000))
+
+sequence.append(utils.AssertionSummaryAction())
+
+sequence.start()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]