itemengine-cypress-automation 1.0.581-IEI-7178-328dd33.0 → 1.0.582-IEI-7178-6c816dc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -402,4 +402,43 @@ describe('Get Question Data API cases', () => {
|
|
|
402
402
|
.eq(1)
|
|
403
403
|
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": 0,\n \"next_token\": null,\n \"timestamp\": ${timestamp}\n },\n \"data\": []\n}\n`);
|
|
404
404
|
});
|
|
405
|
+
|
|
406
|
+
it('Entering a request for a text selection question type', () => {
|
|
407
|
+
cy.get('textarea[class="body-param__text"]')
|
|
408
|
+
.clear()
|
|
409
|
+
.fill(`{\n "item_references": [],\n "references": [],\n "types": ["text selection"],\n "limit": 1,\n "sort_field": "created",\n "sort": "desc"\n}\n`);
|
|
410
|
+
cy.get('.execute')
|
|
411
|
+
.click();
|
|
412
|
+
cy.wait(2000);
|
|
413
|
+
cy.get('.loading-container')
|
|
414
|
+
.should('not.exist');
|
|
415
|
+
cy.get('td[class="response-col_status"]')
|
|
416
|
+
.eq(0)
|
|
417
|
+
.should('have.text', '200');
|
|
418
|
+
cy.get('td.response-col_description')
|
|
419
|
+
.find('code.language-json')
|
|
420
|
+
.eq(0)
|
|
421
|
+
.invoke('text')
|
|
422
|
+
.then((text) => {
|
|
423
|
+
const jsonResponse = JSON.parse(text);
|
|
424
|
+
expect(jsonResponse.data[0]).to.include.keys(
|
|
425
|
+
'reference',
|
|
426
|
+
'type',
|
|
427
|
+
'content',
|
|
428
|
+
'correct_answer',
|
|
429
|
+
'scoring',
|
|
430
|
+
'settings',
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
expect(jsonResponse.data[0].settings).to.include.keys(
|
|
434
|
+
'additional_settings',
|
|
435
|
+
'print_layout_settings',
|
|
436
|
+
'student_view_settings',
|
|
437
|
+
'style_and_layout_customize_settings',
|
|
438
|
+
'tool_settings',
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
expect(jsonResponse.data[0].type).to.equal('text selection');
|
|
442
|
+
});
|
|
443
|
+
});
|
|
405
444
|
});
|
|
@@ -235,4 +235,57 @@ describe('Set Question Data API cases', () => {
|
|
|
235
235
|
.eq(7)
|
|
236
236
|
.should('have.text',"true");
|
|
237
237
|
});
|
|
238
|
+
|
|
239
|
+
it('Creating text selection question and resource from save API', () => {
|
|
240
|
+
unique_reference_id_1 = uuid();
|
|
241
|
+
unique_reference_id_2 = uuid();
|
|
242
|
+
cy.visit('/item-engine/data-api/item-bank/save-questions');
|
|
243
|
+
cy.get('.try-out__btn')
|
|
244
|
+
.click();
|
|
245
|
+
cy.get('textarea[class="body-param__text"]')
|
|
246
|
+
.clear()
|
|
247
|
+
.fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken0","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
|
|
248
|
+
cy.get('.execute')
|
|
249
|
+
.click();
|
|
250
|
+
cy.wait(2000);
|
|
251
|
+
cy.get('.loading-container')
|
|
252
|
+
.should('not.exist');
|
|
253
|
+
cy.visit('/item-engine/data-api/item-bank/save-resources');
|
|
254
|
+
cy.get('.try-out__btn')
|
|
255
|
+
.click();
|
|
256
|
+
cy.get('textarea[class="body-param__text"]')
|
|
257
|
+
.clear()
|
|
258
|
+
.fill(`{\n "resources": [\n {\n "type": 1,\n "data": {\n "type": "Passage",\n "heading": "Passage created via save resources data API",\n "content": "This is content of the passage"\n },\n "reference": "${unique_reference_id_2}"\n }\n ],\n "organisation_id": "${Cypress.env('organisation_id')}",\n "meta": {\n "user": {\n "id": "dfbb6366-d88d-416d-9d9c-7ee6420817b3",\n "first_name": "fname",\n "last_name": "lname",\n "email": "user@demo.com"\n }\n }\n}\n`);
|
|
259
|
+
cy.get('.execute')
|
|
260
|
+
.click();
|
|
261
|
+
cy.wait(2000);
|
|
262
|
+
cy.get('.loading-container')
|
|
263
|
+
.should('not.exist');
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('Throw validation error while creating text selection question', () => {
|
|
267
|
+
unique_reference_id_1 = uuid();
|
|
268
|
+
cy.visit('/item-engine/data-api/item-bank/save-questions');
|
|
269
|
+
cy.get('.try-out__btn')
|
|
270
|
+
.click();
|
|
271
|
+
cy.get('textarea[class="body-param__text"]')
|
|
272
|
+
.clear()
|
|
273
|
+
.fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken6","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
|
|
274
|
+
cy.get('.execute')
|
|
275
|
+
.click();
|
|
276
|
+
cy.wait(2000);
|
|
277
|
+
cy.get('.loading-container')
|
|
278
|
+
.should('not.exist');
|
|
279
|
+
cy.get('td[class="response-col_status"]')
|
|
280
|
+
.eq(0)
|
|
281
|
+
.should('have.text', '200');
|
|
282
|
+
cy.get('td.response-col_description')
|
|
283
|
+
.find('code.language-json')
|
|
284
|
+
.eq(0)
|
|
285
|
+
.invoke('text')
|
|
286
|
+
.then((text) => {
|
|
287
|
+
const jsonResponse = JSON.parse(text);
|
|
288
|
+
expect(jsonResponse.meta.message).to.equal('Invalid answer "optiontoken6" in question 1. Must match one of the token IDs.');
|
|
289
|
+
});
|
|
290
|
+
});
|
|
238
291
|
});
|