Bug 35574: Tidy
[koha.git] / t / cypress / support / e2e.js
1 // ***********************************************
2 // This example commands.js shows you how to
3 // create various custom commands and overwrite
4 // existing commands.
5 //
6 // For more comprehensive examples of custom
7 // commands please read more here:
8 // https://on.cypress.io/custom-commands
9 // ***********************************************
10 //
11 //
12 // -- This is a parent command --
13 // Cypress.Commands.add('login', (email, password) => { ... })
14 //
15 //
16 // -- This is a child command --
17 // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18 //
19 //
20 // -- This is a dual command --
21 // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22 //
23 //
24 // -- This will overwrite an existing command --
25 // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
26
27 function get_fallback_login_value(param) {
28
29     var env_var = param == 'username' ? 'KOHA_USER' : 'KOHA_PASS';
30
31     return typeof Cypress.env(env_var) === 'undefined' ? 'koha' : Cypress.env(env_var);
32 }
33
34 Cypress.Commands.add('login', (username, password) => {
35     var user = typeof username === 'undefined' ? get_fallback_login_value('username') : username;
36     var pass = typeof password === 'undefined' ? get_fallback_login_value('password') : password;
37     cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1')
38     cy.get("#userid").type(user)
39     cy.get("#password").type(pass)
40     cy.get("#submit-button").click()
41 })
42
43 Cypress.Commands.add('left_menu_active_item_is', (label) => {
44     cy.get("#navmenulist a.current:not(.disabled)").should('have.length',1).contains(label);
45 })
46 const dayjs = require("dayjs") /* Cannot use our calendar JS code, it's in an include file (!)
47                                    Also note that moment.js is deprecated */
48
49 const dates = {
50     today_iso: dayjs().format("YYYY-MM-DD"),
51     today_us: dayjs().format("MM/DD/YYYY"),
52     tomorrow_iso: dayjs().add(1, "day").format("YYYY-MM-DD"),
53     tomorrow_us: dayjs().add(1, "day").format("MM/DD/YYYY"),
54 }
55
56 cy.get_title = () => {
57     return {
58         access_type: "access type",
59         biblio_id: null,
60         coverage_depth: "coverage depth",
61         date_first_issue_online: "date first",
62         date_last_issue_online: "date last",
63         date_monograph_published_online: "date mono online",
64         date_monograph_published_print: "date mono print",
65         embargo_info: "embargo info",
66         external_id: "",
67         first_author: "first author",
68         first_editor: "first editor",
69         monograph_edition: "monograph edition",
70         monograph_volume: "monograph volume",
71         notes: "notes",
72         num_first_issue_online: "num first issue",
73         num_first_vol_online: "num first vol",
74         num_last_issue_online: "num last issue",
75         num_last_vol_online: "num last vol",
76         online_identifier: "online identifier",
77         parent_publication_title_id: "parent id",
78         preceding_publication_title_id: "preceeding id",
79         print_identifier: "print identifier",
80         publication_title: "publication title",
81         publication_type: "journal",
82         publisher_name: "publication name",
83         resources: [
84             {
85                 ended_on: null,
86                 package: {
87                     content_type: "",
88                     package_id: 1,
89                     name: "first package name"
90                 },
91                 package_id: 1,
92                 resource_id: 2,
93                 title: {
94                     biblio_id: 439,
95                     title_id: 1,
96                 },
97                 title_id: 1
98             }
99         ],
100         title_id: 1,
101         title_url: "title url"
102       };
103 }
104
105 cy.get_agreements_to_relate = () => {
106     return [
107         {
108             agreement_id: 2,
109             description: "a second agreement",
110             name: "second agreement name"
111         },
112         {
113             agreement_id: 3,
114             description: "a third agreement",
115             name: "third agreement name"
116         },
117         {
118             agreement_id: 4,
119             description: "a fourth agreement",
120             name: "fourth agreement name"
121         },
122     ]
123 }
124
125 cy.get_vendors_to_relate = () => {
126     return [
127         {
128             "id": 1,
129             "name": "My Vendor",
130             "aliases": [],
131         },
132         {
133             "id": 2,
134             "name": "My Vendor 2",
135             "aliases": [
136                 {"alias": "alias", alias_id: 1, vendor_id: 2}
137             ],
138         }
139     ]
140 }
141 cy.get_counter_file = () => {
142     return {
143             "date_uploaded": "2023-06-19T09:13:39+00:00",
144             "erm_counter_files_id": 1,
145             "file_content": "Report_Name,\"Journal Requests (Excluding OA_Gold)\"\r\nReport_ID,TR_J1\r\nRelease,5\r\nInstitution_Name,\"University Of West London\"\r\nInstitution_ID,\"Proprietary:Wiley:EAL00000122866; ISNI:0000000121857124\"\r\nMetric_Types,\"Total_Item_Requests; Unique_Item_Requests\"\r\nReport_Filters,\"Metric_Type:Total_Item_Requests|Unique_Item_Requests; Access_Type:Controlled; End_Date:2023-06-01; Begin_Date:2022-01-01; Data_Type:Journal; Access_Method:Regular\"\r\nReport_Attributes,\r\nExceptions,\"3031: Usage Not Ready for Requested Dates (Requested data between 2023-06-01 and 2023-06-01. However only data between 2018-11-01 and 2023-05-31 exists.)\"\r\nReporting_Period,\"Begin_Date=2022-01-01; End_Date=2023-06-01\"\r\nCreated,2023-06-19T02:13:31Z\r\nCreated_By,\"Atypon Systems LLC.\"\r\n\r\nTitle,Publisher,Publisher_ID,Platform,DOI,Proprietary_ID,Print_ISSN,Online_ISSN,URI,Metric_Type,Reporting_Period_Total,\"Jan 2022\",\"Feb 2022\",\"Mar 2022\",\"Apr 2022\",\"May 2022\",\"Jun 2022\",\"Jul 2022\",\"Aug 2022\",\"Sep 2022\",\"Oct 2022\",\"Nov 2022\",\"Dez 2022\",\"Jan 2023\",\"Feb 2023\",\"Mar 2023\",\"Apr 2023\",\"May 2023\",\"Jun 2023\"\r\n\"AEM Education and Training\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)2472-5390,Wiley:AET2,2472-5390,2472-5390,,Total_Item_Requests,16,1,3,0,1,3,1,0,2,1,0,0,1,0,3,0,0,0,0\r\n\"AEM Education and Training\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)2472-5390,Wiley:AET2,2472-5390,2472-5390,,Unique_Item_Requests,10,1,2,0,1,1,1,0,1,1,0,0,1,0,1,0,0,0,0\r\n\"AIChE Journal\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)1547-5905,Wiley:AIC,0001-1541,1547-5905,,Total_Item_Requests,4,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0\r\n\"AIChE Journal\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)1547-5905,Wiley:AIC,0001-1541,1547-5905,,Unique_Item_Requests,4,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0\r\n\"ANZ Journal of Surgery\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1445-2197,Wiley:ANS,1445-1433,1445-2197,,Total_Item_Requests,103,11,2,20,14,8,2,9,1,0,5,6,0,2,4,6,5,8,0\r\n\"ANZ Journal of Surgery\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1445-2197,Wiley:ANS,1445-1433,1445-2197,,Unique_Item_Requests,77,9,2,16,8,6,1,9,1,0,3,4,0,1,4,4,2,7,0\r\n\"AORN Journal\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)1878-0369,Wiley:AORN,0001-2092,1878-0369,,Total_Item_Requests,634,71,45,59,20,43,47,45,11,14,15,31,22,29,18,28,39,97,0\r\n\"AORN Journal\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)1878-0369,Wiley:AORN,0001-2092,1878-0369,,Unique_Item_Requests,436,53,27,27,15,34,30,30,6,11,13,22,17,23,16,26,26,60,0\r\nAPMIS,Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0463,Wiley:APM,0903-4641,1600-0463,,Total_Item_Requests,6,0,0,0,1,0,0,0,2,0,0,0,2,0,1,0,0,0,0\r\nAPMIS,Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0463,Wiley:APM,0903-4641,1600-0463,,Unique_Item_Requests,4,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0\r\n\"AWWA Water Science\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)2577-8161,Wiley:AWS2,,2577-8161,,Total_Item_Requests,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0\r\n\"AWWA Water Science\",Wiley,0000000403801313,\"Wiley Online Library\",10.1002/(ISSN)2577-8161,Wiley:AWS2,,2577-8161,,Unique_Item_Requests,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0\r\nAbacus,Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1467-6281,Wiley:ABAC,0001-3072,1467-6281,,Total_Item_Requests,51,3,0,7,0,2,0,1,0,0,0,11,6,0,3,17,1,0,0\r\nAbacus,Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1467-6281,Wiley:ABAC,0001-3072,1467-6281,,Unique_Item_Requests,36,2,0,6,0,2,0,1,0,0,0,7,2,0,2,13,1,0,0\r\n\"Academic Emergency Medicine\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1553-2712,Wiley:ACEM,1069-6563,1553-2712,,Total_Item_Requests,213,18,16,11,13,21,20,28,16,6,11,2,4,18,17,1,7,4,0\r\n\"Academic Emergency Medicine\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1553-2712,Wiley:ACEM,1069-6563,1553-2712,,Unique_Item_Requests,159,15,11,10,10,15,13,23,12,6,7,2,2,10,12,1,7,3,0\r\n\"Accounting & Finance\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1467-629X,Wiley:ACFI,0810-5391,1467-629X,,Total_Item_Requests,67,2,4,4,13,8,1,0,2,2,1,9,6,2,0,2,4,7,0\r\n\"Accounting & Finance\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1467-629X,Wiley:ACFI,0810-5391,1467-629X,,Unique_Item_Requests,53,1,4,4,11,7,1,0,2,1,1,7,3,1,0,2,4,4,0\r\n\"Accounting Perspectives\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1911-3838,Wiley:APR,1911-382X,1911-3838,,Total_Item_Requests,19,0,0,2,1,3,0,1,0,0,0,0,0,3,1,0,4,4,0\r\n\"Accounting Perspectives\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1911-3838,Wiley:APR,1911-382X,1911-3838,,Unique_Item_Requests,14,0,0,1,1,1,0,1,0,0,0,0,0,2,1,0,4,3,0\r\n\"Acta Anaesthesiologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1399-6576,Wiley:AAS,0001-5172,1399-6576,,Total_Item_Requests,181,29,20,19,5,15,4,19,6,5,6,4,0,3,29,1,12,4,0\r\n\"Acta Anaesthesiologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1399-6576,Wiley:AAS,0001-5172,1399-6576,,Unique_Item_Requests,117,21,12,11,4,10,4,14,3,5,4,4,0,2,14,1,4,4,0\r\n\"Acta Neurologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0404,Wiley:ANE,0001-6314,1600-0404,,Total_Item_Requests,23,0,0,2,0,5,0,1,1,0,2,2,0,2,1,5,2,0,0\r\n\"Acta Neurologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0404,Wiley:ANE,0001-6314,1600-0404,,Unique_Item_Requests,21,0,0,2,0,4,0,1,1,0,1,2,0,2,1,5,2,0,0\r\n\"Acta Obstetricia et Gynecologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0412,Wiley:AOGS,0001-6349,1600-0412,,Total_Item_Requests,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,4,2,0\r\n\"Acta Obstetricia et Gynecologica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0412,Wiley:AOGS,0001-6349,1600-0412,,Unique_Item_Requests,11,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,2,1,0\r\n\"Acta Ophthalmologica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1755-3768,Wiley:AOS,1755-375X,1755-3768,,Total_Item_Requests,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0\r\n\"Acta Ophthalmologica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1755-3768,Wiley:AOS,1755-375X,1755-3768,,Unique_Item_Requests,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0\r\n\"Acta Paediatrica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1651-2227,Wiley:APA,0803-5253,1651-2227,,Total_Item_Requests,229,23,26,14,12,8,45,22,6,10,8,3,9,7,8,11,9,8,0\r\n\"Acta Paediatrica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1651-2227,Wiley:APA,0803-5253,1651-2227,,Unique_Item_Requests,165,16,19,8,8,8,37,11,6,7,6,3,8,6,7,7,3,5,0\r\n\"Acta Physiologica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1748-1716,Wiley:APHA,1748-1708,1748-1716,,Total_Item_Requests,13,2,0,0,1,1,8,0,0,0,0,0,0,0,1,0,0,0,0\r\n\"Acta Physiologica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1748-1716,Wiley:APHA,1748-1708,1748-1716,,Unique_Item_Requests,12,2,0,0,1,1,7,0,0,0,0,0,0,0,1,0,0,0,0\r\n\"Acta Psychiatrica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0447,Wiley:ACPS,0001-690X,1600-0447,,Total_Item_Requests,226,5,9,28,28,15,18,4,1,2,4,13,14,24,8,20,21,12,0\r\n\"Acta Psychiatrica Scandinavica\",Wiley,0000000403801313,\"Wiley Online Library\",10.1111/(ISSN)1600-0447,Wiley:ACPS,0001-690X,1600-0447,,Unique_Item_Requests,178,4,5,19,23,10,17,3,1,1,4,13,10,19,6,18,14,11,0\r\n",
146             "filename": "PTFS Journals_TR_J1",
147             "type": "TR_J1",
148             "usage_data_provider_id": 1,
149             "counter_logs": [
150                 {
151                     "borrowernumber": null,
152                     "counter_files_id": 2,
153                     "erm_counter_log_id": 2,
154                     "filename": "PTFS Journals_TR_J1",
155                     "importdate": "2023-06-19T09:40:46+00:00",
156                     "logdetails": null
157                 }
158             ]
159         }
160       
161 }
162
163 cy.get_usage_data_provider = () => {
164     return   {
165         "active": 1,
166         "aggregator": "test_aggregator",
167         "api_key": '12345',
168         "begin_date": dates['today_iso'],
169         "customer_id": "12345",
170         "description": "A data provider for cypress testing",
171         "end_date": dates['tomorrow_iso'],
172         "erm_usage_data_provider_id": 1,
173         "method": "test",
174         "name": "Wiley Online Library",
175         "report_release": "test_report_release",
176         "report_types": "TR_J1;",
177         "requestor_email": "test_requestor_email",
178         "requestor_id": "12345",
179         "requestor_name": "test_requestor_name",
180         "service_type": "test_service_type",
181         "service_url": "www.url.com",
182         "counter_files": [
183             {
184                 "type": "TR_J1",
185                 "date_uploaded": dates['today_iso']
186             },
187             {
188                 "type": "TR_J1",
189                 "date_uploaded": dates['tomorrow_iso']
190             },
191
192         ],
193         "earliest_title": "2023-01-01",
194         "latest_title": "2023-01-01",
195         "earliest_item": "",
196         "latest_item": "",
197         "earliest_platform": "2023-01-01",
198         "latest_platform": "2023-01-01",
199         "earliest_database": "",
200         "latest_database": "",
201         "last_run": "2023-10-01"
202     }
203 }
204
205 cy.get_usage_title = () => {
206     return [
207         {
208           "online_issn": "2472-5390",
209           "print_issn": "2472-5390",
210           "publisher": "Wiley",
211           "publisher_id": "0000000403801313",
212           "title": "AEM Education and Training",
213           "title_doi": "10.1002/(ISSN)2472-5390",
214           "title_id": 1338,
215           "title_uri": "",
216           "usage_data_provider_id": 5
217         }
218     ]
219 }
220
221 cy.get_default_report = () => {
222     const params = {
223         "url": "/api/v1/erm/usage_titles/monthly_report?q=[{\"erm_usage_muses.year\":2022,\"erm_usage_muses.report_type\":\"TR_J1\",\"erm_usage_muses.month\":[1,2,3,4,5,6,7,8,9,10,11,12],\"erm_usage_muses.metric_type\":[\"Total_Item_Requests\",\"Unique_Item_Requests\"]},{\"erm_usage_muses.year\":2023,\"erm_usage_muses.report_type\":\"TR_J1\",\"erm_usage_muses.month\":[1,2,3,4,5,6,7,8,9,10,11,12],\"erm_usage_muses.metric_type\":[\"Total_Item_Requests\",\"Unique_Item_Requests\"]}]",
224         "columns": [1],
225         "queryObject": {
226             "data_display": "monthly",
227             "report_type": "TR_J1",
228             "metric_types": [
229                 "Total_Item_Requests",
230                 "Unique_Item_Requests"
231             ],
232             "usage_data_providers": null,
233             "titles": null,
234             "start_month": null,
235             "start_year": "2022",
236             "end_month": null,
237             "end_year": "2023"
238         },
239         "yearly_filter": true,
240         "type": "monthly",
241         "tp_columns": {
242             "2022": [
243                 {
244                     "short": "Jan",
245                     "description": "January",
246                     "value": 1,
247                     "active": true
248                 },
249                 {
250                     "short": "Feb",
251                     "description": "February",
252                     "value": 2,
253                     "active": true
254                 },
255                 {
256                     "short": "Mar",
257                     "description": "March",
258                     "value": 3,
259                     "active": true
260                 },
261                 {
262                     "short": "Apr",
263                     "description": "April",
264                     "value": 4,
265                     "active": true
266                 },
267                 {
268                     "short": "May",
269                     "description": "May",
270                     "value": 5,
271                     "active": true
272                 },
273                 {
274                     "short": "Jun",
275                     "description": "June",
276                     "value": 6,
277                     "active": true
278                 },
279                 {
280                     "short": "Jul",
281                     "description": "July",
282                     "value": 7,
283                     "active": true
284                 },
285                 {
286                     "short": "Aug",
287                     "description": "August",
288                     "value": 8,
289                     "active": true
290                 },
291                 {
292                     "short": "Sep",
293                     "description": "September",
294                     "value": 9,
295                     "active": true
296                 },
297                 {
298                     "short": "Oct",
299                     "description": "October",
300                     "value": 10,
301                     "active": true
302                 },
303                 {
304                     "short": "Nov",
305                     "description": "November",
306                     "value": 11,
307                     "active": true
308                 },
309                 {
310                     "short": "Dec",
311                     "description": "December",
312                     "value": 12,
313                     "active": true
314                 }
315             ],
316             "2023": [
317                 {
318                     "short": "Jan",
319                     "description": "January",
320                     "value": 1,
321                     "active": true
322                 },
323                 {
324                     "short": "Feb",
325                     "description": "February",
326                     "value": 2,
327                     "active": true
328                 },
329                 {
330                     "short": "Mar",
331                     "description": "March",
332                     "value": 3,
333                     "active": true
334                 },
335                 {
336                     "short": "Apr",
337                     "description": "April",
338                     "value": 4,
339                     "active": true
340                 },
341                 {
342                     "short": "May",
343                     "description": "May",
344                     "value": 5,
345                     "active": true
346                 },
347                 {
348                     "short": "Jun",
349                     "description": "June",
350                     "value": 6,
351                     "active": true
352                 },
353                 {
354                     "short": "Jul",
355                     "description": "July",
356                     "value": 7,
357                     "active": true
358                 },
359                 {
360                     "short": "Aug",
361                     "description": "August",
362                     "value": 8,
363                     "active": true
364                 },
365                 {
366                     "short": "Sep",
367                     "description": "September",
368                     "value": 9,
369                     "active": true
370                 },
371                 {
372                     "short": "Oct",
373                     "description": "October",
374                     "value": 10,
375                     "active": true
376                 },
377                 {
378                     "short": "Nov",
379                     "description": "November",
380                     "value": 11,
381                     "active": true
382                 },
383                 {
384                     "short": "Dec",
385                     "description": "December",
386                     "value": 12,
387                     "active": true
388                 }
389             ]
390         }
391     }
392
393     return {
394         "erm_default_usage_report_id": 1,
395         "report_name": "Cypress report",
396         "report_url_params": JSON.stringify(params)
397     }
398 }
399
400 cy.get_multiple_providers = () => {
401     return [
402         {
403             "active": 1,
404             "aggregator": "test_aggregator",
405             "api_key": '12345',
406             "customer_id": "12345",
407             "description": "A data provider for cypress testing",
408             "erm_usage_data_provider_id": 1,
409             "method": "test",
410             "name": "Cypress test provider",
411             "report_release": "test_report_release",
412             "report_types": "TR_J1;",
413             "requestor_email": "test_requestor_email",
414             "requestor_id": "12345",
415             "requestor_name": "test_requestor_name",
416             "service_type": "test_service_type",
417             "service_url": "www.url.com",
418         },
419         {
420             "active": 1,
421             "aggregator": "test_aggregator",
422             "api_key": '12345',
423             "begin_date": dates['today_iso'],
424             "customer_id": "12345",
425             "description": "A second provider for reports testing",
426             "end_date": dates['tomorrow_iso'],
427             "erm_usage_data_provider_id": 2,
428             "method": "test",
429             "name": "Second test provider",
430             "report_release": "test_report_release",
431             "report_types": "TR_J1;TR_J2;TR_J3",
432             "requestor_email": "test_requestor_email",
433             "requestor_id": "12345",
434             "requestor_name": "test_requestor_name",
435             "service_type": "test_service_type",
436             "service_url": "www.url.com",
437         },
438     ]
439 }
440
441 cy.getCounterRegistryProvider = () => {
442     return [
443         {
444             "abbrev": "Wiley",
445             "address": "John Wiley & Sons, Inc.\t\nCorporate Headquarters\tSuite 300\n111 River Street\t\nHoboken, NJ 07030-5774\nUSA",
446             "address_country": {
447                 "code": "US",
448                 "name": "United States of America"
449             },
450             "contact": {
451                 "email": "eal@wiley.com",
452                 "form_url": "",
453                 "person": "",
454                 "phone": ""
455             },
456             "content_provider_name": "John Wiley & Sons",
457             "host_types": [
458                 {
459                     "name": "Aggregated_Full_Content"
460                 }
461             ],
462             "id": "60c7aa79-272d-4610-8ad5-c399bd938c8e",
463             "name": "Wiley Online Library",
464             "reports": [
465                 {
466                     "counter_release": "5",
467                     "report_id": "TR_J4",
468                     "report_name": "Title Report - Journal Report 4"
469                 },
470                 {
471                     "counter_release": "5",
472                     "report_id": "DR_D2",
473                     "report_name": "Database Report - Report 2"
474                 },
475                 {
476                     "counter_release": "5",
477                     "report_id": "TR_J3",
478                     "report_name": "Title Report - Journal Report 3"
479                 },
480                 {
481                     "counter_release": "5",
482                     "report_id": "DR_D1",
483                     "report_name": "Database Report - Report 1"
484                 },
485                 {
486                     "counter_release": "5",
487                     "report_id": "TR_J2",
488                     "report_name": "Title Report - Journal Report 2"
489                 },
490                 {
491                     "counter_release": "5",
492                     "report_id": "PR",
493                     "report_name": "Platform Master Report"
494                 },
495                 {
496                     "counter_release": "5",
497                     "report_id": "TR_B2",
498                     "report_name": "Title Report - Book Report 2"
499                 },
500                 {
501                     "counter_release": "5",
502                     "report_id": "TR_B3",
503                     "report_name": "Title Report - Book Report 3"
504                 },
505                 {
506                     "counter_release": "5",
507                     "report_id": "TR",
508                     "report_name": "Title Master Report"
509                 },
510                 {
511                     "counter_release": "5",
512                     "report_id": "TR_B1",
513                     "report_name": "Title Report - Book Report 1"
514                 },
515                 {
516                     "counter_release": "5",
517                     "report_id": "PR_P1",
518                     "report_name": "Platform Report - Report 1"
519                 },
520                 {
521                     "counter_release": "5",
522                     "report_id": "TR_J1",
523                     "report_name": "Title Report - Journal Report 1"
524                 },
525                 {
526                     "counter_release": "5",
527                     "report_id": "DR",
528                     "report_name": "Database Master Report"
529                 }
530             ],
531             "sushi_services": [
532                 {
533                     "counter_release": "5",
534                     "url": "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/101d3199-5878-4421-b9c2-88826bee3ad6\/"
535                 }
536             ],
537             "website": "https:\/\/onlinelibrary.wiley.com\/"
538         }
539     ]
540 }
541
542 cy.getSushiService = () => {
543     return {
544         "api_key_info": "",
545         "api_key_required": false,
546         "contact": {
547             "email": "eal@wiley.com",
548             "form_url": "",
549             "person": "",
550             "phone": ""
551         },
552         "counter_release": "5",
553         "credentials_auto_expire": false,
554         "credentials_auto_expire_info": "",
555         "customer_id_info": "EAL0000123 (EAL followed by 7 to 11 digits)",
556         "customizations_in_place": true,
557         "customizations_info": "Consortia reporting extension",
558         "data_host": "https:\/\/registry.projectcounter.org\/api\/v1\/usage-data-host\/761269a2-27ed-44ce-8a8f-cca4f198c23f\/",
559         "id": "101d3199-5878-4421-b9c2-88826bee3ad6",
560         "ip_address_authorization": false,
561         "ip_address_authorization_info": "",
562         "notification_count": 0,
563         "notifications_url": "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/101d3199-5878-4421-b9c2-88826bee3ad6\/notification\/",
564         "platform_attr_required": false,
565         "platform_specific_info": "",
566         "request_volume_limits_applied": false,
567         "request_volume_limits_info": "",
568         "requestor_id_info": "EAL0000123 (EAL followed by 7 to 11 digits)*\r\n(Only required for those operating outside of their approved institutional IP range).",
569         "requestor_id_required": true,
570         "url": "https:\/\/onlinelibrary.wiley.com\/reports\/"
571     }
572 }