<commit_before>#!/usr/bin/python

"""Test of Mozilla ARIA slider presentation using Firefox.
"""

from macaroon.playback import *
import utils

sequence = MacroSequence()

########################################################################
# We wait for the focus to be on the Firefox window as well as for focus
# to move to the "Graphical ARIA Slider" frame.
#
sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))

########################################################################
# Load the Mozilla ARIA slider demo.
#
sequence.append(KeyComboAction("<Control>l"))
sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
sequence.append(TypeAction("http://www.mozilla.org/access/dhtml/pretty-slider.htm"))
sequence.append(KeyComboAction("Return"))
sequence.append(WaitForDocLoad())
sequence.append(WaitForFocus("Graphical ARIA Slider", acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
sequence.append(PauseAction(3000))

########################################################################
# Tab to the first slider.  The following will be presented.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.AssertPresentationAction(
    "tab to slider", 
    ["BRAILLE LINE:  '10% Slider'",
     "     VISIBLE:  '10% Slider', cursor=1",
     "SPEECH OUTPUT: 'My slider slider 10%'"]))

########################################################################
# Do a basic "Where Am I" via KP_Enter.  
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_Enter"))
sequence.append(PauseAction(3000))
sequence.append(utils.AssertPresentationAction(
    "basic whereAmI",
    ["BRAILLE LINE:  '10% Slider'",
     "     VISIBLE:  '10% Slider', cursor=1",
     "SPEECH OUTPUT: 'slider 10% 10 percent'"]))

########################################################################
# Move the slider several times.  The following will be presented for each.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
sequence.append(WaitAction("object:property-change:accessible-value",
                           None,
                           None,
                           pyatspi.ROLE_SLIDER,
                           5000))
sequence.append(utils.AssertPresentationAction(
    "0 move slider", 
    ["BRAILLE LINE:  '$15.00 Slider'",
     "     VISIBLE:  '$15.00 Slider', cursor=1",<commit_msg>Update regression test since Orca is speaking what is on the screen<commit_after>#!/usr/bin/python

"""Test of Mozilla ARIA slider presentation using Firefox.
"""

from macaroon.playback import *
import utils

sequence = MacroSequence()

########################################################################
# We wait for the focus to be on the Firefox window as well as for focus
# to move to the "Graphical ARIA Slider" frame.
#
sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))

########################################################################
# Load the Mozilla ARIA slider demo.
#
sequence.append(KeyComboAction("<Control>l"))
sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
sequence.append(TypeAction("http://www.mozilla.org/access/dhtml/pretty-slider.htm"))
sequence.append(KeyComboAction("Return"))
sequence.append(WaitForDocLoad())
sequence.append(WaitForFocus("Graphical ARIA Slider", acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
sequence.append(PauseAction(3000))

########################################################################
# Tab to the first slider.  The following will be presented.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.AssertPresentationAction(
    "tab to slider", 
    ["BRAILLE LINE:  '10% Slider'",
     "     VISIBLE:  '10% Slider', cursor=1",
     "SPEECH OUTPUT: 'slider 10%'"]))

########################################################################
# Do a basic "Where Am I" via KP_Enter.  
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_Enter"))
sequence.append(PauseAction(3000))
sequence.append(utils.AssertPresentationAction(
    "basic whereAmI",
    ["BRAILLE LINE:  '10% Slider'",
     "     VISIBLE:  '10% Slider', cursor=1",
     "SPEECH OUTPUT: 'slider 10% 10 percent'"]))

########################################################################
# Move the slider several times.  The following will be presented for each.
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
sequence.append(WaitAction("object:property-change:accessible-value",
                           None,
                           None,
                           pyatspi.ROLE_SLIDER,
                           5000))
sequence.append(utils.AssertPresentationAction(
    "0 move slider", 
    ["BRAILLE LINE:  '$15.00 Slider'",
     "     VISIBLE:  '$15.00 Slider', cursor=1",
{'fraction_non_alphanumeric': 0.2525416836112241, 'fraction_numerical': 0.015453436356242375, 'mean_word_length': 4.912259615384615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '395073', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1332, 'n_words': 302}