itemengine-cypress-automation 1.0.579-IEI-7193-main-6a7df51.0 → 1.0.579-IEI-7046-a317a6b.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.
Files changed (32) hide show
  1. package/cypress/config-files/ilprod.json +1 -2
  2. package/cypress/config-files/ilqa.json +1 -2
  3. package/cypress/config-files/ilstage.json +1 -2
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +123 -8
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +123 -8
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +131 -14
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +138 -9
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +138 -9
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +153 -10
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +138 -9
  11. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +108 -7
  12. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +138 -9
  13. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +0 -17
  14. package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +0 -18
  15. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +0 -19
  16. package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +0 -18
  17. package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +0 -18
  18. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +0 -19
  19. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +0 -17
  20. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +0 -16
  21. package/cypress/e2e/ILC/dataApi/fetchQuestion.js +0 -39
  22. package/cypress/e2e/ILC/dataApi/saveQuestions.js +0 -53
  23. package/cypress/pages/components/ckEditorToolbar.js +0 -20
  24. package/cypress/pages/components/draggableOptionContainer.js +0 -14
  25. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -17
  26. package/cypress/pages/components/optionsWrapperComponent.js +2 -33
  27. package/cypress/pages/components/questionInputFieldComponent.js +2 -18
  28. package/cypress/pages/dragAndDropIntoCategoriesPage.js +38 -0
  29. package/cypress/pages/matchingPage.js +0 -18
  30. package/cypress/pages/numberLineLabelPage.js +0 -1
  31. package/cypress/pages/textSelectionPage.js +1 -17
  32. package/package.json +1 -1
@@ -1,5 +1,8 @@
1
1
  import { dragAndDropIntoCategoriesPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import { showAlternativeAnswersComponent } from "../../../../pages/components";
4
+
5
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
3
6
 
4
7
  describe('Create item page - Drag and drop into categories: Per dropzone with alternative answers', () => {
5
8
  before(() => {
@@ -33,7 +36,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
33
36
  //Failing due to https://redmine.zeuslearning.com/issues/574339
34
37
  // dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
35
38
  dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 30);
36
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
39
+ if (alternativeAnswerCheck) {
40
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
41
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
42
+ {
43
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
44
+ pointsText: '(Points per correct option - 5 points)',
45
+ },
46
+ {
47
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
48
+ pointsText: '(Points per correct option - 3 points)',
49
+ }
50
+ ]);
51
+ } else {
52
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
53
+ }
37
54
  });
38
55
 
39
56
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct icons should be displayed for all correct dropzones proper icon should display beside empty dropzone, correct/incorrect answer status message should not be displayed and correct answer section should not be displayed', () => {
@@ -106,7 +123,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
106
123
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
107
124
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
108
125
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
109
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
126
+ if (alternativeAnswerCheck) {
127
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
128
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
129
+ {
130
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
131
+ pointsText: '(Points per correct option - 5 points)',
132
+ },
133
+ {
134
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
135
+ pointsText: '(Points per correct option - 3 points)',
136
+ }
137
+ ]);
138
+ } else {
139
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
140
+ }
110
141
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
111
142
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
112
143
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct icons should be displayed for all correct dropzones, incorrect icon should be displayed for incorrect dropzones, correct/incorrect answer status message and correct answer section should not be displayed')
@@ -131,7 +162,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
131
162
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
132
163
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
133
164
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
134
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
165
+ if (alternativeAnswerCheck) {
166
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
167
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
168
+ {
169
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
170
+ pointsText: '(Points per correct option - 5 points)',
171
+ },
172
+ {
173
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
174
+ pointsText: '(Points per correct option - 3 points)',
175
+ }
176
+ ]);
177
+ } else {
178
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
179
+ }
135
180
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
136
181
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct icons should be displayed for all correct dropzones, incorrect icon should be displayed for incorrect dropzones, correct/incorrect answer status message and correct answer section should not be displayed')
137
182
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -156,7 +201,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
156
201
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
157
202
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
158
203
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
159
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
204
+ if (alternativeAnswerCheck) {
205
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
206
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
207
+ {
208
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
209
+ pointsText: '(Points per correct option - 5 points)',
210
+ },
211
+ {
212
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
213
+ pointsText: '(Points per correct option - 3 points)',
214
+ }
215
+ ]);
216
+ } else {
217
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
218
+ }
160
219
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
161
220
  /*cy.log('When the user has attempted the question with partially correct such that a dropzone is correctly attempted with both the correct and alternative answer options and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, incorrect icon should be displayed for the dropzone containing options of alternative accordion and correct accordion in the same dropzone, correct/incorrect answer status message and correct answer section should not be displayed')
162
221
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -180,7 +239,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
180
239
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
181
240
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
182
241
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
183
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
242
+ if (alternativeAnswerCheck) {
243
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
244
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
245
+ {
246
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
247
+ pointsText: '(Points per correct option - 5 points)',
248
+ },
249
+ {
250
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
251
+ pointsText: '(Points per correct option - 3 points)',
252
+ }
253
+ ]);
254
+ } else {
255
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
256
+ }
184
257
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
185
258
  /*cy.log('When the user has attempted the question partially correct such that one dropzone is correctly attempted as per the correct accordion and another dropzone is correctly attempted as per the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone, correct/incorrect answer status message and correct answer section should not be displayed')
186
259
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -204,7 +277,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
204
277
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
205
278
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
206
279
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
207
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
280
+ if (alternativeAnswerCheck) {
281
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
282
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
283
+ {
284
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
285
+ pointsText: '(Points per correct option - 5 points)',
286
+ },
287
+ {
288
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
289
+ pointsText: '(Points per correct option - 3 points)',
290
+ }
291
+ ]);
292
+ } else {
293
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
294
+ }
208
295
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
209
296
  /*cy.log('When the user has attempted the question partially correct with only common options across both accordions and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
210
297
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -228,7 +315,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
228
315
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
229
316
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'correct': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
230
317
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
231
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
318
+ if (alternativeAnswerCheck) {
319
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
320
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
321
+ {
322
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
323
+ pointsText: '(Points per correct option - 5 points)',
324
+ },
325
+ {
326
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
327
+ pointsText: '(Points per correct option - 3 points)',
328
+ }
329
+ ]);
330
+ } else {
331
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
332
+ }
232
333
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
233
334
  /*cy.log('When the user has attempted the question partially correct such that equal number of dropzones are correct according to correct accordion and alternative accordion mappings and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
234
335
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -256,7 +357,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
256
357
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(3);
257
358
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'correct': 4, 'correct': 5 });
258
359
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
259
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
360
+ if (alternativeAnswerCheck) {
361
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
362
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
363
+ {
364
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
365
+ pointsText: '(Points per correct option - 5 points)',
366
+ },
367
+ {
368
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
369
+ pointsText: '(Points per correct option - 3 points)',
370
+ }
371
+ ]);
372
+ } else {
373
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
374
+ }
260
375
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
261
376
  /*cy.log('When the user has attempted the question such that more number of dropzones are correct as per the alternative accordion mapping than the correct accordion mapping and points achieved from the alternative accordion mapping is more than the points achieved from correct accordion mapping and clicks on \'Check answer\' button, then correct icon should be displayed besides alternative accordion responses, incorrect icon should be displayed besides the correct accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
262
377
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -291,7 +406,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
291
406
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
292
407
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
293
408
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
294
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
409
+ if (alternativeAnswerCheck) {
410
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
411
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
412
+ {
413
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
414
+ pointsText: '(Points per correct option - 5 points)',
415
+ },
416
+ {
417
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
418
+ pointsText: '(Points per correct option - 3 points)',
419
+ }
420
+ ]);
421
+ } else {
422
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
423
+ }
295
424
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
296
425
  /*cy.log('When the user has attempted the question such that more number of dropzones are correct according to the alternative accordion mapping and points achieved from the correct accordion mapping is equal to the points achieved from alternative accordion mapping and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
297
426
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -3,7 +3,6 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
  const promptArray = ['Land pollution', 'Water pollution', 'Air pollution'];
6
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
7
6
 
8
7
  describe('Create Item page - Matching : Question Instructions and prompt section', () => {
9
8
  before(() => {
@@ -273,22 +272,6 @@ describe('Create Item page - Matching : Question Instructions and prompt section
273
272
  utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
274
273
  });
275
274
 
276
- if (imageExpandEnhancement === 'true') {
277
- it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
278
- matchingPage.steps.switchToEditTab();
279
- matchingPage.steps.clearPromptInputField(0);
280
- matchingPage.steps.focusInPromptInputField(0);
281
- matchingPage.steps.selectImageOptionFromCKEditorToolbar();
282
- matchingPage.steps.addImageToInputField();
283
- matchingPage.steps.switchToPreviewTab();
284
- matchingPage.steps.verifyExpandIconInImage();
285
- matchingPage.steps.clickExpandIconInImage();
286
- utilities.verifyInnerText(matchingPage.closeImagePopup(), 'Close');
287
- matchingPage.steps.closeImagePopup();
288
- matchingPage.steps.verifyExpandIconInImage();
289
- });
290
- }
291
-
292
275
  it('CSS of added prompt in \'Preview\' tab table', { tags: 'css' }, () => {
293
276
  utilities.verifyCSS(matchingPage.promptContainerPreviewTab().find('.question-text-wrapper'), {
294
277
  'color': css.color.text,
@@ -6,7 +6,6 @@ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Stu
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  var itemReferenceID = "";
8
8
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
9
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
10
9
 
11
10
  describe('Create item page - Multiple selection: Preview contents', () => {
12
11
  before(() => {
@@ -92,23 +91,6 @@ describe('Create item page - Multiple selection: Preview contents', () => {
92
91
  multipleSelectionPage.steps.verifyEquationTextInPreviewTab(2);
93
92
  cy.eyesCheckWindow(`Multiple selection - ${view} - Image, Bold Text, and Equation Display`);
94
93
  });
95
- if (imageExpandEnhancement === 'true') {
96
- it('Image expand icon should be visible on the image in option', () => {
97
- multipleSelectionPage.steps.verifyImageInPreviewTab(0);
98
- multipleSelectionPage.steps.verifyExpandIconInImage();
99
- });
100
-
101
- it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
102
- multipleSelectionPage.steps.verifyImageInPreviewTab(0);
103
- multipleSelectionPage.steps.clickExpandIconInImage();
104
- utilities.verifyInnerText(multipleSelectionPage.closeImagePopup(), 'Close');
105
- });
106
-
107
- it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
108
- multipleSelectionPage.steps.closeImagePopup();
109
- multipleSelectionPage.steps.verifyExpandIconInImage();
110
- });
111
- }
112
94
 
113
95
  if (view !== 'Grading view' && view !== 'Correct answer view') {
114
96
  it(`All the options should be in unchecked state`, () => {
@@ -6,7 +6,6 @@ const css = Cypress.env('css');
6
6
  let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
7
7
  const views = utilities.getViews(previewContentViews);
8
8
  var itemReferenceID = "";
9
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
10
9
 
11
10
  describe('Create item page - Multiple selection grid: Preview contents', () => {
12
11
  before(() => {
@@ -95,24 +94,6 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
95
94
  utilities.verifyInnerText(multipleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
96
95
  utilities.verifyElementVisibilityState(multipleSelectionGridPage.questionInstructionsText(), 'visible');
97
96
  });
98
-
99
- if (imageExpandEnhancement === 'true') {
100
- it('Image expand icon should be visible on the image in option', () => {
101
- multipleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
102
- multipleSelectionGridPage.steps.verifyExpandIconInImage();
103
- });
104
-
105
- it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
106
- multipleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
107
- multipleSelectionGridPage.steps.clickExpandIconInImage();
108
- utilities.verifyInnerText(multipleSelectionGridPage.closeImagePopup(), 'Close');
109
- });
110
-
111
- it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
112
- multipleSelectionGridPage.steps.closeImagePopup();
113
- multipleSelectionGridPage.steps.verifyExpandIconInImage();
114
- });
115
- }
116
97
 
117
98
  it(`Multiple selection grid - The question grid as set by the user should be displayed in the ${view}`, () => {
118
99
  multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
@@ -3,7 +3,6 @@ import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
7
6
  const labels = ['Label 1', 'Label 2', 'Label 3']
8
7
  describe('Create Item page - Number line label : Question instructions and label section', () => {
9
8
  before(() => {
@@ -42,23 +41,6 @@ describe('Create Item page - Number line label : Question instructions and label
42
41
  utilities.verifyTextContent(numberLineLabelPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
43
42
  });
44
43
 
45
- if (imageExpandEnhancement === 'true') {
46
- it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
47
- numberLineLabelPage.steps.switchToEditTab();
48
- numberLineLabelPage.steps.clearQuestionInstructionsInputField();
49
- numberLineLabelPage.steps.focusInQuestionInstructionsInputField();
50
- numberLineLabelPage.steps.selectImageOptionFromCKEditorToolbar();
51
- numberLineLabelPage.steps.addImageToInputField();
52
- numberLineLabelPage.steps.focusOutQuestionInstructionsInputField();
53
- numberLineLabelPage.steps.switchToPreviewTab();
54
- numberLineLabelPage.steps.verifyExpandIconInImage();
55
- numberLineLabelPage.steps.clickExpandIconInImage();
56
- utilities.verifyInnerText(numberLineLabelPage.closeImagePopup(), 'Close');
57
- numberLineLabelPage.steps.closeImagePopup();
58
- numberLineLabelPage.steps.verifyExpandIconInImage();
59
- });
60
- }
61
-
62
44
  //Need to remove this comment once https://redmine.zeuslearning.com/issues/578531 is resolved
63
45
  // numberLineLabelPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
64
46
  });
@@ -6,7 +6,6 @@ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Stu
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  var itemReferenceID = "";
8
8
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
9
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
10
9
 
11
10
  describe('Create item page - Single selection: Preview contents', () => {
12
11
  before(() => {
@@ -95,23 +94,6 @@ describe('Create item page - Single selection: Preview contents', () => {
95
94
  singleSelectionPage.steps.verifyEquationTextInPreviewTab(3);
96
95
  cy.eyesCheckWindow(`Single selection - ${view} - Options with image, equation, bold text, and link`);
97
96
  });
98
- if (imageExpandEnhancement === 'true') {
99
- it('Image expand icon should be visible on the image in option', () => {
100
- singleSelectionPage.steps.verifyImageInPreviewTab(0);
101
- singleSelectionPage.steps.verifyExpandIconInImage();
102
- });
103
-
104
- it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
105
- singleSelectionPage.steps.verifyImageInPreviewTab(0);
106
- singleSelectionPage.steps.clickExpandIconInImage();
107
- utilities.verifyInnerText(singleSelectionPage.closeImagePopup(), 'Close');
108
- });
109
-
110
- it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
111
- singleSelectionPage.steps.closeImagePopup();
112
- singleSelectionPage.steps.verifyExpandIconInImage();
113
- });
114
- }
115
97
 
116
98
  if (view !== 'Grading view' && view !== 'Correct answer view') {
117
99
  it(`All the options should be in unchecked state`, () => {
@@ -5,7 +5,6 @@ import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
6
  let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
7
7
  const views = utilities.getViews(previewContentViews);
8
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
8
  var itemReferenceID = "";
10
9
  describe('Create item page - Single selection grid: Preview contents', () => {
11
10
  before(() => {
@@ -94,24 +93,6 @@ describe('Create item page - Single selection grid: Preview contents', () => {
94
93
  utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
95
94
  utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsText(), 'visible');
96
95
  });
97
-
98
- if (imageExpandEnhancement === 'true') {
99
- it('Image expand icon should be visible on the image in option', () => {
100
- singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
101
- singleSelectionGridPage.steps.verifyExpandIconInImage();
102
- });
103
-
104
- it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
105
- singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
106
- singleSelectionGridPage.steps.clickExpandIconInImage();
107
- utilities.verifyInnerText(singleSelectionGridPage.closeImagePopup(), 'Close');
108
- });
109
-
110
- it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
111
- singleSelectionGridPage.steps.closeImagePopup();
112
- singleSelectionGridPage.steps.verifyExpandIconInImage();
113
- });
114
- }
115
96
 
116
97
  it(`Single selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
117
98
  singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
@@ -3,7 +3,6 @@ import { commonComponents } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
7
6
 
8
7
  describe('Create item page - Text entry math: Question instructions, Add structure - Question input field', () => {
9
8
  before(() => {
@@ -198,22 +197,6 @@ describe('Create item page - Text entry math: Question instructions, Add structu
198
197
  textEntryMathPage.steps.switchToPreviewTab();
199
198
  utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 1);
200
199
  });
201
-
202
- if (imageExpandEnhancement === 'true') {
203
- it('When user add large image in question input field, user should be able to expand the image in preview tab', () => {
204
- textEntryMathPage.steps.switchToEditTab();
205
- textEntryMathPage.steps.focusInQuestionInputField();
206
- textEntryMathPage.steps.selectImageOptionFromCKEditorToolbar();
207
- textEntryMathPage.steps.addImageToInputField();
208
- textEntryMathPage.steps.switchToPreviewTab();
209
- textEntryMathPage.steps.verifyExpandIconInImage();
210
- textEntryMathPage.steps.clickExpandIconInImage();
211
- utilities.verifyInnerText(textEntryMathPage.closeImagePopup(), 'Close');
212
- textEntryMathPage.steps.closeImagePopup();
213
- textEntryMathPage.steps.verifyExpandIconInImage();
214
-
215
- });
216
- }
217
200
  });
218
201
 
219
202
  describe('User should be able to edit incomplete authored question', () => {
@@ -3,7 +3,6 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
  const grepTags = Cypress.env('grepTags');
6
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
7
6
 
8
7
  describe('Create Item page - Text selection: Question Instructions and Question section', () => {
9
8
  before(() => {
@@ -192,21 +191,6 @@ describe('Create Item page - Text selection: Question Instructions and Question
192
191
  textSelectionPage.steps.verifyBoldTextInPreviewTab();
193
192
  textSelectionPage.steps.verifyLinkInPreviewTab();
194
193
  });
195
- if (imageExpandEnhancement === 'true') {
196
- it('Image expand icon should be visible on the image in option', () => {
197
- textSelectionPage.steps.verifyExpandIconInImage();
198
- });
199
-
200
- it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
201
- textSelectionPage.steps.clickExpandIconInImage();
202
- utilities.verifyInnerText(textSelectionPage.closeImagePopup(), 'Close');
203
- });
204
-
205
- it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
206
- textSelectionPage.steps.closeImagePopup();
207
- textSelectionPage.steps.verifyExpandIconInImage();
208
- });
209
- }
210
194
 
211
195
  //Failing due to https://redmine.zeuslearning.com/issues/537907
212
196
  it('CSS of \'Preview tab\' when image, equation, bold text and link are added', { tags: 'css' }, () => {
@@ -402,43 +402,4 @@ 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
- });
444
405
  });
@@ -235,57 +235,4 @@ 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
- });
291
238
  });