예제 #1
0
#!/usr/bin/python3

# Test that the File menu and menu items work correctly.

from testCommon import run_app, bail

from dogtail.procedural import *

try:
    run_app(file='LoremIpsum.txt')

    # Save a Copy
    click('File', roleName='menu')
    click('Save As...', roleName='menu item')
    click('Cancel', roleName='push button')

    # Print Preview
    focus.application('xed')
    click('File', roleName='menu')
    click('Print Preview', roleName='menu item')
    click('Close preview', roleName='push button')

    # Print
    focus.application('xed')
    click('File', roleName='menu')
    click('Print...', roleName='menu item')
    focus.dialog('Print')
    click('Page Setup', roleName='page tab')
    click('Text Editor', roleName='page tab')
    click('Cancel', roleName='push button')
예제 #2
0
#!/usr/bin/python3

# Test opening a file with wrong extenstion.

from testCommon import run_app, bail

from dogtail.procedural import *

try:

    run_app(file='test-mime.bin')

    # Close xreader
    click('File', roleName='menu')
    click('Close', roleName='menu item')

except:
    bail()
예제 #3
0
#!/usr/bin/python3

# Test that the File menu and menu items work correctly.

from testCommon import run_app, bail

from dogtail.procedural import *

try:
    run_app(file='test-links.pdf')

    # Open a file
    click('File', roleName='menu')
    click('Open…', roleName='menu item')
    click('Cancel', roleName='push button')

    # Save a Copy
    focus.frame('test-links.pdf')
    click('File', roleName='menu')
    click('Save a Copy…', roleName='menu item')
    click('Cancel', roleName='push button')

    # Print
    focus.frame('test-links.pdf')
    click('File', roleName='menu')
    click('Print…', roleName='menu item')
    focus.dialog('Print')
    click('Cancel', roleName='push button')

    # Properties
    focus.frame('test-links.pdf')
예제 #4
0
#!/usr/bin/python3

# This test opens the Help menu and runs through the menu items.

from testCommon import run_app, bail

from dogtail.procedural import *

try:
    run_app()

    # Contents
    click('Help', roleName='menu')
    click('Contents', roleName='menu item')
    focus.dialog('Text Editor')
    keyCombo('<Control>w')

    # Keyboard Shortcuts
    click('Help', roleName='menu')
    click('Keyboard Shortcuts', roleName='menu item')
    keyCombo('<Alt>F4')

    # About
    click('Help', roleName='menu')
    click('About', roleName='menu item')
    focus.dialog('About xed')
    click('Close', roleName='push button')

    # Quit application
    click('File', roleName='menu')
    click('Quit', roleName='menu item')
예제 #5
0
#!/usr/bin/python3

# Test opening a password encrypted file and unlocking it.

from testCommon import run_app, bail

from dogtail.procedural import *

try:

	run_app(file='test-encrypt.pdf')

	# Try an incorrect password first
	focus.dialog('Enter password')
	type('wrong password')
	click('Unlock Document', roleName='push button')
	focus.dialog('Enter password')
	click('Cancel', roleName='push button')

	# Try again with the correct password
	focus.frame('test-encrypt.pdf — Password Required')
	click('Unlock Document', roleName='push button')
	type('Foo')
	focus.dialog('Enter password')
	click('Unlock Document', roleName='push button')

	# Close xreader
	focus.frame('test-encrypt.pdf — Dokument1')
	click('File', roleName='menu')
	click('Close', roleName='menu item')
예제 #6
0
#!/usr/bin/python3

# Test reloading a document.

from testCommon import run_app, bail

from dogtail.procedural import *

try:

    run_app(file='test-page-labels.pdf')

    focus.widget('page-label-entry')
    focus.widget.text = "iii"
    activate()

    if focus.widget.text != "III":
        click('File', roleName='menu')
        click('Close', roleName='menu item')
        exit(1)

    # Close xreader
    click('File', roleName='menu')
    click('Close', roleName='menu item')

except:
    bail()