itemengine-cypress-automation 1.0.240-textentrychangesreverted-28d08d1.0 → 1.0.240

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/headerSection.js +22 -5
  3. package/cypress/e2e/ILC/ChartsLine/headerSection.js +23 -5
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -4
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +3 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +4 -6
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +1 -3
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +3 -4
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +4 -5
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +3 -5
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +172 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +3 -5
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +0 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +3 -8
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +6 -6
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +2 -2
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +3 -1
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -8
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +3 -5
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +2 -2
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +16 -16
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -2
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +3 -3
  35. package/cypress/e2e/ILC/Graphing/headerSection.js +2 -3
  36. package/cypress/e2e/ILC/GridFill/headerSection.js +2 -4
  37. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +6 -3
  38. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -4
  39. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
  40. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
  41. package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -8
  42. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +2 -8
  43. package/cypress/e2e/ILC/ListOrderingNew/optionsOrientationSection.js +150 -0
  44. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/horizontalOrientationAllOrNothingForAllViews.smoke.js +218 -0
  45. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +176 -0
  46. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +170 -0
  47. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +170 -0
  48. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +230 -0
  49. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js +64 -0
  50. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/manuallyAndNonScored.js +110 -0
  51. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +249 -0
  52. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +172 -0
  53. package/cypress/e2e/ILC/Matching/clickAndDrop.js +6 -10
  54. package/cypress/e2e/ILC/Matching/headerSection.js +2 -10
  55. package/cypress/e2e/ILC/Matching/matchingConnector.js +128 -0
  56. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
  57. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
  58. package/cypress/e2e/ILC/MatchingDropdown/editTabBasicSection.js +154 -0
  59. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +4 -6
  60. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -4
  61. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -1
  62. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +3 -9
  63. package/cypress/e2e/ILC/NumberLine/headerSection.js +2 -3
  64. package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -4
  65. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
  66. package/cypress/e2e/ILC/SingleSelection/headerSection.js +2 -5
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -2
  68. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -2
  69. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +2 -9
  70. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +210 -0
  71. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +210 -0
  72. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +258 -0
  73. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +246 -0
  74. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  75. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +245 -0
  76. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +541 -0
  77. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +243 -0
  78. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  79. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +242 -0
  80. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +195 -0
  81. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
  82. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +8 -1
  83. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +12 -0
  84. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
  85. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
  86. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
  87. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +2 -0
  88. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
  89. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  90. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
  91. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
  92. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
  93. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -0
  94. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
  95. package/cypress/e2e/ILC/TextSelection/Scoring/singleSelectionPreviewScoring.js +247 -0
  96. package/cypress/e2e/ILC/TextSelection/headerSection.js +4 -5
  97. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/singleMultipleSelection.js +100 -0
  99. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionOutline.js +248 -0
  100. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionStrikethrough.js +247 -0
  101. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionUnderline.js +239 -0
  102. package/cypress/e2e/ILC/TextSelection/textSelectionStyle.js +150 -0
  103. package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +3 -2
  104. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
  105. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
  106. package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +21 -5
  107. package/cypress/pages/components/autoScoredScoringPreviewTab.js +1 -0
  108. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -11
  109. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -29
  110. package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
  111. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  112. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +2 -3
  113. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -2
  114. package/cypress/pages/components/optionsWrapperComponent.js +2 -2
  115. package/cypress/pages/components/playbackControlsBaseComponent.js +2 -2
  116. package/cypress/pages/components/questionInputFieldComponent.js +1 -0
  117. package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -2
  118. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +1 -1
  119. package/cypress/pages/createItemPage.js +1 -1
  120. package/cypress/pages/dialogBoxBase.js +21 -9
  121. package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -5
  122. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +83 -5
  123. package/cypress/pages/graphingPage.js +4 -7
  124. package/cypress/pages/gridFillPage.js +15 -16
  125. package/cypress/pages/listOrderingPage.js +373 -2
  126. package/cypress/pages/matchingPage.js +89 -33
  127. package/cypress/pages/multipleSelectionGridPage.js +11 -13
  128. package/cypress/pages/multipleSelectionPage.js +4 -5
  129. package/cypress/pages/numberLinePage.js +2 -13
  130. package/cypress/pages/shortTextResponsePage.js +2 -3
  131. package/cypress/pages/textEntryMathPage.js +28 -0
  132. package/cypress/pages/textSelectionPage.js +242 -3
  133. package/cypress/pages/videoResponsePage.js +0 -2
  134. package/package.json +1 -1
  135. /package/cypress/e2e/ILC/TextSelection/{styleAndLayoutCustomizationAccordion.js → styleAndLayoutCustomizationAccordionFilledIn.js} +0 -0
@@ -23,6 +23,8 @@ describe('Create item page - Text entry math: Value is equivalent evaluation met
23
23
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
24
24
  textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
25
25
  textEntryMathPage.steps.selectEvaluationMethod('Symbols are equivalent');
26
+ textEntryMathPage.steps.expandAdditionalSettings();
27
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
26
28
  });
27
29
 
28
30
  it('When the user enters a equation using decimals in \'Specify correct answer\' section and the user enters the same exact answer it should be treated as correct', () => {
@@ -21,6 +21,8 @@ describe('Create item page - Text entry math: Value is equivalent evaluation met
21
21
  textEntryMathPage.steps.expandAdditionalSettings();
22
22
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
23
23
  textEntryMathPage.steps.allotPoints(20);
24
+ textEntryMathPage.steps.expandAdditionalSettings();
25
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
24
26
  });
25
27
 
26
28
  it('When the user enters a equation using decimals in \'Specify correct answer\' section and the user enters the same exact answer it should be treated as correct', () => {
@@ -24,6 +24,7 @@ describe('Create item page - Text entry math: All or nothing scoring', () => {
24
24
  textEntryMathPage.steps.selectEvaluationMethod('Response is true');
25
25
  textEntryMathPage.steps.expandAdditionalSettings();
26
26
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
27
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
27
28
  textEntryMathPage.steps.switchToPreviewTab();
28
29
  });
29
30
 
@@ -219,6 +220,7 @@ describe('Create item page - Text entry math: All or nothing scoring', () => {
219
220
  textEntryMathPage.steps.selectEvaluationMethod('Expanded form');
220
221
  textEntryMathPage.steps.expandAdditionalSettings();
221
222
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
223
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
222
224
  textEntryMathPage.steps.switchToPreviewTab();
223
225
  });
224
226
 
@@ -430,6 +432,7 @@ describe('Create item page - Text entry math: All or nothing scoring', () => {
430
432
  textEntryMathPage.steps.selectEvaluationMethod('Factored form');
431
433
  textEntryMathPage.steps.expandAdditionalSettings();
432
434
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
435
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
433
436
  textEntryMathPage.steps.switchToPreviewTab();
434
437
  });
435
438
 
@@ -628,6 +631,7 @@ describe('Create item page - Text entry math: All or nothing scoring', () => {
628
631
  textEntryMathPage.steps.selectEvaluationMethod('Simplified version');
629
632
  textEntryMathPage.steps.expandAdditionalSettings();
630
633
  textEntryMathPage.steps.selectEquationEditorSectionCategories([equationEditorCategoriesAndSymbols.trig.displayName, equationEditorCategoriesAndSymbols.greek.displayName, equationEditorCategoriesAndSymbols.calculus.displayName]);
634
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
631
635
  textEntryMathPage.steps.switchToPreviewTab();
632
636
  });
633
637
 
@@ -17,6 +17,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
17
17
  textEntryMathPage.steps.addResponseArea();
18
18
  textEntryMathPage.steps.addResponseArea();
19
19
  textEntryMathPage.steps.allotPoints(10);
20
+ textEntryMathPage.steps.expandAdditionalSettings();
21
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
20
22
  });
21
23
 
22
24
  textEntryMathPage.tests.verifyMinimumScoringDropdown();
@@ -39,6 +41,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
39
41
  textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'a+b');
40
42
  textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(1, 'a−b');
41
43
  textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
44
+ textEntryMathPage.steps.expandAdditionalSettings();
45
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
42
46
  });
43
47
 
44
48
  textEntryMathPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
@@ -199,6 +203,8 @@ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring,
199
203
  textEntryMathPage.steps.addResponseArea();
200
204
  textEntryMathPage.steps.allotPoints(10);
201
205
  textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
206
+ textEntryMathPage.steps.expandAdditionalSettings();
207
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
202
208
  });
203
209
 
204
210
  textEntryMathPage.tests.verifyRoundingDropdown();
@@ -32,6 +32,8 @@ describe('Create item page - Text entry math: Preview contents', () => {
32
32
  textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
33
33
  textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
34
34
  equationEditorFlyout.steps.enterQuadraticEquation();
35
+ textEntryMathPage.steps.expandAdditionalSettings();
36
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
35
37
  textEntryMathPage.steps.switchToPreviewTab();
36
38
  break;
37
39
  case 'Item view':
@@ -24,6 +24,8 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
24
24
  textEntryMathWithImagePage.steps.verifyImageIsUploaded();
25
25
  textEntryMathWithImagePage.steps.insertResponseArea(10);
26
26
  textEntryMathWithImagePage.steps.insertResponseArea(40);
27
+ textEntryMathWithImagePage.steps.expandAdditionalSettings();
28
+ textEntryMathWithImagePage.steps.selectModalVisibilityTypeButton();
27
29
  textEntryMathWithImagePage.steps.switchToPreviewTab();
28
30
  });
29
31
 
@@ -85,6 +87,8 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
85
87
  textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
86
88
  textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
87
89
  equationEditorFlyout.steps.enterEquationUsingPiSymbol();
90
+ textEntryMathWithImagePage.steps.expandAdditionalSettings();
91
+ textEntryMathWithImagePage.steps.selectModalVisibilityTypeButton();
88
92
  textEntryMathWithImagePage.steps.switchToPreviewTab();
89
93
  break;
90
94
  case 'Item preview':
@@ -288,6 +292,8 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
288
292
  textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
289
293
  equationEditorFlyout.steps.enterEquationUsingPiSymbol();
290
294
  textEntryMathWithImagePage.steps.allotPoints(20);
295
+ textEntryMathWithImagePage.steps.expandAdditionalSettings();
296
+ textEntryMathWithImagePage.steps.selectModalVisibilityTypeButton();
291
297
  });
292
298
 
293
299
  it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
@@ -387,6 +387,8 @@ describe('Create item page - Text entry math: Question instructions, Options sec
387
387
  textEntryMathWithImagePage.steps.verifyFileNameLabel('highlightImage.jpg');
388
388
  utilities.verifyElementVisibilityState(textEntryMathWithImagePage.uploadImageProgressBar(), 'visible');
389
389
  textEntryMathWithImagePage.steps.verifyImageIsUploaded();
390
+ textEntryMathWithImagePage.steps.expandAdditionalSettings();
391
+ textEntryMathWithImagePage.steps.selectModalVisibilityTypeButton();
390
392
  });
391
393
 
392
394
  it('When the user has uploaded canvas image, then switching to the preview tab should display canvas image with same dimensions', () => {
@@ -36,6 +36,8 @@ describe('Create item page - Text entry math: Preview contents', () => {
36
36
  textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
37
37
  textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
38
38
  equationEditorFlyout.steps.enterQuadraticEquation();
39
+ textEntryMathWithImagePage.steps.expandAdditionalSettings();
40
+ textEntryMathWithImagePage.steps.selectModalVisibilityTypeButton();
39
41
  textEntryMathWithImagePage.steps.switchToPreviewTab();
40
42
  break;
41
43
  case 'Item view':
@@ -0,0 +1,247 @@
1
+ import { textSelectionPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ 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.'];
7
+
8
+ describe('Create Item page - text selection: Alternative answer with single selection', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question Preview: AutoScored - Single selection: When correct answer points are more than alternate answer points', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to text selection question type');
17
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
18
+ cy.barsPreLoaderWait();
19
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
20
+ textSelectionPage.steps.clearQuestionInputField();
21
+ paragraphTextArray.forEach((paragraphText) => {
22
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
23
+ });
24
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
25
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
26
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
27
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
28
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
29
+ textSelectionPage.steps.selectSingleSelectionToggle();
30
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
31
+ textSelectionPage.steps.allotPoints(20);
32
+ textSelectionPage.steps.clickOnAddAlternativeAnswerButton();
33
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
34
+ textSelectionPage.steps.allotPoints(12);
35
+ textSelectionPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
36
+ textSelectionPage.steps.switchToPreviewTab();
37
+ });
38
+
39
+ it('When the user switches to \'Grading view\' without attempting the question then the no Paragraph should be selected, \'Your answer is incorrect\' label should not be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
40
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
41
+ textSelectionPage.steps.switchToGradingView();
42
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
43
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
44
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[2]);
45
+ textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
46
+ utilities.verifyElementVisibilityState(textSelectionPage.correctIncorrectAnswerLabel(), 'notExist');
47
+ utilities.verifyElementVisibilityState(textSelectionPage.correctAnswerSection(), 'exist');
48
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
49
+ });
50
+
51
+
52
+ it('When user attempts the response from the correct accordion, full points should be alloted on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
53
+ textSelectionPage.steps.resetQuestionPreview();
54
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
55
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
56
+ textSelectionPage.steps.switchToGradingView();
57
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
58
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
59
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
60
+ });
61
+
62
+ it('CSS of Correct answer state', { tags: 'css' }, () => {
63
+ utilities.verifyCSS(textSelectionPage.correctIncorrectAnswerLabelWrapper(), {
64
+ 'border': `1px solid ${css.color.correctAnswer}`,
65
+ 'color': css.color.text,
66
+ 'font-size': css.fontSize.default,
67
+ 'font-weight': css.fontWeight.regular
68
+ });
69
+ });
70
+
71
+ it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
72
+ cy.checkAccessibility(textSelectionPage.previewTabQuestionWrapper());
73
+ });
74
+
75
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points from the alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
76
+ textSelectionPage.steps.resetQuestionPreview();
77
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
78
+ textSelectionPage.steps.verifyPreviewScore(12, 20);
79
+ textSelectionPage.steps.switchToGradingView();
80
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
81
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
82
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
83
+ });
84
+
85
+ it('When user attempts the question with incorrect selected Paragraph then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () => {
86
+ textSelectionPage.steps.switchToPreviewTab();
87
+ textSelectionPage.steps.resetQuestionPreview();
88
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
89
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
90
+ textSelectionPage.steps.switchToGradingView();
91
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
92
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
93
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
94
+ });
95
+
96
+ it('CSS of incorrect answer state', { tags: 'css' }, () => {
97
+ utilities.verifyCSS(textSelectionPage.correctIncorrectAnswerLabelWrapper(), {
98
+ 'border': `1px solid ${css.color.incorrectAnswer}`,
99
+ 'color': css.color.text,
100
+ 'font-size': css.fontSize.default,
101
+ 'font-weight': css.fontWeight.regular
102
+ });
103
+ });
104
+
105
+ it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
106
+ cy.checkAccessibility(textSelectionPage.previewTabQuestionWrapper());
107
+ });
108
+ });
109
+
110
+ describe('Question Preview: AutoScored - Single selection: When alternate answer points are more than correct answer points', () => {
111
+ abortEarlySetup();
112
+ before(() => {
113
+ cy.log('Navigating to text selection question type');
114
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
115
+ cy.barsPreLoaderWait();
116
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
117
+ textSelectionPage.steps.clearQuestionInputField();
118
+ paragraphTextArray.forEach((paragraphText) => {
119
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
120
+ });
121
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
122
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
123
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
124
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
125
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
126
+ textSelectionPage.steps.selectSingleSelectionToggle();
127
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
128
+ textSelectionPage.steps.allotPoints(10);
129
+ textSelectionPage.steps.clickOnAddAlternativeAnswerButton();
130
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
131
+ textSelectionPage.steps.allotPoints(20);
132
+ textSelectionPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
133
+ textSelectionPage.steps.switchToPreviewTab();
134
+ });
135
+
136
+ it('When the user switches to \'Grading view\' without attempting the question then the no Paragraph should be selected, \'Your answer is incorrect\' label should not be displayed and the correct answer section with the answers of the alternate accordion should be displayed', () => {
137
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
138
+ textSelectionPage.steps.switchToGradingView();
139
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
140
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
141
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[2]);
142
+ textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
143
+ utilities.verifyElementVisibilityState(textSelectionPage.correctAnswerSection(), 'exist');
144
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
145
+ });
146
+
147
+ it('When the user selects a correct paragraph with points less than alternative answer, then the user should be awarded with points from correct accordian and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
148
+ textSelectionPage.steps.resetQuestionPreview();
149
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
150
+ textSelectionPage.steps.verifyPreviewScore(10, 20);
151
+ textSelectionPage.steps.switchToGradingView();
152
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
153
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
154
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
155
+ });
156
+
157
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points from alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
158
+ textSelectionPage.steps.resetQuestionPreview();
159
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
160
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
161
+ textSelectionPage.steps.switchToGradingView();
162
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
163
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
164
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
165
+ });
166
+
167
+ it('When user attempts the question with incorrect selected Paragraph then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () => {
168
+ textSelectionPage.steps.switchToPreviewTab();
169
+ textSelectionPage.steps.resetQuestionPreview();
170
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
171
+ textSelectionPage.steps.verifyPreviewScore(0, 20);
172
+ textSelectionPage.steps.switchToGradingView();
173
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
174
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
175
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[1]);
176
+ });
177
+ });
178
+
179
+ describe('Question Preview: AutoScored - Single selection: When correct answer points are equal to alternate answer points', () => {
180
+ abortEarlySetup();
181
+ before(() => {
182
+ cy.log('Navigating to text selection question type');
183
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
184
+ cy.barsPreLoaderWait();
185
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
186
+ textSelectionPage.steps.clearQuestionInputField();
187
+ paragraphTextArray.forEach((paragraphText) => {
188
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
189
+ });
190
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
191
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
192
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
193
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
194
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
195
+ textSelectionPage.steps.selectSingleSelectionToggle();
196
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
197
+ textSelectionPage.steps.allotPoints(10);
198
+ textSelectionPage.steps.clickOnAddAlternativeAnswerButton();
199
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
200
+ textSelectionPage.steps.allotPoints(10);
201
+ textSelectionPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
202
+ textSelectionPage.steps.switchToPreviewTab();
203
+ });
204
+
205
+ it('When the user switches to \'Grading view\' without attempting the question then the no Paragraph should be selected, \'Your answer is incorrect\' label should not be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
206
+ textSelectionPage.steps.verifyPreviewScore(0, 10);
207
+ textSelectionPage.steps.switchToGradingView();
208
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
209
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
210
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[2]);
211
+ textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
212
+ utilities.verifyElementVisibilityState(textSelectionPage.correctAnswerSection(), 'exist');
213
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
214
+ });
215
+
216
+ it('When the user selects a correct Paragraph with points equal to alternative answer, then the user should be awarded with points from correct accordian and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
217
+ textSelectionPage.steps.resetQuestionPreview();
218
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
219
+ textSelectionPage.steps.verifyPreviewScore(10, 10);
220
+ textSelectionPage.steps.switchToGradingView();
221
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
222
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
223
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
224
+ });
225
+
226
+ it('When user attempts the response from the alternative accordion, then the user should be awarded with points specified for alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
227
+ textSelectionPage.steps.resetQuestionPreview();
228
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
229
+ textSelectionPage.steps.verifyPreviewScore(10, 10);
230
+ textSelectionPage.steps.switchToGradingView();
231
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
232
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
233
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
234
+ });
235
+
236
+ it('When user attempts the question with incorrect selected Paragraph then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () => {
237
+ textSelectionPage.steps.switchToPreviewTab();
238
+ textSelectionPage.steps.resetQuestionPreview();
239
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
240
+ textSelectionPage.steps.verifyPreviewScore(0, 10);
241
+ textSelectionPage.steps.switchToGradingView();
242
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
243
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
244
+ textSelectionPage.steps.verifyCorrectIconForOptionCorrectAnswerSection(paragraphTextArray[0]);
245
+ });
246
+ });
247
+ });
@@ -43,18 +43,17 @@ describe('Create item page - Text selection: Header section and Saving question'
43
43
  });
44
44
 
45
45
  describe('Validation error messages', () => {
46
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
46
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please set points', 'Please enter all option']);
47
47
 
48
48
  it('Validation error messages should be displayed below required input fields', () => {
49
- textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
50
- utilities.verifyInnerText(textSelectionPage.specifyCorrectAnswerErrorMessage(), 'Error: Please set a correct answer.');
49
+ textSelectionPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
50
+ textSelectionPage.steps.verifyWarningIconOnRequiredFields(['Please set points', 'Please enter all option']);
51
51
  });
52
52
 
53
53
  it('Validation error messages should disappear when required input fields are filled', () => {
54
54
  textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', 'Lorem');
55
55
  textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection('Lorem');
56
- utilities.verifyElementVisibilityState(textSelectionPage.specifyCorrectAnswerErrorMessage(), 'notExist');
57
- textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
56
+ textSelectionPage.steps.allotPoints(10);
58
57
  });
59
58
 
60
59
  textSelectionPage.tests.verifyCreateItemWrapperContentsA11y();
@@ -50,8 +50,7 @@ describe('Create Item page - Text selection: Question Instructions and Question
50
50
  it('When the user removes all the text from the question input field and focuses out of it, an error message \'Error: Question is required.\' should be displayed', () => {
51
51
  textSelectionPage.steps.clearQuestionInputField();
52
52
  textSelectionPage.steps.focusOutOfQuestionInputField();
53
- utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Question is required.');
54
- textSelectionPage.steps.verifyErroredStateOfQuestionInputField();
53
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
55
54
  });
56
55
 
57
56
  textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
@@ -0,0 +1,100 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ 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.'];
5
+
6
+ describe('text selection: Set correct answer toggles', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Single Multiple selection: Edit tab content', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigating to text selection question type');
15
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
16
+ });
17
+
18
+ textSelectionPage.tests.verifySingleMultipleSelectionModeContentCSSandA11y();
19
+ });
20
+
21
+ describe('Single Multiple selection: Edit tab functionality', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ cy.log('Navigating to text selection question type');
25
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
26
+ cy.barsPreLoaderWait();
27
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
28
+ textSelectionPage.steps.clearQuestionInputField();
29
+ paragraphTextArray.forEach((paragraphText) => {
30
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
31
+ });
32
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
33
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
34
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
35
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
36
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
37
+ });
38
+
39
+ it('When the user selects the \'Single selection\' toggle button then the user should be able to select only one Paragraph in the \'Specify correct answer\' section', () => {
40
+ textSelectionPage.steps.selectSingleSelectionToggle();
41
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
42
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
43
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
44
+ textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
45
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1], 'blue');
46
+ });
47
+
48
+ it('When the user selects the \'Multiple selection\' toggle button then the user should be able to select multiple Paragraphs in the \'Specify correct answer\' section', () => {
49
+ textSelectionPage.steps.selectMultipleSelectionToggle();
50
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1], 'blue');
51
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
52
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
53
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
54
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2], 'blue');
55
+ });
56
+
57
+ it('When the user selects \'Single selection\' toggle button after selecting multiple Paragraphs using the \'Multiple selection\' option then the 1st Paragraph from the top of the already selected option should remain selected', () => {
58
+ textSelectionPage.steps.selectSingleSelectionToggle();
59
+ textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
60
+ textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
61
+ textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
62
+ });
63
+ });
64
+
65
+ describe('Single Multiple selection: Preview tab functionality', () => {
66
+ abortEarlySetup();
67
+ before(() => {
68
+ cy.log('Navigating to text selection question type');
69
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
70
+ cy.barsPreLoaderWait();
71
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
72
+ textSelectionPage.steps.clearQuestionInputField();
73
+ paragraphTextArray.forEach((paragraphText) => {
74
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
75
+ });
76
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
77
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
78
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
79
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
80
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
81
+ });
82
+
83
+ it('When the user selects the \'Single selection\' toggle button then the user should be able to select only one region in the \'Preview tab\' section', () => {
84
+ textSelectionPage.steps.selectSingleSelectionToggle();
85
+ textSelectionPage.steps.switchToPreviewTab();
86
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
87
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
88
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[0]);
89
+ });
90
+
91
+ it('When the user selects the \'Multiple selection\' toggle button then the user should be able to select multiple regions in the \'Preview tab\' section', () => {
92
+ textSelectionPage.steps.switchToEditTab();
93
+ textSelectionPage.steps.selectMultipleSelectionToggle();
94
+ textSelectionPage.steps.switchToPreviewTab();
95
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
96
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
97
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
98
+ });
99
+ });
100
+ });