Unverified Commit 6cbd52bf authored by Giovane Liberato's avatar Giovane Liberato
Browse files

Adjustments on configuration and methods used

parent 1da5d8fa
......@@ -3,18 +3,21 @@
import subprocess
import time
from dogtail.procedural import click, focus, select, keyCombo, type
from dogtail.config import config
from dogtail.rawinput import pressKey, typeText
from dogtail.procedural import click, focus, select, type
from dogtail.tree import root
from dogtail.utils import run
def start_pidgin():
pid = subprocess.Popen(['pidgin', '-c', '/home/tvbinar/.alice_purple'])
time.sleep(3)
time.sleep(2)
focus.application('Pidgin')
return pid
def open_conversation_with(buddy):
click.tableCell(buddy)
keyCombo("Enter")
pressKey("Enter")
focus.frame(buddy)
time.sleep(1)
......@@ -26,26 +29,23 @@ def send_message(buddy, message):
focus.frame(buddy)
focus.text()
type(message)
keyCombo("Enter")
pressKey("Enter")
def assert_otr_status(expected):
try:
# TODO remove this space from pidgin UI, probably used for formating
focus.frame.button(' ' + expected)
except SearchError:
raise AssertionError("OTR status != then %s", expected)
# TODO remove this space from pidgin UI, probably used for formating
focus.frame.button(' ' + expected)
if __name__ == '__main__':
config.searchCutoffCount = 3
config.fatalErrors = True
pid = start_pidgin()
root.application('Pidgin')
try:
open_conversation_with("bob@localhost")
assert_otr_status('Not private')
start_private_conversation()
assert_otr_status('Unverified')
send_message('bob@localhost', 'Hi bob!')
finally:
raw_input("End?\n")
pid.terminate()
open_conversation_with("bob@localhost")
assert_otr_status('Not private')
start_private_conversation()
assert_otr_status('Unverified')
send_message('bob@localhost', 'Hi bob!')
raw_input("End?\n")
pid.terminate()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment