Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
438f5f01
Commit
438f5f01
authored
Sep 20, 2015
by
anonym
Browse files
Merge remote-tracking branch 'kytv/test/9330-focus' into stable
Fix-committed:
#9330
parents
bb560d66
b1705ccf
Changes
2
Hide whitespace changes
Inline
Side-by-side
features/step_definitions/pidgin.rb
View file @
438f5f01
...
...
@@ -23,14 +23,6 @@ def focus_pidgin_irc_conversation_window(account)
@vm
.
focus_window
(
".*
#{
Regexp
.
escape
(
account
)
}
$"
)
end
def
close_pidgin_conversation_window
(
account
)
focus_pidgin_irc_conversation_window
(
account
)
@screen
.
type
(
Sikuli
::
Key
.
F4
,
Sikuli
::
KeyModifier
.
ALT
)
if
@screen
.
exists
(
'PidginConfirmationIcon.png'
)
@screen
.
click
(
'GnomeCloseButton.png'
)
end
end
When
/^I create my XMPP account$/
do
next
if
@skip_steps_while_restoring_background
account
=
xmpp_account
(
"Tails_account"
)
...
...
@@ -299,14 +291,7 @@ Then /^Pidgin successfully connects to the "([^"]+)" account$/ do |account|
@new_circuit_tries
=
0
until
@new_circuit_tries
==
$config
[
"MAX_NEW_TOR_CIRCUIT_RETRIES"
]
do
# Sometimes the OFTC welcome notice window pops up over the buddy list one...
begin
@vm
.
focus_window
(
'Buddy List'
)
rescue
ExecutionFailedInVM
# Sometimes focusing the window with xdotool will fail with the
# conversation window right on top of it. We'll try to close the
# conversation window. At worst, the test will still fail...
close_pidgin_conversation_window
(
account
)
end
@vm
.
focus_window
(
'Buddy List'
)
# FIXME This should be modified to use waitAny once #9633 is addressed
begin
...
...
features/support/helpers/vm_helper.rb
View file @
438f5f01
...
...
@@ -408,12 +408,34 @@ EOF
return
execute
(
"pidof -x -o '%PPID' "
+
process
).
stdout
.
chomp
.
split
end
def
focus_window
(
window_title
,
user
=
LIVE_USER
)
def
select_virtual_desktop
(
desktop_number
,
user
=
LIVE_USER
)
assert
(
desktop_number
>=
0
&&
desktop_number
<=
3
,
"Only values between 0 and 3 are valid virtual desktop numbers"
)
execute_successfully
(
"xdotool se
arch --name '
#{
window_title
}
' windowactivate --sync
"
,
user
"xdotool se
t_desktop '
#{
desktop_number
}
'
"
,
user
)
end
def
focus_window
(
window_title
,
user
=
LIVE_USER
)
def
do_focus
(
window_title
,
user
)
execute_successfully
(
"xdotool search --name '
#{
window_title
}
' windowactivate --sync"
,
user
)
end
begin
do_focus
(
window_title
,
user
)
rescue
ExecutionFailedInVM
# Often when vdotool fails to focus a window it'll work when retried
# after redrawing the screen. Switching to a new virtual desktop then
# back seems to be a reliable way to handle this.
select_virtual_desktop
(
3
)
select_virtual_desktop
(
0
)
sleep
1
do_focus
(
window_title
,
user
)
end
end
def
file_exist?
(
file
)
execute
(
"test -e '
#{
file
}
'"
).
success?
end
...
...
anonym
@anonym
mentioned in issue
#9330 (closed)
·
May 14, 2020
mentioned in issue
#9330 (closed)
mentioned in issue #9330
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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