itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.184

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
  2. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
  3. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
  4. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
  5. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
  6. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
  7. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  8. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  11. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
  12. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
  13. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  14. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  26. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
  27. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
  29. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  30. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  31. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  32. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  33. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  34. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  35. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
  36. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
  37. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  38. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  39. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
  40. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
  42. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
  43. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
  44. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
  45. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  46. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
  47. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
  48. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
  49. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
  50. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
  51. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
  52. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
  53. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
  54. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
  55. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
  56. package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
  57. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
  58. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
  59. package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
  60. package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
  61. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
  62. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  63. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
  64. package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
  65. package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
  66. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  67. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
  68. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  69. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
  70. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  71. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
  72. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
  73. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
  74. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  75. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  76. package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
  77. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
  78. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
  79. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
  80. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
  81. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
  82. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
  83. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
  84. package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
  85. package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
  86. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  87. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
  88. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  89. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  90. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  91. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
  92. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
  93. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
  94. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
  95. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
  96. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
  97. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
  99. package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
  100. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
  101. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
  102. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
  103. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
  104. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
  105. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
  106. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
  107. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
  108. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  109. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
  110. package/cypress/fixtures/constants.js +1 -1
  111. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  112. package/cypress/fixtures/theme/ilc.json +20 -18
  113. package/cypress/pages/audioPlayerPage.js +274 -504
  114. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  115. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  116. package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
  117. package/cypress/pages/components/commonComponents.js +1 -0
  118. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  119. package/cypress/pages/components/equationEditorFlyout.js +3 -2
  120. package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
  121. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
  122. package/cypress/pages/components/imageCanvasComponent.js +2 -1
  123. package/cypress/pages/components/index.js +3 -0
  124. package/cypress/pages/components/layoutSectionComponent.js +1191 -0
  125. package/cypress/pages/components/numberLineCommonComponent.js +36 -0
  126. package/cypress/pages/components/optionsWrapperComponent.js +13 -2
  127. package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
  128. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
  129. package/cypress/pages/components/toolSettingsComponent.js +6 -0
  130. package/cypress/pages/contentBlocksPage.js +18 -2
  131. package/cypress/pages/createItemPage.js +75 -8
  132. package/cypress/pages/dialogBoxBase.js +2 -2
  133. package/cypress/pages/drawingResponsePage.js +24 -4
  134. package/cypress/pages/feedbackScalePage.js +3 -0
  135. package/cypress/pages/graphingPage.js +19 -1
  136. package/cypress/pages/gridFillPage.js +25 -8
  137. package/cypress/pages/index.js +2 -1
  138. package/cypress/pages/itemPreviewSettingsPage.js +4 -0
  139. package/cypress/pages/listOrderingPage.js +435 -557
  140. package/cypress/pages/matchingPage.js +1 -1
  141. package/cypress/pages/multipleSelectionPage.js +23 -1
  142. package/cypress/pages/numberLineLabelPage.js +333 -0
  143. package/cypress/pages/numberLinePage.js +1370 -132
  144. package/cypress/pages/rulerPage.js +6 -2
  145. package/cypress/pages/textSelectionPage.js +461 -23
  146. package/package.json +1 -1
@@ -0,0 +1,230 @@
1
+ import { dialogBoxBase, listOrderingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const grepTags = Cypress.env('grepTags');
6
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
+ const views = utilities.getViews(correctAnswerViews);
8
+ var itemReferenceID = "";
9
+ const options = ['sprout', 'plant', 'flower', 'seed'];
10
+ const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
11
+
12
+ describe('Create item page - List ordering: All or nothing ', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ if (!grepTags || !grepTags.includes('smoke')) {
18
+ describe('Question preview modes: Student view and Grading view', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
22
+ cy.barsPreLoaderWait();
23
+ listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
24
+ listOrderingPage.steps.switchToPreviewTab();
25
+ });
26
+
27
+ listOrderingPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
28
+
29
+ it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
30
+ listOrderingPage.steps.switchToEditTab();
31
+ listOrderingPage.steps.allotPoints(20);
32
+ listOrderingPage.steps.addInputToOptionsInputField(options);
33
+ listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }])
34
+ listOrderingPage.steps.switchToPreviewTab();
35
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
36
+ });
37
+
38
+ it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
39
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }])
40
+ listOrderingPage.steps.resetQuestionPreview();
41
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(0, '');
42
+ });
43
+ });
44
+ };
45
+
46
+ views.forEach((view) => {
47
+ describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ switch (view) {
51
+ case 'Question preview':
52
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
53
+ cy.barsPreLoaderWait();
54
+ listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
55
+ listOrderingPage.steps.addInputToOptionsInputField(options);
56
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
57
+ listOrderingPage.steps.allotPoints(20);
58
+ listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }])
59
+ listOrderingPage.steps.switchToPreviewTab();
60
+ break;
61
+ case 'Item preview':
62
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
63
+ itemPreviewPage.steps.switchToPreviewTab();
64
+ break;
65
+ case 'Grading view':
66
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
67
+ break;
68
+ };
69
+ });
70
+
71
+ beforeEach(() => {
72
+ switch (view) {
73
+ case 'Question preview':
74
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
75
+ listOrderingPage.steps.resetQuestionPreview();
76
+ break;
77
+ case 'Item preview':
78
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ itemPreviewPage.steps.resetQuestionPreview();
80
+ break;
81
+ case 'Grading view':
82
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
83
+ break;
84
+ }
85
+ });
86
+
87
+ if (view === 'Question preview') {
88
+ after(() => {
89
+ listOrderingPage.steps.clickOnSaveQuestionButton();
90
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
91
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
92
+ });
93
+ };
94
+
95
+ it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons should not be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
96
+ if (view === 'Grading view') {
97
+ utilities.verifyElementDisabledClass(studentViewPage.submitButton());
98
+ };
99
+ if (view === 'Question preview' || view === 'Item preview') {
100
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
101
+ listOrderingPage.steps.switchToGradingView();
102
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
103
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(0);
104
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
105
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
106
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
107
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
108
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers:');
109
+ listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
110
+ };
111
+ });
112
+
113
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
114
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
115
+ if (view === 'Grading view') {
116
+ studentViewPage.steps.submitResponse();
117
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
118
+ studentViewPage.steps.clickOnGoToGradingViewButton();
119
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
120
+ };
121
+ if (view === 'Question preview' || view === 'Item preview') {
122
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
123
+ listOrderingPage.steps.switchToGradingView();
124
+ };
125
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(0);
126
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
127
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(2);
128
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
129
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
130
+ listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
131
+ });
132
+
133
+ it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
134
+ if (view === 'Grading view') {
135
+ studentViewPage.steps.clearResponses();
136
+ };
137
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '3' }]);
138
+ if (view === 'Grading view') {
139
+ studentViewPage.steps.submitResponse();
140
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
141
+ studentViewPage.steps.clickOnGoToGradingViewButton();
142
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
143
+ };
144
+ if (view === 'Question preview' || view === 'Item preview') {
145
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
146
+ listOrderingPage.steps.switchToGradingView();
147
+ };
148
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
149
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
150
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
151
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
152
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
153
+ listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
154
+ });
155
+
156
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
157
+ if (view === 'Grading view') {
158
+ studentViewPage.steps.clearResponses();
159
+ };
160
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }]);
161
+ if (view === 'Grading view') {
162
+ studentViewPage.steps.submitResponse();
163
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
164
+ studentViewPage.steps.clickOnGoToGradingViewButton();
165
+ gradingViewPage.steps.verifyGradingViewScore(20, 20);
166
+ };
167
+ if (view === 'Question preview' || view === 'Item preview') {
168
+ listOrderingPage.steps.verifyPreviewScore(20, 20);
169
+ listOrderingPage.steps.switchToGradingView();
170
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
171
+ };
172
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
173
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
174
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
175
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
176
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
177
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
178
+ });
179
+ });
180
+ });
181
+
182
+ if (!grepTags || !grepTags.includes('smoke')) {
183
+ describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
184
+ abortEarlySetup();
185
+ before(() => {
186
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
187
+ cy.barsPreLoaderWait();
188
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
189
+ listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
190
+ listOrderingPage.steps.allotPoints(20);
191
+ listOrderingPage.steps.addInputToOptionsInputField(options);
192
+ listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }]);
193
+ });
194
+
195
+ 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', () => {
196
+ listOrderingPage.steps.expandMinimumScoringDropdown();
197
+ listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
198
+ listOrderingPage.steps.allotMinimumPoints(2);
199
+ listOrderingPage.steps.switchToPreviewTab();
200
+ listOrderingPage.steps.switchToGradingView();
201
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
202
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
203
+ });
204
+
205
+ 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', () => {
206
+ listOrderingPage.steps.resetQuestionPreview();
207
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
208
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
209
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
210
+ });
211
+
212
+ it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
213
+ listOrderingPage.steps.switchToEditTab();
214
+ listOrderingPage.steps.expandMinimumScoringDropdown();
215
+ listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
216
+ listOrderingPage.steps.allotMinimumPoints(2);
217
+ listOrderingPage.steps.switchToPreviewTab();
218
+ listOrderingPage.steps.switchToGradingView();
219
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
220
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
221
+ });
222
+
223
+ 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', () => {
224
+ listOrderingPage.steps.resetQuestionPreview();
225
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
226
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
227
+ });
228
+ });
229
+ };
230
+ });
@@ -0,0 +1,124 @@
1
+ import { listOrderingPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ var itemReferenceID = "";
5
+ const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(checkAnswerViews);
7
+ const options = ['sprout', 'plant', 'flower', 'seed'];
8
+ const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
9
+
10
+ describe('Create item page - list ordering - Check answer functionality', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ views.forEach((view) => {
16
+ //Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
17
+ const checkAnswer = (view) => {
18
+ switch (view) {
19
+ case 'Question preview':
20
+ case 'Item preview':
21
+ listOrderingPage.steps.checkAnswer();
22
+ break;
23
+ case 'Student view':
24
+ studentViewPage.steps.checkAnswer();
25
+ break;
26
+ default:
27
+ throw new Error(`Unsupported page identifier: ${view}`);
28
+ }
29
+ };
30
+
31
+ describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ switch (view) {
35
+ case 'Question preview':
36
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
37
+ cy.barsPreLoaderWait();
38
+ listOrderingPage.steps.addInputToOptionsInputField(options);
39
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
40
+ listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
41
+ listOrderingPage.steps.allotPoints(20);
42
+ listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }])
43
+ listOrderingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
44
+ listOrderingPage.steps.switchToPreviewTab();
45
+ break;
46
+ case 'Item preview':
47
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
48
+ itemPreviewPage.steps.switchToPreviewTab();
49
+ break;
50
+ case 'Student view':
51
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
52
+ break;
53
+ }
54
+ });
55
+
56
+ beforeEach(() => {
57
+ switch (view) {
58
+ case 'Question preview':
59
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
60
+ listOrderingPage.steps.resetQuestionPreview();
61
+ break;
62
+ case 'Item preview':
63
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
64
+ itemPreviewPage.steps.resetQuestionPreview();
65
+ break;
66
+ case 'Student view':
67
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
68
+ break;
69
+ }
70
+ });
71
+
72
+ if (view === 'Question preview') {
73
+ after(() => {
74
+ listOrderingPage.steps.clickOnSaveQuestionButton();
75
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
76
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
77
+ });
78
+ };
79
+
80
+ it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons should not be displayed besides all incorrect options, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
81
+ checkAnswer(view);
82
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(0);
83
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
84
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
85
+ listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
86
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
87
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ });
89
+
90
+ it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect options, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
91
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
92
+ checkAnswer(view);
93
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(0);
94
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
95
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(2);
96
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
97
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
98
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
99
+ });
100
+
101
+ it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect options, correct icons should be displayed besides correct options, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
102
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '3' }]);
103
+ checkAnswer(view);
104
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
105
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
106
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
107
+ listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
108
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
109
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
110
+ });
111
+
112
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct options, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
113
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }]);
114
+ checkAnswer(view);
115
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
116
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
117
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
118
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
119
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
120
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
121
+ });
122
+ });
123
+ });
124
+ });
@@ -0,0 +1,201 @@
1
+ import { listOrderingPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+ const css = Cypress.env('css');
9
+
10
+ describe('Create item page - List ordering - Preview contents in all views', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ views.forEach((view) => {
16
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ switch (view) {
20
+ case 'Question preview':
21
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
22
+ cy.barsPreLoaderWait();
23
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
24
+ listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
25
+ listOrderingPage.steps.allotPoints(10);
26
+ cy.log('Add image to option input field')
27
+ listOrderingPage.steps.focusInOptionsInputField(0);
28
+ ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar();
29
+ ckEditorToolbar.steps.addImageToInputField();
30
+ listOrderingPage.steps.enterTextInOptionInputField(0, 'Fox');
31
+ cy.log('Add bold text to option input field')
32
+ listOrderingPage.steps.focusInOptionsInputField(1);
33
+ ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
34
+ listOrderingPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
35
+ cy.log('Add equation to option input field')
36
+ listOrderingPage.steps.enterTextInOptionInputField(2, 'Solve the following');
37
+ listOrderingPage.steps.focusInOptionsInputField(2);
38
+ ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
39
+ equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
40
+ listOrderingPage.steps.enterTextInOptionInputField(3, 'alpha');
41
+ listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }])
42
+ listOrderingPage.steps.switchToPreviewTab();
43
+ break;
44
+ case 'Item view':
45
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
46
+ break;
47
+ case 'Item preview':
48
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
49
+ listOrderingPage.steps.switchToPreviewTab();
50
+ break;
51
+ case 'Student view':
52
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
53
+ break;
54
+ case 'Grading view':
55
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
56
+ break;
57
+ case 'Correct answer view':
58
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ break;
60
+ default:
61
+ throw new Error('Invalid view');
62
+ }
63
+ });
64
+
65
+ after(() => {
66
+ if (view === 'Question preview') {
67
+ listOrderingPage.steps.clickOnSaveQuestionButton();
68
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
69
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
70
+ }
71
+ if (view === 'Student view') {
72
+ studentViewPage.steps.submitResponse();
73
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
74
+ }
75
+ });
76
+
77
+ it('Question instructions should be visible', () => {
78
+ utilities.verifyInnerText(listOrderingPage.questionInstructionsText(), 'Arrange options in correct order.');
79
+ utilities.verifyElementVisibilityState(listOrderingPage.questionInstructionsText(), 'visible');
80
+ });
81
+
82
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
83
+ it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
84
+ listOrderingPage.steps.verifyOptionWithImageInPreviewTab(0);
85
+ listOrderingPage.steps.verifyOptionWithBoldTextInPreviewTab(1);
86
+ listOrderingPage.steps.verifyOptionWithEquationTextInPreviewTab(2);
87
+ });
88
+
89
+ it('When the user expands a position dropdown, based on the number of options in the list to order, a list of dropdown options to place the particular option in the list order should be displayed', () => {
90
+ listOrderingPage.steps.expandPositionDropdownPreviewTab(0);
91
+ utilities.verifyElementVisibilityState(listOrderingPage.dropdownList(), 'visible');
92
+ for (let index = 0; index < 4; index++) {
93
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.positionDropdownListOption(), index), `${index + 1}`);
94
+ }
95
+ });
96
+
97
+ it('The user should be able to select an option from the position dropdown. When the user has not set position in all dropdowns, an alert message "All options need to have a value assigned to them from the dropdown." should be displayed', () => {
98
+ listOrderingPage.steps.selectOptionPositionPreviewTab(0, 2);
99
+ utilities.verifyElementVisibilityState(listOrderingPage.dropdownList(), 'notExist');
100
+ listOrderingPage.steps.verifyAssignValueToAllDropdownAlertMessage();
101
+ });
102
+
103
+ it('When the user tries to set position of an option such that the same position has already been assigned to another option, then the selected position from the previous option dropdown should reset', () => {
104
+ listOrderingPage.steps.selectOptionPositionPreviewTab(1, 2);
105
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(0, '');
106
+ });
107
+
108
+ it('User should be able to reorder options containing image, bold text and equation options in the list using position dropdowns. On setting position for all options, the alert message should get removed', () => {
109
+ listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }])
110
+ listOrderingPage.steps.verifyAlertMessageNotExists();
111
+ });
112
+ } else if (view === 'Grading view') {
113
+ it(`The order of the responses should be as per the submitted response`, () => {
114
+ listOrderingPage.steps.verifyOptionWithImageDropdownLayoutInGradingView(0);
115
+ listOrderingPage.steps.verifyOptionWithBoldTextDropdownLayoutInGradingView(1);
116
+ listOrderingPage.steps.verifyOptionWithEquationTextDropdownLayoutInGradingView(2);
117
+ listOrderingPage.steps.verifyTextContentOfOptionDropdownLayoutInGradingView('alpha', 3);
118
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
119
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
120
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
121
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
122
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
123
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
124
+ });
125
+
126
+ it('The order of the responses should not be editable', () => {
127
+ listOrderingPage.steps.expandPositionDropdownPreviewTab(2);
128
+ utilities.verifyElementVisibilityState(listOrderingPage.dropdownList(), 'notExist');
129
+ });
130
+ } else {
131
+ it('The order of the options should be as per the correct answer order', () => {
132
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(0, '2');
133
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(1, '1');
134
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(2, '3');
135
+ listOrderingPage.steps.verifySelectedOptionPositionDropdown(3, '4');
136
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
137
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
138
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
139
+ listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
140
+ });
141
+ }
142
+
143
+ it('CSS of preview contents', { tags: 'css' }, () => {
144
+ switch (view) {
145
+ case 'Question preview':
146
+ case 'Item preview':
147
+ case 'Item view':
148
+ case 'Item preview':
149
+ case 'Student view':
150
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.positionDropdownPreviewTab(), 0), {
151
+ 'background-color': css.color.optionsBg,
152
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
153
+ });
154
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.positionDropdownPreviewTab(), 0), {
155
+ 'background-color': css.color.defaultBackground,
156
+ 'border': `1px solid ${css.color.correctAnswer}`
157
+ });
158
+ utilities.verifyCSS(listOrderingPage.dropdownOptionWrapperPreviewTab(), {
159
+ 'background-color': css.color.defaultBackground,
160
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
161
+ });
162
+ utilities.verifyCSS(listOrderingPage.dropdownOptionWrapperPreviewTab().find('.question-text-wrapper'), {
163
+ 'color': css.color.text,
164
+ 'font-size': css.fontSize.default,
165
+ 'font-weight': css.fontWeight.regular
166
+ });
167
+ utilities.verifyCSS(listOrderingPage.dropdownWrapperPreviewTab().find('.dropdown-label-text'), {
168
+ 'color': css.color.liText,
169
+ 'font-size': css.fontSize.default,
170
+ 'font-weight': css.fontWeight.regular
171
+ });
172
+ break;
173
+ case 'Grading view':
174
+ case 'Correct answer view':
175
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.positionDropdownPreviewTab(), 0), {
176
+ 'background-color': css.color.optionsBg,
177
+ 'border': `1px solid ${css.color.correctAnswer}`
178
+ });
179
+ utilities.verifyCSS(listOrderingPage.dropdownOptionWrapperGradingView(), {
180
+ 'background-color': css.color.defaultBackground,
181
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
182
+ });
183
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.dropdownOptionWrapperGradingView(), 3).find('.question-text-wrapper'), {
184
+ 'color': css.color.text,
185
+ 'font-size': css.fontSize.default,
186
+ 'font-weight': css.fontWeight.regular
187
+ });
188
+ utilities.verifyCSS(listOrderingPage.dropdownWrapperPreviewTab().find('.dropdown-label-text'), {
189
+ 'color': css.color.text,
190
+ 'font-size': css.fontSize.default,
191
+ 'font-weight': css.fontWeight.regular
192
+ });
193
+ }
194
+ });
195
+
196
+ it('Accessibility of preview contents', { tags: 'a11y' }, () => {
197
+ cy.checkAccessibility(listOrderingPage.optionWrapperPreviewTab().parents('[class*="question-preview-wrapper"]'));
198
+ });
199
+ });
200
+ });
201
+ });