1
1
import pytest
2
- from selenium .webdriver .common .action_chains import ActionChains
3
2
4
3
import markers
5
4
from api import osf_api
@@ -131,20 +130,7 @@ def test_create_new_registration_modal(self, driver, registrations_page):
131
130
modal_schema_list .sort ()
132
131
assert api_schema_list == modal_schema_list
133
132
# 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 ()
148
134
# Verify the modal window has closed
149
135
assert create_registration_modal .modal_window .absent ()
150
136
@@ -160,20 +146,7 @@ def test_create_new_draft_registration(self, driver, registrations_page):
160
146
create_registration_modal .select_schema_radio_button (
161
147
schema_name = 'Open-Ended Registration'
162
148
)
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 ()
177
150
# Verify that you are redirected to the Draft Registration Metadata page
178
151
DraftRegistrationMetadataPage (driver , verify = True )
179
152
0 commit comments