itemengine-cypress-automation 1.0.143-migrationScripts-d059d60.0 → 1.0.144-21MatchRepoUpdate-0ab2c79.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/additionalSettingsBasic.js +104 -0
  2. package/cypress/e2e/ILC/ContentBlocks/additionalSection.js +92 -0
  3. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +11 -1
  4. package/cypress/e2e/ILC/ContentBlocks/previewTab.js +91 -0
  5. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +3 -3
  6. package/cypress/e2e/ILC/Desmos/desmosFourFunctionCalculatorEditTabBasicSection.js +2 -1
  7. package/cypress/e2e/ILC/Desmos/desmosFourFunctionCalculatorPreviewContents.smoke.js +2 -1
  8. package/cypress/e2e/ILC/Desmos/desmosGeometryToolEditTabBasicSection.js +1 -0
  9. package/cypress/e2e/ILC/Desmos/desmosGeometryToolPreviewContents.smoke.js +2 -1
  10. package/cypress/e2e/ILC/Desmos/desmosGraphingCalculatorEditTabBasicSection.js +1 -0
  11. package/cypress/e2e/ILC/Desmos/desmosGraphingCalculatorPreviewContents.smoke.js +2 -1
  12. package/cypress/e2e/ILC/Desmos/desmosMatrixCalculatorEditTabBasicSection.js +2 -2
  13. package/cypress/e2e/ILC/Desmos/desmosMatrixCalculatorPreviewContents.smoke.js +2 -1
  14. package/cypress/e2e/ILC/Desmos/desmosScientificCalculatorEditTabBasicSection.js +3 -2
  15. package/cypress/e2e/ILC/Desmos/desmosScientificCalculatorPreviewContents.smoke.js +2 -1
  16. package/cypress/e2e/ILC/DesmosGraphing/additionalSettings.js +0 -5
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +124 -0
  18. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +0 -9
  19. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +17 -17
  20. package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +83 -0
  21. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +32 -30
  22. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +25 -21
  23. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +40 -41
  24. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +249 -99
  25. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +118 -187
  26. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
  27. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +11 -11
  29. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneSettings.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +1 -3
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsBasic.js +138 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsForDropdowns.js +309 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownSettings.js +181 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettingsBasic.js +132 -0
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +143 -0
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsForDropdowns.js +345 -0
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  38. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +49 -0
  39. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +25 -0
  40. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +251 -0
  41. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +49 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsBasic.js +93 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +215 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +1 -1
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/textContainerSettings.js +219 -0
  46. package/cypress/e2e/ILC/GeoGebraTools/3DGraphingCalculatorEditTabBasicSection.js +96 -0
  47. package/cypress/e2e/ILC/GeoGebraTools/3DGraphingCalculatorPreviewTabContents.smoke.js +75 -0
  48. package/cypress/e2e/ILC/GeoGebraTools/casCalculatorEditTabBasicSection.js +96 -0
  49. package/cypress/e2e/ILC/GeoGebraTools/casCalculatorPreviewTabContents.smoke.js +75 -0
  50. package/cypress/e2e/ILC/GeoGebraTools/geometryCalculatorEditTabBasicSection.js +96 -0
  51. package/cypress/e2e/ILC/GeoGebraTools/geometryCalculatorPreviewTabContents.smoke.js +76 -0
  52. package/cypress/e2e/ILC/GeoGebraTools/graphingCalculatorEditTabBasicSection.js +96 -0
  53. package/cypress/e2e/ILC/GeoGebraTools/graphingCalculatorPreviewTabContents.smoke.js +73 -0
  54. package/cypress/e2e/ILC/GeoGebraTools/probablityCalculatorEditTabBasicSection.js +96 -0
  55. package/cypress/e2e/ILC/GeoGebraTools/probablityCalculatorPreviewTabContents.smoke.js +75 -0
  56. package/cypress/e2e/ILC/GeoGebraTools/scientificCalculatorEditTabBasicSection.js +96 -0
  57. package/cypress/e2e/ILC/GeoGebraTools/scientificCalculatorPreviewTabContents.smoke.js +75 -0
  58. package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +10 -8
  59. package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +3 -2
  60. package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +2 -1
  61. package/cypress/e2e/ILC/GeogebraActivity/insertResourceLink.js +318 -0
  62. package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +2 -1
  63. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +15 -4
  64. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +280 -0
  65. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +136 -0
  66. package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +205 -0
  67. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +213 -0
  68. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +106 -0
  69. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +79 -0
  70. package/cypress/e2e/ILC/MultipleSelection/additionalSettingsBasic.js +108 -0
  71. package/cypress/e2e/ILC/MultipleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +251 -0
  72. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +180 -0
  73. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +48 -56
  74. package/cypress/e2e/ILC/SingleSelection/additionalSettingsBasic.js +107 -0
  75. package/cypress/e2e/ILC/SingleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +251 -0
  76. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +180 -0
  77. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +12 -3
  78. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +4 -1
  79. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +93 -68
  80. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +59 -52
  81. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +59 -52
  82. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +61 -50
  83. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +65 -51
  84. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +55 -46
  85. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +6 -3
  86. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +11 -9
  87. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +4 -3
  88. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +4 -2
  89. package/cypress/e2e/ILC/UploadResponse/additionalSettingsBasic.js +85 -0
  90. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +12 -12
  91. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +1 -1
  92. package/cypress/fixtures/constants.js +2 -0
  93. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +1114 -1511
  94. package/cypress/fixtures/theme/ilc.json +7 -1
  95. package/cypress/pages/audioResponsePage.js +26 -2
  96. package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +1 -0
  97. package/cypress/pages/components/additionalSettingsPanel.js +3 -10
  98. package/cypress/pages/components/ariaLabelSectionComponent.js +84 -0
  99. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +5 -2
  100. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  101. package/cypress/pages/components/commonComponents.js +1 -1
  102. package/cypress/pages/components/createCustomCategoryFlyout.js +2 -2
  103. package/cypress/pages/components/createQuestionBasePage.js +1 -1
  104. package/cypress/pages/components/desmosToolComponent.js +1 -0
  105. package/cypress/pages/components/draggableOptionContainer.js +1 -1
  106. package/cypress/pages/components/editCategoryFlyout.js +9 -10
  107. package/cypress/pages/components/equationEditorFlyout.js +20 -11
  108. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +167 -3
  109. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +149 -6
  110. package/cypress/pages/components/gradingViewEnumerationComponent.js +151 -0
  111. package/cypress/pages/components/gridQuestionCommonComponent.js +390 -0
  112. package/cypress/pages/components/imageCanvasComponent.js +25 -1
  113. package/cypress/pages/components/index.js +5 -1
  114. package/cypress/pages/components/placeholderTextSectionComponent.js +110 -0
  115. package/cypress/pages/components/responseAreaSettingsPopupComponent.js +2 -2
  116. package/cypress/pages/contentBlocksPage.js +60 -1
  117. package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -17
  118. package/cypress/pages/essayResponsePage.js +14 -11
  119. package/cypress/pages/fillInTheGapsDragAndDropPage.js +15 -0
  120. package/cypress/pages/fillInTheGapsDropdownPage.js +121 -2
  121. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
  122. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +70 -3
  123. package/cypress/pages/fillInTheGapsOverImageTextPage.js +33 -3
  124. package/cypress/pages/fillInTheGapsTextPage.js +81 -4
  125. package/cypress/pages/geoGebraActivityPage.js +75 -11
  126. package/cypress/pages/geoGebraToolsPage.js +292 -0
  127. package/cypress/pages/graphingPage.js +2 -1
  128. package/cypress/pages/gridFillPage.js +713 -0
  129. package/cypress/pages/index.js +3 -1
  130. package/cypress/pages/multipleSelectionGridPage.js +71 -317
  131. package/cypress/pages/multipleSelectionPage.js +2 -1
  132. package/cypress/pages/selectQuestionResourceToolPage.js +13 -2
  133. package/cypress/pages/singleSelectionGridPage.js +78 -329
  134. package/cypress/pages/singleSelectionPage.js +2 -1
  135. package/cypress/pages/textEntryMathPage.js +24 -6
  136. package/cypress/pages/textEntryMathWithImagePage.js +1 -1
  137. package/cypress/pages/uploadResponsePage.js +4 -3
  138. package/package.json +1 -1
  139. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +0 -43
  140. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -642
@@ -0,0 +1,213 @@
1
+ import { gridFillPage, 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
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+
9
+ describe('Create item page - Grid fill : Preview contents', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ views.forEach((view) => {
15
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ switch (view) {
19
+ case 'Question preview':
20
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
21
+ cy.barsPreLoaderWait();
22
+ gridFillPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
23
+ gridFillPage.steps.allotPoints(5);
24
+ gridFillPage.steps.increaseColumnsCount();
25
+ gridFillPage.steps.increaseRowsCount();
26
+ gridFillPage.steps.expandCustomizeLayoutAccordion();
27
+ gridFillPage.steps.shadeCell(0, 0);
28
+ gridFillPage.steps.selectHideCellButton();
29
+ gridFillPage.steps.hideCell(2);
30
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 4);
31
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 5);
32
+ gridFillPage.steps.switchToPreviewTab();
33
+ break;
34
+ case 'Item view':
35
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
36
+ break;
37
+ case 'Item preview':
38
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
39
+ gridFillPage.steps.switchToPreviewTab();
40
+ break;
41
+ case 'Student view':
42
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
43
+ break;
44
+ case 'Grading view':
45
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
46
+ break;
47
+ case 'Correct answer view':
48
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
49
+ break;
50
+ default:
51
+ throw new Error('Invalid view');
52
+ }
53
+ });
54
+
55
+ after(() => {
56
+ if (view === 'Question preview') {
57
+ gridFillPage.steps.clickOnSaveQuestionButton();
58
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
59
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
60
+ }
61
+ if (view === 'Student view') {
62
+ studentViewPage.steps.submitResponse();
63
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
64
+ }
65
+ });
66
+
67
+ it('Question instructions should be visible', () => {
68
+ utilities.verifyInnerText(gridFillPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
69
+ utilities.verifyElementVisibilityState(gridFillPage.questionInstructionsText(), 'visible');
70
+ });
71
+
72
+ it('Grid matrix should be displayed with 4 rows and 6 columns and 24 cells should be present', () => {
73
+ utilities.verifyElementVisibilityState(gridFillPage.gridWrapperPreviewTab(), 'visible');
74
+ gridFillPage.steps.verifyRowsCountPreviewTab(4);
75
+ gridFillPage.steps.verifyColumnsCountPreviewTab(6);
76
+ utilities.verifyElementCount(gridFillPage.cellInPreviewTab(), 24);
77
+ });
78
+
79
+ it('Cell with \'Hide\' customization should be displayed', () => {
80
+ gridFillPage.steps.verifyHideCustomizedCellPreviewTab(0, 2);
81
+ });
82
+
83
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
84
+
85
+ it('Cell with \'Shade\' customization should be displayed', () => {
86
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 0);
87
+ });
88
+
89
+ it('User should be able to select cell', () => {
90
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
91
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 4);
92
+ gridFillPage.steps.selectCellPreviewTab(0, 5);
93
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 5);
94
+ gridFillPage.steps.selectCellPreviewTab(1, 1);
95
+ gridFillPage.steps.verifyCellSelectedPreviewTab(1, 1);
96
+ });
97
+
98
+ it('User should be able to unselect cells', () => {
99
+ gridFillPage.steps.unselectCellPreviewTab(1, 1);
100
+ });
101
+
102
+ it('When user hovers over cell, then cell should be in interactive state', () => {
103
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 9));
104
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 9), {
105
+ 'border-color': css.color.activeButtons,
106
+ 'background-color': css.color.gridCellHoverStateBg
107
+ });
108
+ utilities.hoverAwayFromElement(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 9));
109
+ });
110
+ }
111
+ else if (view === 'Grading view') {
112
+ it('Cell with \'Hide\' customization should be displayed', () => {
113
+ gridFillPage.steps.verifyHideCustomizedCellPreviewTab(0, 2);
114
+ });
115
+
116
+ it(`The grid fill should be displayed filled with selected correct answer cells and status message \' Your answer is correct\' should be displayed`, () => {
117
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 0);
118
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 4);
119
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 5);
120
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
121
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
122
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 0);
123
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
124
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 4);
125
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 4);
126
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 5);
127
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 5);
128
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 5);
129
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
130
+ });
131
+
132
+ it('Grid fill should not be editable', () => {
133
+ gridFillPage.steps.selectCellPreviewTab(1, 3);
134
+ gridFillPage.steps.verifyCellNotSelectedPreviewTab(1, 3);
135
+ });
136
+
137
+ } else {
138
+ it('Cell with \'Hide\' customization should be displayed', () => {
139
+ gridFillPage.steps.verifyHideCustomizedCellPreviewTab(0, 2);
140
+ });
141
+
142
+ it(`The grid fill should be displayed filled with selected correct answer cells`, () => {
143
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 0);
144
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 4);
145
+ gridFillPage.steps.verifyCellSelectedPreviewTab(0, 5);
146
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
147
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
148
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 0);
149
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
150
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 4);
151
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 4);
152
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 5);
153
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 5);
154
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 5);
155
+ });
156
+
157
+ it('Grid fill should not be editable', () => {
158
+ gridFillPage.steps.selectCellPreviewTab(1, 3);
159
+ gridFillPage.steps.verifyCellNotSelectedPreviewTab(1, 3);
160
+ });
161
+ }
162
+
163
+ it('CSS of preview contents', { tags: 'css' }, () => {
164
+ utilities.verifyCSS(gridFillPage.questionInstructionsText(), {
165
+ 'color': css.color.text,
166
+ 'font-size': css.fontSize.default,
167
+ 'font-weight': css.fontWeight.regular
168
+ });
169
+ switch (view) {
170
+ case 'Question preview':
171
+ case 'Item preview':
172
+ case 'Item view':
173
+ case 'Item preview':
174
+ case 'Student view':
175
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 4), {
176
+ 'border-color': css.color.activeHighlightBorder,
177
+ 'background-color': css.color.gridCellSelectedStateBg
178
+ });
179
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 2), {
180
+ 'border-color': css.color.secondaryBtnDisabled,
181
+ 'background-color': css.color.defaultBackground
182
+ });
183
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 7), {
184
+ 'border-color': css.color.activeButtons,
185
+ 'background-color': css.color.gridCellDefaultStateBg
186
+ });
187
+ break;
188
+ case 'Grading view':
189
+ case 'Correct answer view':
190
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 4), {
191
+ 'border-color': css.color.correctAnswer,
192
+ 'background-color': css.color.gridCellCorrectAnswerBg
193
+ });
194
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 2), {
195
+ 'border-color': css.color.secondaryBtnDisabled,
196
+ 'background-color': css.color.defaultBackground
197
+ });
198
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 7), {
199
+ 'border-color': css.color.figDefaultComponentBorder,
200
+ 'background-color': css.color.gridCellDefaultStateBg
201
+ });
202
+ break;
203
+ default:
204
+ throw new Error('Invalid view');
205
+ }
206
+ });
207
+
208
+ it.skip('Accessibility of preview tab', { tags: 'a11y' }, () => {
209
+ cy.checkAccessibility(gridFillPage.questionInstructionsText().parents('[class*="preview"]'));
210
+ });
211
+ });
212
+ });
213
+ });
@@ -0,0 +1,106 @@
1
+ import { gridFillPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+
5
+ describe('Create Item page - Grid fill: Manually and non scored', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question Preview: Manually Scored', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
14
+ cy.barsPreLoaderWait();
15
+ gridFillPage.steps.addTextInQuestionInstructionsInputField('grid fill');
16
+ gridFillPage.steps.expandScoringTypeDropdown();
17
+ gridFillPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
18
+ gridFillPage.steps.switchToPreviewTab();
19
+ });
20
+
21
+ it('Question instructions and grid should be displayed in the preview tab', () => {
22
+ gridFillPage.steps.verifyQuestionInstructionsTextPreviewTab('grid fill');
23
+ utilities.verifyElementVisibilityState(gridFillPage.gridWrapperPreviewTab(), 'visible');
24
+ });
25
+
26
+ gridFillPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
27
+ });
28
+
29
+ describe('Question Preview: Non Scored', () => {
30
+ abortEarlySetup();
31
+ before(() => {
32
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
33
+ cy.barsPreLoaderWait();
34
+ gridFillPage.steps.addTextInQuestionInstructionsInputField('grid fill');
35
+ gridFillPage.steps.selectCell(0, 4);
36
+ gridFillPage.steps.selectCell(0, 3);
37
+ gridFillPage.steps.expandScoringTypeDropdown();
38
+ gridFillPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
39
+ gridFillPage.steps.checkAllowStudentToCheckAnswerCheckbox();
40
+ gridFillPage.steps.switchToPreviewTab();
41
+ });
42
+
43
+ gridFillPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
44
+
45
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed', () => {
46
+ gridFillPage.steps.switchToGradingView();
47
+ gridFillPage.steps.verifyCorrectIncorrectIconsNotExist();
48
+ gridFillPage.steps.switchToStudentView();
49
+ });
50
+
51
+ it('When the user attempts the question incorrectly and on switching to \'Grading\' view, incorrect icon should be displayed in all incorrect responses, correct icon should be displayed in all correct responses, a status message with text \'Your answer is incorrect\'', () => {
52
+ gridFillPage.steps.selectCellPreviewTab(0, 2);
53
+ gridFillPage.steps.switchToGradingView();
54
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
55
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
56
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 2);
57
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
58
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
59
+ cy.log('When user clicks on Check answer button after he attempts the question incorrectly incorrect icons should be displayed in all incorrect responses, status message \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
60
+ gridFillPage.steps.checkAnswer();
61
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 2);
62
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
63
+ });
64
+
65
+ it('When the user attempts the question partially correct, then on switching to \'Grading\' view, correct icon should be displayed in the correct answer responses, incorrect icon should be displayed in 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', () => {
66
+ gridFillPage.steps.resetQuestionPreview();
67
+ gridFillPage.steps.selectCellPreviewTab(0, 3);
68
+ gridFillPage.steps.selectCellPreviewTab(0, 2);
69
+ gridFillPage.steps.switchToGradingView();
70
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 2);
71
+ gridFillPage.steps.verifyIncorrectResponseBackgroundColor(0, 2);
72
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
73
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 3);
74
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
75
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
76
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
77
+ cy.log('When user clicks on Check answer button after he attempts the question partially correct, correct icon should be displayed in the correct answer responses, incorrect icon should be displayed in incorrect answer response, status message \'Your answer is incorrect\' should be displayed')
78
+ gridFillPage.steps.checkAnswer();
79
+ gridFillPage.steps.verifyCorrectResponseIcon(0,3);
80
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 3);
81
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 2);
82
+ gridFillPage.steps.verifyIncorrectResponseBackgroundColor(0, 2);
83
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
84
+ });
85
+
86
+ it('When user attempts the question correctly, on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed in the correct answer responses, a status message with text \'Your answer is correct\'', () => {
87
+ gridFillPage.steps.resetQuestionPreview();
88
+ gridFillPage.steps.selectCellPreviewTab(0, 3);
89
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
90
+ gridFillPage.steps.switchToGradingView();
91
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
92
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 3);
93
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
94
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 3);
95
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
96
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
97
+ cy.log('When user clicks on Check answer button after he attempts the question correctly, then correct icon should be displayed in the correct answer responses, status message \'Your answer is correct\' should be displayed')
98
+ gridFillPage.steps.checkAnswer();
99
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
100
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 3);
101
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
102
+ gridFillPage.steps.verifyCorrectResponseBackgroundColor(0, 4);
103
+ gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
104
+ });
105
+ });
106
+ });
@@ -0,0 +1,79 @@
1
+ import { dialogBoxBase, gridFillPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ describe('Create Item page - Grid fill: Specify Correct answer, Alternative correct answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Specify correct answer section - \'Correct\' accordion', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
14
+ cy.barsPreLoaderWait();
15
+ });
16
+
17
+ gridFillPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('grid fill');
18
+
19
+ gridFillPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
20
+ });
21
+
22
+ describe('Specify correct answer section - \'Alternative\' accordion', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
26
+ cy.barsPreLoaderWait();
27
+ });
28
+
29
+ gridFillPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation();
30
+
31
+ it('When user has added points and selected grid cells in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
32
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
33
+ gridFillPage.steps.allotPoints(20);
34
+ gridFillPage.steps.addAlternativeAnswerAccordion(1);
35
+ });
36
+
37
+ gridFillPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
38
+
39
+ it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
40
+ cy.log('Pre-step: Selecting a cell in grid');
41
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 1);
42
+ gridFillPage.steps.addAlternativeAnswerAccordion(2);
43
+ });
44
+
45
+ gridFillPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
46
+
47
+ it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
48
+ cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
49
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 1);
50
+ gridFillPage.steps.allotPoints(5);
51
+ gridFillPage.steps.deleteAlternativeAnswerAccordion(0);
52
+ gridFillPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
53
+ gridFillPage.steps.verifyAlternativeAnswerAccordionLabel(0);
54
+ });
55
+
56
+ it('When user has not given an input in \'Cell shade count\' then user should not be able to add another alternate accordion', () => {
57
+ cy.log('Pre-step: Uncheck \'Match exact position of cells\' checkbox');
58
+ gridFillPage.steps.uncheckMatchExactPositionOfCellsCheckbox();
59
+ gridFillPage.steps.addAlternativeAnswerAccordion(1);
60
+ gridFillPage.steps.closeWarningPopup();
61
+ gridFillPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
62
+ });
63
+
64
+ it('\'Error: Please set a correct answer.\' error message should be displayed', () => {
65
+ utilities.verifyInnerText(gridFillPage.errorMessage(), 'Error: Please set a correct answer.');
66
+ });
67
+
68
+ it('When user has given an input in \'Cell shade count\' then user should be able to add another alternate accordion', () => {
69
+ gridFillPage.steps.addInputToCellShadeCountInputField(5);
70
+ gridFillPage.steps.addAlternativeAnswerAccordion(1);
71
+ gridFillPage.steps.verifyAlternativeAnswerAccordionLabel(1);
72
+ });
73
+
74
+ it('The newly added alternate accordion should be displayed in its default state i.e. with a grid and checked \'Match exact position of cell\' checkbox', () => {
75
+ gridFillPage.steps.verifyDefaultGridInSpecifyCorrectAnswerSection();
76
+ gridFillPage.steps.verifyMatchExactPositionOfCellsCheckboxIsChecked();
77
+ });
78
+ });
79
+ });
@@ -0,0 +1,108 @@
1
+ import { multipleSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
6
+ const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
7
+
8
+ describe('Multiple selection - Additional settings', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Additional settings accordion', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
17
+ });
18
+
19
+ multipleSelectionPage.tests.verifyAdditionalSettingsAccordionProperties();
20
+ });
21
+
22
+ describe('Additional settings: Font size - Contents in edit tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
26
+ cy.barsPreLoaderWait();
27
+ multipleSelectionPage.steps.expandAdditionalSettings();
28
+ });
29
+
30
+ multipleSelectionPage.tests.verifyFontSizeSectionContents();
31
+ });
32
+
33
+ describe('Additional settings: Font size - functionality in edit tab', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
37
+ cy.barsPreLoaderWait();
38
+ multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Multiple selection');
39
+ multipleSelectionPage.steps.addInputToOptionsInputField(options);
40
+ multipleSelectionPage.steps.expandAdditionalSettings();
41
+ });
42
+
43
+ Object.keys(fontSizes).forEach((option) => {
44
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the edit tab options should change to ${fontSizes[option]} accordingly`, () => {
45
+ multipleSelectionPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
46
+ utilities.verifyInnerText(multipleSelectionPage.fontSizeDropdown(), `${option}`);
47
+ utilities.verifyCSS(multipleSelectionPage.optionsText(), {
48
+ 'font-size': fontSizes[option]
49
+ });
50
+ });
51
+ });
52
+ });
53
+
54
+ describe('Additional settings: Font size - functionality in preview tab', () => {
55
+ abortEarlySetup();
56
+ before(() => {
57
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
58
+ cy.barsPreLoaderWait();
59
+ multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Multiple selection');
60
+ multipleSelectionPage.steps.addInputToOptionsInputField(options);
61
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
62
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
63
+ multipleSelectionPage.steps.expandAdditionalSettings();
64
+ });
65
+
66
+ Object.keys(fontSizes).forEach((option) => {
67
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
68
+ multipleSelectionPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
69
+ utilities.verifyInnerText(multipleSelectionPage.fontSizeDropdown(), `${option}`);
70
+ multipleSelectionPage.steps.switchToPreviewTab();
71
+ utilities.verifyCSS(multipleSelectionPage.questionInstructionsText(), {
72
+ 'font-size': fontSizes[option]
73
+ });
74
+ utilities.verifyCSS(multipleSelectionPage.optionsText(), {
75
+ 'font-size': fontSizes[option]
76
+ });
77
+ multipleSelectionPage.steps.switchToGradingView();
78
+ utilities.verifyCSS(multipleSelectionPage.optionsText(), {
79
+ 'font-size': fontSizes[option]
80
+ });
81
+ multipleSelectionPage.steps.switchToStudentView();
82
+ multipleSelectionPage.steps.switchToEditTab();
83
+ });
84
+ });
85
+ });
86
+
87
+ describe('Additional settings: Accessibility section', () => {
88
+ abortEarlySetup();
89
+ before(() => {
90
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
91
+ cy.barsPreLoaderWait();
92
+ multipleSelectionPage.steps.expandAdditionalSettings();
93
+ });
94
+
95
+ multipleSelectionPage.tests.verifyAdditionalSettingsAccessibilitySection();
96
+ });
97
+
98
+ describe('Additional settings: Details section', () => {
99
+ abortEarlySetup();
100
+ before(() => {
101
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
102
+ cy.barsPreLoaderWait();
103
+ multipleSelectionPage.steps.expandAdditionalSettings();
104
+ });
105
+
106
+ multipleSelectionPage.tests.verifyDetailsSection();
107
+ });
108
+ });