itemengine-cypress-automation 1.0.143-migrationScripts-d059d60.0 → 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 +2 -2
  139. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +0 -43
  140. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -642
@@ -44,4 +44,6 @@ export * from './textEntryMathWithImagePage';
44
44
  export * from './graphingPage';
45
45
  export * from './simpleCalculatorPage'
46
46
  export * from './contentBlocksPage';
47
- export * from './geoGebraActivityPage';
47
+ export * from './gridFillPage';
48
+ export * from './geoGebraActivityPage';
49
+ export * from './geoGebraToolsPage';
@@ -1,355 +1,109 @@
1
- import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase } from "./components"
2
- import { gridCommonComponents } from "./components/gridCommonComponents"
3
- import { studentResponseAndLayoutComponent } from "./components/studentResponseAreaAndLayoutComponent";
1
+ import utilities from "../support/helpers/utilities";
2
+ import { createQuestionBasePage, questionInstructionsComponent, gridQuestionCommonComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, correctIncorrectAnswerLabelComponent } from "./components";
4
3
  const css = Cypress.env('css');
5
4
 
6
5
  const selectors = {
7
- ...commonComponents,
8
- ...gridCommonComponents,
9
- ...autoScoredSetCorrectAnswerSection,
10
- ...scoringSectionBase,
11
- ...autoScoredScoringSectionMultipleResponsesType,
12
- ...autoScoredAdditionalSettings,
13
- ...previewScoringAndShowCorrectAnswerComponent,
14
- ...autoScoredPreviewBase,
15
6
  ...questionInstructionsComponent,
16
- ...additionalSettingsPanel,
17
- optionsCheckbox: () => cy.get('.choice-option-radio-button input'),
18
- optionsCheckboxWrapper: () => cy.get('.single-selection-grid-radio-label-wrapper'),
19
- pointsPerResponseLabel: () => cy.get('[class*="indexstyles__PartialDifferentPointsHeader"]'),
20
- partialEqualWeightsPointsPerResponseScore: () => cy.get('[class*="indexstyles__PartialPointsDiv"]')
7
+ ...gridQuestionCommonComponent,
8
+ ...correctIncorrectAnswerLabelComponent
21
9
  }
22
10
 
23
11
  const steps = {
24
12
  ...createQuestionBasePage.steps,
25
13
  ...questionInstructionsComponent.steps,
26
- ...autoScoredSetCorrectAnswerSection.steps,
27
- ...scoringSectionBase.steps,
28
- ...gridCommonComponents.steps,
29
- ...commonComponents.steps,
30
- ...autoScoredScoringSectionMultipleResponsesType.steps,
31
- ...additionalSettingsPanel.steps,
32
- ...previewScoringAndShowCorrectAnswerComponent.steps,
33
- ...autoScoredAdditionalSettings.steps,
34
- ...autoScoredPreviewBase.steps,
35
- ...autoScoredScoringSection.steps,
14
+ ...gridQuestionCommonComponent.steps,
15
+ ...scoringSectionBaseEditTab.steps,
16
+ ...autoScoredScoringPreviewTab.steps,
17
+ ...correctIncorrectAnswerLabelComponent.steps,
36
18
  /**
37
- * @param {number} questionStemIndex index of question stem
38
- * @param {string[]} optionsArray array of options
39
- * @description This function checkmarks the options in a question stem the set correct answer table
19
+ * Modifies the property of an option cell in the grid for checkbox settings.
20
+ * @param {Object} position - The position of the option cell.
21
+ * @param {number} position.row - The row index (zero-based) of the option cell.
22
+ * @param {number} position.column - The column index (zero-based) of the option cell.
23
+ * @param {('Checkbox', 'Checkbox with text', 'No checkbox')} listOption - The option to select from the list.
24
+ * @throws {Error} Thrown if the listOption is invalid.
40
25
  */
41
- setAnswersForQuestionStemInSetCorrectAnswerTable: (questionStemIndex, optionsArray) => {
42
- gridCommonComponents.setCorrectAnswerTableRow()
43
- .eq(questionStemIndex)
44
- .within(() => {
45
- optionsArray.forEach((options) => {
46
- multipleSelectionGridPage.optionsCheckbox()
47
- .eq(options)
48
- .click()
49
- .should('be.checked');
50
- });
51
- });
52
- },
53
-
54
- /**
55
- * @param {number[][]} optionIndexInQuestionStemRow array of options to be selected for all question stems
56
- * @description This function checkmarks all the options in the set correct answer table
57
- */
58
- setAnswersForAllQuestionStemsInSetCorrectAnswerTable: (optionsArrayForQuestionStem) => {
59
- optionsArrayForQuestionStem.forEach((options, questionStemIndex) => {
60
- steps.setAnswersForQuestionStemInSetCorrectAnswerTable(questionStemIndex, options);
26
+ modifyTableCellPropertyForOptionCells: ({ row, column }, listOption) => {
27
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
28
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyButton(), column)
29
+ .scrollIntoView()
30
+ .click();
61
31
  });
32
+ utilities.verifyElementVisibilityState(gridQuestionCommonComponent.editCellPropertyList(), 'visible');
33
+ switch (listOption) {
34
+ case 'Checkbox':
35
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyListOption(), 0)
36
+ .click();
37
+ break;
38
+ case 'Checkbox with text':
39
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyListOption(), 1)
40
+ .click();
41
+ break;
42
+ case 'No checkbox':
43
+ utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyListOption(), 2)
44
+ .click();
45
+ break;
46
+ default:
47
+ throw new Error('Invalid list option');
48
+ }
62
49
  },
63
50
 
64
51
  /**
65
- * @param {number} questionStemIndex index of question stem
66
- * @param {string[]} optionsArray array of options
67
- * @description This function checkmarks the options in a question stem the preview tab answer table
52
+ * Verifies that an option button with a checkbox is in the selected state in the preview tab.
53
+ * @param {Object} position - The position of the option button.
54
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
55
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
68
56
  */
69
- setAnswersForQuestionStemInPreviewTabAnswerTable: (questionStemIndex, optionsArray) => {
70
- gridCommonComponents.previewTabAnswerTableRow()
71
- .eq(questionStemIndex)
57
+ verifyOptionWithCheckboxSelectedState: ({ row, column }) => {
58
+ gridQuestionCommonComponent.gridPreviewTab()
72
59
  .within(() => {
73
- optionsArray.forEach((options) => {
74
- multipleSelectionGridPage.optionsCheckbox()
75
- .eq(options)
76
- .click()
77
- .should('be.checked');
60
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
61
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
62
+ .should('have.class', 'selected')
63
+ .find('svg')
64
+ .should('have.class', 'checkbox-checked');
78
65
  });
79
66
  });
80
67
  },
81
68
 
82
69
  /**
83
- * @param {number[][]} optionIndexInQuestionStemRow array of options to be selected for all question stems
84
- * @description This function checkmarks all the options in the set correct answer table
85
- */
86
- setAnswersForAllQuestionStemsInPreviewTabAnswerTable: (optionsArrayForQuestionStem) => {
87
- optionsArrayForQuestionStem.forEach((optionsArray, questionStemIndex) => {
88
- multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(questionStemIndex, optionsArray)
89
- });
90
- },
91
-
92
- verifyTableRowCheckboxesInSetCorrectAnswerTable: (rowIndex, checkboxesCount) => {
93
- gridCommonComponents.setCorrectAnswerTableRow()
94
- .eq(rowIndex)
95
- .within(() => {
96
- multipleSelectionGridPage.optionsCheckbox()
97
- .should('have.length', checkboxesCount)
98
- });
99
- },
100
-
101
- verifyTableRowCheckboxesInPreviewTabAnswerTable: (rowIndex, checkboxesCount) => {
102
- gridCommonComponents.previewTabAnswerTableRow()
103
- .eq(rowIndex)
104
- .within(() => {
105
- multipleSelectionGridPage.optionsCheckbox()
106
- .should('have.length', checkboxesCount)
107
- });
108
- },
109
-
110
- verifyDisabledTableRowCheckboxesInSetCorrectAnswerTable: (rowIndex) => {
111
- gridCommonComponents.setCorrectAnswerTableRow()
112
- .eq(rowIndex)
113
- .within(() => {
114
- multipleSelectionGridPage.optionsCheckbox()
115
- .each(($el) => {
116
- cy.wrap($el)
117
- .should('be.disabled');
118
- });
119
- });
120
- },
121
-
122
- verifyCheckboxesUncheckedInPreviewTabAnswerTable: () => {
123
- gridCommonComponents.previewTabAnswerTableRow()
124
- .each(($el) => {
125
- cy.wrap($el)
126
- .within(() => {
127
- multipleSelectionGridPage.optionsCheckbox()
128
- .each(($el) => {
129
- cy.wrap($el)
130
- .should('not.be.checked');
131
- });
132
- });
133
- });
134
- },
135
-
136
- verifyEnabledUncheckedTableRowCheckboxesInSetCorrectAnswerTable: (rowIndex) => {
137
- gridCommonComponents.setCorrectAnswerTableRow()
138
- .eq(rowIndex)
139
- .within(() => {
140
- multipleSelectionGridPage.optionsCheckbox()
141
- .each(($el) => {
142
- cy.wrap($el)
143
- .should('be.enabled')
144
- .and('not.be.checked');
145
- });
146
- });
147
- },
148
-
149
- /**
150
- * @param {number} rowIndex index of the row
151
- * @param {number} optionIndex index of the option to be selected within the row
152
- * @description This function verifies the incorrect icon in the preview tab table
153
- */
154
- verifyIncorrectOptionsCrossmarkIcon: (rowIndex, optionsArray) => {
155
- gridCommonComponents.previewTabAnswerTableRow()
156
- .eq(rowIndex)
70
+ * Verifies that an option button with a checkbox is in the unselected state in the preview tab.
71
+ * @param {Object} position - The position of the option button.
72
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
73
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
74
+ */
75
+ verifyOptionWithCheckboxUnselectedState: ({ row, column }) => {
76
+ gridQuestionCommonComponent.gridPreviewTab()
157
77
  .within(() => {
158
- optionsArray.forEach((options) => {
159
- multipleSelectionGridPage.optionsCheckboxWrapper()
160
- .eq(options)
161
- .within(() => {
162
- gridCommonComponents.correctIncorrectIconWrapper()
163
- .should('have.class', 'icon-incorrect')
164
- .and('be.visible');
165
- });
78
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
79
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
80
+ .should('not.have.class', 'selected')
81
+ .find('svg')
82
+ .should('have.class', 'checkbox-unchecked');
166
83
  });
167
84
  });
168
85
  },
169
86
 
170
87
  /**
171
- * @param {number} rowIndex index of the row
172
- * @param {number[]} optionsArray array of index of the option to be selected within the row
173
- * @description This function verifies the correct icon in the preview tab table
174
- */
175
- verifyCorrectOptionsCheckmarkIcon: (rowIndex, optionsArray) => {
176
- gridCommonComponents.previewTabAnswerTableRow()
177
- .eq(rowIndex)
178
- .within(() => {
179
- optionsArray.forEach((options) => {
180
- multipleSelectionGridPage.optionsCheckboxWrapper()
181
- .eq(options)
182
- .within(() => {
183
- gridCommonComponents.correctIncorrectIconWrapper()
184
- .should('have.class', 'icon-correct')
185
- .and('be.visible');
186
- });
187
- });
188
- });
189
- },
190
-
191
-
192
- verifyCorrectIncorrectIconDoesNotExist: (rowIndex, optionsArray) => {
193
- gridCommonComponents.previewTabAnswerTableRow()
194
- .eq(rowIndex)
88
+ * Verifies that an option button without a checkbox is in the selected state in the preview tab.
89
+ * @param {Object} position - The position of the option button.
90
+ * @param {number} position.row - The row index (zero-based) in the preview tab.
91
+ * @param {number} position.column - The column index (zero-based) of the option button in the preview tab.
92
+ */
93
+ verifyOptionWithoutCheckboxSelectedState: ({ row, column }) => {
94
+ gridQuestionCommonComponent.gridPreviewTab()
195
95
  .within(() => {
196
- optionsArray.forEach((options) => {
197
- multipleSelectionGridPage.optionsCheckboxWrapper()
198
- .eq(options)
199
- .within(() => {
200
- gridCommonComponents.correctIncorrectIconWrapper()
201
- .should('not.exist');
202
- });
96
+ utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row).within(() => {
97
+ utilities.getNthElement(gridQuestionCommonComponent.optionsButton(), column)
98
+ .should('have.class', 'selected');
203
99
  });
204
100
  });
205
- },
206
-
207
- resetQuestionPreview: () => {
208
- createQuestionBasePage.steps.switchToEditTab();
209
- createQuestionBasePage.steps.switchToPreviewTab();
210
- steps.verifyCheckboxesUncheckedInPreviewTabAnswerTable();
211
- },
212
-
213
- //TODO: Make all border related changes once https://redmine.zeuslearning.com/issues/518498 is resolved
214
- verifyCorrectAttemptBorder: () => {
215
- gridCommonComponents.correctIncorrectAnswerBorder()
216
- .should('have.css', 'border', `1px solid ${css.color.correctAnswer}`);
217
- },
218
-
219
- verifyIncorrectAttemptBorder: () => {
220
- gridCommonComponents.correctIncorrectAnswerBorder()
221
- .should('have.css', 'border', `1px solid ${css.color.incorrectAnswer}`);
222
- },
223
-
224
- verifyCorrectIncorrectBorderNotVisible: () => {
225
- gridCommonComponents.correctIncorrectAnswerBorder()
226
- .should('have.css', 'border')
227
- .and('match', /0px none/);
228
- },
229
-
230
- //V3 - This function should be updated in all files
231
- /**
232
- * @param {number} points points displayed in partial equal weights points per response
233
- * @description Verify points displayed in partial equal weights points per response
234
- */
235
- verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
236
- multipleSelectionGridPage.partialEqualWeightsPointsPerResponseScore()
237
- .each(($element) => {
238
- cy.wrap($element)
239
- .verifyInnerText(`${points}`);
240
- });
241
- },
101
+ }
242
102
  }
243
103
 
244
104
  const tests = {
245
- ...createQuestionBasePage.tests,
246
- ...commonComponents.tests,
247
105
  ...questionInstructionsComponent.tests,
248
- ...gridCommonComponents.tests,
249
- ...autoScoredSetCorrectAnswerSection.tests,
250
- ...autoScoredScoringSection.tests,
251
- ...scoringSectionBase.tests,
252
- ...previewScoringAndShowCorrectAnswerComponent.tests,
253
- ...additionalSettingsPanel.tests,
254
- ...autoScoredAdditionalSettings.tests,
255
- ...studentResponseAndLayoutComponent.tests,
256
- verifyAllContentsOfSetCorrectAnswerTableForScoringType: (scoringType, questionStemsArray, optionsArray) => {
257
- it(`When user has selected ${scoringType} scoring type then added question stems, options and enabled checkboxes should be displayed`, () => {
258
- multipleSelectionGridPage.steps.verifyQuestionStemsInSetCorrectAnswerTable(questionStemsArray);
259
- multipleSelectionGridPage.steps.verifyTableHeaderContentsInSetCorrectAnswerTable(optionsArray);
260
- for (let index = 0; index < 4; index++) {
261
- multipleSelectionGridPage.steps.verifyEnabledUncheckedTableRowCheckboxesInSetCorrectAnswerTable(index);
262
- }
263
- });
264
- },
265
-
266
- /**
267
- * @param {number} totalPoints the maximum points that can be scored by the user
268
- * @description this function verifies the functionality of minimum points when penalty points are not set and user attempts incorrect answer
269
- */
270
- verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer: (totalPoints) => {
271
- it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
272
- cy.log('Switch to edit tab and set minimum score if attempted points')
273
- createQuestionBasePage.steps.switchToEditTab();
274
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
275
- createQuestionBasePage.steps.switchToPreviewTab()
276
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 1], [0, 1, 2], [1], [1]]);
277
- multipleSelectionGridPage.previewScoreText()
278
- .verifyInnerText(`1/${totalPoints}`);
279
- });
280
-
281
- it('When user removes minimum score awarded (if attempted) points, then in Preview tab on selecting any options other than correct answers, points should not be provided', () => {
282
- cy.log('Switch to edit tab and remove minimum score if attempted points')
283
- createQuestionBasePage.steps.switchToEditTab();
284
- multipleSelectionGridPage.steps.clearMinimumScoreIfAttemptedPointsField();
285
- createQuestionBasePage.steps.switchToPreviewTab()
286
- multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [2]);
287
- multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [0]);
288
- multipleSelectionGridPage.previewScoreText()
289
- .verifyInnerText(`0/${totalPoints}`);
290
- });
291
- },
292
-
293
- /**
294
- *
295
- * @param {number} scoredPoints the points scored by the user
296
- * @param {number} totalPoints the maximum points that can be scored by the user
297
- * @description this function verifies the functionality of Penalty points when minimum points are not set and user attempts incorrect answer
298
- */
299
- verifyPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPoints, totalPoints) => {
300
- it('When user has defined penalty points', () => {
301
- cy.log('Pre-step: Switch to edit tab and set penalty points');
302
- createQuestionBasePage.steps.switchToEditTab();
303
- multipleSelectionGridPage.steps.allotPenaltyPoints('3')
304
-
305
- cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
306
- createQuestionBasePage.steps.switchToPreviewTab();
307
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 1], [0, 1, 2], [1], [1]]);
308
- multipleSelectionGridPage.previewScoreText()
309
- .verifyInnerText(`0/${totalPoints}`);
310
-
311
- cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
312
- multipleSelectionGridPage.steps.resetQuestionPreview()
313
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [0, 1], [1, 2]]);
314
- multipleSelectionGridPage.previewScoreText()
315
- .verifyInnerText(`${scoredPoints}/${totalPoints}`);
316
- });
317
- },
318
-
319
- /**
320
- * @param {number} scoredPoints the points scored by the user
321
- * @param {number} totalPoints the maximum points that can be scored by the user
322
- * @description this function verifies the functionality of Minimum score if attempted points when penalty points are set and user attempts incorrect answer
323
- */
324
- verifyMinimumScoreIfAttemptedAndPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPoints, totalPoints) => {
325
- it('When user has defined both penalty points and minimum score awarded (if attempted) points', () => {
326
- cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points');
327
- createQuestionBasePage.steps.switchToEditTab();
328
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1');
329
-
330
- cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
331
- createQuestionBasePage.steps.switchToPreviewTab();
332
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 1], [0, 1, 2], [1], [1]]);
333
- multipleSelectionGridPage.previewScoreText()
334
- .verifyInnerText(`1/${totalPoints}`);
335
-
336
- cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
337
- multipleSelectionGridPage.steps.resetQuestionPreview()
338
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [0, 1], [1, 2]]);
339
- multipleSelectionGridPage.previewScoreText()
340
- .verifyInnerText(`${scoredPoints}/${totalPoints}`);
341
-
342
- cy.log('When user switches to edit tab and increases the minimum score awarded (if attempted) points to check the case for an attempt in which points of the attempt is less than minimum score awarded (if attempted) points, then the minimum score awarded (if attempted) points should be displayed to the user');
343
- createQuestionBasePage.steps.switchToEditTab();
344
- multipleSelectionGridPage.steps.clearMinimumScoreIfAttemptedPointsField()
345
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('6')
346
- cy.log('Switching to preview tab');
347
- createQuestionBasePage.steps.switchToPreviewTab();
348
- multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [0, 2], [1], [1]]);
349
- multipleSelectionGridPage.previewScoreText()
350
- .verifyInnerText(`6/${totalPoints}`);
351
- });
352
- }
106
+ ...autoScoredScoringPreviewTab.tests
353
107
  }
354
108
 
355
109
  export const multipleSelectionGridPage = {
@@ -1,6 +1,6 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities"
3
- import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent } from "./components"
3
+ import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent, additionalSettingsAccessibilitySectionComponent } from "./components"
4
4
  const css = Cypress.env('css');
5
5
  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'];
6
6
 
@@ -557,6 +557,7 @@ const tests = {
557
557
  ...equationEditorFlyout.tests,
558
558
  ...commonComponents.tests,
559
559
  ...autoScoredStudentViewSettings.tests,
560
+ ...additionalSettingsAccessibilitySectionComponent.tests,
560
561
  /**
561
562
  * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
562
563
  * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
@@ -54,9 +54,20 @@ const steps = {
54
54
  .click();
55
55
  },
56
56
 
57
+ //TODO: Update once https://redmine.zeuslearning.com/issues/564419 is resolved
57
58
  selectResourceType: (resourceCategory) => {
58
- selectQuestionResourceToolPage.resourceAndToolOptionTitle(resourceCategory)
59
- .click();
59
+ if (resourceCategory === 'desmos scientific calculator') {
60
+ selectQuestionResourceToolPage.resourceAndToolOptionTitle('scientific calculator')
61
+ .eq(0)
62
+ .click();
63
+ } else if (resourceCategory === 'geogebra scientific calculator') {
64
+ selectQuestionResourceToolPage.resourceAndToolOptionTitle('scientific calculator')
65
+ .eq(1)
66
+ .click();
67
+ } else {
68
+ selectQuestionResourceToolPage.resourceAndToolOptionTitle(resourceCategory)
69
+ .click();
70
+ }
60
71
  }
61
72
  }
62
73