Skip to content

Commit

Permalink
test: don't wait_visible when we click
Browse files Browse the repository at this point in the history
Our click function already calls `wait_visible` so there is no need to
wait twice.
  • Loading branch information
jelly authored and martinpitt committed Mar 13, 2024
1 parent da22d7a commit 4f22465
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,6 @@ def login_and_go(self, path: Optional[str] = None, user: Optional[str] = None, h
def start_machine_troubleshoot(self, new=False, known_host=False, password=None, expect_closed_dialog=True, browser=None):
b = browser or self.browser

b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')

b.wait_visible('#hosts_setup_server_dialog')
Expand Down
4 changes: 0 additions & 4 deletions test/verify/check-shell-multi-machine
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ class TestMultiMachine(testlib.MachineCase):
self.login_and_go(None)
b.go("/@10.111.113.2")
self.start_machine_troubleshoot(expect_closed_dialog=False)
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.wait_in_text('#hosts_setup_server_dialog', "new host")
Expand Down Expand Up @@ -757,7 +756,6 @@ class TestMultiMachine(testlib.MachineCase):
# De-authorize key and relogin, then re-authorize.
m2.execute("rm /home/fred/.ssh/authorized_keys")
b.relogin(None, wait_remote_session_machine=m1)
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.wait_in_text('#hosts_setup_server_dialog', "Unable to log in")
Expand All @@ -774,7 +772,6 @@ class TestMultiMachine(testlib.MachineCase):
# change the passphrase back to the login password
m1.execute("ssh-keygen -q -f /home/admin/.ssh/id_rsa -p -P foobar -N foobarfoo")
b.relogin(None, wait_remote_session_machine=m1)
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.wait_in_text('#hosts_setup_server_dialog', "The SSH key for logging in")
Expand Down Expand Up @@ -821,7 +818,6 @@ class TestMultiMachine(testlib.MachineCase):

self.login_and_go(None)
b.go("/@10.111.113.2")
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.click('#hosts_setup_server_dialog button:contains(Add)')
Expand Down
4 changes: 0 additions & 4 deletions test/verify/check-superuser
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ class TestSuperuserDashboard(testlib.MachineCase):

self.login_and_go()
b.go("/@10.111.113.2")
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.wait_visible('#hosts_setup_server_dialog button:contains("Add")')
Expand Down Expand Up @@ -601,7 +600,6 @@ class TestSuperuserDashboard(testlib.MachineCase):
# Logging out and logging back in should give us immediate
# superuser on m2 (once we have logged in there).
b.relogin()
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.set_input_text("#login-custom-password", "foobar")
Expand Down Expand Up @@ -661,7 +659,6 @@ class TestSuperuserOldDashboard(testlib.MachineCase):
b.wait_visible('#content')

b.go("/@10.111.113.2")
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_popup('troubleshoot-dialog')
b.click('#troubleshoot-dialog button:contains("Add")')
Expand Down Expand Up @@ -731,7 +728,6 @@ class TestSuperuserDashboardOldMachine(testlib.MachineCase):
self.setup_provisioned_hosts()
self.login_and_go()
b.go("/@10.111.113.2")
b.wait_visible("#machine-troubleshoot")
b.click('#machine-troubleshoot')
b.wait_visible('#hosts_setup_server_dialog')
b.click('#hosts_setup_server_dialog button:contains("Add")')
Expand Down
6 changes: 0 additions & 6 deletions test/verify/check-system-services
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,6 @@ class TestTimers(testlib.MachineCase):
wait_systemctl_timer("2037-01-01 01:22")
self.assertIn("2037-01-01 01:22", m.execute("systemctl list-timers"))
# creates a new monthly timer that runs on 6th at 14:12 and 8th at 21:12 of every month
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "monthly_timer")
Expand Down Expand Up @@ -1482,7 +1481,6 @@ class TestTimers(testlib.MachineCase):
wait_systemctl_timer("2036-03-08 21:12")
self.assertIn("2036-03-08 21:12", m.execute("systemctl list-timers"))
# creates a new weekly timer that runs on Fri at 12:45 and Sun at 20:12 every week
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "weekly_timer")
Expand Down Expand Up @@ -1516,7 +1514,6 @@ class TestTimers(testlib.MachineCase):
wait_systemctl_timer("Fri 2036-03-21 12:45")
self.assertIn("Fri 2036-03-21 12:45", m.execute("systemctl list-timers"))
# creates a new daily timer that runs at 2:40 and at 21:15 every day
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "daily_timer")
Expand Down Expand Up @@ -1547,7 +1544,6 @@ class TestTimers(testlib.MachineCase):
wait_systemctl_timer("2036-04-10 21:15")
self.assertIn("2036-04-10 21:15", m.execute("systemctl list-timers"))
# creates a new houry timer that runs at *:05 and at *:26
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "hourly_timer")
Expand Down Expand Up @@ -1602,7 +1598,6 @@ class TestTimers(testlib.MachineCase):
self.assertIn("2036-04-10 04:16:05", m.execute("systemctl list-timers | grep minutely_timer.timer"))

# creates a new timer that runs at today at 23:59
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "no_repeat_timer")
Expand All @@ -1621,7 +1616,6 @@ class TestTimers(testlib.MachineCase):
self.assertIn("2036-04-10 23:59", m.execute("systemctl list-timers"))

# creates a boot timer that runs after 10 sec from boot
b.wait_visible("#create-timer")
b.click('#create-timer')
b.wait_visible("#timer-dialog")
b.set_input_text("#servicename", "boot_timer")
Expand Down
2 changes: 0 additions & 2 deletions test/verify/check-users
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def getUserAddDetails(machine):


def performUserAction(browser, user, action):
browser.wait_visible(f"#accounts-list tbody tr:contains({user}) button.pf-v5-c-menu-toggle")
browser.click(f"#accounts-list tbody tr:contains({user}) button.pf-v5-c-menu-toggle")
browser.wait_visible(f"#accounts-list tbody tr:contains({user}) button.pf-v5-c-menu-toggle[aria-expanded=true]")
browser.click(f".pf-v5-c-menu__list-item:contains({action}) button")
Expand Down Expand Up @@ -64,7 +63,6 @@ def createUser(
):
if default_shell is None:
default_shell = getUserAddDetails(machine)["SHELL"] or "/bin/bash"
browser.wait_visible('#accounts-create')
browser.click('#accounts-create')
browser.wait_visible('#accounts-create-dialog')
if run_assert_pixels:
Expand Down

0 comments on commit 4f22465

Please sign in to comment.