Skip to content

Commit 58182fd

Browse files
test: Fix selectors in selenium tests
1 parent 2a29be5 commit 58182fd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ietf/doc/tests_js.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _read_author_form(form_elt):
118118
# Must provide a "basis" (change reason)
119119
self.driver.find_element(By.ID, 'id_basis').send_keys('change testing')
120120
# Now click the 'submit' button and check that the update was accepted.
121-
submit_button = self.driver.find_element(By.CSS_SELECTOR, 'button[type="submit"]')
121+
submit_button = self.driver.find_element(By.CSS_SELECTOR, '#content button[type="submit"]')
122122
self.driver.execute_script("arguments[0].click();", submit_button) # FIXME: no idea why this fails:
123123
# self.scroll_to_element(submit_button)
124124
# submit_button.click()
@@ -132,4 +132,4 @@ def _read_author_form(form_elt):
132132
self.assertEqual(
133133
list(draft.documentauthor_set.values_list('person', flat=True)),
134134
[first_auth.person.pk] + [auth.pk for auth in authors]
135-
)
135+
)

ietf/utils/jstest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def login(self, username='plain'):
8181
self.driver.get(url)
8282
self.driver.find_element(By.NAME, 'username').send_keys(username)
8383
self.driver.find_element(By.NAME, 'password').send_keys(password)
84-
self.driver.find_element(By.XPATH, '//button[@type="submit"]').click()
84+
self.driver.find_element(By.XPATH, '//*[@id="content"]//button[@type="submit"]').click()
8585

8686
def scroll_to_element(self, element):
8787
"""Scroll an element into view"""
@@ -108,4 +108,4 @@ def __init__(self, element, child_selector):
108108

109109
def __call__(self, driver):
110110
child = self.element.find_element(By.CSS_SELECTOR, self.child_selector)
111-
return child if child is not None else False
111+
return child if child is not None else False

0 commit comments

Comments
 (0)