Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OTRv4
pidgin-otrng-testing
Commits
6cbd52bf
Unverified
Commit
6cbd52bf
authored
Oct 10, 2018
by
Giovane Liberato
Browse files
Adjustments on configuration and methods used
parent
1da5d8fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_interactive_path.py
View file @
6cbd52bf
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment