Skip to content

Commit a678406

Browse files
authored
Merge pull request #246 from DougCorell/testFix/project-registrations-modal
[ENG-4602] - Project Registrations Page - Update Tests After Modal Scrolling Issue Has Been Resolved
2 parents 875b2fe + 5a828ee commit a678406

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

tests/test_project_registrations.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
from selenium.webdriver.common.action_chains import ActionChains
32

43
import markers
54
from api import osf_api
@@ -131,20 +130,7 @@ def test_create_new_registration_modal(self, driver, registrations_page):
131130
modal_schema_list.sort()
132131
assert api_schema_list == modal_schema_list
133132
# Click the Cancel button to close the modal window
134-
try:
135-
create_registration_modal.cancel_button.click()
136-
except ValueError:
137-
# In some environments there may be several schemas listed on the modal
138-
# which may push the Cancel button below the visible part of the screen
139-
# depending on the screen resolution. Currently this modal window does
140-
# not have the ability to vertically scroll, so the scroll_into_view
141-
# method will not work. There is an open ticket for the scrolling issue:
142-
# ENG-3740.
143-
cancel_button = driver.find_element_by_css_selector(
144-
'button[data-test-new-registration-modal-cancel-button]'
145-
)
146-
ActionChains(driver).move_to_element(cancel_button).perform()
147-
cancel_button.click()
133+
create_registration_modal.cancel_button.click()
148134
# Verify the modal window has closed
149135
assert create_registration_modal.modal_window.absent()
150136

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

0 commit comments

Comments
 (0)