<commit_before>#!/usr/bin/python

"""Test to verify bug #433398 is still fixed.
   Orca does not provide access to the state of checked menu items in OOo.
"""

from macaroon.playback import *
import utils

sequence = MacroSequence()

######################################################################
# 1. Start oocalc. There is a bug_361167.params file that will
#    automatically load fruit.ods.
#
sequence.append(PauseAction(3000))

######################################################################
# 2. Type Control-Home to position the text caret in cell A1.
#
sequence.append(KeyComboAction("<Control>Home"))

######################################################################
# 3. Press the right arrow to move to cell B2.
#
sequence.append(KeyComboAction("Right"))

######################################################################
# 4. Type Alt-w to bring up the Windows menu.
sequence.append(KeyComboAction("<Alt>w"))
sequence.append(WaitForFocus("New Window", acc_role=pyatspi.ROLE_MENU_ITEM))

######################################################################
# 5. Type down arrow three times to get to the Freeze menu item
#
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboAction("Down"))

sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
    "Type down arrow to get to the Freeze menu item [1]",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane MenuBar Freeze'",
     "     VISIBLE:  'Freeze', cursor=1",
     "SPEECH OUTPUT: 'Freeze'"]))

######################################################################
# 6. Type Return to check it.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Return"))
sequence.append(utils.AssertPresentationAction(
    "Type Return to check it",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view4 Sheet Sheet1 Table'",
     "     VISIBLE:  'Sheet Sheet1 Table', cursor=1",
     "BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view4 Sheet Sheet1 Table Apples Cell B1 '",
     "     VISIBLE:  'Apples Cell B1 ', cursor=1",
     "SPEECH OUTPUT: 'Sheet Sheet1 table'",
     "SPEECH OUTPUT: 'Apples B1'"]))

######################################################################
# 7. Type Alt-w to bring up the Windows menu.
#
sequence.append(KeyComboAction("<Alt>w"))
sequence.append(WaitForFocus("New Window", acc_role=pyatspi.ROLE_MENU_ITEM))

######################################################################
# 8. Type down arrow three times to get to the Freeze menu item.
#
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboAction("Down"))

sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
    "Type down arrow to get to the Freeze menu item [2]",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane MenuBar <x> Freeze'",
     "     VISIBLE:  '<x> Freeze', cursor=1",
     "SPEECH OUTPUT: 'Freeze checked'"]))

######################################################################
# 9. Type Return to uncheck it.
#<commit_msg>Updated OOo Calc Test<commit_after>#!/usr/bin/python

"""Test to verify bug #433398 is still fixed.
   Orca does not provide access to the state of checked menu items in OOo.
"""

from macaroon.playback import *
import utils

sequence = MacroSequence()

######################################################################
# 1. Start oocalc. There is a bug_361167.params file that will
#    automatically load fruit.ods.
#
sequence.append(PauseAction(3000))

######################################################################
# 2. Type Control-Home to position the text caret in cell A1.
#
sequence.append(KeyComboAction("<Control>Home"))

######################################################################
# 3. Press the right arrow to move to cell B2.
#
sequence.append(KeyComboAction("Right"))

######################################################################
# 4. Type Alt-w to bring up the Windows menu.
sequence.append(KeyComboAction("<Alt>w"))
sequence.append(WaitForFocus("New Window", acc_role=pyatspi.ROLE_MENU_ITEM))

######################################################################
# 5. Type down arrow three times to get to the Freeze menu item
#
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboAction("Down"))

sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
    "Type down arrow to get to the Freeze menu item [1]",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane MenuBar Freeze'",
     "     VISIBLE:  'Freeze', cursor=1",
     "SPEECH OUTPUT: 'Freeze'"]))

######################################################################
# 6. Type Return to check it.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Return"))
sequence.append(utils.AssertPresentationAction(
    "Type Return to check it",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane ScrollPane Document view4 Sheet Sheet1 Table'",
     "     VISIBLE:  'Sheet Sheet1 Table', cursor=1",
     "SPEECH OUTPUT: 'Sheet Sheet1 table'"]))

######################################################################
# 7. Type Alt-w to bring up the Windows menu.
#
sequence.append(KeyComboAction("<Alt>w"))
sequence.append(WaitForFocus("New Window", acc_role=pyatspi.ROLE_MENU_ITEM))

######################################################################
# 8. Type down arrow three times to get to the Freeze menu item.
#
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboAction("Down"))

sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
    "Type down arrow to get to the Freeze menu item [2]",
    ["BRAILLE LINE:  'soffice Application fruit.ods - " + utils.getOOoName("Calc") + " Frame fruit.ods - " + utils.getOOoName("Calc") + " RootPane MenuBar <x> Freeze'",
     "     VISIBLE:  '<x> Freeze', cursor=1",
     "SPEECH OUTPUT: 'Freeze checked'"]))

######################################################################
# 9. Type Return to uncheck it.
#
{'fraction_non_alphanumeric': 0.29361017692645125, 'fraction_numerical': 0.011405176195350197, 'mean_word_length': 5.826347305389222, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2747952', 'n_tokens_mistral': 2021, 'n_tokens_neox': 1907, 'n_words': 503}