Beispiel #1
0
 def test_drag(self):
     self.runDemo('Tool Palette')
     focus.window('Tool Palette')
     src_position = focus.window.node.child("gtk-caps-lock-warning").position
     dst_position = focus.window.node.child("Passive DnD Mode").position
     dst_position = (dst_position[0] + 50, dst_position[1] + 50)
     drag(src_position, dst_position)
Beispiel #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)
Beispiel #3
0
 def testFocusMenuItem(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     click.menu('File')
     focus.menuItem('New')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_MENU_ITEM)
Beispiel #4
0
 def test_press(self):
     self.runDemo('Builder')
     focus.window('GtkBuilder demo')
     btn = focus.window.node.button('New')
     press(btn.position[0], btn.position[1])
     self.assertIn(pyatspi.STATE_ARMED, btn.getState().getStates())
     release(btn.position[0], btn.position[1])
     self.assertNotIn(pyatspi.STATE_ARMED, btn.getState().getStates())
Beispiel #5
0
 def test_typing_on_widget(self):
     self.runDemo('Dialog and Message Boxes')
     focus.window('Dialogs')
     focus.widget(roleName='text')
     type("hello world")
     from time import sleep
     sleep(0.1)
     self.assertEquals(focus.widget.node.text, 'hello world')
Beispiel #6
0
 def test_custom_actions_button(self):
     try:
         self.runDemo('Dialog and Message Boxes', retry=False)
         focus.window('Dialogs')
     except SearchError:
         self.runDemo('Dialogs and Message Boxes', retry=False)
         focus.window('Dialogs and Message Boxes')
     click.button('Interactive Dialog')
     self.assertTrue(focus.dialog("Interactive Dialog"))
 def test_custom_actions_button(self):
     try:
         self.runDemo('Dialog and Message Boxes', retry=False)
         focus.window('Dialogs')
     except SearchError:
         self.runDemo('Dialogs and Message Boxes', retry=False)
         focus.window('Dialogs and Message Boxes')
     click.button('Interactive Dialog')
     self.assertTrue(focus.dialog("Interactive Dialog"))
 def test_focus_icon(self):
     self.runDemo('Clipboard')
     try:
         wnd = self.app.child('Clipboard demo', roleName='frame', retry=False, recursive=False)
     except SearchError:
         wnd = self.app.child('Clipboard', roleName='frame', retry=False, recursive=False)
     focus.window(wnd.name)
     focus.icon('Warning')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_ICON)
 def test_throws_action_not_supported(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)
     with self.assertRaises(ActionNotSupported) as cm:
         activate.text('')
     self.assertEqual(str(cm.exception), "Cannot do 'activate' action on [text | ]")
 def test_custom_actions_text(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.text('')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #11
0
    def test_custom_actions_text_with_debug(self):
        self.runDemo('Builder')
        focus.window('GtkBuilder demo')
        config.debugSearching = True
        output = trap_stdout(click.text, '')
        self.assertIn(
            u"searching for descendent of [frame | GtkBuilder demo]: child with roleName='text'",
            output)

        self.assert_(isinstance(focus.widget.node, tree.Node))
        self.assertEquals(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #12
0
    def testDeselect(self):
        type('Icon View')
        click('Icon View')
        type('+')
        self.runDemo('Icon View Basics')
        focus.window('GtkIconView demo')

        focus.widget(roleName='icon')
        select()
        deselect()
        self.assertFalse(focus.widget.isSelected)
 def test_typing_on_widget(self):
     try:
         self.runDemo('Dialog and Message Boxes', retry=False)
         focus.window('Dialogs')
     except SearchError:
         self.runDemo('Dialogs and Message Boxes', retry=False)
         focus.window('Dialogs and Message Boxes')
     focus.widget(roleName='text')
     type("hello world")
     from time import sleep
     sleep(0.1)
     self.assertEqual(focus.widget.node.text, 'hello world')
Beispiel #14
0
 def test_typing_on_widget(self):
     try:
         self.runDemo('Dialog and Message Boxes', retry=False)
         focus.window('Dialogs')
     except SearchError:
         self.runDemo('Dialogs and Message Boxes', retry=False)
         focus.window('Dialogs and Message Boxes')
     focus.widget(roleName='text')
     type("hello world")
     from time import sleep
     sleep(0.1)
     self.assertEqual(focus.widget.node.text, 'hello world')
Beispiel #15
0
    def test_deselect(self):
        type('Icon View')
        click('Icon View')
        type('+')
        sleep(0.5)
        self.runDemo('Icon View Basics')
        focus.window('GtkIconView demo')

        focus.widget(roleName='icon')
        select()
        deselect()
        self.assertFalse(focus.widget.isSelected)
    def test_custom_actions_text_with_debug(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)
        config.debugSearching = True
        output = trap_stdout(click.text, '')
        self.assertIn(
            "searching for descendent of [frame | %s]: child with roleName='text'" % wnd.name,
            output)

        self.assertTrue(isinstance(focus.widget.node, tree.Node))
        self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #17
0
 def test_custom_actions_text(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.text('')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #18
0
 def test_focus_icon(self):
     self.runDemo('Clipboard')
     try:
         wnd = self.app.child('Clipboard demo',
                              roleName='frame',
                              retry=False,
                              recursive=False)
     except SearchError:
         wnd = self.app.child('Clipboard',
                              roleName='frame',
                              retry=False,
                              recursive=False)
     focus.window(wnd.name)
     focus.icon('Warning')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_ICON)
    def test_deselect(self):
        type('Icon View')
        click('Icon View')
        type('+')
        sleep(0.5)
        self.runDemo('Icon View Basics')
        try:
            wnd = self.app.child('GtkIconView demo', roleName='frame', recursive=False, retry=False)
        except SearchError:
            wnd = self.app.child('Icon View Basics', roleName='frame', recursive=False, retry=False)
        focus.window(wnd.name)

        focus.widget(roleName='icon')
        select()
        deselect()
        self.assertFalse(focus.widget.isSelected)
Beispiel #20
0
 def test_throws_action_not_supported(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)
     with self.assertRaises(ActionNotSupported) as cm:
         activate.text('')
     self.assertEqual(str(cm.exception),
                      "Cannot do 'activate' action on [text | ]")
Beispiel #21
0
    def test_custom_actions_text_with_debug(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)
        config.debugSearching = True
        output = trap_stdout(click.text, '')
        self.assertIn(
            "searching for descendent of [frame | %s]: child with roleName='text'"
            % wnd.name, output)

        self.assertTrue(isinstance(focus.widget.node, tree.Node))
        self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #22
0
    def test_deselect(self):
        type('Icon View')
        click('Icon View')
        type('+')
        sleep(0.5)
        self.runDemo('Icon View Basics')
        try:
            wnd = self.app.child('GtkIconView demo',
                                 roleName='frame',
                                 recursive=False,
                                 retry=False)
        except SearchError:
            wnd = self.app.child('Icon View Basics',
                                 roleName='frame',
                                 recursive=False,
                                 retry=False)
        focus.window(wnd.name)

        focus.widget(roleName='icon')
        select()
        deselect()
        self.assertFalse(focus.widget.isSelected)
Beispiel #23
0
 def test_focus_table_cell(self):
     self.runDemo('Builder')
     focus.window('GtkBuilder demo')
     focus.tableCell('')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_TABLE_CELL)
Beispiel #24
0
 def test_focus_icon(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.icon('')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_ICON)
Beispiel #25
0
 def test_focus_text(self):
     self.runDemo('Assistant')
     focus.window('Page 1')
     focus.text('')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #26
0
 def testTyping(self):
     self.runDemo('Dialog and Message Boxes')
     focus.window('Dialogs')
     focus.widget(roleName='text')
     type("hello world")
     self.assertEquals(focus.widget.node.text, 'hello world')
 def test_focus_text(self):
     self.runDemo('Assistant')
     focus.window('Page 1')
     focus.text('')
     self.assertTrue(isinstance(focus.widget.node, tree.Node))
     self.assertEqual(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #28
0
 def testFocusTableCell(self):
     self.runDemo('Builder')
     focus.window('GtkBuilder demo')
     focus.tableCell('')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_TABLE_CELL)
Beispiel #29
0
 def testFocusText(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.text('')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #30
0
 def test_custom_actions_button(self):
     self.runDemo('Dialog and Message Boxes')
     focus.window('Dialogs')
     click.button('Interactive Dialog')
     self.assertTrue(focus.dialog("Interactive Dialog"))
Beispiel #31
0
 def testFocusButton(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.button('Open')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_PUSH_BUTTON)
Beispiel #32
0
 def test_custom_actions_text(self):
     self.runDemo('Builder')
     focus.window('GtkBuilder demo')
     click.text('')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_TEXT)
Beispiel #33
0
 def test_throws_action_not_supported(self):
     self.runDemo('Builder')
     focus.window('GtkBuilder demo')
     with self.assertRaises(ActionNotSupported) as cm:
         activate.text('')
     self.assertEquals(str(cm.exception), "Cannot do 'activate' action on [text | ]")
Beispiel #34
0
 def test_doubleClick(self):
     btn = focus.application.node.child('Builder')
     doubleClick(btn.position[0], btn.position[1])
     focus.window('GtkBuilder demo')
Beispiel #35
0
 def test_focus_button(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.button('Open')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_PUSH_BUTTON)
Beispiel #36
0
 def testKeyCombo(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     keyCombo("<ctrl>a")
     focus.dialog('About GTK+ Code Demos')
Beispiel #37
0
 def test_focus_menu(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.menu('File')
     self.assert_(isinstance(focus.widget.node, tree.Node))
     self.assertEquals(focus.widget.node.role, pyatspi.ROLE_MENU)
Beispiel #38
0
 def test_keyCombo_on_widget(self):
     self.runDemo('Application window')
     focus.window('Application Window')
     focus.icon('')
     keyCombo("<ctrl>a")
     focus.dialog('About GTK+ Code Demos')
Beispiel #39
0
def open_conversation_with(buddy):
    click.tableCell(buddy)
    pressKey("Enter")
    focus.window(buddy)
    time.sleep(2)
Beispiel #40
0
def send_message(buddy, message):
    focus.window(buddy)
    focus.text()
    typeText(message)
    pressKey("Enter")