Fix address form test for Vite 8 reactivity timing

The test_user_address test was using find_element with no wait after
clicking "Insert Address" to dynamically add form fields. With Rolldown,
Vue's reactive update takes ~15ms to render the new fields, which is
enough to break a synchronous find_element. Switch to
wait_for_selector_visible which properly polls for the element.
This commit is contained in:
Dannon Baker
2026-05-09 21:52:01 -04:00
parent 60a6b5a119
commit 54b1f044eb
@@ -1,5 +1,3 @@
from selenium.webdriver.common.by import By
from galaxy_test.selenium.framework import (
selenium_test,
SeleniumTestCase,
@@ -90,9 +88,6 @@ class TestManageInformation(SeleniumTestCase):
@selenium_test
def test_user_address(self):
def get_address_form():
return self.find_element_by_selector("div.ui-portlet-section > div.portlet-content")
self.register(self._get_random_email())
self.navigate_to_manage_information()
self.components.change_user_address.address_button.wait_for_and_click()
@@ -114,7 +109,7 @@ class TestManageInformation(SeleniumTestCase):
for input_field_label in address_field_labels:
input_value = self._get_random_name(prefix=input_field_label)
address_fields[input_field_label] = input_value
input_field = self.get_address_input_field(get_address_form(), input_field_label)
input_field = self.get_address_input_field(input_field_label)
self.clear_input_field_and_write(input_field, input_value)
# save new address
self.components.change_user_email.submit.wait_for_and_click()
@@ -125,7 +120,7 @@ class TestManageInformation(SeleniumTestCase):
# check if address was saved correctly
for input_field_label in address_fields.keys():
input_field = self.get_address_input_field(get_address_form(), input_field_label)
input_field = self.get_address_input_field(input_field_label)
assert input_field.get_attribute("value") == address_fields[input_field_label]
def navigate_to_manage_information(self):
@@ -136,8 +131,8 @@ class TestManageInformation(SeleniumTestCase):
element.clear()
element.send_keys(new_input_text)
def get_address_input_field(self, address_form, input_field_label):
return address_form.find_element(By.CSS_SELECTOR, f"[data-label='{input_field_label}'] > div > div > input")
def get_address_input_field(self, input_field_label):
return self.wait_for_selector_visible(f"[data-label='{input_field_label}'] > div > div > input")
class TestDeleteCurrentAccount(SeleniumTestCase):