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,390 @@
1
+ import constants from "../../fixtures/constants";
2
+ import utilities from "../../support/helpers/utilities";
3
+ import { autoScoredScoringPreviewTab } from "./autoScoredScoringPreviewTab";
4
+ const css = Cypress.env('css');
5
+
6
+ const selectors = {
7
+ editCellPropertyButton: () => cy.get('button[aria-label="More Action"]'),
8
+ editCellPropertyList: () => cy.get('.ngie-action-cell-container [role="menu"]'),
9
+ editCellPropertyListOption: () => cy.get('[class*="MuiMenuItem"][role="menuitem"]'),
10
+ editCellPropertyTableWrapper: () => cy.get('.single-select-grid-option-selection-component .selection-grid-wrapper').eq(0),
11
+ editCellPropertyRow: () => gridQuestionCommonComponent.editCellPropertyTableWrapper().find('[class*="wrapper-row"]'),
12
+ cellPropertyInputField: () => cy.get('[title="Enter text here..."]'),
13
+ optionCellPropertyInputField: () => cy.get('[title="Option text or image..."]'),
14
+ tableRowSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-accordion [class*="wrapper-row"]'),
15
+ tableRowPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="wrapper-row"]'),
16
+ optionsButton: () => cy.get('[class*="PreviewSelectionButton"]'),
17
+ gridPreviewTab: () => cy.get('.single-selection-grid-wrapper:visible'),
18
+ tableCell: () => cy.get('[class*="CellContainer"]'),
19
+ correctAnswerGrid: () => cy.get('.selection-grid-wrapper').last(),
20
+ tableRow: () => cy.get('[class*="wrapper-row"]'),
21
+ correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="CorrectAnswerHeader"]')
22
+ }
23
+
24
+ const steps = {
25
+ /**
26
+ * Modifies the property of a table cell at the specified row and column.
27
+ * @param {Object} position - The position of the table cell to modify.
28
+ * @param {number} position.row - The row index (zero-based) of the table cell.
29
+ * @param {number} position.column - The column index (zero-based) of the table cell.
30
+ * @param {('Heading', 'Subheading', 'Text', 'None')} listOption - The option to select from the list (e.g., 'Heading', 'Subheading', 'Text', 'None').
31
+ * @throws {Error} Thrown if the listOption is invalid.
32
+ */
33
+ modifyTableCellProperty: ({ row, column }, listOption) => {
34
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
35
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyButton(), column)
36
+ .scrollIntoView()
37
+ .click();
38
+ });
39
+ utilities.verifyElementVisibilityState(gridQuestionCommonComponent.editCellPropertyList(), 'visible');
40
+ switch (listOption) {
41
+ case 'Heading':
42
+ gridQuestionCommonComponent.editCellPropertyListOption()
43
+ .contains('Heading', { matchCase: false })
44
+ .click();
45
+ break;
46
+ case 'Subheading':
47
+ gridQuestionCommonComponent.editCellPropertyListOption()
48
+ .contains('Subheading', { matchCase: false })
49
+ .click();
50
+ break;
51
+ case 'Text':
52
+ gridQuestionCommonComponent.editCellPropertyListOption()
53
+ .contains('Text', { matchCase: false })
54
+ .click();
55
+ break;
56
+ case 'None':
57
+ gridQuestionCommonComponent.editCellPropertyListOption()
58
+ .contains('None', { matchCase: false })
59
+ .click();
60
+ break;
61
+ default:
62
+ throw new Error('Invalid list option');
63
+ }
64
+ },
65
+
66
+ /**
67
+ * Enters text into the input field of a table cell property.
68
+ * @param {Object} position - The position of the table cell property.
69
+ * @param {number} position.row - The row index (zero-based) of the table cell property.
70
+ * @param {number} position.column - The column index (zero-based) of the table cell property.
71
+ * @param {string} text - The text to enter into the input field.
72
+ */
73
+ enterTextInCellPropertyInputField: ({ row, column }, text) => {
74
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
75
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column).within(() => {
76
+ gridQuestionCommonComponent.cellPropertyInputField()
77
+ .type(text)
78
+ .blur();
79
+ });
80
+ });
81
+ },
82
+
83
+ /**
84
+ * Enters text into the input field of an option cell.
85
+ * @param {Object} position - The position of the option cell.
86
+ * @param {number} position.row - The row index (zero-based) of the option cell.
87
+ * @param {number} position.column - The column index (zero-based) of the option cell.
88
+ * @param {string} text - The text to enter into the input field.
89
+ */
90
+ enterTextInOptionCellInputField: ({ row, column }, text) => {
91
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
92
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column).within(() => {
93
+ gridQuestionCommonComponent.optionCellPropertyInputField()
94
+ .type(text)
95
+ .blur();
96
+ })
97
+ });
98
+ },
99
+
100
+ setRowsAndColumnsForBasicQuestion: () => {
101
+ gridQuestionCommonComponent.steps.modifyTableCellProperty({ row: 1, column: 0 }, 'Heading');
102
+ gridQuestionCommonComponent.steps.modifyTableCellProperty({ row: 2, column: 0 }, 'Subheading');
103
+ gridQuestionCommonComponent.steps.enterTextInCellPropertyInputField({ row: 1, column: 0 }, 'Elephants are the only mammals that can\'t jump');
104
+ gridQuestionCommonComponent.steps.enterTextInCellPropertyInputField({ row: 2, column: 0 }, 'Bats are blind and navigate by using echolocation');
105
+ },
106
+
107
+ //Note: Need to work on this after https://redmine.zeuslearning.com/issues/565255 gets resolved
108
+ /**
109
+ * @param {number} cellIndex - Index of the table cell.
110
+ * @param {("Heading" | "Subheading" | "Text" | "None")} cellProperty - Type of property to verify.
111
+ * @description Verifies the appearance and content of a specific property in a table cell on the preview tab.
112
+ */
113
+ verifyTableCellPropertyPreviewTab: (cellIndex, cellProperty) => {
114
+ switch (cellProperty) {
115
+ case 'Heading':
116
+ utilities.getNthElement(gridQuestionCommonComponent.cellContainerPreviewTab(), cellIndex)
117
+ .should('have.class', 'heading');
118
+ break;
119
+ case 'Subheading':
120
+ utilities.getNthElement(gridQuestionCommonComponent.cellContainerPreviewTab(), cellIndex)
121
+ .should('have.class', 'subheading');
122
+ break;
123
+ case 'Text':
124
+ utilities.getNthElement(gridQuestionCommonComponent.cellContainerPreviewTab(), cellIndex)
125
+ .should('have.class', 'text');
126
+ break;
127
+ case 'Dropzone':
128
+ utilities.getNthElement(gridQuestionCommonComponent.cellContainerPreviewTab(), cellIndex)
129
+ .should('have.class', 'dropzone-cell');
130
+ break;
131
+ case 'None':
132
+ utilities.getNthElement(gridQuestionCommonComponent.cellContainerPreviewTab(), cellIndex)
133
+ .should('have.class', 'text')
134
+ .and('have.text', '');
135
+ break;
136
+ default:
137
+ throw new Error('Invalid list option');
138
+ };
139
+ },
140
+
141
+ /**
142
+ * Focuses on the input field of a table cell property for editing.
143
+ * @param {Object} position - The position of the table cell property.
144
+ * @param {number} position.row - The row index (zero-based) of the table cell property.
145
+ * @param {number} position.column - The column index (zero-based) of the table cell property.
146
+ */
147
+ focusInEditTableCellInputField: ({ row, column }) => {
148
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
149
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column).within(() => {
150
+ gridQuestionCommonComponent.cellPropertyInputField()
151
+ .click();
152
+ });
153
+ });
154
+ },
155
+
156
+ /**
157
+ * Focuses on the input field of an option cell for editing.
158
+ * @param {Object} position - The position of the option cell.
159
+ * @param {number} position.row - The row index (zero-based) of the option cell.
160
+ * @param {number} position.column - The column index (zero-based) of the option cell.
161
+ */
162
+ focusInEditTableOptionCellInputField: ({ row, column }) => {
163
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
164
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column).within(() => {
165
+ gridQuestionCommonComponent.optionCellPropertyInputField()
166
+ .click();
167
+ });
168
+ });
169
+ },
170
+
171
+ /**
172
+ * Verifies that a table cell in the preview tab contains an image with specific attributes.
173
+ * @param {Object} position - The position of the table cell.
174
+ * @param {number} position.row - The row index (zero-based) of the table cell.
175
+ * @param {number} position.column - The column index (zero-based) of the table cell.
176
+ */
177
+ verifyTableCellWithImageInPreviewTab: ({ row, column }) => {
178
+ gridQuestionCommonComponent.gridPreviewTab()
179
+ .within(() => {
180
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
181
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
182
+ .find('img')
183
+ .should('have.attr', 'src', constants.foxImageLink)
184
+ .and('have.attr', 'alt', constants.foxImageAltText);
185
+ })
186
+ });
187
+ },
188
+
189
+ /**
190
+ * Verifies that a table cell in the preview tab contains bold text.
191
+ * @param {Object} position - The position of the table cell.
192
+ * @param {number} position.row - The row index (zero-based) of the table cell.
193
+ * @param {number} position.column - The column index (zero-based) of the table cell.
194
+ */
195
+ verifyTableCellWithBoldTextInPreviewTab: ({ row, column }) => {
196
+ gridQuestionCommonComponent.gridPreviewTab()
197
+ .within(() => {
198
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
199
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
200
+ .find('strong')
201
+ .should('have.text', 'This is a bold option');
202
+ });
203
+ });
204
+ },
205
+
206
+ /**
207
+ * Verifies that a table cell in the preview tab contains text representing an equation.
208
+ * @param {Object} position - The position of the table cell.
209
+ * @param {number} position.row - The row index (zero-based) of the table cell.
210
+ * @param {number} position.column - The column index (zero-based) of the table cell.
211
+ */
212
+ verifyTableCellWithEquationTextInPreviewTab: ({ row, column }) => {
213
+ gridQuestionCommonComponent.gridPreviewTab()
214
+ .within(() => {
215
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
216
+ utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
217
+ .find('[role="math"]')
218
+ .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
219
+ .contains(constants.CKEditorInputFieldEnteredEquationText);
220
+ });
221
+ });
222
+ },
223
+
224
+ /**
225
+ * Sets an answer in the Specify Correct Answer section.
226
+ * @param {Object} position - The position of the option button.
227
+ * @param {number} position.row - The row index (zero-based) of the Specify Correct Answer section.
228
+ * @param {number} position.column - The column index (zero-based) of the option button.
229
+ */
230
+ setAnswerInSpecifyCorrectAnswerSection: ({ row, column }) => {
231
+ utilities.getNthElement(gridQuestionCommonComponent.tableRowSpecifyCorrectAnswerSection(), row)
232
+ .within(() => {
233
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
234
+ .click()
235
+ .should('have.class', 'selected');
236
+ });
237
+ },
238
+
239
+ /**
240
+ * Sets answers for all question stems in the Specify Correct Answer section.
241
+ * @param {Object[]} rowsAndColumns - An array of objects containing row and column indices.
242
+ * @param {number} rowsAndColumns[].row - The row index (zero-based) of the Specify Correct Answer section.
243
+ * @param {number} rowsAndColumns[].column - The column index (zero-based) of the option button.
244
+ */
245
+ setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection: (rowsAndColumns) => {
246
+ rowsAndColumns.forEach(({ row, column }) => {
247
+ steps.setAnswerInSpecifyCorrectAnswerSection({ row, column });
248
+ });
249
+ },
250
+
251
+ /**
252
+ * Selects options in the preview tab.
253
+ * @param {Object} position - The position of the option button.
254
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
255
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
256
+ */
257
+ selectOptionsInPreviewTab: ({ row, column }) => {
258
+ gridQuestionCommonComponent.gridPreviewTab().within(() => {
259
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
260
+ .within(() => {
261
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
262
+ .click()
263
+ .should('have.class', 'selected');
264
+ });
265
+ });
266
+ },
267
+
268
+ /**
269
+ * Selects options for all question stems in the preview tab.
270
+ * @param {Object[]} rowsAndColumns - An array of objects containing row and column indices.
271
+ * @param {number} rowsAndColumns[].row - The row index (zero-based) in the preview tab.
272
+ * @param {number} rowsAndColumns[].column - The column index (zero-based) of the option button in the preview tab.
273
+ */
274
+ selectOptionsForAllQuestionStemsInPreviewTab: (rowsAndColumns) => {
275
+ rowsAndColumns.forEach(({ row, column }) => {
276
+ steps.selectOptionsInPreviewTab({ row, column });
277
+ });
278
+ },
279
+
280
+ /**
281
+ * Verifies the disabled state of an option button in the preview tab.
282
+ * @param {Object} position - The position of the option button.
283
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
284
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
285
+ */
286
+ verifyOptionDisabledState: ({ row, column }) => {
287
+ gridQuestionCommonComponent.gridPreviewTab().within(() => {
288
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
289
+ .within(() => {
290
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
291
+ .should('have.attr', 'tabindex', '-1');
292
+ });
293
+ });
294
+ },
295
+
296
+ /**
297
+ * Verifies the background color and icon visibility of an incorrect option button in the preview tab.
298
+ * @param {Object} position - The position of the option button.
299
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
300
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
301
+ */
302
+ verifyIncorrectOptionBackgroundAndIcon: ({ row, column }) => {
303
+ gridQuestionCommonComponent.gridPreviewTab().within(() => {
304
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
305
+ .within(() => {
306
+ utilities.verifyCSS(utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column), {
307
+ 'background-color': css.color.incorrectAnswerLabelBg,
308
+ 'border': `1px solid ${css.color.incorrectAnswer}`
309
+ });
310
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column).within(() => {
311
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
312
+ });
313
+ });
314
+ });
315
+ },
316
+
317
+ /**
318
+ * Verifies the background color and icon visibility of an correct option button in the preview tab.
319
+ * @param {Object} position - The position of the option button.
320
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
321
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
322
+ */
323
+ verifyCorrectOptionBackgroundAndIcon: ({ row, column }) => {
324
+ gridQuestionCommonComponent.gridPreviewTab().within(() => {
325
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
326
+ .within(() => {
327
+ utilities.verifyCSS(utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column), {
328
+ 'background-color': css.color.correctAnswerLabelBg,
329
+ 'border': `1px solid ${css.color.correctAnswer}`
330
+ });
331
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column).within(() => {
332
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
333
+ });
334
+ });
335
+ });
336
+ },
337
+
338
+ /**
339
+ * Verifies correct answer responses for multiple rows and columns.
340
+ * @param {Array<{row: number, column: number}>} rowsAndColumns - An array of objects containing row and column indices.
341
+ * @returns {void}
342
+ */
343
+ verifyCorrectAnswerResponses: (rowsAndColumns) => {
344
+ rowsAndColumns.forEach(({ row, column }) => {
345
+ gridQuestionCommonComponent.correctAnswerGrid()
346
+ .within(() => {
347
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
348
+ .within(() => {
349
+ utilities.verifyCSS(utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column), {
350
+ 'background-color': css.color.correctAnswerLabelBg,
351
+ 'border': `1px solid ${css.color.correctAnswer}`
352
+ });
353
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column).within(() => {
354
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
355
+ });
356
+ });
357
+ })
358
+ });
359
+ },
360
+
361
+ verifyCorrectAnswerSectionNotExists: () => {
362
+ utilities.verifyElementVisibilityState(gridQuestionCommonComponent.correctAnswersLabel(), 'notExist');
363
+ },
364
+
365
+ /**
366
+ * Verifies that the correct and incorrect icons do not exist and the background color of the option button is transparent in the preview tab.
367
+ * @param {Object} position - The position of the option button.
368
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
369
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
370
+ */
371
+ verifyCorrectIncorrectIconNotExists: ({ row, column }) => {
372
+ gridQuestionCommonComponent.gridPreviewTab().within(() => {
373
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
374
+ .within(() => {
375
+ utilities.verifyCSS(utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column), {
376
+ 'background-color': css.color.transparent,
377
+ });
378
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column).within(() => {
379
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'hidden');
380
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'notExist');
381
+ });
382
+ });
383
+ });
384
+ }
385
+ }
386
+
387
+ export const gridQuestionCommonComponent = {
388
+ ...selectors,
389
+ steps,
390
+ }
@@ -571,7 +571,31 @@ const steps = {
571
571
  .eq(index)
572
572
  .trigger('mouseout', { force: true });
573
573
  });
574
- }
574
+ },
575
+
576
+ /**
577
+ * @param {string} fileFormat format of the uploaded file in the highlight region
578
+ * @description this function verifies the attribute of the image has the expected file format
579
+ */
580
+ verifyUploadedImageFormatInBackgroundImageSection: (fileFormat) => {
581
+ imageCanvasComponent.canvasImage()
582
+ .should(($element) => {
583
+ const hrefAttributeValue = $element.attr('src');
584
+ expect(hrefAttributeValue).to.include(fileFormat);
585
+ });
586
+ },
587
+
588
+ /**
589
+ * @param {string} fileFormat format of the uploaded file in the highlight region
590
+ * @description this function verifies the attribute of the image has the expected file format
591
+ */
592
+ verifyUploadedImageFormatInPreviewTab: (fileFormat) => {
593
+ imageCanvasComponent.canvasImageInPreviewTab()
594
+ .should(($element) => {
595
+ const hrefAttributeValue = $element.attr('src');
596
+ expect(hrefAttributeValue).to.include(fileFormat);
597
+ });
598
+ },
575
599
  }
576
600
 
577
601
  const tests = {
@@ -53,5 +53,9 @@ export * from './imageActionsComponent';
53
53
  export * from './createCustomCategoryFlyout';
54
54
  export * from './customizeMathCharacterComponent';
55
55
  export * from './fillInTheGapsDragAndDropCommonComponents';
56
- export * from './additionalSettingsAccessibilitySectionComponent';
57
56
  export * from './responseAreaSettingsPopupComponent';
57
+ export * from './gridQuestionCommonComponent';
58
+ export * from './gradingViewEnumerationComponent';
59
+ export * from './ariaLabelSectionComponent';
60
+ export * from './placeholderTextSectionComponent';
61
+ export * from './additionalSettingsAccessibilitySectionComponent';
@@ -0,0 +1,110 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ const css = Cypress.env('css');
3
+
4
+ const selectors = {
5
+ placeholderTextSectionLabel: () => cy.get('[class*="PlaceholderTextWrapper"]'),
6
+ placeholderTextInputFieldLabel: () => cy.get('.customized-placeholder-wrapper .text-label'),
7
+ placeholderTextInputField: () => cy.get('.customized-placeholder-wrapper input[aria-label="Placeholder Text"]'),
8
+ individualPlaceholderTextInputField: () => cy.get('input[aria-label*="Enter placeholder text"]'),
9
+ customizePlaceholderTextCheckbox: () => cy.get('[data-ngie-testid*="customize-placeholder-text-for-individual"][data-ngie-testid*="checkbox"] input'),
10
+ customizePlaceholderTextCheckboxLabel: () => cy.get('[data-ngie-testid*="customize-placeholder-text-for-individual"][data-ngie-testid*="checkbox"] .MuiFormControlLabel-label'),
11
+ inputFieldNumeration: () => cy.get('.MuiInputAdornment-root'),
12
+ }
13
+
14
+ const steps = {
15
+ verifyPlaceholderTextInputFieldValue: (value) => {
16
+ utilities.verifyInputFieldValue(placeholderTextSectionComponent.placeholderTextInputField(), value);
17
+ },
18
+
19
+ verifyCustomizePlaceholderTextCheckboxUnchecked: () => {
20
+ placeholderTextSectionComponent.customizePlaceholderTextCheckbox()
21
+ .should('not.be.checked');
22
+ },
23
+
24
+
25
+ addInputToPlaceholderTextInputField: (value) => {
26
+ placeholderTextSectionComponent.placeholderTextInputField()
27
+ .type(value)
28
+ .should('have.value', value)
29
+ },
30
+
31
+ clearPlaceholderTextInputField: () => {
32
+ placeholderTextSectionComponent.placeholderTextInputField()
33
+ .clear()
34
+ .blur();
35
+ },
36
+
37
+ addInputToIndividualPlaceholderTextInputField: (inputFieldIndex, value) => {
38
+ placeholderTextSectionComponent.individualPlaceholderTextInputField()
39
+ .eq(inputFieldIndex)
40
+ .type(value)
41
+ .should('have.value', value)
42
+ },
43
+
44
+ clearIndividualPlaceholderTextInputField: (inputFieldIndex) => {
45
+ placeholderTextSectionComponent.individualPlaceholderTextInputField()
46
+ .eq(inputFieldIndex)
47
+ .clear();
48
+ },
49
+
50
+ checkCustomizePlaceholderTextCheckbox: () => {
51
+ placeholderTextSectionComponent.customizePlaceholderTextCheckbox()
52
+ .click()
53
+ .should('be.checked');
54
+ },
55
+
56
+
57
+ verifyIndividualPlaceholderTextInputFields: (inputFieldIndex) => {
58
+ placeholderTextSectionComponent.individualPlaceholderTextInputField()
59
+ .eq(inputFieldIndex)
60
+ .parents('.input-editable')
61
+ .within(() => {
62
+ utilities.verifyInnerText(placeholderTextSectionComponent.inputFieldNumeration(), `${inputFieldIndex + 1}`)
63
+ utilities.verifyInputFieldValue(placeholderTextSectionComponent.individualPlaceholderTextInputField(), '');
64
+ });
65
+ },
66
+ }
67
+
68
+ const tests = {
69
+ verifyPlaceholderTextSectionContents: (typeOfInput) => {
70
+ it('"Placeholder text" section label, "Placeholder text" label and input field should be displayed. By default, the input field should be empty', () => {
71
+ utilities.verifyInnerText(placeholderTextSectionComponent.placeholderTextSectionLabel(), 'Placeholder text');
72
+ utilities.verifyInnerText(placeholderTextSectionComponent.placeholderTextInputFieldLabel(), 'Placeholder text');
73
+ placeholderTextSectionComponent.steps.verifyPlaceholderTextInputFieldValue('');
74
+ });
75
+
76
+ it(`"Customize placeholder text for individual ${typeOfInput} label and checkbox should be displayed. By default, the checkbox should be unchecked`, () => {
77
+ utilities.verifyInnerText(placeholderTextSectionComponent.customizePlaceholderTextCheckboxLabel(), `Customize placeholder text for individual ${typeOfInput}`);
78
+ placeholderTextSectionComponent.steps.verifyCustomizePlaceholderTextCheckboxUnchecked();
79
+ });
80
+
81
+ it('CSS of placeholder text section', { tags: 'css' }, () => {
82
+ utilities.verifyCSS(placeholderTextSectionComponent.placeholderTextSectionLabel(), {
83
+ 'color': css.color.labels,
84
+ 'font-size': css.fontSize.default,
85
+ 'font-weight': css.fontWeight.semibold
86
+ });
87
+ utilities.verifyCSS(placeholderTextSectionComponent.placeholderTextInputFieldLabel(), {
88
+ 'color': css.color.labels,
89
+ 'font-size': css.fontSize.normal,
90
+ 'font-weight': css.fontWeight.semibold
91
+ });
92
+ utilities.verifyCSS(placeholderTextSectionComponent.placeholderTextInputField(), {
93
+ 'color': css.color.text,
94
+ 'font-size': css.fontSize.default,
95
+ 'font-weight': css.fontWeight.regular
96
+ });
97
+ utilities.verifyCSS(placeholderTextSectionComponent.customizePlaceholderTextCheckboxLabel(), {
98
+ 'color': css.color.labelText,
99
+ 'font-size': css.fontSize.normal,
100
+ 'font-weight': css.fontWeight.regular
101
+ });
102
+ });
103
+ },
104
+ }
105
+
106
+ export const placeholderTextSectionComponent = {
107
+ ...selectors,
108
+ steps,
109
+ tests
110
+ }
@@ -1,8 +1,8 @@
1
1
  const selectors = {
2
2
  responseAreaSettingsWidthLabel: () => cy.get('[class*="InputNumberFieldstyle__NumberFieldWrapper"] .input-label-fields').eq(0),
3
- responseAreaSettingsWidthInputField: () => cy.get('[class*="InputNumberFieldstyle__NumberFieldWrapper"] input').eq(0),
3
+ responseAreaSettingsWidthInputField: () => cy.get('input[id="Width (px)"]'),
4
4
  responseAreaSettingsHeightLabel: () => cy.get('[class*="InputNumberFieldstyle__NumberFieldWrapper"] .input-label-fields').eq(1),
5
- responseAreaSettingsHeightInputField: () => cy.get('[class*="InputNumberFieldstyle__NumberFieldWrapper"] input').eq(1),
5
+ responseAreaSettingsHeightInputField: () => cy.get('input[id="Height (px)"]'),
6
6
  responseAreaSettingsCancelButton: () => cy.get('[class*="ResponseSettingsPopupstyles__PopupActionButtons"] button').eq(0),
7
7
  responseAreaSettingsOkButton: () => cy.get('[class*="ResponseSettingsPopupstyles__PopupActionButtons"] button').eq(1),
8
8
  }
@@ -36,6 +36,14 @@ const selectors = {
36
36
  groupDividerStyleOptionButton: (index) => cy.get('.group-divider-style button').eq(index),
37
37
  tabsPrefixLabel: () => cy.get('[class*="ContentBlocksstyles__TabPrefixWrapper"] .inline-text-property-label'),
38
38
  tabsPrefixInputField: () => cy.get('[class*="ContentBlocksstyles__TabPrefixWrapper"] input'),
39
+ assessmentMetricsLabel: () => cy.get('[class*="ContentBlocksstyles__AssessementMatricsWrapper"] [class*="ContentBlocksstyles__LabelContent"]'),
40
+ lexileLabel: () => cy.get('[class*="ContentBlocksstyles__AssessementMatricsWrapper"] .inline-text-property-label'),
41
+ lexileInputField: () => cy.get('[class*="ContentBlocksstyles__AssessementMatricsWrapper"] .input-label input'),
42
+ detailsLabel: () => cy.get('[class*="ContentBlocksstyles__DetailsWrapper"] [class*="ContentBlocksstyles__LabelContent"]'),
43
+ acknowledgementsAndReferencesLabel: () => cy.get('[class*="ContentBlocksstyles__DetailsWrapper"] .additional-settings-label').eq(0),
44
+ acknowledgementsAndReferencesInputField: () => cy.get('[class*="ContentBlocksstyles__DetailsWrapper"] [role="textbox"]').eq(0),
45
+ teacherScoringGuidelinesLabel: () => cy.get('[class*="ContentBlocksstyles__DetailsWrapper"] .additional-settings-label').eq(1),
46
+ teacherScoringGuidelinesInputField: () => cy.get('[class*="ContentBlocksstyles__DetailsWrapper"] [role="textbox"]').eq(1),
39
47
  //Preview tab
40
48
  titlePreviewTab: () => cy.get('.content-blocks-heading'),
41
49
  subTitleLabelPreviewTab: () => cy.get('[class*="ContentBlocksPreviewstyles__SubTitleText"]').eq(0),
@@ -232,7 +240,7 @@ const steps = {
232
240
  * @description Deletes a page at the specified index.
233
241
  * @param {number} index - The index of the page to delete.
234
242
  */
235
- deletePage: (index) => {
243
+ deleteContentBlock: (index) => {
236
244
  contentBlocksPage.deleteButton()
237
245
  .eq(index)
238
246
  .click();
@@ -445,6 +453,44 @@ const steps = {
445
453
  .click();
446
454
  },
447
455
 
456
+ /**
457
+ * @description Enters text into the Lexile input field and verifies the entered text.
458
+ * @param {string} text - The text to enter into the Lexile input field.
459
+ */
460
+ enterTextInLexileInputField: (text) => {
461
+ contentBlocksPage.lexileInputField()
462
+ .clear()
463
+ .type(text)
464
+ .should('have.text', text);
465
+ },
466
+
467
+ /**
468
+ * @description Enters text into the Acknowledgements and References input field and verifies the entered text.
469
+ * @param {string} text - The text to enter into the Acknowledgements and References input field.
470
+ */
471
+ enterTextInAcknowledgementsAndReferencesInputField: (text) => {
472
+ contentBlocksPage.acknowledgementsAndReferencesInputField()
473
+ .clear()
474
+ .type(text)
475
+ .should('have.text', text)
476
+ },
477
+
478
+ /**
479
+ * @description Enters text into the Teacher scoring guidelines input field and verifies the entered text.
480
+ * @param {string} text - The text to enter into the Teacher scoring guidelines input field.
481
+ */
482
+ enterTextInTeacherScoringGuidelinesInputField: (text) => {
483
+ contentBlocksPage.teacherScoringGuidelinesInputField()
484
+ .clear()
485
+ .type(text)
486
+ .should('have.text', text)
487
+ },
488
+
489
+ /**
490
+ * @description Verifies the content of the body sub-title.
491
+ * @param {number} index - The index of the body sub-title to verify.
492
+ * @param {string} numeration - The numeration of the body sub-title.
493
+ */
448
494
  verifyBodySubTitleContent: (index, numeration) => {
449
495
  contentBlocksPage.bodySubTitleWrapper()
450
496
  .eq(index)
@@ -460,6 +506,11 @@ const steps = {
460
506
  });
461
507
  },
462
508
 
509
+ /**
510
+ * @description Verifies the content of the text block.
511
+ * @param {number} index - The index of the text block to verify.
512
+ * @param {string} numeration - The numeration of the text block.
513
+ */
463
514
  verifyTextBlockContent: (index, numeration) => {
464
515
  contentBlocksPage.textBlockWrapper()
465
516
  .eq(index)
@@ -475,6 +526,10 @@ const steps = {
475
526
  });
476
527
  },
477
528
 
529
+ /**
530
+ * @description Verifies the content of the group divider.
531
+ * @param {number} index - The index of the group divider to verify.
532
+ */
478
533
  verifyGroupDividerContent: (index) => {
479
534
  contentBlocksPage.groupDividerWrapper()
480
535
  .eq(index)
@@ -487,6 +542,10 @@ const steps = {
487
542
  });
488
543
  },
489
544
 
545
+ /**
546
+ * @description Verifies that a selector does not have a placeholder attribute.
547
+ * @param {Function} selector - The selector function to verify.
548
+ */
490
549
  verifyPlaceholderTextNotExist: (selector) => {
491
550
  selector()
492
551
  .should('not.have.attr', 'placeholder');