Exemplo n.º 1
0
def run_ui_typing_helper(cache, text):
    if os.path.isfile(cache):
        os.remove(cache)

    pid = run('gedit {}'.format(cache))
    gedit = tree.root.application('gedit')

    focus.application('gedit')
    focus.text()
    typeText(text)

    keyCombo('<Control>s')

    try:
        # @NOTE: maybe we can't access the menu and click the
        # item `Quit` at menu `File`

        click.menu('File')
        click.menuItem('Quit')
    except Exception as error:
        keyCombo('<Control>q')

    try:
        with open(cache) as fd:
            return fd.read()
    except Exception as error:
        os.kill(pid, signal.SIGKILL)
        return None
Exemplo n.º 2
0
 def test_custom_actions_menu(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     click.menu('File')
     click.menuItem('New')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_MENU_ITEM)
Exemplo n.º 3
0
 def test_custom_actions_menu(self):
     self.runDemo('Builder')
     try:
         wnd = self.app.child('GtkBuilder demo', roleName='frame', recursive=False, retry=False)
     except SearchError:
         wnd = self.app.child('Builder', roleName='frame', recursive=False, retry=False)
     focus.window(wnd.name)
     click.menu('File')
     click.menuItem('New')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_MENU_ITEM)
Exemplo n.º 4
0
 def test_custom_actions_menu(self):
     self.runDemo('Builder')
     try:
         wnd = self.app.child('GtkBuilder demo',
                              roleName='frame',
                              recursive=False,
                              retry=False)
     except SearchError:
         wnd = self.app.child('Builder',
                              roleName='frame',
                              recursive=False,
                              retry=False)
     focus.window(wnd.name)
     click.menu('File')
     click.menuItem('New')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_MENU_ITEM)
Exemplo n.º 5
0
def end_private_conversation():
    click.menu('OTR')
    click.menuItem("End private conversation")
Exemplo n.º 6
0
def start_private_conversation():
    click.menu('OTR')
    click.menuItem("Start private conversation")