itemengine-cypress-automation 1.0.544-IEI-6994-Add-test-coverage-for-text-selection--d8792a9.0 → 1.0.544

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.
@@ -82,20 +82,6 @@ describe('Create item page - Text selection: Partial equal weights', () => {
82
82
  textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();*/
83
83
  });
84
84
 
85
- it('When the user attempts the question partially correct with some correct options, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer response, and a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
86
- textSelectionPage.steps.resetQuestionPreview();
87
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
88
- textSelectionPage.steps.verifyPreviewScore(10, 20);
89
- textSelectionPage.steps.switchToGradingView();
90
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
91
- textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
92
- textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
93
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
94
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
95
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
96
- textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
97
- });
98
-
99
85
  it('When the user attempts the question correctly then the user should be awarded full points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, a status message and correct answer section should not be displayed', () => {
100
86
  textSelectionPage.steps.resetQuestionPreview();
101
87
  textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
@@ -65,20 +65,6 @@ describe('Create item page - Text selection - Selection mode - Sentence: Partial
65
65
  textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
66
66
  });
67
67
 
68
- it('When the user attempts the question partially correct with some correct options, then the user should be awarded points for that options and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer response, incorrect icon should be displayed besides the containers not attempted and a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
69
- textSelectionPage.steps.resetQuestionPreview();
70
- textSelectionPage.steps.selectOptionInPreviewTab(sentenceTextArray[0]);
71
- textSelectionPage.steps.verifyPreviewScore(10, 20);
72
- textSelectionPage.steps.switchToGradingView();
73
- textSelectionPage.steps.verifyCorrectIconForOption(sentenceTextArray[0]);
74
- textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(sentenceTextArray[1]);
75
- textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(sentenceTextArray[3]);
76
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
77
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(sentenceTextArray[0]);
78
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(sentenceTextArray[1]);
79
- textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
80
- });
81
-
82
68
  it('When the user attempts the question correctly then the user should be awarded full points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, a status message and correct answer section should not be displayed', () => {
83
69
  textSelectionPage.steps.resetQuestionPreview();
84
70
  textSelectionPage.steps.selectOptionInPreviewTab(sentenceTextArray[0]);
@@ -519,37 +519,11 @@ describe('Create item page - Text selection: All or nothing ', () => {
519
519
  textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
520
520
  });
521
521
 
522
- it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, attempts the question and switches to grading view, then the user should be awarded with minimum points', () => {
523
- textSelectionPage.steps.resetQuestionPreview();
524
- textSelectionPage.steps.switchToPreviewTab();
525
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
526
- textSelectionPage.steps.switchToGradingView();
527
- textSelectionPage.steps.verifyPreviewScore(2, 20);
528
- });
529
-
530
522
  it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
531
- textSelectionPage.steps.switchToEditTab();
532
- textSelectionPage.steps.expandMinimumScoringDropdown();
533
- textSelectionPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
534
- textSelectionPage.steps.allotMinimumPoints(2);
535
523
  textSelectionPage.steps.resetQuestionPreview();
536
524
  textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
537
525
  textSelectionPage.steps.verifyPreviewScore(2, 20);
538
526
  });
539
-
540
- it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
541
- textSelectionPage.steps.resetQuestionPreview();
542
- textSelectionPage.steps.verifyPreviewScore(2, 20);
543
- });
544
-
545
- it('When the user has selected \'No minimum score\' from the minimum scoring dropdown, and attempts the question incorrectly, then the user should be awarded with 0 points', () => {
546
- textSelectionPage.steps.switchToEditTab();
547
- textSelectionPage.steps.expandMinimumScoringDropdown();
548
- textSelectionPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
549
- textSelectionPage.steps.resetQuestionPreview();
550
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
551
- textSelectionPage.steps.verifyPreviewScore(0, 20);
552
- });
553
527
  });
554
528
  };
555
529
  });
@@ -1,5 +1,4 @@
1
1
  import { textSelectionPage } from "../../../pages";
2
- import {autoScoredScoringSectionMultiResponseType} from "../../../pages/components";
3
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
3
  import utilities from "../../../support/helpers/utilities";
5
4
  const css = Cypress.env('css');
@@ -194,91 +193,6 @@ describe('Create item page - Fill in the gaps with drag and drop: Minimum scorin
194
193
  utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect answer: 5');
195
194
  utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 10');
196
195
  });
197
-
198
- it('When the user selects \'Penalty points for the entire question\' from the penalty scoring dropdown, and attempts the question incorrectly with only incorrect options, then the user should be awarded negative points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
199
- textSelectionPage.steps.expandPenaltyScoringDropdown();
200
- textSelectionPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
201
- autoScoredScoringSectionMultiResponseType.steps.clearPenaltyPoints();
202
- autoScoredScoringSectionMultiResponseType.steps.allotPenaltyPoints('2');
203
- autoScoredScoringSectionMultiResponseType.steps.uncheckRoundNegativeScoresToZeroCheckbox();
204
- textSelectionPage.steps.switchToPreviewTab();
205
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
206
- textSelectionPage.steps.verifyPreviewScore(-2,10);
207
- textSelectionPage.steps.switchToGradingView();
208
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
209
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
210
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
211
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
212
- });
213
-
214
- it('When the user selects \'Penalty points for the entire question\' from the penalty scoring dropdown, and attempts the question correctly, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed besides all correct responses, a status message should not be displayed and correct answer section with all correct answers should not be displayed', () => {
215
- textSelectionPage.steps.resetQuestionPreview();
216
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
217
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
218
- textSelectionPage.steps.verifyPreviewScore(10,10);
219
- textSelectionPage.steps.switchToGradingView();
220
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
221
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
222
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
223
- textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
224
- });
225
-
226
- it('When the user selects \'Penalty points for the entire question\' from the penalty scoring dropdown, and attempts the question incorrectly with both correct and incorrect options, then the user should be awarded negative points and on switching to \'Grading\' view, correct icons should be displayed besides all correct responses, incorrect icons should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
227
- textSelectionPage.steps.resetQuestionPreview();
228
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
229
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
230
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
231
- textSelectionPage.steps.verifyPreviewScore(8,10);
232
- textSelectionPage.steps.switchToGradingView();
233
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
234
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
235
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
236
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
237
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
238
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
239
- });
240
-
241
- it('When the user selects \'Penalty points for each incorrect answer\' from the penalty scoring dropdown, and attempts the question incorrectly, then the user should be awarded negative points for incorrect options and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
242
- textSelectionPage.steps.switchToEditTab();
243
- textSelectionPage.steps.unSelectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1], true);
244
- textSelectionPage.steps.expandPenaltyScoringDropdown();
245
- textSelectionPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect answer');
246
- autoScoredScoringSectionMultiResponseType.steps.uncheckAutomaticallySetPenaltyPointsCheckbox();
247
- autoScoredScoringSectionMultiResponseType.steps.allotPenaltyPointsForEachIncorrectOption('2');
248
- textSelectionPage.steps.switchToPreviewTab();
249
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
250
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
251
- textSelectionPage.steps.verifyPreviewScore(-4,10);
252
- textSelectionPage.steps.switchToGradingView();
253
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[1]);
254
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
255
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
256
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
257
- });
258
-
259
- it('When the user selects \'Penalty points for each incorrect answer\' from the penalty scoring dropdown, and attempts the question correctly, then the user should be awarded full points for correct options and on switching to \'Grading\' view, correct icons should be displayed besides all correct responses, a status message should not be displayed and correct answer section with all correct answers should not be displayed', () => {
260
- textSelectionPage.steps.resetQuestionPreview();
261
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
262
- textSelectionPage.steps.verifyPreviewScore(10,10);
263
- textSelectionPage.steps.switchToGradingView();
264
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
265
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
266
- textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
267
- });
268
-
269
- it('When the user selects \'Penalty points for each incorrect answer\' from the penalty scoring dropdown, and attempts the question incorrectly with both correct and incorrect options, then the user should be awarded points deducted for incorrect responses and on switching to \'Grading\' view, correct icons should be displayed besides all correct responses, incorrect icons should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
270
- textSelectionPage.steps.resetQuestionPreview();
271
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
272
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
273
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
274
- textSelectionPage.steps.verifyPreviewScore(6,10);
275
- textSelectionPage.steps.switchToGradingView();
276
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
277
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[1]);
278
- textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
279
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
280
- textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
281
- });
282
196
  });
283
197
 
284
198
  describe('Scoring section: Rounding - Edit tab', () => {
@@ -286,79 +200,12 @@ describe('Create item page - Fill in the gaps with drag and drop: Minimum scorin
286
200
  before(() => {
287
201
  textSelectionPage.steps.navigateToCreateQuestion('text selection');
288
202
  cy.barsPreLoaderWait();
289
- textSelectionPage.steps.clearQuestionInputField();
290
- paragraphTextArray.forEach((paragraphText) => {
291
- textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
292
- });
293
- textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
294
- textSelectionPage.steps.switchTextSelectionMode('Paragraph');
295
- textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
296
- textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
297
- textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
298
- textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
299
- textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
300
- textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
301
- textSelectionPage.steps.allotPoints(4);
302
- textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
203
+ textSelectionPage.steps.allotPoints(10);
204
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
303
205
  });
304
206
 
305
207
  textSelectionPage.tests.verifyRoundingDropdown();
306
208
 
307
209
  textSelectionPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
308
-
309
- it("When the user selects rounding to \'Round down if <= 0.99\' then the score '<=0.99' should be rounded down to nearest whole number", () => {
310
- textSelectionPage.steps.expandRoundingDropdown();
311
- textSelectionPage.steps.switchToPreviewTab();
312
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
313
- textSelectionPage.steps.verifyPreviewScore(1,4);
314
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
315
- textSelectionPage.steps.verifyPreviewScore(2,4);
316
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
317
- textSelectionPage.steps.verifyPreviewScore(4,4);
318
- textSelectionPage.steps.switchToGradingView();
319
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
320
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
321
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
322
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
323
- textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
324
- });
325
-
326
- it("When the user selects rounding to \'Round down if <= 0.50\' then the score '<=0.50' should be rounded down to nearest whole number", () => {
327
- textSelectionPage.steps.switchToEditTab();
328
- textSelectionPage.steps.expandRoundingDropdown();
329
- textSelectionPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
330
- textSelectionPage.steps.switchToPreviewTab();
331
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
332
- textSelectionPage.steps.verifyPreviewScore(1,4);
333
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
334
- textSelectionPage.steps.verifyPreviewScore(2.6667,4);
335
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
336
- textSelectionPage.steps.verifyPreviewScore(4,4);
337
- textSelectionPage.steps.switchToGradingView();
338
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
339
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
340
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
341
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
342
- textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
343
- });
344
-
345
- it('When the user selects rounding to \'Round down if <= 0.50\' then the score \'<=0.50\' should be rounded down to nearest whole number and the score \'>0.50\' should be rounded up to nearest whole number', () => {
346
- textSelectionPage.steps.switchToEditTab();
347
- textSelectionPage.steps.expandRoundingDropdown();
348
- textSelectionPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
349
- textSelectionPage.steps.switchToPreviewTab();
350
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
351
- textSelectionPage.steps.verifyPreviewScore(1,4);
352
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
353
- textSelectionPage.steps.verifyPreviewScore(3,4);
354
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
355
- textSelectionPage.steps.verifyPreviewScore(4,4);
356
- textSelectionPage.steps.switchToGradingView();
357
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
358
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
359
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[2]);
360
- textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
361
- textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
362
- });
363
210
  });
364
211
  });
@@ -2,11 +2,11 @@ import { textSelectionPage, itemPreviewPage, studentViewPage } from "../../../pa
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
- let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
5
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  var itemReferenceID = "";
8
8
 
9
- const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.', 'Birds are creatures with feathers, beaks, and the ability to lay eggs.', 'Many animal species are undocumented even today.', 'Research is going on to discover new species in the far corners of the earth'];
9
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
10
10
 
11
11
  describe('Create item page - Text selection : Preview contents', () => {
12
12
  before(() => {
@@ -54,9 +54,6 @@ describe('Create item page - Text selection : Preview contents', () => {
54
54
  case 'Correct answer view':
55
55
  cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
56
56
  break;
57
- case 'Print preview':
58
- cy.visit(`/item-engine/demo/render-item/print-view/${utilities.base64Encoding(itemReferenceID)}`);
59
- break;
60
57
  default:
61
58
  throw new Error('Invalid view');
62
59
  }
@@ -74,75 +71,64 @@ describe('Create item page - Text selection : Preview contents', () => {
74
71
  }
75
72
  });
76
73
 
77
- if (view === 'Print preview') {
78
- it('Question instructions should be visible', () => {
79
- utilities.verifyInnerText(textSelectionPage.questionInstructionsPrintViewText(), 'Select the correct statements.');
80
- utilities.verifyElementVisibilityState(textSelectionPage.questionInstructionsPrintViewText(), 'visible');
81
- });
74
+ it('Question instructions should be visible', () => {
75
+ utilities.verifyInnerText(textSelectionPage.questionInstructionsText(), 'Select the correct statements.');
76
+ utilities.verifyElementVisibilityState(textSelectionPage.questionInstructionsText(), 'visible');
77
+ });
82
78
 
83
- it(`Text added in the question field should be displayed in the ${view}`, () => {
84
- textSelectionPage.steps.verifyQuestionTextParagraphPrintView();
85
- });
86
- } else {
87
- it('Question instructions should be visible', () => {
88
- utilities.verifyInnerText(textSelectionPage.questionInstructionsText(), 'Select the correct statements.');
89
- utilities.verifyElementVisibilityState(textSelectionPage.questionInstructionsText(), 'visible');
79
+ it('The added text in Question input field should be displayed in the preview tab question', () => {
80
+ paragraphTextArray.forEach((paragraphText, index) => {
81
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPreviewTab(), index), `${paragraphText}`);
90
82
  });
83
+ });
91
84
 
92
- it('The added text in Question input field should be displayed in the preview tab question', () => {
93
- paragraphTextArray.forEach((paragraphText, index) => {
94
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPreviewTab(), index), `${paragraphText}`);
95
- });
96
- });
85
+ it(`Text selection - ${view} - The text which is not available as option should not be interactive in preview tab`, () => {
86
+ textSelectionPage.steps.verifyNonOptionTextIsNotInteractiveInPreviewTab(paragraphTextArray[3]);
87
+ });
97
88
 
98
- it(`Text selection - ${view} - The text which is not available as option should not be interactive in preview tab`, () => {
99
- textSelectionPage.steps.verifyNonOptionTextIsNotInteractiveInPreviewTab(paragraphTextArray[3]);
89
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
90
+ it(`The selected options in specify possible options section should be displayed and by default all options should not be selected`, () => {
91
+ for (let index = 0; index < 3; index++) {
92
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), paragraphTextArray[index]);
93
+ utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), 'visible');
94
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[index]);
95
+ };
96
+ utilities.verifyElementCount(textSelectionPage.optionPreviewTab(), 3);
100
97
  });
101
98
 
102
- if (view !== 'Grading view' && view !== 'Correct answer view') {
103
- it(`The selected options in specify possible options section should be displayed and by default all options should not be selected`, () => {
104
- for (let index = 0; index < 3; index++) {
105
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), paragraphTextArray[index]);
106
- utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), 'visible');
107
- textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[index]);
108
- };
109
- utilities.verifyElementCount(textSelectionPage.optionPreviewTab(), 3);
110
- });
111
-
112
- it(`When user hovers on the available options, then those options should be displayed in hover state highlight`, () => {
113
- for (let index = 0; index < 3; index++) {
114
- textSelectionPage.steps.verifyHoverStateOfOptionInPreviewTab(paragraphTextArray[index], "blue");
115
- };
116
- });
99
+ it(`When user hovers on the available options, then those options should be displayed in hover state highlight`, () => {
100
+ for (let index = 0; index < 3; index++) {
101
+ textSelectionPage.steps.verifyHoverStateOfOptionInPreviewTab(paragraphTextArray[index], "blue");
102
+ };
103
+ });
117
104
 
118
- it(`When user selects an option, then that option should be displayed in selected state`, () => {
119
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
120
- textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[0], "blue");
121
- textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
122
- textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[1], "blue");
123
- });
105
+ it(`When user selects an option, then that option should be displayed in selected state`, () => {
106
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
107
+ textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[0], "blue");
108
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
109
+ textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[1], "blue");
110
+ });
124
111
 
125
- it(`When user clicks on a selected option, then that option should be deselected`, () => {
126
- textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
127
- textSelectionPage.steps.verifyStandardStateOptionInPreviewTab(paragraphTextArray[0]);
128
- });
129
- } else if (view === 'Grading view') {
130
- it(`The question text should be displayed with the selected correct options and status message 'Your answer is incorrect' should be displayed`, () => {
131
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
132
- textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
133
- });
112
+ it(`When user clicks on a selected option, then that option should be deselected`, () => {
113
+ textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
114
+ textSelectionPage.steps.verifyStandardStateOptionInPreviewTab(paragraphTextArray[0]);
115
+ });
116
+ } else if (view === 'Grading view') {
117
+ it(`The question text should be displayed with the selected correct options and status message 'Your answer is incorrect' should be displayed`, () => {
118
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
119
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
120
+ });
134
121
 
135
- it(`The submitted answer options should not be editable`, () => {
136
- textSelectionPage.steps.verifyAnswerSectionNotEditableInPreviewTab();
137
- });
138
- } else {
139
- it(`The question text should be displayed with the selected correct options`, () => {
140
- for (let index = 0; index < 2; index++) {
141
- textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[index]);
142
- };
143
- textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
144
- });
145
- }
122
+ it(`The submitted answer options should not be editable`, () => {
123
+ textSelectionPage.steps.verifyAnswerSectionNotEditableInPreviewTab();
124
+ });
125
+ } else {
126
+ it(`The question text should be displayed with the selected correct options`, () => {
127
+ for (let index = 0; index < 2; index++) {
128
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[index]);
129
+ };
130
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
131
+ });
146
132
  }
147
133
  });
148
134
  });
@@ -17,36 +17,6 @@ describe('Create Item page - Text selection: Question Instructions and Question
17
17
  });
18
18
 
19
19
  textSelectionPage.tests.verifyQuestionInstructionsInputFieldEditTab();
20
-
21
- it('Verify that users cannot add more than 20,000 characters to the question input field', () => {
22
- const MAX_LIMIT = 20000;
23
- const overflowString = 'x'.repeat(MAX_LIMIT + 500); // attempt to exceed by 500 chars
24
-
25
- textSelectionPage.steps.clearQuestionInputField();
26
- textSelectionPage.steps.focusInQuestionInputField();
27
-
28
- // Type in manageable chunks to avoid performance issues
29
- const chunkSize = 4000;
30
- const chunks = overflowString.match(new RegExp(`.{1,${chunkSize}}`, 'g')) || [];
31
- chunks.forEach(chunk => {
32
- textSelectionPage.questionInputField().type(chunk, { delay: 0 });
33
- });
34
-
35
- // Assert content length does not exceed MAX_LIMIT
36
- textSelectionPage.questionInputField()
37
- .invoke('text')
38
- .then(text => {
39
- expect(text.length, `Question input length (${text.length}) should be <= ${MAX_LIMIT}`).to.be.at.most(MAX_LIMIT);
40
- });
41
-
42
- // Try adding extra characters beyond limit; length should remain capped
43
- textSelectionPage.questionInputField().type('y'.repeat(200), { delay: 0 });
44
- textSelectionPage.questionInputField()
45
- .invoke('text')
46
- .then(text => {
47
- expect(text.length, 'Length after additional typing should still be capped').to.be.at.most(MAX_LIMIT);
48
- });
49
- });
50
20
  });
51
21
 
52
22
  describe('Question Instructions input field - Preview tab', () => {
@@ -140,7 +110,7 @@ describe('Create Item page - Text selection: Question Instructions and Question
140
110
  it('Image, equation, bold text and link added in Question input field should be properly displayed in specify correct answer section', () => {
141
111
  textSelectionPage.steps.verifyImageAndAltTextInSpecifyCorrectAnswerSection();
142
112
  textSelectionPage.steps.verifyEquationInSpecifyCorrectAnswerSection();
143
- textSelectionPage.steps.verifyBoldTextInSpecifyCorrectAnswerSection('This is Bold text input.lorem');
113
+ textSelectionPage.steps.verifyBoldTextInSpecifyCorrectAnswerSection();
144
114
  textSelectionPage.steps.verifyLinkInSpecifyCorrectAnswerSection();
145
115
  });
146
116
  });
@@ -300,12 +300,6 @@ const steps = {
300
300
  .should('be.checked');
301
301
  },
302
302
 
303
- uncheckAutomaticallySetPenaltyPointsCheckbox: () => {
304
- autoScoredScoringSectionMultiResponseType.automaticallySetPenaltyPointsCheckbox()
305
- .click()
306
- .should('not.be.checked');
307
- },
308
-
309
303
  /**
310
304
  * @param {("Specify total penalty points" | "Specify points for each incorrect option")} radioOption option from the penalty points for each incorrect option radio buttons
311
305
  * @description this function selects radio button from the penalty points for each incorrect option section
@@ -379,12 +373,6 @@ const steps = {
379
373
  .should('have.class', 'radio-option-disabled');
380
374
  },
381
375
 
382
- selectSpecifyTotalPenaltyPointsRadioButton: () => {
383
- autoScoredScoringSectionMultiResponseType.specifyTotalPenaltyPointsRadioButton()
384
- .click()
385
- .should('be.checked');
386
- },
387
-
388
376
  /**
389
377
  * verify the displayed penalty points for each incorrect option
390
378
  * @param {number} penaltyPoints displayed penalty points
@@ -3,17 +3,6 @@ import constants from "../../fixtures/constants";
3
3
  const selectors = {
4
4
  imageIcon: () => cy.get('a[title="Insert Image"]:visible'),
5
5
  boldIcon: () => cy.get('.cke_button__bold:visible'),
6
- italicIcon: () => cy.get('.cke_button__italic:visible'),
7
- underlineIcon: () => cy.get('.cke_button__underline:visible'),
8
- strikeThroughIcon: () => cy.get('.cke_button__strike:visible'),
9
- removeFormatIcon: () => cy.get('.cke_button__removeformat:visible'),
10
- justifyLeftIcon: () => cy.get('.cke_button__justifyleft:visible'),
11
- justifyCenterIcon: () => cy.get('.cke_button__justifycenter:visible'),
12
- justifyRightIcon: () => cy.get('.cke_button__justifyright:visible'),
13
- fontSizeIcon: () => cy.get('a[title="Font Size"]:visible'),
14
- fontColorIcon: () => cy.get('a[title="Text Color"]:visible'),
15
- amethystColorTileIconTextColorOption: () => cy.get('td a[title="Amethyst"]'),
16
- fontColoriFrame: () => cy.get('.cke_panel_frame:visible'),
17
6
  equationEditorIcon: () => cy.get('.cke_button__nextgeneqneditor:visible'),
18
7
  linkIcon: () => cy.get('.cke_button__link:visible'),
19
8
  ckeDialogbox: () => cy.get('.cke_dialog_body:visible'),
@@ -87,135 +76,7 @@ const steps = {
87
76
  saveTableProperties: () => {
88
77
  ckEditorToolbar.ckeOkButton()
89
78
  .click();
90
- },
91
-
92
- selectItalicOptionFromCKEditorToolbar: () => {
93
- ckEditorToolbar.italicIcon()
94
- .scrollIntoView()
95
- .click();
96
- },
97
-
98
- selectUnderlineOptionFromCKEditorToolbar: () => {
99
- ckEditorToolbar.underlineIcon()
100
- .scrollIntoView()
101
- .click();
102
- },
103
-
104
- selectStrikeThroughOptionFromCKEditorToolbar: () => {
105
- ckEditorToolbar.strikeThroughIcon()
106
- .scrollIntoView()
107
- .click();
108
- },
109
-
110
- selectRemoveFormatOptionFromCKEditorToolbar: () => {
111
- ckEditorToolbar.removeFormatIcon()
112
- .scrollIntoView()
113
- .click();
114
- },
115
-
116
- selectJustifyLeftOptionFromCKEditorToolbar: () => {
117
- ckEditorToolbar.justifyLeftIcon()
118
- .scrollIntoView()
119
- .click();
120
- },
121
-
122
- selectJustifyCenterOptionFromCKEditorToolbar: () => {
123
- ckEditorToolbar.justifyCenterIcon()
124
- .scrollIntoView()
125
- .click();
126
- },
127
-
128
- selectJustifyRightOptionFromCKEditorToolbar: () => {
129
- ckEditorToolbar.justifyRightIcon()
130
- .scrollIntoView()
131
- .click();
132
- },
133
-
134
- openFontSizeDropdownFromCKEditorToolbar: () => {
135
- ckEditorToolbar.fontSizeIcon()
136
- .scrollIntoView()
137
- .click();
138
- },
139
-
140
- openFontColorDropdownFromCKEditorToolbar: () => {
141
- ckEditorToolbar.fontColorIcon()
142
- .click();
143
- },
144
-
145
- clickOnAmethystColorInTextColorPopup: () => {
146
- cy.getIframeBody('iframe.cke_panel_frame:visible')
147
- .find('a[title="Amethyst"]')
148
- .should('be.visible')
149
- .click();
150
- },
151
-
152
- /**
153
- * Selects a font size option from the CKEditor font size dropdown panel.
154
- *
155
- * This function is resilient to different CKEditor builds / HTML outputs:
156
- * - Accepts values with or without the 'px' suffix (e.g. '10' or '10px').
157
- * - Tries multiple selector variants for inline style differences (with / without spaces / semicolons).
158
- * - Falls back to matching pure numeric text labels when the size is rendered as plain text.
159
- * - As a final fallback, iterates spans that have an inline font-size style and compares the computed style.
160
- *
161
- * On success it scrolls the target into view and clicks it. On failure it throws an Error including
162
- * the list of discovered size tokens to aid debugging.
163
- *
164
- * @param {string|number} fontSize - Desired font size (e.g. '10', '12px'). Will be normalized to '<value>px'.
165
- * @example
166
- * ckEditorToolbar.steps.selectFontSizeOptionFromCKEditorToolbar('10');
167
- * ckEditorToolbar.steps.selectFontSizeOptionFromCKEditorToolbar('18px');
168
- * @throws {Error} When the requested font size option cannot be located in the open panel.
169
- */
170
- selectFontSizeOptionFromCKEditorToolbar: (fontSize) => {
171
- // Normalize requested font size (accept '10' or '10px')
172
- const fontSizeValue = /px$/.test(fontSize) ? fontSize : `${fontSize}px`;
173
-
174
- // Ensure panel iframe is visible and loaded
175
- cy.get('.cke_panel_frame:visible', { timeout: 10000 })
176
- .its('0.contentDocument.body')
177
- .should('not.be.empty')
178
- .then(cy.wrap)
179
- .then($body => {
180
- // Primary selector attempts (style attribute variants)
181
- const selectors = [
182
- `span[style*="font-size:${fontSizeValue}"]`,
183
- `span[style*="font-size: ${fontSizeValue}"]`,
184
- `a span[style*="font-size:${fontSizeValue}"]`
185
- ];
186
- let $match = null;
187
- for (const sel of selectors) {
188
- const found = $body.find(sel);
189
- if (found.length) { $match = found.first(); break; }
190
- }
191
- // Fallback: match by text content (numeric part) inside anchors/spans
192
- if (!$match) {
193
- const numeric = fontSizeValue.replace('px', '').trim();
194
- const textCandidates = $body.find('a, span').filter((_, el) => el.textContent.trim() === numeric);
195
- if (textCandidates.length) {
196
- $match = textCandidates.first();
197
- }
198
- }
199
- // Final fallback: search spans that have inline font-size style and compare computed style
200
- if (!$match) {
201
- const inlineSpans = $body.find('span[style*="font-size"]');
202
- const computedCandidate = inlineSpans.filter((_, el) => window.getComputedStyle(el).fontSize === fontSizeValue);
203
- if (computedCandidate.length) {
204
- $match = computedCandidate.first();
205
- }
206
- }
207
- if ($match) {
208
- cy.wrap($match)
209
- .scrollIntoView()
210
- .should('be.visible')
211
- .click();
212
- } else {
213
- const available = Array.from($body.find('span[style*="font-size"], a span[style*="font-size"]')).map(el => el.textContent.trim()).filter(Boolean);
214
- cy.log(`Font size '${fontSizeValue}' not found. Available (text tokens): ${available.join(', ')}`);
215
- throw new Error(`Font size option '${fontSizeValue}' not found in CKEditor panel.`);
216
- }
217
- });
218
- },
79
+ }
219
80
  }
220
81
  export const ckEditorToolbar = {
221
82
  ...selectors,
@@ -100,8 +100,6 @@ const selectors = {
100
100
  correctIncorrectAnswerLabel: () => cy.get('[class*="AnswerStatusText"]'),
101
101
  correctAnswersLabel: () => cy.get('[class*="Highlightstyles__CorrectAnswerHeader-"]'),
102
102
  optionsInputFieldInQuestionPreviewTab: () => cy.get('[class*="word-span highlight_option"]'),
103
- questionInstructionsPrintViewText: () => cy.get('.question-text-wrapper').eq(0),
104
- questionTextPrintViewParagraphs: () => cy.get('#nextgen-assess-print-view [data-testid="question-instruction-element"] p'),
105
103
  }
106
104
 
107
105
  const steps = {
@@ -188,49 +186,6 @@ const steps = {
188
186
  .should('have.text', '​​​​​​​This is Bold text input.');
189
187
  },
190
188
 
191
- verifyItalicTextInQuestionInputField: () => {
192
- textSelectionPage.questionInputField()
193
- .find('em, i')
194
- .should('exist')
195
- .invoke('text')
196
- .should('eq', '​​​​​​​This is Italic text input.');
197
- },
198
-
199
- verifyUnderlineTextInQuestionInputField: () => {
200
- textSelectionPage.questionInputField()
201
- .find('u')
202
- .should('exist')
203
- .invoke('text')
204
- },
205
-
206
- verifyStrikeThroughTextInQuestionInputField: () => {
207
- textSelectionPage.questionInputField()
208
- .find('s, strike, del')
209
- .should('exist')
210
- .invoke('text')
211
- },
212
-
213
- verifyQuestionInputFieldTextIsLeftAligned: () => {
214
- textSelectionPage.questionInputField()
215
- .find('p')
216
- .each($p => {
217
- const align = Cypress.$($p).css('text-align');
218
- expect(['left', 'start']).to.include(align);
219
- });
220
- },
221
-
222
- verifyQuestionInputFieldTextIsCenterAligned: () => {
223
- textSelectionPage.questionInputField()
224
- .find('p')
225
- .should('have.css', 'text-align', 'center');
226
- },
227
-
228
- verifyQuestionInputFieldTextIsRightAligned: () => {
229
- textSelectionPage.questionInputField()
230
- .find('p')
231
- .should('have.css', 'text-align', 'right');
232
- },
233
-
234
189
  verifyImageAndAltTextInSpecifyPossibleOptionsSection: () => {
235
190
  textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
236
191
  .find('img')
@@ -255,29 +210,7 @@ const steps = {
255
210
  textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
256
211
  .find('strong')
257
212
  .should('exist')
258
- .should('have.text', 'This is Bold text input.');
259
- },
260
-
261
- verifyItalicTextInSpecifyPossibleOptionsSection: () => {
262
- textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
263
- .find('em, i')
264
- .should('exist')
265
- .invoke('text')
266
- .should('eq', 'This is Italic text input.');
267
- },
268
-
269
- verifyUnderlineTextInSpecifyPossibleOptionsSection: () => {
270
- textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
271
- .find('u')
272
- .should('exist')
273
- .invoke('text')
274
- },
275
-
276
- verifyStrikeThroughTextInSpecifyPossibleOptionsSection: () => {
277
- textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
278
- .find('s, strike, del')
279
- .should('exist')
280
- .invoke('text')
213
+ .should('have.text', 'This is Bold text input.lorem');
281
214
  },
282
215
 
283
216
  verifyImageAndAltTextInSpecifyCorrectAnswerSection: () => {
@@ -300,33 +233,11 @@ const steps = {
300
233
  .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
301
234
  },
302
235
 
303
- verifyBoldTextInSpecifyCorrectAnswerSection: (text) => {
236
+ verifyBoldTextInSpecifyCorrectAnswerSection: () => {
304
237
  textSelectionPage.specifyCorrectAnswerTextWrapper()
305
238
  .find('strong')
306
239
  .should('exist')
307
- .should('have.text', text);
308
- },
309
-
310
- verifyItalicTextInSpecifyCorrectAnswerSection: () => {
311
- textSelectionPage.specifyCorrectAnswerTextWrapper()
312
- .find('em, i')
313
- .should('exist')
314
- .invoke('text')
315
- .should('eq', 'This is Italic text input.');
316
- },
317
-
318
- verifyUnderlineTextInSpecifyCorrectAnswerSection: () => {
319
- textSelectionPage.specifyCorrectAnswerTextWrapper()
320
- .find('u')
321
- .should('exist')
322
- .invoke('text')
323
- },
324
-
325
- verifyStrikeThroughTextInSpecifyCorrectAnswerSection: () => {
326
- textSelectionPage.specifyCorrectAnswerTextWrapper()
327
- .find('s, strike, del')
328
- .should('exist')
329
- .invoke('text')
240
+ .should('have.text', 'This is Bold text input.lorem');
330
241
  },
331
242
 
332
243
  verifyImageAndAltTextInPreviewTab: () => {
@@ -357,40 +268,6 @@ const steps = {
357
268
  .should('have.text', 'This is Bold text input.lorem');
358
269
  },
359
270
 
360
- verifyItalicTextInPreviewTab: () => {
361
- textSelectionPage.questionTextWrapperPreviewTab()
362
- .find('em, i')
363
- .should('exist')
364
- .invoke('text')
365
- .should('eq', '​​​​​​​This is Italic text input.');
366
- },
367
-
368
- verifyUnderlineTextInPreviewTab: () => {
369
- textSelectionPage.questionTextWrapperPreviewTab()
370
- .find('u')
371
- .should('exist')
372
- .invoke('text')
373
- },
374
-
375
- verifyStrikeThroughTextInPreviewTab: () => {
376
- textSelectionPage.questionTextWrapperPreviewTab()
377
- .find('s, strike, del')
378
- .should('exist')
379
- .invoke('text')
380
- },
381
-
382
- verifyTextColorInCkeditorField(color) {
383
- textSelectionPage.questionInputField()
384
- .find('span[style*="color"]')
385
- .should('have.css', 'color', color);
386
- },
387
-
388
- verifyFontSizeInQuestionInputField(fontSize) {
389
- textSelectionPage.questionInputField()
390
- .find('span[style*="font-size"]')
391
- .should('have.css', 'font-size', fontSize);
392
- },
393
-
394
271
  verifySpecifyPossibleOptionsFieldErrorMessage: () => {
395
272
  textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
396
273
  .next()
@@ -650,15 +527,6 @@ const steps = {
650
527
  textSelectionPage.steps.verifyOptionIsSelectedInSpecifyCorrectAnswerSection(optionText);
651
528
  },
652
529
 
653
- /**
654
- * @param {*} optionText Text of the option in set correct answer section
655
- * @description Unselect an option in set correct answer section
656
- */
657
- unSelectOptionInSpecifyCorrectAnswerSection: (optionText) => {
658
- textSelectionPage.steps.clickOnOptionInSpecifyCorrectAnswerSection(optionText);
659
- textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection(optionText);
660
- },
661
-
662
530
  /**
663
531
  * @param {*} optionText Text of the option in set correct answer section
664
532
  * @description Deselect an option in set correct answer section
@@ -957,17 +825,6 @@ const steps = {
957
825
  .and('have.attr', 'aria-checked', 'true');
958
826
  },
959
827
 
960
- /**
961
- * @param {string} optionText Text of the option in set correct answer section
962
- * @description Verify that option is in unselected state in set correct answer section
963
- */
964
- verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection: (optionText) => {
965
- textSelectionPage.optionSpecifyCorrectAnswer()
966
- .contains(optionText)
967
- .should('not.have.class', 'correct_answer')
968
- .and('have.attr', 'aria-checked', 'false');
969
- },
970
-
971
828
  /**
972
829
  * @param {string} optionText Text of the option in specify possible options section
973
830
  * @description Verify that option is not in selected state in specify possible options section
@@ -1391,12 +1248,6 @@ const steps = {
1391
1248
  .click({ force: true });
1392
1249
  utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'exist');
1393
1250
  },
1394
-
1395
- verifyQuestionTextParagraphPrintView: () => {
1396
- textSelectionPage.questionTextPrintViewParagraphs().each(($el, index) => {
1397
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPrintViewParagraphs(), index), `${paragraphTextArray[index]}`);
1398
- });
1399
- }
1400
1251
  }
1401
1252
 
1402
1253
  const tests = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.544-IEI-6994-Add-test-coverage-for-text-selection--d8792a9.0",
3
+ "version": "1.0.544",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service.yaml CHANGED
@@ -38,6 +38,90 @@ deployment:
38
38
  - "*.*.mozilla.com"
39
39
  - "*.*.*.mozilla.com"
40
40
  - "cdn.jsdelivr.net"
41
+ - "unpkg.com"
42
+ - "*.learnosity.com"
43
+ - "media.wne-cdn.com"
44
+ - "*.applitools.com"
45
+ - "*.imaginelearning.com"
46
+ - "*.*.imaginelearning.com"
47
+ - "*.il-apps.com"
48
+ - "*.*.il-apps.com"
49
+ - "cdn.pixabay.com"
50
+ - "sts.amazonaws.com"
51
+ - "sqs.us-west-2.amazonaws.com"
52
+ - "sqs.us-east-2.amazonaws.com"
53
+ - "dynamodb.us-east-2.amazonaws.com"
54
+ - "*.dynamodb.us-east-2.amazonaws.com"
55
+ - "*.cloudfront.net"
56
+ - "*.amazonaws.com"
57
+ - "*.us-east-2.aoss.amazonaws.com"
58
+ - "assets.brainingcamp.com"
59
+ - "*.brainingcamp.com"
60
+ - "*.edgenuity.com"
61
+ - "*.edgenuityapp.com"
62
+ - "*.ets.org"
63
+ - "*.oraclecloud.com"
64
+ - "imaginelearning.tii-sandbox.com"
65
+ - "www.w3.org"
66
+ - "www.imsglobal.org"
67
+ - "*.imsglobal.org"
68
+ - "*.apache.org"
69
+ - "*.jsdelivr.net"
70
+ - "*.gradle.org"
71
+ - "*.gradle-dn.com"
72
+ - "*.speechstream.net"
73
+ CIDRs:
74
+ - "169.254.169.254/32"
75
+ aws:
76
+ enabled: true
77
+ permissions:
78
+ - service: "s3"
79
+ accessType: "full"
80
+ resources:
81
+ - name: "media"
82
+ region: "us-east-2"
83
+ - name: "upload-media"
84
+ region: "us-east-2"
85
+
86
+ - service: "dynamodbTable"
87
+ accessType: "full"
88
+ resources:
89
+ - name: "activity-management"
90
+ region: "us-east-2"
91
+ - name: "asset-migration-status"
92
+ region: "us-east-2"
93
+ - name: "assignment-management"
94
+ region: "us-east-2"
95
+ - name: "authorisation-management"
96
+ region: "us-east-2"
97
+ - name: "braincamp-manipulatives-initial-states"
98
+ region: "us-east-2"
99
+ - name: "consumer-management"
100
+ region: "us-east-2"
101
+ - name: "failed-submission-management"
102
+ region: "us-east-2"
103
+ - name: "file-management"
104
+ region: "us-east-2"
105
+ - name: "item-management"
106
+ region: "us-east-2"
107
+ - name: "item-status"
108
+ region: "us-east-2"
109
+ - name: "migration-data"
110
+ region: "us-east-2"
111
+ - name: "migration-status-management"
112
+ region: "us-east-2"
113
+ - name: "pending-elasticsearch-updates"
114
+ region: "us-east-2"
115
+ - name: "pending-score-responses"
116
+ region: "us-east-2"
117
+ - name: "rubric-consumer-management"
118
+ region: "us-east-2"
119
+ - name: "rubric-management"
120
+ region: "us-east-2"
121
+ - name: "sandbox-user-management"
122
+ region: "us-east-2"
123
+ - name: "scoring-management"
124
+ region: "us-east-2"
41
125
  env:
42
126
  - name: OTK_VERSION
43
127
  value: "2"
@@ -1,107 +0,0 @@
1
- import { textSelectionPage } from "../../../pages";
2
- import { ckEditorToolbar } from "../../../pages/components";
3
- import abortEarlySetup from "../../../support/helpers/abortEarly";
4
- import utilities from "../../../support/helpers/utilities";
5
- const css = Cypress.env('css');
6
-
7
- const textFormattingOptions = ['boldIcon', 'italicIcon', 'underlineIcon', 'strikeThroughIcon', 'removeFormatIcon', 'justifyLeftIcon', 'justifyCenterIcon', 'justifyRightIcon'];
8
-
9
- describe('Create item page - Text Selection: CKeditor text formatting and text type options', () => {
10
- before(() => {
11
- cy.loginAs('admin');
12
- });
13
-
14
- describe('Text Selection : Text formatting and decoration options' , () => {
15
- abortEarlySetup();
16
- before(() => {
17
- textSelectionPage.steps.navigateToCreateQuestion('text selection');
18
- cy.barsPreLoaderWait();
19
- });
20
-
21
- it('When user focuses on the question field, CKEditor toolbar should be visible having all the text formatting and decoration toolbar options', () => {
22
- textSelectionPage.steps.clearQuestionInputField();
23
- textSelectionPage.steps.focusInQuestionInputField();
24
- textFormattingOptions.forEach(option => {
25
- utilities.verifyElementVisibilityState(ckEditorToolbar[option](), 'visible');
26
- });
27
- });
28
-
29
- it('When user selects bold option from the toolbar, the text added should be bold', () => {
30
- ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
31
- textSelectionPage.steps.addInputToQuestionInputField('This is Bold text input.');
32
- textSelectionPage.steps.verifyBoldTextInQuestionInputField();
33
- ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar(); //to disable bold option
34
- });
35
-
36
- it('When user selects italic option from the toolbar, the text added should be in italic', () => {
37
- textSelectionPage.steps.addInputToQuestionInputField('{enter}');
38
- ckEditorToolbar.steps.selectItalicOptionFromCKEditorToolbar();
39
- textSelectionPage.steps.addInputToQuestionInputField('This is Italic text input.');
40
- textSelectionPage.steps.verifyItalicTextInQuestionInputField();
41
- ckEditorToolbar.steps.selectItalicOptionFromCKEditorToolbar(); //to disable italic option
42
- });
43
-
44
- it('When user selects underline option from the toolbar, the text added should be underlined', () => {
45
- textSelectionPage.steps.addInputToQuestionInputField('{enter}');
46
- ckEditorToolbar.steps.selectUnderlineOptionFromCKEditorToolbar();
47
- textSelectionPage.steps.addInputToQuestionInputField('This is Underline text input.');
48
- textSelectionPage.steps.verifyUnderlineTextInQuestionInputField();
49
- ckEditorToolbar.steps.selectUnderlineOptionFromCKEditorToolbar(); //to disable underline option
50
- });
51
-
52
- it('When user selects strikethrough option from the toolbar, the text added should be strikethrough', () => {
53
- textSelectionPage.steps.addInputToQuestionInputField('{enter}');
54
- ckEditorToolbar.steps.selectStrikeThroughOptionFromCKEditorToolbar();
55
- textSelectionPage.steps.addInputToQuestionInputField('This is Strikethrough text input.');
56
- textSelectionPage.steps.verifyStrikeThroughTextInQuestionInputField();
57
- ckEditorToolbar.steps.selectStrikeThroughOptionFromCKEditorToolbar(); //to disable strikethrough option
58
- });
59
-
60
- it('When user adds equation using equation editor, then the math text added by user should be displayed in the question field', ()=>{
61
- textSelectionPage.steps.addInputToQuestionInputField('{enter}');
62
- textSelectionPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
63
- textSelectionPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
64
- textSelectionPage.steps.verifyEquationInQuestionInputField();
65
- textSelectionPage.steps.addInputToQuestionInputField('{rightarrow}{enter}');
66
- });
67
-
68
- it("Verify all the text decoration and text types options in 'Specify Possible options' section and 'Specify correct answer section'", () => {
69
- textSelectionPage.steps.verifyBoldTextInSpecifyPossibleOptionsSection();
70
- textSelectionPage.steps.verifyItalicTextInSpecifyPossibleOptionsSection();
71
- textSelectionPage.steps.verifyUnderlineTextInSpecifyPossibleOptionsSection();
72
- textSelectionPage.steps.verifyStrikeThroughTextInSpecifyPossibleOptionsSection();
73
- textSelectionPage.steps.verifyEquationInSpecifyPossibleOptionsSection();
74
- textSelectionPage.steps.verifyBoldTextInSpecifyCorrectAnswerSection('This is Bold text input.');
75
- textSelectionPage.steps.verifyItalicTextInSpecifyCorrectAnswerSection();
76
- textSelectionPage.steps.verifyUnderlineTextInSpecifyCorrectAnswerSection();
77
- textSelectionPage.steps.verifyStrikeThroughTextInSpecifyCorrectAnswerSection();
78
- textSelectionPage.steps.verifyEquationInSpecifyCorrectAnswerSection();
79
- });
80
-
81
- it('When user changes the text alignment options then it should change the alignment of the selected text in question field, specify correct answer section and specify possible options section', () => {
82
- textSelectionPage.steps.clearQuestionInputField();
83
- textSelectionPage.steps.addInputToQuestionInputField('Sample text to check text alignment');
84
- ckEditorToolbar.steps.selectJustifyLeftOptionFromCKEditorToolbar();
85
- textSelectionPage.steps.verifyQuestionInputFieldTextIsLeftAligned();
86
- ckEditorToolbar.steps.selectJustifyLeftOptionFromCKEditorToolbar(); //to disable justify left option
87
- ckEditorToolbar.steps.selectJustifyCenterOptionFromCKEditorToolbar();
88
- textSelectionPage.steps.verifyQuestionInputFieldTextIsCenterAligned();
89
- ckEditorToolbar.steps.selectJustifyCenterOptionFromCKEditorToolbar(); //to disable justify center option
90
- ckEditorToolbar.steps.selectJustifyRightOptionFromCKEditorToolbar();
91
- textSelectionPage.steps.verifyQuestionInputFieldTextIsRightAligned();
92
- ckEditorToolbar.steps.selectJustifyRightOptionFromCKEditorToolbar(); //to disable justify right option
93
- });
94
-
95
- it('When user edits the font size and font color, then the changes should be reflected in the question field', () => {
96
- textSelectionPage.steps.clearQuestionInputField();
97
- ckEditorToolbar.steps.openFontColorDropdownFromCKEditorToolbar();
98
- ckEditorToolbar.steps.clickOnAmethystColorInTextColorPopup();
99
- textSelectionPage.steps.addInputToQuestionInputField('Sample text to check font size and color');
100
- textSelectionPage.steps.verifyTextColorInCkeditorField('rgb(155, 89, 182)');
101
- textSelectionPage.steps.clearQuestionInputField();
102
- ckEditorToolbar.steps.openFontSizeDropdownFromCKEditorToolbar();
103
- ckEditorToolbar.steps.selectFontSizeOptionFromCKEditorToolbar('22px');
104
- textSelectionPage.steps.verifyFontSizeInQuestionInputField('22px');
105
- });
106
- });
107
- });