Skip to content

Commit ed56faa

Browse files
author
Ramya Virajamangala
committed
Added comments to describe the workflow
1 parent 811a744 commit ed56faa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pages/project.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,10 @@ def select_from_dropdown_listbox(self, selection):
597597
resource_information_save_button = Locator(
598598
By.CSS_SELECTOR, '[data-test-save-resource-metadata-button]'
599599
)
600-
600+
# Get the rows of search results matching the locator
601601
rows = GroupLocator(By.CSS_SELECTOR, '[data-test-user-card-main]')
602602

603+
# Select the correct user from the table of search results
603604
def select_from_table_of_rows(self, selection):
604605
for row in self.rows:
605606
cell = row.find_element(
@@ -615,11 +616,11 @@ def select_from_table_of_rows(self, selection):
615616
By.CSS_SELECTOR, '[data-analytics-name="Contributor name"]'
616617
)
617618

619+
# Select new_user from contributors list on metadata page
618620
def select_from_list(self, selection):
619621
for contributor in self.contributors_list:
620622
if selection in contributor.text.strip():
621623
return contributor
622-
break
623624

624625
search_cancel_button = Locator(
625626
By.CSS_SELECTOR, '[data-test-user-search-cancel-button]'

tests/test_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def test_edit_contributors(
352352
project_metadata_page.search_input.send_keys(new_user)
353353
project_metadata_page.contributor_search_button.click()
354354

355-
# Get the row number for the user from the search table
355+
# Select the new_user from the search results and add the user to the project
356356
WebDriverWait(driver, 5).until(
357357
EC.visibility_of_element_located(
358358
(
@@ -371,6 +371,7 @@ def test_edit_contributors(
371371
(By.CSS_SELECTOR, '[data-test-contributors-list]')
372372
)
373373
)
374+
# Retrieve the new_user from contributors list
374375
user = project_metadata_page.select_from_list(new_user)
375376
assert new_user in user.text.strip()
376377

0 commit comments

Comments
 (0)