Lines 1-50
Link Here
|
1 |
import { mount } from "@cypress/vue" |
1 |
import { mount } from "@cypress/vue"; |
2 |
import { data } from "cypress/types/jquery" |
2 |
import { data } from "cypress/types/jquery"; |
3 |
|
3 |
|
4 |
const dayjs = require("dayjs") |
4 |
const dayjs = require("dayjs"); |
5 |
|
5 |
|
6 |
const dates = { |
6 |
const dates = { |
7 |
today_iso: dayjs().format("YYYY-MM-DD"), |
7 |
today_iso: dayjs().format("YYYY-MM-DD"), |
8 |
today_us: dayjs().format("MM/DD/YYYY"), |
8 |
today_us: dayjs().format("MM/DD/YYYY"), |
9 |
tomorrow_iso: dayjs().add(1, "day").format("YYYY-MM-DD"), |
9 |
tomorrow_iso: dayjs().add(1, "day").format("YYYY-MM-DD"), |
10 |
tomorrow_us: dayjs().add(1, "day").format("MM/DD/YYYY"), |
10 |
tomorrow_us: dayjs().add(1, "day").format("MM/DD/YYYY"), |
11 |
} |
11 |
}; |
12 |
|
12 |
|
13 |
describe("Data provider CRUD operations", () => { |
13 |
describe("Data provider CRUD operations", () => { |
14 |
beforeEach(() => { |
14 |
beforeEach(() => { |
15 |
cy.login() |
15 |
cy.login(); |
16 |
cy.title().should("eq", "Koha staff interface") |
16 |
cy.title().should("eq", "Koha staff interface"); |
17 |
cy.intercept( |
17 |
cy.intercept( |
18 |
"GET", |
18 |
"GET", |
19 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
19 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
20 |
'{"value":"1"}' |
20 |
'{"value":"1"}' |
21 |
) |
21 |
); |
22 |
cy.intercept( |
22 |
cy.intercept( |
23 |
"GET", |
23 |
"GET", |
24 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
24 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
25 |
'{"value":"local"}' |
25 |
'{"value":"local"}' |
26 |
) |
26 |
); |
27 |
}) |
27 |
}); |
28 |
|
28 |
|
29 |
it("Should list providers", () => { |
29 |
it("Should list providers", () => { |
30 |
// GET usage_data_providers returns 500 |
30 |
// GET usage_data_providers returns 500 |
31 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
31 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
32 |
statusCode: 500, |
32 |
statusCode: 500, |
33 |
error: "Something went wrong", |
33 |
error: "Something went wrong", |
34 |
}) |
34 |
}); |
35 |
cy.visit("/cgi-bin/koha/erm/erm.pl") |
35 |
cy.visit("/cgi-bin/koha/erm/erm.pl"); |
36 |
cy.get("#navmenulist").contains("Data providers").click() |
36 |
cy.get("#navmenulist").contains("Data providers").click(); |
37 |
cy.get("main div[class='dialog alert']").contains( |
37 |
cy.get("main div[class='dialog alert']").contains( |
38 |
/Something went wrong/ |
38 |
/Something went wrong/ |
39 |
) |
39 |
); |
40 |
|
40 |
|
41 |
// GET usage_data_providers returns empty list |
41 |
// GET usage_data_providers returns empty list |
42 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", []) |
42 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", []); |
43 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
43 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
44 |
cy.get("#usage_data_providers_list").contains("There are no usage data providers defined") |
44 |
cy.get("#usage_data_providers_list").contains( |
|
|
45 |
"There are no usage data providers defined" |
46 |
); |
45 |
|
47 |
|
46 |
const dataProvider = cy.get_usage_data_provider() |
48 |
const dataProvider = cy.get_usage_data_provider(); |
47 |
const dataProviders = [dataProvider] |
49 |
const dataProviders = [dataProvider]; |
48 |
|
50 |
|
49 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
51 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
50 |
statusCode: 200, |
52 |
statusCode: 200, |
Lines 53-147
describe("Data provider CRUD operations", () => {
Link Here
|
53 |
"X-Base-Total-Count": "1", |
55 |
"X-Base-Total-Count": "1", |
54 |
"X-Total-Count": "1", |
56 |
"X-Total-Count": "1", |
55 |
}, |
57 |
}, |
56 |
}) |
58 |
}); |
57 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider) |
59 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider); |
58 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
60 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
59 |
cy.get("#usage_data_providers_list").contains("Showing 1 to 1 of 1 entries") |
61 |
cy.get("#usage_data_providers_list").contains( |
60 |
}) |
62 |
"Showing 1 to 1 of 1 entries" |
|
|
63 |
); |
64 |
}); |
61 |
|
65 |
|
62 |
it("Should add provider", () => { |
66 |
it("Should add provider", () => { |
63 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
67 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
64 |
cy.contains("New data provider").click() |
68 |
cy.contains("New data provider").click(); |
65 |
cy.get("#data_providers_add h2").contains("New usage data provider") |
69 |
cy.get("#data_providers_add h2").contains("New usage data provider"); |
66 |
|
70 |
|
67 |
const dataProvider = cy.get_usage_data_provider() |
71 |
const dataProvider = cy.get_usage_data_provider(); |
68 |
|
72 |
|
69 |
cy.get("#data_providers_add").contains("Submit").click() |
73 |
cy.get("#data_providers_add").contains("Submit").click(); |
70 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
74 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
71 |
"have.length", |
75 |
"have.length", |
72 |
6 |
76 |
6 |
73 |
) |
77 |
); |
74 |
|
78 |
|
75 |
// Fill in text inputs |
79 |
// Fill in text inputs |
76 |
cy.get("#usage_data_provider_name").type(dataProvider.name) |
80 |
cy.get("#usage_data_provider_name").type(dataProvider.name); |
77 |
cy.get("#usage_data_provider_description").type(dataProvider.description) |
81 |
cy.get("#usage_data_provider_description").type( |
78 |
cy.get("#usage_data_provider_service_type").type(dataProvider.service_type) |
82 |
dataProvider.description |
79 |
cy.get("#usage_data_provider_service_url").type(dataProvider.service_url) |
83 |
); |
80 |
cy.get("#usage_data_provider_report_release").type(dataProvider.report_release) |
84 |
cy.get("#usage_data_provider_service_type").type( |
81 |
cy.get("#usage_data_provider_customer_id").type(dataProvider.customer_id) |
85 |
dataProvider.service_type |
82 |
cy.get("#usage_data_provider_requestor_id").type(dataProvider.requestor_id) |
86 |
); |
83 |
cy.get("#usage_data_provider_api_key").type(dataProvider.api_key) |
87 |
cy.get("#usage_data_provider_service_url").type( |
84 |
cy.get("#usage_data_provider_requestor_name").type(dataProvider.requestor_name) |
88 |
dataProvider.service_url |
85 |
cy.get("#usage_data_provider_requestor_email").type(dataProvider.requestor_email) |
89 |
); |
86 |
|
90 |
cy.get("#usage_data_provider_report_release").type( |
87 |
cy.get("#data_providers_add").contains("Submit").click() |
91 |
dataProvider.report_release |
|
|
92 |
); |
93 |
cy.get("#usage_data_provider_customer_id").type( |
94 |
dataProvider.customer_id |
95 |
); |
96 |
cy.get("#usage_data_provider_requestor_id").type( |
97 |
dataProvider.requestor_id |
98 |
); |
99 |
cy.get("#usage_data_provider_api_key").type(dataProvider.api_key); |
100 |
cy.get("#usage_data_provider_requestor_name").type( |
101 |
dataProvider.requestor_name |
102 |
); |
103 |
cy.get("#usage_data_provider_requestor_email").type( |
104 |
dataProvider.requestor_email |
105 |
); |
106 |
|
107 |
cy.get("#data_providers_add").contains("Submit").click(); |
88 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
108 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
89 |
"have.length", |
109 |
"have.length", |
90 |
1 |
110 |
1 |
91 |
) |
111 |
); |
92 |
|
112 |
|
93 |
// Fill in status and report types |
113 |
// Fill in status and report types |
94 |
cy.get("#harvester_status .vs__search").type( |
114 |
cy.get("#harvester_status .vs__search").type( |
95 |
dataProvider.active + "{enter}", |
115 |
dataProvider.active + "{enter}", |
96 |
{ force: true } |
116 |
{ force: true } |
97 |
) |
117 |
); |
98 |
cy.get("#report_type .vs__search").type( |
118 |
cy.get("#report_type .vs__search").type( |
99 |
dataProvider.report_types.slice(0, -1) + "{enter}", |
119 |
dataProvider.report_types.slice(0, -1) + "{enter}", |
100 |
{ force: true } |
120 |
{ force: true } |
101 |
) |
121 |
); |
102 |
|
122 |
|
103 |
// Fill in start and end dates |
123 |
// Fill in start and end dates |
104 |
cy.get("#usage_data_provider_begin_date+input").click() |
124 |
cy.get("#usage_data_provider_begin_date+input").click(); |
105 |
cy.get(".flatpickr-calendar") |
125 |
cy.get(".flatpickr-calendar") |
106 |
.eq(1) |
126 |
.eq(1) |
107 |
.find("span.today") |
127 |
.find("span.today") |
108 |
.click({ force: true }) |
128 |
.click({ force: true }); |
109 |
cy.get("#usage_data_provider_end_date+input").click() |
129 |
cy.get("#usage_data_provider_end_date+input").click(); |
110 |
cy.get(".flatpickr-calendar") |
130 |
cy.get(".flatpickr-calendar") |
111 |
.eq(1) |
131 |
.eq(1) |
112 |
.find("span.today") |
132 |
.find("span.today") |
113 |
.next("span") |
133 |
.next("span") |
114 |
.click({ force: true }) |
134 |
.click({ force: true }); |
115 |
|
135 |
|
116 |
// Submit the form, get 500 |
136 |
// Submit the form, get 500 |
117 |
cy.intercept("POST", "/api/v1/erm/usage_data_providers", { |
137 |
cy.intercept("POST", "/api/v1/erm/usage_data_providers", { |
118 |
statusCode: 500, |
138 |
statusCode: 500, |
119 |
error: "Something went wrong", |
139 |
error: "Something went wrong", |
120 |
}) |
140 |
}); |
121 |
cy.get("#data_providers_add").contains("Submit").click() |
141 |
cy.get("#data_providers_add").contains("Submit").click(); |
122 |
cy.get("main div[class='dialog alert']").contains( |
142 |
cy.get("main div[class='dialog alert']").contains( |
123 |
"Something went wrong: Error: Internal Server Error" |
143 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
124 |
) |
144 |
); |
125 |
|
145 |
|
126 |
// Submit the form, success! |
146 |
// Submit the form, success! |
127 |
cy.intercept("POST", "/api/v1/erm/usage_data_providers", { |
147 |
cy.intercept("POST", "/api/v1/erm/usage_data_providers", { |
128 |
statusCode: 201, |
148 |
statusCode: 201, |
129 |
body: dataProvider, |
149 |
body: dataProvider, |
130 |
}) |
150 |
}); |
131 |
cy.get("#data_providers_add").contains("Submit").click() |
151 |
cy.get("#data_providers_add").contains("Submit").click(); |
132 |
cy.get("main div[class='dialog message']").contains( |
152 |
cy.get("main div[class='dialog message']").contains( |
133 |
"Data provider created" |
153 |
"Data provider created" |
134 |
) |
154 |
); |
135 |
|
155 |
|
136 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
156 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
137 |
statusCode: 200, |
157 |
statusCode: 200, |
138 |
body: [dataProvider], |
158 |
body: [dataProvider], |
139 |
}) |
159 |
}); |
140 |
}) |
160 |
}); |
141 |
|
161 |
|
142 |
it("Should edit provider", () => { |
162 |
it("Should edit provider", () => { |
143 |
const dataProvider = cy.get_usage_data_provider() |
163 |
const dataProvider = cy.get_usage_data_provider(); |
144 |
const dataProviders = [dataProvider] |
164 |
const dataProviders = [dataProvider]; |
145 |
|
165 |
|
146 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
166 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
147 |
statusCode: 200, |
167 |
statusCode: 200, |
Lines 150-203
describe("Data provider CRUD operations", () => {
Link Here
|
150 |
"X-Base-Total-Count": "1", |
170 |
"X-Base-Total-Count": "1", |
151 |
"X-Total-Count": "1", |
171 |
"X-Total-Count": "1", |
152 |
}, |
172 |
}, |
153 |
}) |
173 |
}); |
154 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider).as( |
174 |
cy.intercept( |
155 |
"get-data-provider" |
175 |
"GET", |
156 |
) |
176 |
"/api/v1/erm/usage_data_providers/*", |
157 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
177 |
dataProvider |
158 |
cy.get("#usage_data_providers_list table tbody tr:first").contains("Edit").click() |
178 |
).as("get-data-provider"); |
159 |
cy.wait("@get-data-provider") |
179 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
160 |
cy.wait(500) // Cypress is too fast! Vue hasn't populated the form yet! |
180 |
cy.get("#usage_data_providers_list table tbody tr:first") |
161 |
cy.get("#data_providers_add h2").contains("Edit usage data provider") |
181 |
.contains("Edit") |
|
|
182 |
.click(); |
183 |
cy.wait("@get-data-provider"); |
184 |
cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! |
185 |
cy.get("#data_providers_add h2").contains("Edit usage data provider"); |
162 |
|
186 |
|
163 |
// Form has been correctly filled in |
187 |
// Form has been correctly filled in |
164 |
cy.get("#usage_data_provider_name").should("have.value", dataProvider.name) |
188 |
cy.get("#usage_data_provider_name").should( |
165 |
cy.get("#usage_data_provider_description").should("have.value", dataProvider.description) |
189 |
"have.value", |
166 |
cy.get("#usage_data_provider_service_type").should("have.value", dataProvider.service_type) |
190 |
dataProvider.name |
167 |
cy.get("#usage_data_provider_service_url").should("have.value", dataProvider.service_url) |
191 |
); |
168 |
cy.get("#usage_data_provider_report_release").should("have.value", dataProvider.report_release) |
192 |
cy.get("#usage_data_provider_description").should( |
169 |
cy.get("#usage_data_provider_customer_id").should("have.value", dataProvider.customer_id) |
193 |
"have.value", |
170 |
cy.get("#usage_data_provider_requestor_id").should("have.value", dataProvider.requestor_id) |
194 |
dataProvider.description |
171 |
cy.get("#usage_data_provider_api_key").should("have.value", dataProvider.api_key) |
195 |
); |
172 |
cy.get("#usage_data_provider_requestor_name").should("have.value", dataProvider.requestor_name) |
196 |
cy.get("#usage_data_provider_service_type").should( |
173 |
cy.get("#usage_data_provider_requestor_email").should("have.value", dataProvider.requestor_email) |
197 |
"have.value", |
174 |
|
198 |
dataProvider.service_type |
175 |
cy.get("#harvester_status .vs__selected").contains("Active") |
199 |
); |
176 |
cy.get("#report_type .vs__selected").contains("TR_J1") |
200 |
cy.get("#usage_data_provider_service_url").should( |
177 |
cy.get("#usage_data_provider_begin_date").invoke("val").should("eq", dates["today_iso"]) |
201 |
"have.value", |
178 |
cy.get("#usage_data_provider_end_date").invoke("val").should("eq", dates["tomorrow_iso"]) |
202 |
dataProvider.service_url |
|
|
203 |
); |
204 |
cy.get("#usage_data_provider_report_release").should( |
205 |
"have.value", |
206 |
dataProvider.report_release |
207 |
); |
208 |
cy.get("#usage_data_provider_customer_id").should( |
209 |
"have.value", |
210 |
dataProvider.customer_id |
211 |
); |
212 |
cy.get("#usage_data_provider_requestor_id").should( |
213 |
"have.value", |
214 |
dataProvider.requestor_id |
215 |
); |
216 |
cy.get("#usage_data_provider_api_key").should( |
217 |
"have.value", |
218 |
dataProvider.api_key |
219 |
); |
220 |
cy.get("#usage_data_provider_requestor_name").should( |
221 |
"have.value", |
222 |
dataProvider.requestor_name |
223 |
); |
224 |
cy.get("#usage_data_provider_requestor_email").should( |
225 |
"have.value", |
226 |
dataProvider.requestor_email |
227 |
); |
228 |
|
229 |
cy.get("#harvester_status .vs__selected").contains("Active"); |
230 |
cy.get("#report_type .vs__selected").contains("TR_J1"); |
231 |
cy.get("#usage_data_provider_begin_date") |
232 |
.invoke("val") |
233 |
.should("eq", dates["today_iso"]); |
234 |
cy.get("#usage_data_provider_end_date") |
235 |
.invoke("val") |
236 |
.should("eq", dates["tomorrow_iso"]); |
179 |
|
237 |
|
180 |
// Submit the form, get 500 |
238 |
// Submit the form, get 500 |
181 |
cy.intercept("PUT", "/api/v1/erm/usage_data_providers/*", { |
239 |
cy.intercept("PUT", "/api/v1/erm/usage_data_providers/*", { |
182 |
statusCode: 500, |
240 |
statusCode: 500, |
183 |
error: "Something went wrong", |
241 |
error: "Something went wrong", |
184 |
}) |
242 |
}); |
185 |
cy.get("#data_providers_add").contains("Submit").click() |
243 |
cy.get("#data_providers_add").contains("Submit").click(); |
186 |
cy.get("main div[class='dialog alert']").contains( |
244 |
cy.get("main div[class='dialog alert']").contains( |
187 |
"Something went wrong: Error: Internal Server Error" |
245 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
188 |
) |
246 |
); |
189 |
// Submit the form, success! |
247 |
// Submit the form, success! |
190 |
cy.intercept("PUT", "/api/v1/erm/usage_data_providers/*", { |
248 |
cy.intercept("PUT", "/api/v1/erm/usage_data_providers/*", { |
191 |
statusCode: 200, |
249 |
statusCode: 200, |
192 |
body: dataProvider, |
250 |
body: dataProvider, |
193 |
}) |
251 |
}); |
194 |
cy.get("#data_providers_add").contains("Submit").click() |
252 |
cy.get("#data_providers_add").contains("Submit").click(); |
195 |
cy.get("main div[class='dialog message']").contains("Data provider updated") |
253 |
cy.get("main div[class='dialog message']").contains( |
196 |
}) |
254 |
"Data provider updated" |
|
|
255 |
); |
256 |
}); |
197 |
|
257 |
|
198 |
it("Should show provider", () => { |
258 |
it("Should show provider", () => { |
199 |
const dataProvider = cy.get_usage_data_provider() |
259 |
const dataProvider = cy.get_usage_data_provider(); |
200 |
const dataProviders = [dataProvider] |
260 |
const dataProviders = [dataProvider]; |
201 |
|
261 |
|
202 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
262 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
203 |
statusCode: 200, |
263 |
statusCode: 200, |
Lines 206-233
describe("Data provider CRUD operations", () => {
Link Here
|
206 |
"X-Base-Total-Count": "1", |
266 |
"X-Base-Total-Count": "1", |
207 |
"X-Total-Count": "1", |
267 |
"X-Total-Count": "1", |
208 |
}, |
268 |
}, |
209 |
}) |
269 |
}); |
210 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider).as( |
270 |
cy.intercept( |
211 |
"get-data-provider" |
271 |
"GET", |
212 |
) |
272 |
"/api/v1/erm/usage_data_providers/*", |
213 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
273 |
dataProvider |
|
|
274 |
).as("get-data-provider"); |
275 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
214 |
let name_link = cy.get( |
276 |
let name_link = cy.get( |
215 |
"#usage_data_providers_list table tbody tr:first td:first a" |
277 |
"#usage_data_providers_list table tbody tr:first td:first a" |
216 |
) |
278 |
); |
217 |
name_link.should( |
279 |
name_link.should( |
218 |
"have.text", |
280 |
"have.text", |
219 |
dataProvider.name + " (#" + dataProvider.erm_usage_data_provider_id + ")" |
281 |
dataProvider.name + |
220 |
) |
282 |
" (#" + |
221 |
name_link.click() |
283 |
dataProvider.erm_usage_data_provider_id + |
222 |
cy.wait("@get-data-provider") |
284 |
")" |
223 |
cy.wait(500) // Cypress is too fast! Vue hasn't populated the form yet! |
285 |
); |
224 |
cy.get("#usage_data_providers_show h2").contains("Data provider #" + dataProvider.erm_usage_data_provider_id) |
286 |
name_link.click(); |
225 |
}) |
287 |
cy.wait("@get-data-provider"); |
|
|
288 |
cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! |
289 |
cy.get("#usage_data_providers_show h2").contains( |
290 |
"Data provider #" + dataProvider.erm_usage_data_provider_id |
291 |
); |
292 |
}); |
226 |
|
293 |
|
227 |
it("Should delete provider", () => { |
294 |
it("Should delete provider", () => { |
228 |
const dataProvider = cy.get_usage_data_provider() |
295 |
const dataProvider = cy.get_usage_data_provider(); |
229 |
const dataProviders = [dataProvider] |
296 |
const dataProviders = [dataProvider]; |
230 |
|
297 |
|
231 |
// Click the 'Delete' button from the list |
298 |
// Click the 'Delete' button from the list |
232 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
299 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
233 |
statusCode: 200, |
300 |
statusCode: 200, |
Lines 236-275
describe("Data provider CRUD operations", () => {
Link Here
|
236 |
"X-Base-Total-Count": "1", |
303 |
"X-Base-Total-Count": "1", |
237 |
"X-Total-Count": "1", |
304 |
"X-Total-Count": "1", |
238 |
}, |
305 |
}, |
239 |
}) |
306 |
}); |
240 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider).as( |
307 |
cy.intercept( |
241 |
"get-data-provider" |
308 |
"GET", |
242 |
) |
309 |
"/api/v1/erm/usage_data_providers/*", |
243 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
310 |
dataProvider |
244 |
|
311 |
).as("get-data-provider"); |
245 |
cy.get("#usage_data_providers_list table tbody tr:first").contains("Delete").click() |
312 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
246 |
cy.get(".dialog.alert.confirmation h1").contains("remove this data provider") |
313 |
|
247 |
cy.contains(dataProvider.name) |
314 |
cy.get("#usage_data_providers_list table tbody tr:first") |
248 |
|
315 |
.contains("Delete") |
|
|
316 |
.click(); |
317 |
cy.get(".dialog.alert.confirmation h1").contains( |
318 |
"remove this data provider" |
319 |
); |
320 |
cy.contains(dataProvider.name); |
321 |
|
249 |
// Accept the confirmation dialog, get 500 |
322 |
// Accept the confirmation dialog, get 500 |
250 |
cy.intercept("DELETE", "/api/v1/erm/usage_data_providers/*", { |
323 |
cy.intercept("DELETE", "/api/v1/erm/usage_data_providers/*", { |
251 |
statusCode: 500, |
324 |
statusCode: 500, |
252 |
error: "Something went wrong", |
325 |
error: "Something went wrong", |
253 |
}) |
326 |
}); |
254 |
cy.contains("Yes, delete").click() |
327 |
cy.contains("Yes, delete").click(); |
255 |
cy.get("main div[class='dialog alert']").contains( |
328 |
cy.get("main div[class='dialog alert']").contains( |
256 |
"Something went wrong: Error: Internal Server Error" |
329 |
"Something went wrong: SyntaxError: Unexpected end of JSON input" |
257 |
) |
330 |
); |
258 |
|
331 |
|
259 |
// Accept the confirmation dialog, success! |
332 |
// Accept the confirmation dialog, success! |
260 |
cy.intercept("DELETE", "/api/v1/erm/usage_data_providers/*", { |
333 |
cy.intercept("DELETE", "/api/v1/erm/usage_data_providers/*", { |
261 |
statusCode: 204, |
334 |
statusCode: 204, |
262 |
body: null, |
335 |
body: null, |
263 |
}) |
336 |
}); |
264 |
cy.get("#usage_data_providers_list table tbody tr:first") |
337 |
cy.get("#usage_data_providers_list table tbody tr:first") |
265 |
.contains("Delete") |
338 |
.contains("Delete") |
266 |
.click() |
339 |
.click(); |
267 |
cy.get(".dialog.alert.confirmation h1").contains("remove this data provider") |
340 |
cy.get(".dialog.alert.confirmation h1").contains( |
268 |
cy.contains("Yes, delete").click() |
341 |
"remove this data provider" |
|
|
342 |
); |
343 |
cy.contains("Yes, delete").click(); |
269 |
cy.get("main div[class='dialog message']") |
344 |
cy.get("main div[class='dialog message']") |
270 |
.contains("Data provider") |
345 |
.contains("Data provider") |
271 |
.contains("deleted") |
346 |
.contains("deleted"); |
272 |
|
347 |
|
273 |
// Delete from show |
348 |
// Delete from show |
274 |
// Click the "name" link from the list |
349 |
// Click the "name" link from the list |
275 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
350 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
Lines 279-329
describe("Data provider CRUD operations", () => {
Link Here
|
279 |
"X-Base-Total-Count": "1", |
354 |
"X-Base-Total-Count": "1", |
280 |
"X-Total-Count": "1", |
355 |
"X-Total-Count": "1", |
281 |
}, |
356 |
}, |
282 |
}) |
357 |
}); |
283 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider).as( |
358 |
cy.intercept( |
284 |
"get-data-provider" |
359 |
"GET", |
285 |
) |
360 |
"/api/v1/erm/usage_data_providers/*", |
286 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
361 |
dataProvider |
|
|
362 |
).as("get-data-provider"); |
363 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
287 |
let name_link = cy.get( |
364 |
let name_link = cy.get( |
288 |
"#usage_data_providers_list table tbody tr:first td:first a" |
365 |
"#usage_data_providers_list table tbody tr:first td:first a" |
289 |
) |
366 |
); |
290 |
name_link.should( |
367 |
name_link.should( |
291 |
"have.text", |
368 |
"have.text", |
292 |
dataProvider.name + " (#" + dataProvider.erm_usage_data_provider_id + ")" |
369 |
dataProvider.name + |
293 |
) |
370 |
" (#" + |
294 |
name_link.click() |
371 |
dataProvider.erm_usage_data_provider_id + |
295 |
cy.wait("@get-data-provider") |
372 |
")" |
296 |
cy.wait(500) |
373 |
); |
297 |
cy.get("#usage_data_providers_show h2").contains("Data provider #" + dataProvider.erm_usage_data_provider_id) |
374 |
name_link.click(); |
298 |
|
375 |
cy.wait("@get-data-provider"); |
299 |
cy.get("#usage_data_providers_show .action_links .fa-trash").click() |
376 |
cy.wait(500); |
300 |
cy.get(".dialog.alert.confirmation h1").contains("remove this data provider") |
377 |
cy.get("#usage_data_providers_show h2").contains( |
301 |
cy.contains("Yes, delete").click() |
378 |
"Data provider #" + dataProvider.erm_usage_data_provider_id |
302 |
|
379 |
); |
|
|
380 |
|
381 |
cy.get("#usage_data_providers_show .action_links .fa-trash").click(); |
382 |
cy.get(".dialog.alert.confirmation h1").contains( |
383 |
"remove this data provider" |
384 |
); |
385 |
cy.contains("Yes, delete").click(); |
386 |
|
303 |
//Make sure we return to list after deleting from show |
387 |
//Make sure we return to list after deleting from show |
304 |
cy.get("#usage_data_providers_list table tbody tr:first") |
388 |
cy.get("#usage_data_providers_list table tbody tr:first"); |
305 |
}) |
389 |
}); |
306 |
}) |
390 |
}); |
307 |
|
391 |
|
308 |
describe("Data providers summary", () => { |
392 |
describe("Data providers summary", () => { |
309 |
beforeEach(() => { |
393 |
beforeEach(() => { |
310 |
cy.login() |
394 |
cy.login(); |
311 |
cy.title().should("eq", "Koha staff interface") |
395 |
cy.title().should("eq", "Koha staff interface"); |
312 |
cy.intercept( |
396 |
cy.intercept( |
313 |
"GET", |
397 |
"GET", |
314 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
398 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
315 |
'{"value":"1"}' |
399 |
'{"value":"1"}' |
316 |
) |
400 |
); |
317 |
cy.intercept( |
401 |
cy.intercept( |
318 |
"GET", |
402 |
"GET", |
319 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
403 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
320 |
'{"value":"local"}' |
404 |
'{"value":"local"}' |
321 |
) |
405 |
); |
322 |
}) |
406 |
}); |
323 |
|
407 |
|
324 |
it("Should navigate to the summary page and back to providers list", () => { |
408 |
it("Should navigate to the summary page and back to providers list", () => { |
325 |
const dataProvider = cy.get_usage_data_provider() |
409 |
const dataProvider = cy.get_usage_data_provider(); |
326 |
const dataProviders = [dataProvider] |
410 |
const dataProviders = [dataProvider]; |
327 |
|
411 |
|
328 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
412 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
329 |
statusCode: 200, |
413 |
statusCode: 200, |
Lines 332-351
describe("Data providers summary", () => {
Link Here
|
332 |
"X-Base-Total-Count": "1", |
416 |
"X-Base-Total-Count": "1", |
333 |
"X-Total-Count": "1", |
417 |
"X-Total-Count": "1", |
334 |
}, |
418 |
}, |
335 |
}) |
419 |
}); |
336 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
420 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
337 |
|
|
|
338 |
cy.contains("Data providers summary").click() |
339 |
cy.get("#usage_data_providers_summary").contains("Showing 1 to 1 of 1 entries") |
340 |
|
421 |
|
341 |
cy.contains("Data providers list").click() |
422 |
cy.contains("Data providers summary").click(); |
342 |
cy.get("#usage_data_providers_list").contains("Showing 1 to 1 of 1 entries") |
423 |
cy.get("#usage_data_providers_summary").contains( |
|
|
424 |
"Showing 1 to 1 of 1 entries" |
425 |
); |
343 |
|
426 |
|
344 |
}) |
427 |
cy.contains("Data providers list").click(); |
|
|
428 |
cy.get("#usage_data_providers_list").contains( |
429 |
"Showing 1 to 1 of 1 entries" |
430 |
); |
431 |
}); |
345 |
|
432 |
|
346 |
it("Should correctly display dates", () => { |
433 |
it("Should correctly display dates", () => { |
347 |
const dataProvider = cy.get_usage_data_provider() |
434 |
const dataProvider = cy.get_usage_data_provider(); |
348 |
const dataProviders = [dataProvider] |
435 |
const dataProviders = [dataProvider]; |
349 |
|
436 |
|
350 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
437 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
351 |
statusCode: 200, |
438 |
statusCode: 200, |
Lines 354-407
describe("Data providers summary", () => {
Link Here
|
354 |
"X-Base-Total-Count": "1", |
441 |
"X-Base-Total-Count": "1", |
355 |
"X-Total-Count": "1", |
442 |
"X-Total-Count": "1", |
356 |
}, |
443 |
}, |
357 |
}) |
444 |
}); |
358 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
445 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
359 |
|
446 |
|
360 |
cy.contains("Data providers summary").click() |
447 |
cy.contains("Data providers summary").click(); |
361 |
|
448 |
|
362 |
// Check provider name |
449 |
// Check provider name |
363 |
cy.get("#usage_data_providers_summary table tbody tr:first td:first").should( |
450 |
cy.get( |
364 |
"have.text", |
451 |
"#usage_data_providers_summary table tbody tr:first td:first" |
365 |
dataProvider.name |
452 |
).should("have.text", dataProvider.name); |
366 |
) |
|
|
367 |
|
453 |
|
368 |
// Check start and end dates |
454 |
// Check start and end dates |
369 |
const startDate = dataProvider.counter_files[0].date_uploaded.substr(0,10) |
455 |
const startDate = dataProvider.counter_files[0].date_uploaded.substr( |
370 |
const endDate = dataProvider.counter_files[1].date_uploaded.substr(0,10) |
456 |
0, |
371 |
|
457 |
10 |
372 |
cy.get("#usage_data_providers_summary table tbody tr:first td:nth-child(2)").should( |
458 |
); |
373 |
"have.text", |
459 |
const endDate = dataProvider.counter_files[1].date_uploaded.substr( |
374 |
startDate |
460 |
0, |
375 |
) |
461 |
10 |
376 |
cy.get("#usage_data_providers_summary table tbody tr:first td:nth-child(3)").should( |
462 |
); |
377 |
"have.text", |
463 |
|
378 |
endDate |
464 |
cy.get( |
379 |
) |
465 |
"#usage_data_providers_summary table tbody tr:first td:nth-child(2)" |
|
|
466 |
).should("have.text", startDate); |
467 |
cy.get( |
468 |
"#usage_data_providers_summary table tbody tr:first td:nth-child(3)" |
469 |
).should("have.text", endDate); |
380 |
// Check "Not run" harvests |
470 |
// Check "Not run" harvests |
381 |
cy.get("#usage_data_providers_summary table tbody tr:first td:nth-child(4)").should( |
471 |
cy.get( |
382 |
"have.text", |
472 |
"#usage_data_providers_summary table tbody tr:first td:nth-child(4)" |
383 |
"Not run" |
473 |
).should("have.text", "Not run"); |
384 |
) |
474 |
}); |
385 |
}) |
475 |
}); |
386 |
}) |
|
|
387 |
|
476 |
|
388 |
describe("Data provider tab options", () => { |
477 |
describe("Data provider tab options", () => { |
389 |
beforeEach(() => { |
478 |
beforeEach(() => { |
390 |
cy.login() |
479 |
cy.login(); |
391 |
cy.title().should("eq", "Koha staff interface") |
480 |
cy.title().should("eq", "Koha staff interface"); |
392 |
cy.intercept( |
481 |
cy.intercept( |
393 |
"GET", |
482 |
"GET", |
394 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
483 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", |
395 |
'{"value":"1"}' |
484 |
'{"value":"1"}' |
396 |
) |
485 |
); |
397 |
cy.intercept( |
486 |
cy.intercept( |
398 |
"GET", |
487 |
"GET", |
399 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
488 |
"/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", |
400 |
'{"value":"local"}' |
489 |
'{"value":"local"}' |
401 |
) |
490 |
); |
402 |
|
491 |
|
403 |
const dataProvider = cy.get_usage_data_provider() |
492 |
const dataProvider = cy.get_usage_data_provider(); |
404 |
const dataProviders = [dataProvider] |
493 |
const dataProviders = [dataProvider]; |
405 |
|
494 |
|
406 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
495 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { |
407 |
statusCode: 200, |
496 |
statusCode: 200, |
Lines 410-457
describe("Data provider tab options", () => {
Link Here
|
410 |
"X-Base-Total-Count": "1", |
499 |
"X-Base-Total-Count": "1", |
411 |
"X-Total-Count": "1", |
500 |
"X-Total-Count": "1", |
412 |
}, |
501 |
}, |
413 |
}) |
502 |
}); |
414 |
cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider).as( |
503 |
cy.intercept( |
415 |
"get-data-provider" |
504 |
"GET", |
416 |
) |
505 |
"/api/v1/erm/usage_data_providers/*", |
417 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers") |
506 |
dataProvider |
|
|
507 |
).as("get-data-provider"); |
508 |
cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); |
418 |
let name_link = cy.get( |
509 |
let name_link = cy.get( |
419 |
"#usage_data_providers_list table tbody tr:first td:first a" |
510 |
"#usage_data_providers_list table tbody tr:first td:first a" |
420 |
) |
511 |
); |
421 |
name_link.should( |
512 |
name_link.should( |
422 |
"have.text", |
513 |
"have.text", |
423 |
dataProvider.name + " (#" + dataProvider.erm_usage_data_provider_id + ")" |
514 |
dataProvider.name + |
424 |
) |
515 |
" (#" + |
425 |
name_link.click() |
516 |
dataProvider.erm_usage_data_provider_id + |
426 |
cy.wait("@get-data-provider") |
517 |
")" |
427 |
cy.wait(500) |
518 |
); |
428 |
}) |
519 |
name_link.click(); |
|
|
520 |
cy.wait("@get-data-provider"); |
521 |
cy.wait(500); |
522 |
}); |
429 |
|
523 |
|
430 |
it("Should display provider details", () => { |
524 |
it("Should display provider details", () => { |
431 |
const dataProvider = cy.get_usage_data_provider() |
525 |
const dataProvider = cy.get_usage_data_provider(); |
432 |
const dataProviders = [dataProvider] |
526 |
const dataProviders = [dataProvider]; |
433 |
|
527 |
|
434 |
cy.get("#usage_data_providers_show > div.tab-content > div > legend:nth-child(1)").should( |
528 |
cy.get( |
435 |
"have.text", |
529 |
"#usage_data_providers_show > div.tab-content > div > legend:nth-child(1)" |
436 |
"Data provider" |
530 |
).should("have.text", "Data provider"); |
437 |
) |
|
|
438 |
|
531 |
|
439 |
//Page should be populated correctly |
532 |
//Page should be populated correctly |
440 |
cy.get("#usage_data_provider_name").should("have.text", dataProvider.name) |
533 |
cy.get("#usage_data_provider_name").should( |
441 |
cy.get("#usage_data_provider_description").should("have.text", dataProvider.description) |
534 |
"have.text", |
442 |
cy.get("#usage_data_provider_service_type").should("have.text", dataProvider.service_type) |
535 |
dataProvider.name |
443 |
cy.get("#usage_data_provider_service_url").should("have.text", dataProvider.service_url) |
536 |
); |
444 |
cy.get("#usage_data_provider_report_release").should("have.text", dataProvider.report_release) |
537 |
cy.get("#usage_data_provider_description").should( |
445 |
cy.get("#usage_data_provider_customer_id").should("have.text", dataProvider.customer_id) |
538 |
"have.text", |
446 |
cy.get("#usage_data_provider_requestor_id").should("have.text", dataProvider.requestor_id) |
539 |
dataProvider.description |
447 |
cy.get("#usage_data_provider_api_key").should("have.text", dataProvider.api_key) |
540 |
); |
448 |
cy.get("#usage_data_provider_requestor_name").should("have.text", dataProvider.requestor_name) |
541 |
cy.get("#usage_data_provider_service_type").should( |
449 |
cy.get("#usage_data_provider_requestor_email").should("have.text", dataProvider.requestor_email) |
542 |
"have.text", |
450 |
cy.get("#harvester_status").should("have.text", dataProvider.active ? "Active" : "Inactive") |
543 |
dataProvider.service_type |
451 |
cy.get("#report_type").should("have.text", dataProvider.report_types) |
544 |
); |
452 |
cy.get("#usage_data_provider_begin_date").should("have.text", dataProvider.begin_date) |
545 |
cy.get("#usage_data_provider_service_url").should( |
453 |
cy.get("#usage_data_provider_end_date").should("have.text", dataProvider.end_date) |
546 |
"have.text", |
454 |
}) |
547 |
dataProvider.service_url |
|
|
548 |
); |
549 |
cy.get("#usage_data_provider_report_release").should( |
550 |
"have.text", |
551 |
dataProvider.report_release |
552 |
); |
553 |
cy.get("#usage_data_provider_customer_id").should( |
554 |
"have.text", |
555 |
dataProvider.customer_id |
556 |
); |
557 |
cy.get("#usage_data_provider_requestor_id").should( |
558 |
"have.text", |
559 |
dataProvider.requestor_id |
560 |
); |
561 |
cy.get("#usage_data_provider_api_key").should( |
562 |
"have.text", |
563 |
dataProvider.api_key |
564 |
); |
565 |
cy.get("#usage_data_provider_requestor_name").should( |
566 |
"have.text", |
567 |
dataProvider.requestor_name |
568 |
); |
569 |
cy.get("#usage_data_provider_requestor_email").should( |
570 |
"have.text", |
571 |
dataProvider.requestor_email |
572 |
); |
573 |
cy.get("#harvester_status").should( |
574 |
"have.text", |
575 |
dataProvider.active ? "Active" : "Inactive" |
576 |
); |
577 |
cy.get("#report_type").should("have.text", dataProvider.report_types); |
578 |
cy.get("#usage_data_provider_begin_date").should( |
579 |
"have.text", |
580 |
dataProvider.begin_date |
581 |
); |
582 |
cy.get("#usage_data_provider_end_date").should( |
583 |
"have.text", |
584 |
dataProvider.end_date |
585 |
); |
586 |
}); |
455 |
|
587 |
|
456 |
it("Should display titles", () => { |
588 |
it("Should display titles", () => { |
457 |
cy.intercept("GET", "/api/v1/erm/usage_titles*", { |
589 |
cy.intercept("GET", "/api/v1/erm/usage_titles*", { |
Lines 461-477
describe("Data provider tab options", () => {
Link Here
|
461 |
"X-Base-Total-Count": "0", |
593 |
"X-Base-Total-Count": "0", |
462 |
"X-Total-Count": "0", |
594 |
"X-Total-Count": "0", |
463 |
}, |
595 |
}, |
464 |
}) |
596 |
}); |
465 |
|
597 |
|
466 |
cy.get("#usage_data_providerstabs").contains("Titles").click() |
598 |
cy.get("#usage_data_providerstabs").contains("Titles").click(); |
467 |
cy.get("main div[class='dialog message']").should( |
599 |
cy.get("main div[class='dialog message']").should( |
468 |
"have.text", "No title data has been harvested for this provider" |
600 |
"have.text", |
469 |
) |
601 |
"No title data has been harvested for this provider" |
|
|
602 |
); |
603 |
|
604 |
cy.get("#usage_data_providerstabs").contains("Detail").click(); |
470 |
|
605 |
|
471 |
cy.get("#usage_data_providerstabs").contains("Detail").click() |
606 |
const title = cy.get_usage_title(); |
472 |
|
607 |
const titles = [title]; |
473 |
const title = cy.get_usage_title() |
|
|
474 |
const titles = [title] |
475 |
cy.intercept("GET", "/api/v1/erm/usage_titles*", { |
608 |
cy.intercept("GET", "/api/v1/erm/usage_titles*", { |
476 |
statusCode: 200, |
609 |
statusCode: 200, |
477 |
body: titles, |
610 |
body: titles, |
Lines 479-500
describe("Data provider tab options", () => {
Link Here
|
479 |
"X-Base-Total-Count": "1", |
612 |
"X-Base-Total-Count": "1", |
480 |
"X-Total-Count": "1", |
613 |
"X-Total-Count": "1", |
481 |
}, |
614 |
}, |
482 |
}) |
615 |
}); |
483 |
|
616 |
|
484 |
cy.get("#usage_data_providerstabs").contains("Titles").click() |
617 |
cy.get("#usage_data_providerstabs").contains("Titles").click(); |
485 |
cy.get("#titles_list").contains("Showing 1 to 1 of 1 entries") |
618 |
cy.get("#titles_list").contains("Showing 1 to 1 of 1 entries"); |
486 |
}) |
619 |
}); |
487 |
|
620 |
|
488 |
it("Should allow manual file upload", () => { |
621 |
it("Should allow manual file upload", () => { |
489 |
cy.get("#usage_data_providerstabs").contains("Manual upload").click() |
622 |
cy.get("#usage_data_providerstabs").contains("Manual upload").click(); |
490 |
cy.get("#files h2").should("have.text", "Manual upload:") |
623 |
cy.get("#files h2").should("have.text", "Manual upload:"); |
491 |
|
624 |
|
492 |
cy.get("#import_file").click() |
625 |
cy.get("#import_file").click(); |
493 |
cy.get("#import_file").selectFile( |
626 |
cy.get("#import_file").selectFile("t/cypress/fixtures/file.json"); |
494 |
"t/cypress/fixtures/file.json" |
627 |
cy.get("#files .file_information span").contains("file.json"); |
495 |
) |
628 |
}); |
496 |
cy.get("#files .file_information span").contains("file.json") |
|
|
497 |
}) |
498 |
|
629 |
|
499 |
it("Should display import logs", () => { |
630 |
it("Should display import logs", () => { |
500 |
cy.intercept("GET", "/api/v1/erm/counter_files*", { |
631 |
cy.intercept("GET", "/api/v1/erm/counter_files*", { |
Lines 504-519
describe("Data provider tab options", () => {
Link Here
|
504 |
"X-Base-Total-Count": "0", |
635 |
"X-Base-Total-Count": "0", |
505 |
"X-Total-Count": "0", |
636 |
"X-Total-Count": "0", |
506 |
}, |
637 |
}, |
507 |
}) |
638 |
}); |
508 |
cy.get("#usage_data_providerstabs").contains("Import logs").click() |
639 |
cy.get("#usage_data_providerstabs").contains("Import logs").click(); |
509 |
cy.get("main div[class='dialog message']").should( |
640 |
cy.get("main div[class='dialog message']").should( |
510 |
"have.text", "There are no import logs defined" |
641 |
"have.text", |
511 |
) |
642 |
"There are no import logs defined" |
|
|
643 |
); |
644 |
|
645 |
cy.get("#usage_data_providerstabs").contains("Detail").click(); |
512 |
|
646 |
|
513 |
cy.get("#usage_data_providerstabs").contains("Detail").click() |
647 |
const counter_file = cy.get_counter_file(); |
514 |
|
648 |
const counter_files = [counter_file]; |
515 |
const counter_file = cy.get_counter_file() |
|
|
516 |
const counter_files = [counter_file] |
517 |
cy.intercept("GET", "/api/v1/erm/counter_files*", { |
649 |
cy.intercept("GET", "/api/v1/erm/counter_files*", { |
518 |
statusCode: 200, |
650 |
statusCode: 200, |
519 |
body: counter_files, |
651 |
body: counter_files, |
Lines 521-529
describe("Data provider tab options", () => {
Link Here
|
521 |
"X-Base-Total-Count": "1", |
653 |
"X-Base-Total-Count": "1", |
522 |
"X-Total-Count": "1", |
654 |
"X-Total-Count": "1", |
523 |
}, |
655 |
}, |
524 |
}) |
656 |
}); |
525 |
|
657 |
|
526 |
cy.get("#usage_data_providerstabs").contains("Import logs").click() |
658 |
cy.get("#usage_data_providerstabs").contains("Import logs").click(); |
527 |
cy.get("#counter_logs_list").contains("Showing 1 to 1 of 1 entries") |
659 |
cy.get("#counter_logs_list").contains("Showing 1 to 1 of 1 entries"); |
528 |
}) |
660 |
}); |
529 |
}) |
661 |
}); |