File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -597,9 +597,10 @@ def select_from_dropdown_listbox(self, selection):
597
597
resource_information_save_button = Locator (
598
598
By .CSS_SELECTOR , '[data-test-save-resource-metadata-button]'
599
599
)
600
-
600
+ # Get the rows of search results matching the locator
601
601
rows = GroupLocator (By .CSS_SELECTOR , '[data-test-user-card-main]' )
602
602
603
+ # Select the correct user from the table of search results
603
604
def select_from_table_of_rows (self , selection ):
604
605
for row in self .rows :
605
606
cell = row .find_element (
@@ -615,11 +616,11 @@ def select_from_table_of_rows(self, selection):
615
616
By .CSS_SELECTOR , '[data-analytics-name="Contributor name"]'
616
617
)
617
618
619
+ # Select new_user from contributors list on metadata page
618
620
def select_from_list (self , selection ):
619
621
for contributor in self .contributors_list :
620
622
if selection in contributor .text .strip ():
621
623
return contributor
622
- break
623
624
624
625
search_cancel_button = Locator (
625
626
By .CSS_SELECTOR , '[data-test-user-search-cancel-button]'
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ def test_edit_contributors(
352
352
project_metadata_page .search_input .send_keys (new_user )
353
353
project_metadata_page .contributor_search_button .click ()
354
354
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
356
356
WebDriverWait (driver , 5 ).until (
357
357
EC .visibility_of_element_located (
358
358
(
@@ -371,6 +371,7 @@ def test_edit_contributors(
371
371
(By .CSS_SELECTOR , '[data-test-contributors-list]' )
372
372
)
373
373
)
374
+ # Retrieve the new_user from contributors list
374
375
user = project_metadata_page .select_from_list (new_user )
375
376
assert new_user in user .text .strip ()
376
377
You can’t perform that action at this time.
0 commit comments