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
9872cedf
Unverified
Commit
9872cedf
authored
Oct 10, 2018
by
Giovane Liberato
Browse files
Assert message was sent
parent
6cbd52bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_interactive_path.py
View file @
9872cedf
...
...
@@ -5,6 +5,7 @@ import time
from
dogtail.config
import
config
from
dogtail.rawinput
import
pressKey
,
typeText
from
dogtail.predicate
import
GenericPredicate
from
dogtail.procedural
import
click
,
focus
,
select
,
type
from
dogtail.tree
import
root
from
dogtail.utils
import
run
...
...
@@ -18,25 +19,37 @@ def start_pidgin():
def
open_conversation_with
(
buddy
):
click
.
tableCell
(
buddy
)
pressKey
(
"Enter"
)
focus
.
frame
(
buddy
)
time
.
sleep
(
1
)
focus
.
window
(
buddy
)
time
.
sleep
(
2
)
def
start_private_conversation
():
click
.
menu
(
'OTR'
)
click
.
menuItem
(
"Start private conversation"
)
def
send_message
(
buddy
,
message
):
focus
.
frame
(
buddy
)
focus
.
window
(
buddy
)
focus
.
text
()
time
.
sleep
(
1
)
type
(
message
)
pressKey
(
"Enter"
)
def
assert_otr_status
(
expected
):
# TODO remove this space from pidgin UI, probably used for formating
focus
.
frame
.
button
(
' '
+
expected
)
try
:
# TODO remove this space from pidgin UI, probably used for formating
focus
.
window
.
button
(
' '
+
expected
)
except
:
assert
False
def
assert_message_was_sent_by
(
sender
,
message
):
chat_tab
=
focus
.
window
.
findChild
(
GenericPredicate
(
name
=
sender
,
roleName
=
'page tab'
))
chat_box
=
chat_tab
.
findChild
(
GenericPredicate
(
roleName
=
'text'
))
message_len
=
len
(
message
)
assert
message
==
chat_box
.
text
[
-
message_len
:]
if
__name__
==
'__main__'
:
config
.
searchCutoffCount
=
3
config
.
defaultDelay
=
1.5
config
.
blinkOnActions
=
True
config
.
fatalErrors
=
True
pid
=
start_pidgin
()
...
...
@@ -46,6 +59,8 @@ if __name__ == '__main__':
start_private_conversation
()
assert_otr_status
(
'Unverified'
)
send_message
(
'bob@localhost'
,
'Hi bob!'
)
assert_message_was_sent_by
(
'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