itemengine-cypress-automation 1.0.142 → 1.0.143

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,713 @@
1
+ import { commonComponents, autoScoredScoringSectionMultiResponseType, questionInputFieldComponent, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection } from "./components";
2
+ import { dialogBoxBase } from ".";
3
+ import utilities from "../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const selectors = {
7
+ ...questionInputFieldComponent,
8
+ ...questionInstructionsComponent,
9
+ ...commonComponents,
10
+ ...autoScoredScoringSectionMultiResponseType,
11
+ ...autoScoredSpecifyCorrectAnswerSection,
12
+
13
+ columnsInputField: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] .input-stepper-textfield').eq(0),
14
+ columnsLabel: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [class*="GridFillstyles__CanvasInputLabelWrapper"]').eq(0),
15
+ columnsIncreaseButton: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [aria-label="Increase count"]').eq(0),
16
+ columnsDecreaseButton: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [aria-label="Decrease count"]').eq(0),
17
+ rowsInputField: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] .input-stepper-textfield').eq(1),
18
+ rowsLabel: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [class*="GridFillstyles__CanvasInputLabelWrapper"]').eq(1),
19
+ rowsIncreaseButton: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [aria-label="Increase count"]').eq(1),
20
+ rowsDecreaseButton: () => cy.get('[class*="GridFillstyles__RowsColWrapper"] [aria-label="Decrease count"]').eq(1),
21
+ cellInEditTab: () => cy.get('[class*="GridFillResponsestyles__CellContainer"]'),
22
+ matchExactPositionLabel: () => cy.get('[data-ngie-testid="match-exact-position-of-cells-checkbox"] [class*="label"]'),
23
+ matchExactPositionCheckbox: () => cy.get('[data-ngie-testid="match-exact-position-of-cells-checkbox"] input'),
24
+ cellInSpecifyCorrectAnswerSection: () => cy.get('[class*="GridFillstyles__SetCorrectAnswerWrapper"] [class*="GridFillResponsestyles__CellContainer"]'),
25
+ rowsWrapperSpecifyCorrectAnswerSection: () => cy.get('[class*="GridFillstyles__SetCorrectAnswerWrapper"] [class*="GridFillResponsestyles__RowContainer"]'),
26
+ correctAnswerAccordion: () => cy.get('.correct-answer-accordion'),
27
+ correctAnswerLabel: () => cy.get('.answer-accordion-label div'),
28
+ gridFillWrapper: () => cy.get('.correct-answer-accordion .grid-fill-response-wrapper'),
29
+ pointsPerResponseLabel: () => cy.get('.alternate-points-points-per-text-span'),
30
+ pointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
31
+ pointsPerResponseWrapper: () => cy.get('.alternate-points-points-per-text-wrapper'),
32
+ gridSpecifyCorrectAnswerSection: () => cy.get('[class*="AnswerAccordionstyles__AnswerPanel"] .grid-wrapper-cls'),
33
+ gridRow: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]'),
34
+ cellShadeCountLabel: () => cy.get('[class*="GridFillResponsestyles__CellFillCountLabel"]'),
35
+ cellShadeCountInputField: () => cy.get('.cell-count-cls input'),
36
+
37
+ //Customize layout accordion
38
+ customizeLayoutAccordionButton: () => cy.get('.customize-layout-wrapper-cls .ngie-accordion-summary'),
39
+ customizeLayoutLabel: () => cy.get('[class*="AdditionalGridFillSettingsstyles__StyledLabel"]'),
40
+ customizeLayoutAccordionChevronButton: () => cy.get('.customize-layout-wrapper-cls [class*="MuiAccordionSummary-expandIconWrapper "]'),
41
+ shadeCellButton: () => cy.get('.single-select-toggle-group button').eq(0),
42
+ hideCellButton: () => cy.get('.single-select-toggle-group button').eq(1),
43
+ cellInCustomizeLayout: () => cy.get('[id*="Response-cell"]'),
44
+ rowsWrapperCustomizeLayout: () => cy.get('.customize-layout-wrapper-cls [class*="GridFillResponsestyles__RowContainer"]'),
45
+
46
+ //Preview tab
47
+ gridWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__MatrixContainer"]:visible'),
48
+ cellInPreviewTab: () => cy.get('[class*="GridFillResponsestyles__CellContainer"]:visible'),
49
+ rowsWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]:visible'),
50
+ }
51
+
52
+ const steps = {
53
+ ...scoringSectionBaseEditTab.steps,
54
+ ...questionInstructionsComponent.steps,
55
+ ...autoScoredScoringPreviewTab.steps,
56
+ ...autoScoredStudentViewSettings.steps,
57
+ ...createQuestionBasePage.steps,
58
+ ...correctIncorrectAnswerLabelComponent.steps,
59
+ ...autoScoredSpecifyCorrectAnswerSection.steps,
60
+ ...dialogBoxBase.steps,
61
+ ...autoScoredScoringSectionMultiResponseType.steps,
62
+
63
+ /**
64
+ * @param {number} value value of columns
65
+ * @description function enters value in columns input field
66
+ */
67
+ setColumns: (value) => {
68
+ gridFillPage.columnsInputField()
69
+ .clear()
70
+ .type('{selectall}')
71
+ .type(value)
72
+ .blur();
73
+ gridFillPage.columnsInputField()
74
+ .should('have.value', value);
75
+ },
76
+
77
+ /**
78
+ * @param {number} value value of columns input field
79
+ */
80
+ verifyColumnsInputField: (value) => {
81
+ gridFillPage.columnsInputField()
82
+ .should('have.value', value);
83
+ },
84
+
85
+ decreaseColumnsCount: () => {
86
+ gridFillPage.columnsDecreaseButton()
87
+ .click();
88
+ },
89
+
90
+ increaseColumnsCount: () => {
91
+ gridFillPage.columnsIncreaseButton()
92
+ .click();
93
+ },
94
+
95
+ /**
96
+ * @param {number} value value of rows
97
+ * @description function enters value in rows input field
98
+ */
99
+ setRows: (value) => {
100
+ gridFillPage.rowsInputField()
101
+ .clear()
102
+ .type('{selectall}')
103
+ .type(value)
104
+ .blur();
105
+ gridFillPage.rowsInputField()
106
+ .should('have.value', value);
107
+ },
108
+
109
+ /**
110
+ * @param {number} value value of rows input field
111
+ */
112
+ verifyRowsInputField: (value) => {
113
+ gridFillPage.rowsInputField()
114
+ .should('have.value', value);
115
+ },
116
+
117
+ decreaseRowsCount: () => {
118
+ gridFillPage.rowsDecreaseButton()
119
+ .click();
120
+ },
121
+
122
+ increaseRowsCount: () => {
123
+ gridFillPage.rowsIncreaseButton()
124
+ .click();
125
+ },
126
+
127
+ expandCustomizeLayoutAccordion: () => {
128
+ gridFillPage.customizeLayoutAccordionButton()
129
+ .click();
130
+ },
131
+
132
+ selectShadeCellButton: () => {
133
+ gridFillPage.shadeCellButton()
134
+ .click()
135
+ .should('have.class', 'Mui-selected');
136
+ },
137
+
138
+ selectHideCellButton: () => {
139
+ gridFillPage.hideCellButton()
140
+ .click()
141
+ .should('have.class', 'Mui-selected');
142
+ },
143
+
144
+ /**
145
+ * Shades a cell in the customize layout.
146
+ * @param {number} rowIndex - The index of the row containing the cell.
147
+ * @param {number} columnIndex - The index of the column containing the cell.
148
+ */
149
+ shadeCell: (rowIndex, columnIndex) => {
150
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
151
+ .within(() => {
152
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
153
+ .click()
154
+ .invoke('attr', 'aria-label')
155
+ .should('include', 'fillCell');
156
+ });
157
+ },
158
+
159
+ /**
160
+ * Unshades a cell in the customize layout.
161
+ * @param {number} rowIndex - The index of the row containing the cell.
162
+ * @param {number} columnIndex - The index of the column containing the cell.
163
+ */
164
+ unshadeCell: (rowIndex, columnIndex) => {
165
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
166
+ .within(() => {
167
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
168
+ .click()
169
+ .invoke('attr', 'aria-label')
170
+ .should('not.include', 'fillCell');
171
+ });
172
+ },
173
+
174
+ /**
175
+ * @description select cell in grid of specify correct answer section
176
+ * @param {number} rowIndex Index of row in grid of specify correct answer section
177
+ * @param {number} columnIndex Index of column in grid of specify correct answer section
178
+ */
179
+ selectCellSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
180
+ gridFillPage.gridSpecifyCorrectAnswerSection()
181
+ .within(() => {
182
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
183
+ .within(() => {
184
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
185
+ .click()
186
+ .invoke('attr', 'aria-label')
187
+ .should('include', 'response');
188
+ });
189
+ });
190
+ },
191
+
192
+ /**
193
+ * @description deselect cell in grid of specify correct answer section
194
+ * @param {number} rowIndex Index of row in grid of specify correct answer section
195
+ * @param {number} columnIndex Index of column in grid of specify correct answer section
196
+ */
197
+ deselectCellSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
198
+ gridFillPage.gridSpecifyCorrectAnswerSection()
199
+ .within(() => {
200
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
201
+ .within(() => {
202
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
203
+ .click()
204
+ .invoke('attr', 'aria-label')
205
+ .should('not.include', 'response');
206
+ });
207
+ });
208
+ },
209
+
210
+ /**
211
+ * Hides a cell in the customize layout.
212
+ * @param {number} rowIndex - The index of the row containing the cell.
213
+ * @param {number} columnIndex - The index of the column containing the cell.
214
+ */
215
+ hideCell: (rowIndex, columnIndex) => {
216
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
217
+ .within(() => {
218
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
219
+ .click()
220
+ .invoke('attr', 'aria-label')
221
+ .should('include', 'hideCell');
222
+ });
223
+ },
224
+
225
+ /**
226
+ * Selects a cell in the edit tab.
227
+ * @param {number} rowIndex - The index of the row containing the cell.
228
+ * @param {number} columnIndex - The index of the column containing the cell.
229
+ */
230
+ selectCell: (rowIndex, columnIndex) => {
231
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
232
+ .within(() => {
233
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
234
+ .click()
235
+ .invoke('attr', 'aria-label')
236
+ .should('include', 'response');
237
+ });
238
+ },
239
+
240
+ /**
241
+ * Unselects a cell in the edit tab.
242
+ * @param {number} rowIndex - The index of the row containing the cell.
243
+ * @param {number} columnIndex - The index of the column containing the cell.
244
+ */
245
+ unselectCell: (rowIndex, columnIndex) => {
246
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
247
+ .within(() => {
248
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
249
+ .click()
250
+ .invoke('attr', 'aria-label')
251
+ .should('not.include', 'response');
252
+ });
253
+ },
254
+
255
+ /**
256
+ * Selects a cell in the preview tab.
257
+ * @param {number} rowIndex - The index of the row containing the cell.
258
+ * @param {number} columnIndex - The index of the column containing the cell.
259
+ */
260
+ selectCellPreviewTab: (rowIndex, columnIndex) => {
261
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
262
+ .within(() => {
263
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
264
+ .click();
265
+ });
266
+ },
267
+
268
+
269
+ /**
270
+ * Unselects a cell in the preview tab.
271
+ * @param {number} rowIndex - The index of the row containing the cell.
272
+ * @param {number} columnIndex - The index of the column containing the cell.
273
+ */
274
+ unselectCellPreviewTab: (rowIndex, columnIndex) => {
275
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
276
+ .within(() => {
277
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
278
+ .click();
279
+ });
280
+ },
281
+
282
+ /**
283
+ * @description Verify cell is selected in specify correct answer section grid
284
+ * @param {number} rowIndex Index of row in grid of specify correct answer section
285
+ * @param {number} columnIndex Index of column in grid of specify correct answer section
286
+ */
287
+ verifyCellSelectedSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
288
+ gridFillPage.gridSpecifyCorrectAnswerSection()
289
+ .within(() => {
290
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
291
+ .within(() => {
292
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
293
+ .invoke('attr', 'aria-label')
294
+ .should('include', 'response');
295
+ })
296
+ });
297
+ },
298
+
299
+ /**
300
+ * @description Verify cell is not selected in specify correct answer section grid
301
+ * @param {number} rowIndex Index of row in grid of specify correct answer section
302
+ * @param {number} columnIndex Index of column in grid of specify correct answer section
303
+ */
304
+ verifyCellNotSelectedSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
305
+ gridFillPage.gridSpecifyCorrectAnswerSection()
306
+ .within(() => {
307
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
308
+ .within(() => {
309
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
310
+ .invoke('attr', 'aria-label')
311
+ .should('not.include', 'response');
312
+ });
313
+ });
314
+ },
315
+
316
+ verifyHideCustomizedCellPreviewTab: (index) => {
317
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), index)
318
+ .invoke('attr', 'aria-label')
319
+ .should('include', 'hideCell');
320
+ },
321
+
322
+ /**
323
+ * Verifies if a cell in the preview tab is selected.
324
+ * @param {number} rowIndex - The index of the row containing the cell.
325
+ * @param {number} columnIndex - The index of the column containing the cell.
326
+ */
327
+ verifyCellSelectedPreviewTab: (rowIndex, columnIndex) => {
328
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
329
+ .within(() => {
330
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
331
+ .invoke('attr', 'aria-label')
332
+ .should('include', 'response');
333
+ });
334
+ },
335
+
336
+ /**
337
+ * Verifies if a cell in the preview tab is not selected.
338
+ * @param {number} rowIndex - The index of the row containing the cell.
339
+ * @param {number} columnIndex - The index of the column containing the cell.
340
+ */
341
+ verifyCellNotSelectedPreviewTab: (rowIndex, columnIndex) => {
342
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
343
+ .within(() => {
344
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
345
+ .invoke('attr', 'aria-label')
346
+ .should('include', 'not Selected');
347
+ });
348
+ },
349
+
350
+ /**
351
+ * Verifies if a cell in the preview tab is hidden.
352
+ * @param {number} rowIndex - The index of the row containing the cell.
353
+ * @param {number} columnIndex - The index of the column containing the cell.
354
+ */
355
+ verifyHideCustomizedCellPreviewTab: (rowIndex, columnIndex) => {
356
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
357
+ .within(() => {
358
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
359
+ .invoke('attr', 'aria-label')
360
+ .should('include', 'hideCell');
361
+ });
362
+ },
363
+
364
+ /**
365
+ * Verifies if the correct response icon is visible for a cell in the preview tab.
366
+ * @param {number} rowIndex - The index of the row containing the cell.
367
+ * @param {number} columnIndex - The index of the column containing the cell.
368
+ */
369
+ verifyCorrectResponseIcon: (rowIndex, columnIndex) => {
370
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
371
+ .within(() => {
372
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
373
+ .find('.correct-option-icon')
374
+ .should('be.visible');
375
+ });
376
+ },
377
+
378
+ verifyIncorrectResponseBorder: (index) => {
379
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), index)
380
+ .should('have.css', 'border-color', `${css.color.incorrectAnswer}`);
381
+ },
382
+
383
+ verifyMatchExactPositionOfCellsCheckboxIsChecked: () => {
384
+ gridFillPage.matchExactPositionCheckbox()
385
+ .should('be.checked');
386
+ },
387
+
388
+ checkMatchExactPositionOfCellsCheckbox: () => {
389
+ gridFillPage.matchExactPositionCheckbox()
390
+ .click()
391
+ .should('be.checked');
392
+ },
393
+
394
+ uncheckMatchExactPositionOfCellsCheckbox: () => {
395
+ gridFillPage.matchExactPositionCheckbox()
396
+ .click()
397
+ .should('not.be.checked');
398
+ },
399
+
400
+ /**
401
+ * @description Add input to cell count input field
402
+ * @param {number} cellCount Count of cells to be shaded
403
+ */
404
+ addInputToCellShadeCountInputField: (cellCount) => {
405
+ gridFillPage.cellShadeCountInputField()
406
+ .clear()
407
+ .type(cellCount)
408
+ .blur();
409
+ },
410
+
411
+ clearCellShadeCountInputField: () => {
412
+ gridFillPage.cellShadeCountInputField()
413
+ .clear()
414
+ .blur();
415
+ },
416
+
417
+ verifyDefaultGridInSpecifyCorrectAnswerSection: () => {
418
+ utilities.verifyElementVisibilityState(gridFillPage.gridSpecifyCorrectAnswerSection(), 'visible');
419
+ for (let rowIndex = 0; rowIndex < 3; rowIndex++) {
420
+ for (let columnIndex = 0; columnIndex < 5; columnIndex++) {
421
+ gridFillPage.steps.verifyCellNotSelectedSpecifyCorrectAnswerSection(rowIndex, columnIndex);
422
+ }
423
+ }
424
+ },
425
+
426
+ /**
427
+ * Verifies if the correct response icon is visible for a cell in the preview tab.
428
+ * @param {number} rowIndex - The index of the row containing the cell.
429
+ * @param {number} columnIndex - The index of the column containing the cell.
430
+ */
431
+ verifyIncorrectResponseIcon: (rowIndex, columnIndex) => {
432
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
433
+ .within(() => {
434
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
435
+ .find('.incorrect-option-icon')
436
+ .should('be.visible');
437
+ });
438
+ },
439
+
440
+ /**
441
+ * Verifies if the correct response border is applied to a cell in the preview tab.
442
+ * @param {number} rowIndex - The index of the row containing the cell.
443
+ * @param {number} columnIndex - The index of the column containing the cell.
444
+ */
445
+ verifyCorrectResponseBorder: (rowIndex, columnIndex) => {
446
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
447
+ .within(() => {
448
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
449
+ .should('have.css', 'border-color', css.color.correctAnswer);
450
+ });
451
+ },
452
+
453
+ /**
454
+ * Verifies if the incorrect response border is applied to a cell in the preview tab.
455
+ * @param {number} rowIndex - The index of the row containing the cell.
456
+ * @param {number} columnIndex - The index of the column containing the cell.
457
+ */
458
+ verifyIncorrectResponseBorder: (rowIndex, columnIndex) => {
459
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
460
+ .within(() => {
461
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
462
+ .should('have.css', 'border-color', css.color.incorrectAnswer);
463
+ });
464
+ },
465
+
466
+ /**
467
+ * Verifies if the correct response background color is applied to a cell in the preview tab.
468
+ * @param {number} rowIndex - The index of the row containing the cell.
469
+ * @param {number} columnIndex - The index of the column containing the cell.
470
+ */
471
+ verifyCorrectResponseBackgroundColor: (rowIndex, columnIndex) => {
472
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
473
+ .within(() => {
474
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
475
+ .should('have.css', 'background-color', css.color.gridCellCorrectAnswerBg);
476
+ });
477
+ },
478
+
479
+ /**
480
+ * Verifies if the incorrect response background color is applied to a cell in the preview tab.
481
+ * @param {number} rowIndex - The index of the row containing the cell.
482
+ * @param {number} columnIndex - The index of the column containing the cell.
483
+ */
484
+ verifyIncorrectResponseBackgroundColor: (rowIndex, columnIndex) => {
485
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
486
+ .within(() => {
487
+ utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
488
+ .should('have.css', 'background-color', css.color.gridCellIncorrectAnswerBg);
489
+ });
490
+ },
491
+
492
+ /**
493
+ * Verifies if the correct answer accordion is expanded.
494
+ */
495
+ verifyCorrectAnswerAccordionIsExpanded: () => {
496
+ gridFillPage.correctAnswerAccordion()
497
+ .find('.ngie-accordion-summary')
498
+ .should('have.attr', 'aria-expanded', 'true');
499
+ },
500
+
501
+ /**
502
+ * Verify the points score displayed on response
503
+ * @param {number} pointsPerResponse Points to be displayed on response
504
+ */
505
+ verifyPointsPerResponseScore: (pointsPerResponse) => {
506
+ utilities.verifyElementVisibilityState(gridFillPage.pointsPerResponseScore(), 'visible');
507
+ utilities.verifyInnerText(gridFillPage.pointsPerResponseScore(), `${pointsPerResponse}`);
508
+ },
509
+
510
+ /**
511
+ * @descriptionVerifies the count of rows in the preview tab.
512
+ * @param {number} lengthRows - The expected count of rows.
513
+ */
514
+ verifyRowsCountPreviewTab: (lengthRows) => {
515
+ utilities.verifyElementCount(gridFillPage.rowsWrapperPreviewTab(), lengthRows);
516
+ },
517
+
518
+ /**
519
+ * @description Verifies the count of columns in a row in the preview tab.
520
+ * @param {number} rowsIndex - The index of the row to verify.
521
+ * @param {number} columnsLength - The expected count of cells in the row.
522
+ */
523
+ verifyColumnsCountPreviewTab: (lengthColumns) => {
524
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), 0)
525
+ .within(() => {
526
+ utilities.verifyElementCount(gridFillPage.cellInPreviewTab(), lengthColumns);
527
+ });
528
+ },
529
+ }
530
+
531
+ const tests = {
532
+ ...autoScoredScoringPreviewTab.tests,
533
+ ...autoScoredSpecifyCorrectAnswerSection.tests,
534
+ ...autoScoredScoringPreviewTab.tests,
535
+ ...autoScoredScoringSectionMultiResponseType.tests,
536
+ ...scoringSectionBaseEditTab.tests,
537
+
538
+ verifyContentsOfSpecifyCorrectAnswerSection: () => {
539
+ it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
540
+ utilities.verifyElementCount(gridFillPage.correctAnswerAccordion(), 1);
541
+ gridFillPage.steps.verifyCorrectAnswerAccordionIsExpanded();
542
+ utilities.verifyInnerText(gridFillPage.correctAnswerLabel(), 'Correct');
543
+ utilities.verifyElementVisibilityState(gridFillPage.gridFillWrapper(), 'visible');
544
+ });
545
+ },
546
+
547
+ verifyScoringSubtypeContentsForMultipleResponseTypeQuestion: () => {
548
+ it('\'All or nothing\' and \'Partial - equal weights\' labels and radio buttons should be displayed and by default \'All or nothing\' radio button should be selected', () => {
549
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.allOrNothingRadioButtonLabel(), 'All or nothing');
550
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.allOrNothingRadioButtonLabel(), 'visible');
551
+ autoScoredScoringSectionMultiResponseType.steps.verifyAllOrNothingRadioButtonIsChecked();
552
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.partialEqualWeightsRadioButtonLabel(), 'Partial - equal weights');
553
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.partialEqualWeightsRadioButtonLabel(), 'visible');
554
+ autoScoredScoringSectionMultiResponseType.steps.verifyPartialEqualWeightsRadioButtonIsUnchecked();
555
+ });
556
+
557
+ it('CSS of Scoring section', { tags: 'css' }, () => {
558
+ utilities.verifyCSS(autoScoredScoringSectionMultiResponseType.allOrNothingRadioButtonLabel(), {
559
+ 'color': css.color.labelText,
560
+ 'font-size': css.fontSize.normal,
561
+ 'font-weight': css.fontWeight.regular
562
+ });
563
+ utilities.verifyCSS(autoScoredScoringSectionMultiResponseType.partialEqualWeightsRadioButtonLabel(), {
564
+ 'color': css.color.labelText,
565
+ 'font-size': css.fontSize.normal,
566
+ 'font-weight': css.fontWeight.regular
567
+ });
568
+ });
569
+ },
570
+
571
+ /**
572
+ * Verifies the contents and functionality of the 'Specify correct answer' accordion for grid fill question.
573
+ * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
574
+ * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
575
+ */
576
+ verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
577
+ it(`The default grid should be displayed in the ${accordionName} accordion`, () => {
578
+ gridFillPage.steps.verifyDefaultGridInSpecifyCorrectAnswerSection();
579
+ });
580
+
581
+ it('When user hovers on a grid cell, then that grid cell should be displayed as interactive', () => {
582
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 9));
583
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 9), {
584
+ 'border-color': css.color.activeButtons,
585
+ 'background-color': css.color.gridCellHoverStateBg
586
+ });
587
+ utilities.hoverAwayFromElement(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 9));
588
+ });
589
+
590
+ it('User should be able to select the cells of the grid by clicking on them', () => {
591
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
592
+ });
593
+
594
+ it(`When user deselect all the cells in the grid in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
595
+ gridFillPage.steps.deselectCellSpecifyCorrectAnswerSection(0, 0);
596
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible')
597
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
598
+ if (accordionName == 'Correct') {
599
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
600
+ .within(() => {
601
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
602
+ });
603
+ } else {
604
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
605
+ .eq(1)
606
+ .within(() => {
607
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
608
+ });
609
+ };
610
+ });
611
+
612
+ it('When user selects a cell by clicking on it, then error message should not be displayed', () => {
613
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
614
+ commonComponents.steps.verifyErrorMessageIsNotDisplayed();
615
+ });
616
+
617
+ it(`\'Match exact position of cells\' label and checkbox should be displayed in the ${accordionName} accordion and the checkbox should be checked`, () => {
618
+ utilities.verifyInnerText(gridFillPage.matchExactPositionLabel(), 'Match exact position of cells');
619
+ utilities.verifyElementVisibilityState(gridFillPage.matchExactPositionLabel(), 'visible');
620
+ utilities.verifyElementVisibilityState(gridFillPage.matchExactPositionCheckbox(), 'exist');
621
+ gridFillPage.steps.verifyMatchExactPositionOfCellsCheckboxIsChecked();
622
+ });
623
+
624
+ it('User should be able to uncheck the \'Match exact position of cell\' checkbox', () => {
625
+ gridFillPage.steps.uncheckMatchExactPositionOfCellsCheckbox();
626
+ });
627
+
628
+ it(`When user had unchecked the \'Match exact position of cell\' checkbox, then grid in specify correct answer ${accordionName} accordion should not be displayed and \'Cell shade count\' label and input field should be displayed`, () => {
629
+ utilities.verifyElementVisibilityState(gridFillPage.gridSpecifyCorrectAnswerSection(), 'notExist');
630
+ utilities.verifyInnerText(gridFillPage.cellShadeCountLabel(), 'Cell shade count');
631
+ utilities.verifyElementVisibilityState(gridFillPage.cellShadeCountLabel(), 'visible');
632
+ utilities.verifyElementVisibilityState(gridFillPage.cellShadeCountInputField(), 'visible');
633
+ utilities.verifyInputFieldValue(gridFillPage.cellShadeCountInputField(), '');
634
+ });
635
+
636
+ it('User should be able to enter only numeric value in the \'Cell shade count\' input field', () => {
637
+ gridFillPage.steps.addInputToCellShadeCountInputField('a6@');
638
+ utilities.verifyInputFieldValue(gridFillPage.cellShadeCountInputField(), '6');
639
+ });
640
+
641
+ it(`When user clears the value in \'Cell shade count\' input field, then \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
642
+ gridFillPage.steps.clearCellShadeCountInputField();
643
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible')
644
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
645
+ if (accordionName == 'Correct') {
646
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
647
+ .within(() => {
648
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
649
+ });
650
+ } else {
651
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
652
+ .eq(1)
653
+ .within(() => {
654
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
655
+ });
656
+ };
657
+ });
658
+
659
+ it('CSS of \'Cell shade count\' input field error message', { tags: 'css' }, () => {
660
+ utilities.verifyCSS(gridFillPage.cellShadeCountInputField().parent(), {
661
+ 'background-color': css.color.textAreaErrorBg
662
+ });
663
+ });
664
+
665
+ it('When user enters value in \'Cell shade count\' input field then error message should not be displayed', () => {
666
+ gridFillPage.steps.addInputToCellShadeCountInputField(4);
667
+ commonComponents.steps.verifyErrorMessageIsNotDisplayed();
668
+ });
669
+
670
+ it('When user checks the \'Match exact position of cell\' checkbox, then the grid should be displayed in the default state with no shaded cells and \'Cell shade count\' label and input field should not be displayed', () => {
671
+ gridFillPage.steps.checkMatchExactPositionOfCellsCheckbox();
672
+ gridFillPage.steps.verifyDefaultGridInSpecifyCorrectAnswerSection();
673
+ cy.log('Post-step: Selecting a cell in grid');
674
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 1);
675
+ });
676
+
677
+ autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
678
+
679
+ it('CSS of \'Correct\' accordion contents', { tags: 'css' }, () => {
680
+ utilities.verifyCSS(gridFillPage.matchExactPositionLabel(), {
681
+ 'color': css.color.text,
682
+ 'font-size': css.fontSize.normal,
683
+ 'font-weight': css.fontWeight.bold
684
+ });
685
+ utilities.verifyCSS(gridFillPage.matchExactPositionCheckbox().parents('.ngie-checkbox').find('g').eq(1), {
686
+ 'fill': css.color.activeButtons
687
+ });
688
+ gridFillPage.steps.uncheckMatchExactPositionOfCellsCheckbox();
689
+ utilities.verifyCSS(gridFillPage.cellShadeCountLabel(), {
690
+ 'color': css.color.text,
691
+ 'font-size': css.fontSize.normal,
692
+ 'font-weight': css.fontWeight.bold
693
+ });
694
+ utilities.verifyCSS(gridFillPage.cellShadeCountInputField(), {
695
+ 'color': css.color.text,
696
+ 'font-size': css.fontSize.default,
697
+ 'font-weight': css.fontWeight.regular
698
+ });
699
+ });
700
+
701
+ it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
702
+ cy.checkAccessibility(gridFillPage.cellShadeCountLabel().parents('[aria-label="Specify correct answer section"]'));
703
+ gridFillPage.steps.checkMatchExactPositionOfCellsCheckbox();
704
+ cy.checkAccessibility(gridFillPage.matchExactPositionLabel().parents('[aria-label="Specify correct answer section"]'));
705
+ });
706
+ }
707
+ }
708
+
709
+ export const gridFillPage = {
710
+ ...selectors,
711
+ steps,
712
+ tests
713
+ }