@@ -345,64 +345,35 @@ def test_edit_contributors(
345
345
346
346
WebDriverWait (driver , 5 ).until (
347
347
EC .element_to_be_clickable (
348
- (By .CSS_SELECTOR , '[data-test-edit-contributors]' )
348
+ (By .CSS_SELECTOR , '[data-test-edit-node- contributors-button ]' )
349
349
)
350
350
).click ()
351
-
352
- WebDriverWait (driver , 5 ).until (
353
- EC .element_to_be_clickable (
354
- (
355
- By .CSS_SELECTOR ,
356
- 'a.btn.btn-success.btn-sm.m-l-md[href="#addContributors"]' ,
357
- )
358
- )
359
- ).click ()
360
-
361
351
project_metadata_page .search_input .click ()
362
352
project_metadata_page .search_input .send_keys (new_user )
363
353
project_metadata_page .contributor_search_button .click ()
364
354
365
- # 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
366
356
WebDriverWait (driver , 5 ).until (
367
357
EC .visibility_of_element_located (
368
358
(
369
- By .XPATH ,
370
- '//div[@class="row"]/div[@class="col-md-4"]/table[@class="table-condensed table-hover" ]' ,
359
+ By .CSS_SELECTOR ,
360
+ '[data-test-user-card ]' ,
371
361
)
372
362
)
373
363
)
374
- search_table_path = '//table[@class="table-condensed table-hover"]'
375
- rno , search_table_data = utils .read_data_from_table (
376
- driver , search_table_path , check_match = True , item_match = new_user
377
- )
378
- # Click on the Add button of the row number for the user from the search table to add the new contributor user
379
- WebDriverWait (driver , 5 ).until (
380
- EC .element_to_be_clickable (
381
- (By .XPATH , search_table_path + '/tbody/tr[' + str (rno ) + ']/td[1]' )
382
- )
383
- ).click ()
384
364
385
- WebDriverWait ( driver , 5 ). until (
386
- EC . element_to_be_clickable (( By . XPATH , '//a[@class="btn btn-success"]' ) )
387
- ) .click ()
365
+ project_metadata_page . select_from_table_of_rows ( new_user )
366
+ project_metadata_page . search_cancel_button . click ( )
367
+ project_metadata_page . add_contributor_finish_button .click ()
388
368
389
- project_metadata_page .reload ()
390
369
WebDriverWait (driver , 5 ).until (
391
370
EC .visibility_of_element_located (
392
- (By .XPATH , '//table[@id="manageContributorsTable" ]' )
371
+ (By .CSS_SELECTOR , '[data-test-contributors-list ]' )
393
372
)
394
373
)
395
- contributor_table_path = '//table[@id="manageContributorsTable"]'
396
- # Get the total number of rows in contributors table
397
- rowno , contributor_table_data = utils .read_data_from_table (
398
- driver , contributor_table_path , check_match = False
399
- )
400
-
401
- # Get the user name from the last row which is added recently
402
- user = driver .find_element_by_xpath (
403
- contributor_table_path + '/tbody/tr[' + str (rowno ) + ']/td[2]'
404
- )
405
- assert new_user in user .text
374
+ # Retrieve the new_user from contributors list
375
+ user = project_metadata_page .select_from_list (new_user )
376
+ assert new_user in user .text .strip ()
406
377
407
378
def test_edit_resource_information (self , driver , project_metadata_page ):
408
379
"""This test verifies that user can add/remove
0 commit comments