@@ -328,7 +328,7 @@ def test_edit_preprint(self, session, driver, preprint_detail_page):
328
328
assert tag_found
329
329
330
330
@markers .dont_run_on_prod
331
- @pytest .mark .xfail (reason = 'https://openscience.atlassian.net/browse/ENG-6065' )
331
+ # @pytest.mark.xfail(reason='https://openscience.atlassian.net/browse/ENG-6065')
332
332
def test_withdraw_preprint (self , session , driver , preprint_detail_page ):
333
333
"""Test the Withdraw Preprint functionality. Using the preprint_detail_page
334
334
fixture we start on the Preprint Detail page for an api created preprint. Then
@@ -341,7 +341,6 @@ def test_withdraw_preprint(self, session, driver, preprint_detail_page):
341
341
that the withdrawal request record is created.
342
342
"""
343
343
assert PreprintDetailPage (driver , verify = True )
344
- preprint_detail_page .edit_preprint_button .click ()
345
344
edit_page = PreprintEditPage (driver )
346
345
WebDriverWait (driver , 5 ).until (
347
346
EC .element_to_be_clickable (
@@ -363,8 +362,13 @@ def test_withdraw_preprint(self, session, driver, preprint_detail_page):
363
362
)
364
363
assert withdraw_page .request_withdrawal_button .is_enabled ()
365
364
withdraw_page .request_withdrawal_button .click ()
365
+ WebDriverWait (driver , 5 ).until (EC .visibility_of (withdraw_page .withdrawn_banner ))
366
366
# Should be redirected back to Preprint Detail page
367
367
assert PendingPreprintDetailPage (driver , verify = True )
368
+ # Verify that "This preprint has been withdrawn." banner is displayed on Preprint Detail page.
369
+ assert (
370
+ withdraw_page .withdrawn_banner .text == 'This preprint has been withdrawn.'
371
+ )
368
372
# Verify via the api that the Withdrawal Request record was created
369
373
requests = osf_api .get_preprint_requests_records (
370
374
node_id = preprint_detail_page .guid
@@ -374,7 +378,7 @@ def test_withdraw_preprint(self, session, driver, preprint_detail_page):
374
378
record_found = False
375
379
for request in requests :
376
380
if request ['attributes' ]['request_type' ] == 'withdrawal' :
377
- assert request ['attributes' ]['machine_state' ] == 'pending '
381
+ assert request ['attributes' ]['machine_state' ] == 'accepted '
378
382
record_found = True
379
383
break
380
384
if not record_found :
0 commit comments