Skip to content
Commits on Source (4)
Style * ClickToFocus
......@@ -124,7 +124,7 @@ def run():
elif event.source.role == pyatspi.ROLE_PUSH_BUTTON:
print_accessible(event.source.parent)
print("selectButton(acc, '%s')" % event.source.name)
print_accessible(event.source)
state_change_callback(event, True, "Focus")
elif event.source.role == pyatspi.ROLE_PANEL:
# usually not interesting
pass
......
......@@ -311,6 +311,6 @@ def summary():
print("%d PASS" % npassed)
print("%s%d FAIL%s" % (red, nfailed, normal))
else:
print("%s%d%s PASS" % (green, npassed, normal))
print("%s%d PASS%s" % (green, npassed, normal))
print("%d FAIL" % nfailed)
sys.exit(1 if nfailed else 0)
#!/usr/bin/python
# coding=utf-8
# Copyright (c) 2019 Samuel Thibault <sthibault@hypra.fr>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from dogtail.tree import root
from dogtail.utils import run
from regression import *
import os
import sys
# Startup
# menus don't remain open unless we have a window manager (!?)
os.system('fvwm -f fvwmrc &')
run('./thunderbird-start', appName='Thunderbird')
app = root.application('Thunderbird')
#print("got app")
yes_safe = app.child('Continue in Safe Mode', 'push button')
yes_safe.click()
#print("clicked continue")
waitWindow(app, 'Draft - Mozilla Thunderbird')
win = app.child('Draft - Mozilla Thunderbird', 'frame')
testReachability(win, [])
......@@ -24,7 +24,7 @@ import sys
# Startup
# menus don't remain open unless we have a window manager (!?)
os.system('fvwm -f /dev/null &')
os.system('fvwm -f fvwmrc &')
run('./thunderbird-start', appName='Thunderbird')
app = root.application('Thunderbird')
#print("got app")
......@@ -339,7 +339,7 @@ if not testlist or 'composition' in testlist:
typeText('test@example.com,')
press('Tab')
# ambiguous :/
# FIXME: ambiguous :/
#acc = win.child('', 'entry')
#waitFocus(acc)
#expectText(acc, '')
......@@ -348,7 +348,7 @@ if not testlist or 'composition' in testlist:
#waitFocus(acc)
#expectText(acc, '')
press('Tab')
# ambiguous :/
# FIXME: ambiguous :/
#acc = win.child('', 'entry')
#waitFocus(acc)
#expectText(acc, '')
......@@ -357,9 +357,12 @@ if not testlist or 'composition' in testlist:
waitFocus(acc)
expectText(acc, '')
typeText('hello')
# FIXME
# FIXME: sometimes contains '', sometimes 'h'...
#expectText(acc, 'hello')
expectText(acc, '')
# FIXME: shouldn't be needed, rather wait for the text to appear
time.sleep(1)
expectText(acc, 'hello')
#waitForText(acc, 'hello')
press('Tab')
acc = win.child('about:blank', 'document web')
......@@ -368,8 +371,6 @@ if not testlist or 'composition' in testlist:
typeText('hello')
# FIXME
#expectText(acc, 'hello'
# FIXME: shouldn't be needed, rather wait for the text to appear
time.sleep(1)
expectText(acc, '')
......@@ -535,39 +536,44 @@ if not testlist or 'composition' in testlist:
acc = win.child('about:blank', 'document web')
waitFocus(acc)
pressCombo('<control>Return')
waitDialog(app, 'Send Message')
#pressCombo('<control>Return')
#waitDialog(app, 'Send Message')
win = app.child('Send Message', 'dialog')
acc = win.child('Send', 'push button')
waitFocus(acc)
#win = app.child('Send Message', 'dialog')
#acc = win.child('Send', 'push button')
#waitFocus(acc)
press('Return')
#press('Return')
waitWindow(app, 'Sending Message - hello')
win = app.child('Sending Message - hello', 'dialog')
#waitWindow(app, 'Sending Message - hello')
#win = app.child('Sending Message - hello', 'dialog')
acc = win.child('Cancel', 'push button')
waitFocus(acc)
press('Enter')
#time.sleep(1)
#acc = win.child('Cancel', 'push button')
#waitFocus(acc)
#press('Enter')
#time.sleep(1)
# FIXME: odd window focus behavior
pressCombo('<alt>Tab')
time.sleep(0.1)
press('Enter')
## FIXME: odd window focus behavior
##pressCombo('<alt>Tab')
#pressCombo('<alt>Tab Tab')
##time.sleep(10)
##pressCombo('Tab')
#time.sleep(10)
#press('Enter')
waitWindow(app, 'Send Message Error')
win = app.child('Send Message Error', 'dialog')
#waitWindow(app, 'Send Message Error')
#win = app.child('Send Message Error', 'dialog')
acc = win.child('OK', 'push button')
waitFocus(acc)
press('Enter')
#acc = win.child('OK', 'push button')
#waitFocus(acc)
#press('Enter')
waitWindow(app, 'Write: hello - Thunderbird')
win = app.child('Write: hello - Thunderbird', 'frame')
#waitWindow(app, 'Write: hello - Thunderbird')
#win = app.child('Write: hello - Thunderbird', 'frame')
acc = win.child('about:blank', 'document web')
waitFocus(acc)
#acc = win.child('about:blank', 'document web')
#waitFocus(acc)
pressCombo('<control>w')
......@@ -616,12 +622,119 @@ if not testlist or 'read' in testlist:
press('Enter')
waitWindow(app, 'foo - Trash - Mozilla Thunderbird')
win = app.child('foo - Trash - Mozilla Thunderbird', 'frame')
acc = win.child('foo', 'document web')
waitFocus(acc)
press('Tab')
acc = win.child('foo - Trash', 'page tab')
waitFocus(acc)
press('Tab')
acc = win.child('Search <Ctrl+K>', 'entry')
waitFocus(acc)
press('Tab')
acc = win.child('From: test <test@example.com>', 'entry')
waitFocus(acc)
press('Tab')
acc = win.child('Add to Address Book', 'push button')
waitFocus(acc)
press('Tab')
acc = win.child('Subject: foo', 'entry')
waitFocus(acc)
expectText(acc, 'foo')
press('Tab')
acc = win.child('To: test@example.com', 'entry')
waitFocus(acc)
press('Tab')
# FIXME: ambiguous :/
#acc = win.child('Add to Address Book', 'push button')
#waitFocus(acc)
press('Tab')
# FIXME: ambiguous :/
#acc = win.child('', 'entry')
#waitFocus(acc)
#expectText(acc, '3/5/19, 5:54 PM')
press('Tab')
acc = win.child('foo', 'document web')
waitFocus(acc)
pressCombo('<shift>Tab')
# FIXME: ambiguous :/
#acc = win.child('', 'entry')
#waitFocus(acc)
#expectText(acc, '3/5/19, 5:54 PM')
pressCombo('<shift>Tab')
# FIXME: ambiguous :/
#acc = win.child('Add to Address Book', 'push button')
#waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('To: test@example.com', 'entry')
waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('Subject: foo', 'entry')
waitFocus(acc)
expectText(acc, 'foo')
pressCombo('<shift>Tab')
acc = win.child('Add to Address Book', 'push button')
waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('From: test <test@example.com>', 'entry')
waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('Search <Ctrl+K>', 'entry')
waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('foo - Trash', 'page tab')
waitFocus(acc)
pressCombo('<shift>Tab')
acc = win.child('foo', 'document web')
waitFocus(acc)
# Zoom in
# TODO: control-+
pressCombo('<alt>v')
acc = win.child('View', 'menu')
waitExpanded(acc)
selectMenuItem(acc, 'Zoom')
press('Return')
acc = win.child('Zoom', 'menu')
waitExpanded(acc)
selectMenuItem(acc, 'Zoom In')
press('Return')
acc = win.child('foo', 'document web')
waitFocus(acc)
# Print
pressCombo('<control>p')
waitDialog(app, 'Print')
press('Escape')
acc = win.child('foo', 'document web')
waitFocus(acc)
# TODO: goto next/prev message with Go menu and f/b n/p
#title('Done')
#time.sleep(60)
pressCombo('<control>w')
# TODO: test unread/read?
acc = win.child(trashmail, 'table row')
waitFocus(acc)
......@@ -651,30 +764,11 @@ if not testlist or 'read' in testlist:
# TODO: configure and test opening mails in new tab vs new window
#title('Done')
#time.sleep(60)
# TODO: Module 6
title('Test page orientation')
pressCombo('<alt>f')
acc = win.child('New', 'menu')
waitFocus(acc)
press('u')
waitDialog(app, 'Page Setup')
win = app.child('Page Setup', 'dialog')
press('Tab')
press('Tab')
acc = win.child('Portrait', 'radio button')
waitFocus(acc)
press('Down')
waitNotChecked(acc)
acc = win.child('Landscape', 'radio button')
waitChecked(acc)
waitFocus(acc)
#title('Done')
#time.sleep(60)
title('Quit')
......