[orca] Split ../keystrokes/oocalc/bug_363804 into two tests
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca] Split ../keystrokes/oocalc/bug_363804 into two tests
- Date: Mon, 15 Jun 2009 15:46:45 -0400 (EDT)
commit 92f962d04d29025a5f01d996a820432e4cd64219
Author: Willie Walker <william walker sun com>
Date: Mon Jun 15 15:44:50 2009 -0400
Split ../keystrokes/oocalc/bug_363804 into two tests
One uses a settings file, the other doesn't. This avoids having
to change the Orca settings on the fly as part of the test, which
avoids a nasty hang caused by a DBus interaction.
src/orca/scripts/apps/soffice/speech_generator.py | 4 +-
test/keystrokes/oocalc/bug_363804.py | 133 ---------------------
test/keystrokes/oocalc/bug_363804b.params | 1 +
test/keystrokes/oocalc/bug_363804b.py | 118 ++++++++++++++++++
test/keystrokes/oocalc/bug_363804b.settings | 36 ++++++
5 files changed, 157 insertions(+), 135 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py b/src/orca/scripts/apps/soffice/speech_generator.py
index 01032a0..2c0f4f8 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -316,8 +316,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
try:
if obj.queryText():
objectText = self._script.getText(obj, 0, -1)
- if not script_settings.speakSpreadsheetCoordinates \
- or args.get('formatType', 'unfocused') == 'basicWhereAmI' \
+ if (not script_settings.speakSpreadsheetCoordinates \
+ or args.get('formatType', 'unfocused') == 'basicWhereAmI') \
and len(objectText) == 0:
# Translators: this indicates an empty (blank) spread
# sheet cell.
diff --git a/test/keystrokes/oocalc/bug_363804.py b/test/keystrokes/oocalc/bug_363804.py
index 304b1ea..b4ffea1 100644
--- a/test/keystrokes/oocalc/bug_363804.py
+++ b/test/keystrokes/oocalc/bug_363804.py
@@ -74,139 +74,6 @@ sequence.append(utils.AssertPresentationAction(
"SPEECH OUTPUT: 'A1'"]))
######################################################################
-# Type Insert-Control-space to bring up the application specific
-# Preferences dialog for soffice.
-#
-sequence.append(KeyPressAction(0, None, "KP_Insert"))
-sequence.append(KeyComboAction("<control>space"))
-sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
-sequence.append(WaitForWindowActivate("Orca Preferences for soffice",None))
-sequence.append(WaitForFocus("Speech", acc_role=pyatspi.ROLE_PAGE_TAB))
-
-######################################################################
-# Press End to move focus to the soffice application specific tab in
-# the Preferences dialog.
-#
-sequence.append(KeyComboAction("End"))
-sequence.append(WaitForFocus("soffice", acc_role=pyatspi.ROLE_PAGE_TAB))
-
-######################################################################
-# Press Tab to move to the "Speak spread sheet cell coordinates"
-# checkbox.
-#
-sequence.append(KeyComboAction("Tab"))
-sequence.append(WaitForFocus("Speak spread sheet cell coordinates", acc_role=pyatspi.ROLE_CHECK_BOX))
-
-######################################################################
-# Press Space to toggle the state to unchecked.
-#
-sequence.append(TypeAction(" "))
-sequence.append(WaitAction("object:state-changed:checked",
- None,
- None,
- pyatspi.ROLE_CHECK_BOX,
- 5000))
-
-######################################################################
-# Type Alt-o to press the OK button and reload the Orca user settings.
-#
-sequence.append(KeyComboAction("<Alt>o"))
-sequence.append(PauseAction(3000))
-
-######################################################################
-# Type Control-Home to position the text caret in cell A1.
-#
-sequence.append(KeyComboAction("<Control>Home"))
-
-######################################################################
-# Press the down arrow to move to cell A2.
-#
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("Down"))
-sequence.append(WaitAction("object:active-descendant-changed",
- None,
- None,
- pyatspi.ROLE_TABLE,
- 5000))
-sequence.append(utils.AssertPresentationAction(
- "Down to A2 - don't speak cell coordinates",
- ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Good in Pies Cell A2 '",
- " VISIBLE: 'Good in Pies Cell A2 ', cursor=1",
- "SPEECH OUTPUT: 'Good in Pies'"]))
-
-######################################################################
-# Press the right arrow to move to cell B2.
-#
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("Right"))
-sequence.append(WaitAction("object:active-descendant-changed",
- None,
- None,
- pyatspi.ROLE_TABLE,
- 5000))
-sequence.append(utils.AssertPresentationAction(
- "Right to B2 - don't speak cell coordinates",
- ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Yes Cell B2 '",
- " VISIBLE: 'Yes Cell B2 ', cursor=1",
- "SPEECH OUTPUT: 'Yes'"]))
-
-######################################################################
-# Type Control-Home to position the text caret in cell A1.
-#
-sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("<Control>Home"))
-sequence.append(WaitAction("object:active-descendant-changed",
- None,
- None,
- pyatspi.ROLE_TABLE,
- 5000))
-sequence.append(utils.AssertPresentationAction(
- "Control+Home to A1 - don't speak cell coordinates",
- ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Cell A1 '",
- " VISIBLE: 'Cell A1 ', cursor=1",
- "SPEECH OUTPUT: 'blank'"]))
-
-######################################################################
-# Type Insert-Control-space to bring up the application specific
-# Preferences dialog for soffice again.
-#
-sequence.append(KeyPressAction(0, None, "KP_Insert"))
-sequence.append(KeyComboAction("<control>space"))
-sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
-sequence.append(WaitForWindowActivate("Orca Preferences for soffice",None))
-sequence.append(WaitForFocus("Speech", acc_role=pyatspi.ROLE_PAGE_TAB))
-
-######################################################################
-# Press End to move focus to the soffice application specific tab in
-# the Preferences dialog.
-#
-sequence.append(KeyComboAction("End"))
-sequence.append(WaitForFocus("soffice", acc_role=pyatspi.ROLE_PAGE_TAB))
-
-######################################################################
-# Press Tab to move to the "Speak spread sheet cell coordinates"
-# checkbox.
-#
-sequence.append(KeyComboAction("Tab"))
-sequence.append(WaitForFocus("Speak spread sheet cell coordinates", acc_role=pyatspi.ROLE_CHECK_BOX))
-
-######################################################################
-# Press Space to toggle the state back to checked.
-#
-sequence.append(TypeAction(" "))
-sequence.append(WaitAction("object:state-changed:checked",
- None,
- None,
- pyatspi.ROLE_CHECK_BOX,
- 5000))
-
-######################################################################
-# Type Alt-o to press the OK button and reload the Orca user settings.
-#
-sequence.append(KeyComboAction("<Alt>o"))
-sequence.append(PauseAction(3000))
-
-######################################################################
# Enter Alt-f, Alt-c to close the Calc spreadsheet window.
#
sequence.append(KeyComboAction("<Alt>f"))
diff --git a/test/keystrokes/oocalc/bug_363804b.params b/test/keystrokes/oocalc/bug_363804b.params
new file mode 100644
index 0000000..edd4762
--- /dev/null
+++ b/test/keystrokes/oocalc/bug_363804b.params
@@ -0,0 +1 @@
+PARAMS=$TEST_DIR/fruit.ods
diff --git a/test/keystrokes/oocalc/bug_363804b.py b/test/keystrokes/oocalc/bug_363804b.py
new file mode 100644
index 0000000..018c4b9
--- /dev/null
+++ b/test/keystrokes/oocalc/bug_363804b.py
@@ -0,0 +1,118 @@
+#!/usr/bin/python
+
+"""Test to verify bug #363804 is still fixed.
+ Add ability to turn off coordinate announcement when navigating in Calc.
+"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+######################################################################
+# Start oocalc. There is a bug_361167.params file that will
+# automatically load fruit.ods.
+#
+sequence.append(PauseAction(3000))
+
+######################################################################
+# Type Control-Home to position the text caret in cell A1.
+#
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(WaitAction("object:active-descendant-changed",
+ None,
+ None,
+ pyatspi.ROLE_TABLE,
+ 5000))
+
+######################################################################
+# Press the down arrow to move to cell A2.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitAction("object:active-descendant-changed",
+ None,
+ None,
+ pyatspi.ROLE_TABLE,
+ 5000))
+sequence.append(utils.AssertPresentationAction(
+ "Down to A2 - don't speak cell coordinates",
+ ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Good in Pies Cell A2 '",
+ " VISIBLE: 'Good in Pies Cell A2 ', cursor=1",
+ "SPEECH OUTPUT: 'Good in Pies'"]))
+
+######################################################################
+# Press the right arrow to move to cell B2.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Right"))
+sequence.append(WaitAction("object:active-descendant-changed",
+ None,
+ None,
+ pyatspi.ROLE_TABLE,
+ 5000))
+sequence.append(utils.AssertPresentationAction(
+ "Right to B2 - don't speak cell coordinates",
+ ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Yes Cell B2 '",
+ " VISIBLE: 'Yes Cell B2 ', cursor=1",
+ "SPEECH OUTPUT: 'Yes'"]))
+
+######################################################################
+# Type Control-Home to position the text caret in cell A1.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(WaitAction("object:active-descendant-changed",
+ None,
+ None,
+ pyatspi.ROLE_TABLE,
+ 5000))
+sequence.append(utils.AssertPresentationAction(
+ "Control+Home to A1 - don't speak cell coordinates",
+ ["BRAILLE LINE: 'soffice Application fruit(.ods|) - " + utils.getOOoName("Calc") + " Frame fruit(.ods|) - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view3 Sheet Sheet1 Table Cell A1 '",
+ " VISIBLE: 'Cell A1 ', cursor=1",
+ "SPEECH OUTPUT: 'blank'"]))
+
+######################################################################
+# Enter Alt-f, Alt-c to close the Calc spreadsheet window.
+#
+sequence.append(KeyComboAction("<Alt>f"))
+sequence.append(WaitForFocus("New", acc_role=pyatspi.ROLE_MENU))
+
+sequence.append(KeyComboAction("<Alt>c"))
+sequence.append(WaitAction("object:property-change:accessible-name",
+ None,
+ None,
+ pyatspi.ROLE_ROOT_PANE,
+ 30000))
+#sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PANEL))
+
+######################################################################
+# Enter Alt-f, right arrow, down arrow and Return,
+# (File->New->Spreadsheet), to get the application back
+# to the state it was in when the test started.
+#
+sequence.append(KeyComboAction("<Alt>f"))
+sequence.append(WaitForFocus("New", acc_role=pyatspi.ROLE_MENU))
+
+sequence.append(KeyComboAction("Right"))
+sequence.append(WaitForFocus("Text Document", acc_role=pyatspi.ROLE_MENU_ITEM))
+
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitForFocus("Spreadsheet", acc_role=pyatspi.ROLE_MENU_ITEM))
+
+sequence.append(KeyComboAction("Return"))
+sequence.append(WaitAction("object:property-change:accessible-name",
+ None,
+ None,
+ pyatspi.ROLE_ROOT_PANE,
+ 30000))
+
+######################################################################
+# Wait for things to get back to normal.
+#
+sequence.append(PauseAction(3000))
+
+sequence.append(utils.AssertionSummaryAction())
+
+sequence.start()
diff --git a/test/keystrokes/oocalc/bug_363804b.settings b/test/keystrokes/oocalc/bug_363804b.settings
new file mode 100644
index 0000000..6680d91
--- /dev/null
+++ b/test/keystrokes/oocalc/bug_363804b.settings
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+# Default settings for all tests. These can be overridden by
+# defining a *.params file for a test. See
+# http://live.gnome.org/Orca/RegressionTesting for more info.
+
+import re
+
+import orca.debug
+import orca.settings
+
+# This file should be identical to ../../harness/user-settings.py except
+# for the following two lines of executable code:
+#
+import orca.scripts.apps.soffice.script_settings
+orca.scripts.apps.soffice.script_settings.speakSpreadsheetCoordinates = False
+
+orca.settings.enableEchoByWord = False
+orca.settings.enableKeyEcho = False
+orca.settings.enablePrintableKeys = False
+orca.settings.enableModifierKeys = False
+orca.settings.enableLockingKeys = False
+orca.settings.enableFunctionKeys = False
+orca.settings.enableActionKeys = False
+
+orca.settings.enableBraille = False
+orca.settings.enableBrailleMonitor = False
+
+import orca.orca_state
+try:
+ reload(orca.orca_state.orcaCustomizations)
+except AttributeError:
+ try:
+ orca.orca_state.orcaCustomizations = __import__("orca-customizations")
+ except ImportError:
+ pass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]