Skip to content

Commit

Permalink
Merge pull request #246 from DougCorell/testFix/project-registrations…
Browse files Browse the repository at this point in the history
…-modal

[ENG-4602] - Project Registrations Page - Update Tests After Modal Scrolling Issue Has Been Resolved
  • Loading branch information
jh27539 authored Jul 19, 2023
2 parents 875b2fe + 5a828ee commit a678406
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions tests/test_project_registrations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from selenium.webdriver.common.action_chains import ActionChains

import markers
from api import osf_api
Expand Down Expand Up @@ -131,20 +130,7 @@ def test_create_new_registration_modal(self, driver, registrations_page):
modal_schema_list.sort()
assert api_schema_list == modal_schema_list
# Click the Cancel button to close the modal window
try:
create_registration_modal.cancel_button.click()
except ValueError:
# In some environments there may be several schemas listed on the modal
# which may push the Cancel button below the visible part of the screen
# depending on the screen resolution. Currently this modal window does
# not have the ability to vertically scroll, so the scroll_into_view
# method will not work. There is an open ticket for the scrolling issue:
# ENG-3740.
cancel_button = driver.find_element_by_css_selector(
'button[data-test-new-registration-modal-cancel-button]'
)
ActionChains(driver).move_to_element(cancel_button).perform()
cancel_button.click()
create_registration_modal.cancel_button.click()
# Verify the modal window has closed
assert create_registration_modal.modal_window.absent()

Expand All @@ -160,20 +146,7 @@ def test_create_new_draft_registration(self, driver, registrations_page):
create_registration_modal.select_schema_radio_button(
schema_name='Open-Ended Registration'
)
try:
create_registration_modal.create_draft_button.click()
except ValueError:
# In some environments there may be several schemas listed on the modal
# which may push the Create draft button below the visible part of the
# screen depending on the screen resolution. Currently this modal window
# does not have the ability to vertically scroll, so the scroll_into_view
# method will not work. There is an open ticket for the scrolling issue:
# ENG-3740.
create_draft_button = driver.find_element_by_css_selector(
'button[data-test-new-registration-modal-create-draft-button]'
)
ActionChains(driver).move_to_element(create_draft_button).perform()
create_draft_button.click()
create_registration_modal.create_draft_button.click()
# Verify that you are redirected to the Draft Registration Metadata page
DraftRegistrationMetadataPage(driver, verify=True)

Expand Down

0 comments on commit a678406

Please sign in to comment.