@@ -59,104 +59,12 @@ class PreprintLandingPage(BasePreprintPage):
59
59
'[data-analytics-scope="preprints landing page"]' ,
60
60
settings .LONG_TIMEOUT ,
61
61
)
62
- add_preprint_button = Locator (
63
- By .CLASS_NAME , '[data-analytics-name="Add a preprint"]' , settings .LONG_TIMEOUT
64
- )
65
- search_button = Locator (By .CSS_SELECTOR , '[data-analytics-name="Search"]' )
66
- submit_button = Locator (By .CSS_SELECTOR , '[data-test-submit-button]' )
67
62
68
63
69
64
class PreprintSubmitPage (BasePreprintPage ):
70
65
url_addition = 'submit'
71
66
72
67
identity = Locator (By .CLASS_NAME , 'preprint-submit-header' )
73
- select_a_service_help_text = Locator (
74
- By .CSS_SELECTOR , 'dl[class="dl-horizontal dl-description"]'
75
- )
76
- select_a_service_save_button = Locator (
77
- By .CSS_SELECTOR , '#preprint-form-server button.btn.btn-primary'
78
- )
79
-
80
- upload_from_existing_project_button = Locator (
81
- By .XPATH , '//button[text()="Select from an existing OSF project"]'
82
- )
83
- upload_project_selector = Locator (
84
- By .CSS_SELECTOR , 'span[class="ember-power-select-placeholder"]'
85
- )
86
- upload_project_selector_input = Locator (
87
- By .CSS_SELECTOR , 'input[class="ember-power-select-search-input"]'
88
- )
89
- upload_project_help_text = Locator (
90
- By .CSS_SELECTOR , '.ember-power-select-option--search-message'
91
- )
92
- upload_project_selector_project = Locator (
93
- By .CSS_SELECTOR , '.ember-power-select-option'
94
- )
95
- upload_select_file = Locator (By .CSS_SELECTOR , '.file-browser-item > a:nth-child(2)' )
96
- upload_file_save_continue = Locator (
97
- By .CSS_SELECTOR ,
98
- 'div[class="p-t-xs pull-right"] > button[class="btn btn-primary"]' ,
99
- )
100
-
101
- # Author Assertions
102
- public_available_button = Locator (
103
- By .ID , 'hasDataLinksAvailable' , settings .QUICK_TIMEOUT
104
- )
105
- public_data_input = Locator (
106
- By .CSS_SELECTOR , '[data-test-multiple-textbox-index] > input'
107
- )
108
- preregistration_no_button = Locator (By .ID , 'hasPreregLinksNo' )
109
- preregistration_input = Locator (By .NAME , 'whyNoPrereg' )
110
- save_author_assertions = Locator (
111
- By .CSS_SELECTOR , '[data-test-author-assertions-continue]'
112
- )
113
-
114
- basics_license_dropdown = Locator (
115
- By .CSS_SELECTOR , 'select[class="form-control"]' , settings .LONG_TIMEOUT
116
- )
117
- basics_tags_section = Locator (By .CSS_SELECTOR , '#preprint-form-basics .tagsinput' )
118
- basics_tags_input = Locator (
119
- By .CSS_SELECTOR , '#preprint-form-basics .tagsinput input'
120
- )
121
- basics_abstract_input = Locator (By .NAME , 'basicsAbstract' )
122
- basics_save_button = Locator (By .CSS_SELECTOR , '#preprint-form-basics .btn-primary' )
123
-
124
- first_discipline = Locator (
125
- By .CSS_SELECTOR , 'ul[role="listbox"] > li:nth-child(2)' , settings .QUICK_TIMEOUT
126
- )
127
- discipline_save_button = Locator (
128
- By .CSS_SELECTOR , '#preprint-form-subjects .btn-primary'
129
- )
130
-
131
- authors_save_button = Locator (
132
- By .CSS_SELECTOR , '#preprint-form-authors .btn-primary' , settings .QUICK_TIMEOUT
133
- )
134
-
135
- conflict_of_interest_yes = Locator (By .ID , 'coiYes' , settings .QUICK_TIMEOUT )
136
- conflict_of_interest_no = Locator (By .ID , 'coiNo' , settings .QUICK_TIMEOUT )
137
- no_coi_text_box = Locator (
138
- By .CSS_SELECTOR , '[data-test-has-no-coi]' , settings .QUICK_TIMEOUT
139
- )
140
- coi_save_button = Locator (By .CSS_SELECTOR , '[data-test-coi-continue]' )
141
-
142
- supplemental_create_new_project = Locator (
143
- By .CSS_SELECTOR ,
144
- 'div[class="start"] > div[class="row"] > div:nth-child(2)' ,
145
- settings .QUICK_TIMEOUT ,
146
- )
147
- supplemental_save_button = Locator (
148
- By .CSS_SELECTOR , '#supplemental-materials .btn-primary'
149
- )
150
-
151
- create_preprint_button = Locator (
152
- By .CSS_SELECTOR ,
153
- '.preprint-submit-body .submit-section > div > button.btn.btn-success.btn-md.m-t-md.pull-right' ,
154
- )
155
- modal_create_preprint_button = Locator (
156
- By .CSS_SELECTOR ,
157
- '.modal-footer button.btn-success:nth-child(2)' ,
158
- settings .LONG_TIMEOUT ,
159
- )
160
68
161
69
162
70
class PreprintEditPage (GuidBasePage , BasePreprintPage ):
@@ -167,46 +75,6 @@ class PreprintEditPage(GuidBasePage, BasePreprintPage):
167
75
By .CSS_SELECTOR , '.m-t-md.preprint-header-preview > p:nth-child(1) > em.m-r-md'
168
76
)
169
77
basics_section = Locator (By .ID , 'preprint-form-basics' )
170
- basics_tags_section = Locator (By .CSS_SELECTOR , '#preprint-form-basics .tagsinput' )
171
- basics_tags_input = Locator (
172
- By .CSS_SELECTOR , '#preprint-form-basics .tagsinput input'
173
- )
174
- basics_save_button = Locator (By .CSS_SELECTOR , '#preprint-form-basics .btn-primary' )
175
- basics_section_changes_saved_indicator = Locator (
176
- By .CSS_SELECTOR ,
177
- '#preprint-form-basics > header > div.preprint-section-status.pull-right > span.text-success.' ,
178
- )
179
- discipline_section = Locator (By .ID , 'preprint-form-subjects' )
180
- discipline_save_button = Locator (
181
- By .CSS_SELECTOR , '#preprint-form-subjects .btn-primary'
182
- )
183
- authors_save_button = Locator (
184
- By .CSS_SELECTOR , '#preprint-form-authors .btn-primary' , settings .QUICK_TIMEOUT
185
- )
186
- return_to_preprint_button = Locator (
187
- By .CSS_SELECTOR ,
188
- 'div.submit-section > div > button.btn.btn-default.btn-md.m-t-md.pull-right' ,
189
- )
190
- withdraw_preprint_button = Locator (
191
- By .CSS_SELECTOR ,
192
- 'div.submit-section > div > button.btn.btn-danger.btn-md.m-t-md.pull-right' ,
193
- )
194
-
195
- # Group Locators
196
- primary_subjects = GroupLocator (
197
- By .CSS_SELECTOR ,
198
- '#preprint-form-subjects > div > div > div:nth-child(2) > div:nth-child(1) > ul > li' ,
199
- )
200
-
201
- def select_primary_subject_by_name (self , subject_name ):
202
- """Select a subject from the first box in the Discipline section (i.e. 'primary'
203
- subject). This function would need to be modified or another separate function
204
- created to select from either of the 2 secondary subject boxes.
205
- """
206
- for subject in self .primary_subjects :
207
- if subject .text == subject_name :
208
- subject .click ()
209
- break
210
78
211
79
212
80
class PreprintWithdrawPage (GuidBasePage , BasePreprintPage ):
@@ -217,11 +85,6 @@ class PreprintWithdrawPage(GuidBasePage, BasePreprintPage):
217
85
By .CSS_SELECTOR ,
218
86
'section.preprint-form-block.preprint-form-section-withdraw-comment' ,
219
87
)
220
- reason_for_withdrawal_textarea = Locator (By .NAME , 'explanation' )
221
- request_withdrawal_button = Locator (
222
- By .CSS_SELECTOR ,
223
- 'div.submit-section > button.btn.btn-danger.btn-md.m-t-md.pull-right' ,
224
- )
225
88
226
89
227
90
@pytest .mark .usefixtures ('must_be_logged_in' )
@@ -232,17 +95,6 @@ class PreprintDiscoverPage(BasePreprintPage):
232
95
By .CSS_SELECTOR , 'a[data-test-topbar-object-type-link="Preprints"]'
233
96
)
234
97
loading_indicator = Locator (By .CSS_SELECTOR , '.ball-scale' )
235
- search_box = Locator (By .CSS_SELECTOR , 'input[data-test-search-input]' )
236
- sort_button = Locator (By .CSS_SELECTOR , 'div[data-test-topbar-sort-dropdown]' )
237
- sort_option_newest_to_oldest = Locator (
238
- By .CSS_SELECTOR , '#sortByOptionList > li:nth-child(3) > button'
239
- )
240
-
241
- # Group Locators
242
- search_results = GroupLocator (By .CSS_SELECTOR , 'div[data-test-search-result-card]' )
243
- sort_options = GroupLocator (
244
- By .CSS_SELECTOR , 'ul[class="ember-power-select-options"]'
245
- )
246
98
247
99
248
100
@pytest .mark .usefixtures ('must_be_logged_in' )
@@ -251,15 +103,6 @@ class BrandedPreprintsDiscoverPage(BasePreprintPage):
251
103
252
104
identity = Locator (By .CSS_SELECTOR , '[data-test-search-provider-logo]' )
253
105
loading_indicator = Locator (By .CSS_SELECTOR , '.ball-scale' )
254
- search_box = Locator (By .CSS_SELECTOR , 'input[data-test-search-input]' )
255
- sort_button = Locator (By .CSS_SELECTOR , 'div[data-test-topbar-sort-dropdown]' )
256
- sort_option_newest_to_oldest = Locator (
257
- By .CSS_SELECTOR , '#sortByOptionList > li:nth-child(3) > button'
258
- )
259
- no_results = Locator (By .CSS_SELECTOR , 'div[_no-results_fvrbco]' )
260
-
261
- # Group Locators
262
- search_results = GroupLocator (By .CSS_SELECTOR , 'div[data-test-search-result-card]' )
263
106
264
107
265
108
class PreprintDetailPage (GuidBasePage , BasePreprintPage ):
@@ -274,31 +117,6 @@ class PreprintDetailPage(GuidBasePage, BasePreprintPage):
274
117
By .CSS_SELECTOR , 'h1[data-test-preprint-title]' , settings .LONG_TIMEOUT
275
118
)
276
119
view_page = Locator (By .ID , 'view-page' )
277
- views_count = Locator (By .CSS_SELECTOR , '[data-test-view-count]' )
278
- downloads_count = Locator (By .CSS_SELECTOR , '[data-test-download-count]' )
279
- download_button = Locator (By .CSS_SELECTOR , '[data-test-download-button]' )
280
- edit_preprint_button = Locator (By .CSS_SELECTOR , 'div[class="edit-preprint-button"]' )
281
- default_citation = Locator (By .CSS_SELECTOR , '[data-test-default-citation="apa"]' )
282
-
283
- # Locators for the reviews app preprint detail page
284
- status = Locator (By .CSS_SELECTOR , 'span._status-badge_7ivjq4' )
285
- status_explanation = Locator (By .CSS_SELECTOR , 'div.status-explanation' )
286
- withdraw_reason = Locator (By .CSS_SELECTOR , '[data-test-withdrawal-justification]' )
287
- make_decision_button = Locator (
288
- By .CSS_SELECTOR , 'button.btn.dropdown-toggle.btn-success'
289
- )
290
- accept_radio_button = Locator (By .CSS_SELECTOR , 'input[value="accepted"]' )
291
- reject_radio_button = Locator (By .CSS_SELECTOR , 'input[value="rejected"]' )
292
- withdraw_radio_button = Locator (By .CSS_SELECTOR , 'input[value="withdrawn"]' )
293
- reason_textarea = Locator (By .CSS_SELECTOR , 'textarea.form-control.ember-text-area' )
294
- submit_decision_button = Locator (By .ID , 'submit-btn' )
295
-
296
- # Group Locators
297
- subjects = GroupLocator (
298
- By .CSS_SELECTOR ,
299
- '[class="subject-preview"]' ,
300
- )
301
- tags = GroupLocator (By .CSS_SELECTOR , 'div.tag-section.p-t-xs > span' )
302
120
303
121
304
122
class PendingPreprintDetailPage (PreprintDetailPage ):
@@ -317,29 +135,6 @@ class ReviewsDashboardPage(OSFBasePage):
317
135
url = settings .OSF_HOME + '/reviews'
318
136
identity = Locator (By .CLASS_NAME , '_reviews-dashboard-header_jdu5ey' )
319
137
loading_indicator = Locator (By .CSS_SELECTOR , '.ball-scale' )
320
- provider_group_links = GroupLocator (
321
- By .CSS_SELECTOR , 'li._provider-links-component_gp8jcl'
322
- )
323
-
324
- def click_provider_group_link (self , provider_name , link_name ):
325
- """Search through the Provider Groups in the sidebar on the right side of the
326
- Reviews Dashboard page to find the group with the given provider_name. When
327
- the provider group is found, then search through the links in the group for the
328
- given link_name. Click this link when found.
329
- """
330
- for provider_group in self .provider_group_links :
331
- group_name = provider_group .find_element_by_css_selector (
332
- 'span._provider-name_gp8jcl'
333
- )
334
- if provider_name == group_name .text :
335
- links = provider_group .find_elements_by_css_selector (
336
- 'ul._provider-links_gp8jcl > li > a'
337
- )
338
- for link in links :
339
- if link_name in link .text :
340
- link .click ()
341
- break
342
- break
343
138
344
139
345
140
class BaseReviewsPage (OSFBasePage ):
@@ -402,19 +197,6 @@ class ReviewsWithdrawalsPage(BaseReviewsPage):
402
197
url_addition = 'withdrawals'
403
198
identity = Locator (By .CLASS_NAME , '_reviews-list-heading_k45x8p' )
404
199
loading_indicator = Locator (By .CSS_SELECTOR , '.ball-scale' )
405
- requests = GroupLocator (By .CSS_SELECTOR , 'div._moderation-list-row_17iwzt' )
406
-
407
- def click_requests_row (self , provider_id , preprint_id ):
408
- """Search through the rows of requests on the Reviews Withdrawal Requests
409
- page to find the preprint that has the given preprint_id in its url. When the
410
- row is found click it to open the Preprint Detail page for that preprint.
411
- """
412
- for row in self .requests :
413
- url = row .find_element_by_css_selector ('a' ).get_attribute ('href' )
414
- node_id = url .split (provider_id + '/' , 1 )[1 ]
415
- if node_id == preprint_id :
416
- row .find_element_by_css_selector ('div[title]' ).click ()
417
- break
418
200
419
201
420
202
class ReviewsModeratorsPage (BaseReviewsPage ):
0 commit comments