-
Notifications
You must be signed in to change notification settings - Fork 4
/
settings.py
227 lines (201 loc) · 7.14 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
from environs import Env
env = Env()
env.read_env() # Read .env into os.environ, if it exists
domains = {
'stage1': {
'home': 'https://staging.osf.io',
'api': 'https://api.staging.osf.io',
'files': 'https://files.us.staging.osf.io',
'cas': 'https://accounts.staging.osf.io',
'custom_institution_domains': ['https://staging-osf-nd.cos.io'],
},
'stage2': {
'home': 'https://staging2.osf.io',
'api': 'https://api.staging2.osf.io',
'files': 'https://files.us.staging2.osf.io',
'cas': 'https://accounts.staging2.osf.io',
'custom_institution_domains': [],
},
'stage3': {
'home': 'https://staging3.osf.io',
'api': 'https://api.staging3.osf.io',
'files': 'https://files.us.staging3.osf.io',
'cas': 'https://accounts.staging3.osf.io',
'custom_institution_domains': [],
},
'test': {
'home': 'https://test.osf.io',
'api': 'https://api.test.osf.io',
'files': 'https://files.us.test.osf.io',
'cas': 'https://accounts.test.osf.io',
'custom_institution_domains': [],
},
'prod': {
'home': 'https://osf.io',
'api': 'https://api.osf.io',
'files': 'https://files.osf.io',
'cas': 'https://accounts.osf.io',
'custom_institution_domains': [
'https://open.uwstout.edu',
'https://osf.arizona.edu',
'https://osf.asu.edu',
'https://osf.fsu.edu',
'https://osf.jmu.edu',
'https://osf.nd.edu',
'https://osf.nyu.edu',
'https://osf.sc.edu',
'https://osf.uc.edu',
'https://osf.usc.edu',
'https://osf.ucla.edu',
'https://osf.ucr.edu',
'https://osf.wustl.edu',
'https://osf.research.vcu.edu',
],
},
}
DRIVER = env('DRIVER', 'Firefox')
HEADLESS = env.bool('HEADLESS', False)
QUICK_TIMEOUT = env.int('QUICK_TIMEOUT', 4)
TIMEOUT = env.int('TIMEOUT', 10)
LONG_TIMEOUT = env.int('LONG_TIMEOUT', 30)
VERY_LONG_TIMEOUT = env.int('VERY_LONG_TIMEOUT', 60)
DOMAIN = env('DOMAIN', 'stage1')
NEW_USER_EMAIL = env('NEW_USER_EMAIL')
# Preferred node must be set to run tests on production
PREFERRED_NODE = env('PREFERRED_NODE', None)
if DOMAIN == 'prod':
PREFERRED_NODE = env('PREFERRED_NODE')
EXPECTED_PROVIDERS = env.list(
'EXPECTED_PROVIDERS',
[
'bitbucket',
'box',
'dataverse',
'dropbox',
'figshare',
'github',
'gitlab',
'googledrive',
'osfstorage',
'owncloud',
'onedrive',
's3',
],
)
# As of January 24, 2022, the Engineering Archive ('engrxiv') preprint provider
# has switched away from using OSF as their preprint service. Therefore the
# web page that OSF automatically redirects to is no longer based on the OSF
# Preprints landing/discover page design. However, they remain in our active
# preprint provider list in the OSF api due to legal issues that are still being
# worked out. The best guess is that the transition will be completed (and
# engrxiv removed from the api list) by the end of the first quarter of 2022
# (i.e. end of March). So to prevent this test from failing in Production
# every night for 'engrxiv' we are going to skip the following steps for this
# provider.
# UPDATE 10/26/2022 - the status of 'engrxiv' has not changed and now another
# provider - 'ecoevorxiv' is also leaving OSF.
# UPDATE 10/13/2023 - After the Search Improvements project release, OSF and other providers
# that have moved away from OSF now redirect to https://osf.io/search?q=&resourceType=Preprint&q=
providers_leaving_OSF = ['ecoevorxiv', 'engrxiv', 'livedata', 'osf']
non_branded_registries = ['osf', 'assessment']
# Documented failures for branded preprint discover pages
# ENG-5422 CoP Preprints
# ENG-5423 EdArXiv
# ENG-5424 NewAddictionsX
# ENG-5425 SocArXiv
# ENG-5426 Thesis Commons
known_preprints_discover_failures = [
"edarxiv", "coppreprints", "newaddictionsx", "socarxiv", "thesiscommons"
]
# Documented failures for branded preprint landing pages
# ENG-5398 AfricaArXiv
# ENG-5399 ArabiXiv
# ENG-5400 BodoArXiv
# ENG-5401 CoP Preprints
# ENG-5402 ECSarXiv
# ENG-5403 & ENG-5404 EdArXiv
# ENG-5406 Focus Archive
# ENG-5407 FrenXiv
# ENG-5408 IndiaRxiv
# ENG-5409 MarXiv
# ENG-5410 MindRxiv
# ENG-5411 & ENG-5413 NewAddictionsX
# ENG-5414 & ENG-5415 SocArXiv
# ENG-5416 SportRxiv
# ENG-5417 Thesis Commons
known_preprints_landing_failures = [
"africarxiv", "arabixiv", "bodoarxiv", "coppreprints",
"ecsarxiv", "edarxiv", "focusarchive", "frenxiv", "indiarxiv",
"marxiv", "mindrxiv", "newaddictionsx", "socarxiv", "sportrxiv", "thesiscommons"
]
OSF_HOME = domains[DOMAIN]['home']
API_DOMAIN = domains[DOMAIN]['api']
FILE_DOMAIN = domains[DOMAIN]['files']
CAS_DOMAIN = domains[DOMAIN]['cas']
CUSTOM_INSTITUTION_DOMAINS = domains[DOMAIN]['custom_institution_domains']
# Browser capabilities for browserstack testing
caps = {
'chrome': {
'browser': 'Chrome',
'os': 'Windows',
'os_version': '10',
'resolution': '2048x1536',
},
'edge': {
'browser': 'Edge',
'os': 'Windows',
'os_version': '10',
'resolution': '2048x1536',
},
'firefox': {
'browser': 'Firefox',
'os': 'Windows',
'os_version': '10',
'resolution': '2048x1536',
},
}
BUILD = DRIVER
if DRIVER == 'Remote':
BSTACK_USER = env('BSTACK_USER')
BSTACK_KEY = env('BSTACK_KEY')
BUILD = env('TEST_BUILD', 'chrome')
DESIRED_CAP = caps[BUILD]
upper_build = BUILD.upper()
USER_ONE = env('{}_USER'.format(upper_build), env('USER_ONE', ''))
USER_ONE_PASSWORD = env(
'{}_USER_PASSWORD'.format(upper_build), env('USER_ONE_PASSWORD', '')
)
USER_TWO = env('{}_USER_TWO'.format(upper_build), env('USER_TWO', ''))
USER_TWO_PASSWORD = env(
'{}_USER_TWO_PASSWORD'.format(upper_build), env('USER_TWO_PASSWORD', '')
)
else:
USER_ONE = env('USER_ONE')
USER_ONE_PASSWORD = env('USER_ONE_PASSWORD')
USER_TWO = env('USER_TWO')
USER_TWO_PASSWORD = env('USER_TWO_PASSWORD')
# Used to skip certain tests on specific stagings
STAGE1 = DOMAIN == 'stage1'
STAGE2 = DOMAIN == 'stage2'
STAGE3 = DOMAIN == 'stage3'
TEST = DOMAIN == 'test'
PRODUCTION = DOMAIN == 'prod'
# Users for testing CAS login scemarios
DEACTIVATED_USER = env('DEACTIVATED_USER')
DEACTIVATED_USER_PASSWORD = env('DEACTIVATED_USER_PASSWORD')
UNCONFIRMED_USER = env('UNCONFIRMED_USER')
UNCONFIRMED_USER_PASSWORD = env('UNCONFIRMED_USER_PASSWORD')
CAS_2FA_USER = env('CAS_2FA_USER')
CAS_2FA_USER_PASSWORD = env('CAS_2FA_USER_PASSWORD')
CAS_TOS_USER = env('CAS_TOS_USER')
CAS_TOS_USER_PASSWORD = env('CAS_TOS_USER_PASSWORD')
DEVAPP_CLIENT_ID = env('DEVAPP_CLIENT_ID')
DEVAPP_CLIENT_SECRET = env('DEVAPP_CLIENT_SECRET')
# User with IMAP enabled email
IMAP_EMAIL = env('IMAP_EMAIL')
# Password for IMAP enabled email account - NOT OSF password
IMAP_EMAIL_PASSWORD = env('IMAP_EMAIL_PASSWORD')
IMAP_HOST = env('IMAP_HOST')
# User with existing draft registrations
A11Y_REGISTRATIONS_USER = env('A11Y_REGISTRATIONS_USER')
A11Y_REGISTRATIONS_PASSWORD = env('A11Y_REGISTRATIONS_PASSWORD')