itemengine-cypress-automation 1.0.72 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/cypress/e2e/ILC/AudioResponse/{audioResponseMinimalPreviewSection.js → audioResponseMinimalPreviewSection.smoke.js} +263 -254
  2. package/cypress/e2e/ILC/AudioResponse/{audioResponseStandardPreviewSection.js → audioResponseStandardPreviewSection.smoke.js} +100 -97
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.smoke.js +121 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachCell.js → groupedOptionsPartialScoreForEachCell.smoke.js} +1 -1
  5. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachResponse.js → groupedOptionsPartialScoreForEachResponse.smoke.js} +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.smoke.js +164 -0
  7. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{standardTotalScoreDividedBetweenResponse.js → standardTotalScoreDividedBetweenResponse.smoke.js} +21 -18
  8. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +753 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.smoke.js +943 -0
  10. package/cypress/e2e/ILC/EssayResponse/{essayResponseCustomizeFormattingOptions1.js → essayResponseCustomizeFormattingOptions1.smoke.js} +113 -110
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +581 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.smoke.js +111 -0
  13. package/cypress/e2e/ILC/EssayResponse/{essayResponsePreviewContentsForAllViews.js → essayResponsePreviewContentsForAllViews.smoke.js} +6 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.smoke.js +81 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/{fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js → fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.smoke.js} +25 -22
  16. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAllOrNothingScoring.js → fillInTheGapsDropdownAllOrNothingScoring.smoke.js} +16 -14
  17. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.smoke.js} +80 -74
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.smoke.js +361 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.smoke.js +137 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.smoke.js +171 -0
  21. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.smoke.js} +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextAllOrNothingScoring.js → fillInTheGapsOverImageTextAllOrNothingScoring.smoke.js} +32 -29
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextCheckAnswerForAllViews.js → fillInTheGapsOverImageTextCheckAnswerForAllViews.smoke.js} +5 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.smoke.js +137 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.smoke.js +146 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewContentsForAllViews.js → fillInTheGapsOverImageTextPreviewContentsForAllViews.smoke.js} +5 -3
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewTab.js → fillInTheGapsOverImageTextPreviewTab.smoke.js} +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextShowCorrectAnswerForAllView.js → fillInTheGapsOverImageTextShowCorrectAnswerForAllView.smoke.js} +6 -4
  29. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextAutoScoredScoring.js → fillInTheGapsTextAutoScoredScoring.smoke.js} +12 -9
  30. package/cypress/e2e/ILC/Highlight/HighlightScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +36 -34
  31. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.smoke.js +462 -0
  32. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.smoke.js +148 -0
  33. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.smoke.js +185 -0
  34. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.smoke.js +138 -0
  35. package/cypress/e2e/ILC/HighlightImage/{highlightImagePreviewTab.js → highlightImagePreviewTab.smoke.js} +1 -1
  36. package/cypress/e2e/ILC/HighlightImage/{highlightImageToolsFunctionalityPreviewTab.js → highlightImageToolsFunctionalityPreviewTab.smoke.js} +4 -4
  37. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.smoke.js +122 -0
  38. package/cypress/e2e/ILC/ListMatching/{listMatchingAlternateAnswer.js → listMatchingAlternateAnswer.smoke.js} +47 -43
  39. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.smoke.js +211 -0
  40. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.smoke.js +254 -0
  41. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.smoke.js +191 -0
  42. package/cypress/e2e/ILC/ListOrdering/ListOrderingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +34 -32
  43. package/cypress/e2e/ILC/ListSorting/ListSortingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +41 -38
  44. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.smoke.js +269 -0
  45. package/cypress/e2e/ILC/MultipleSelectionGrid/{multipleSelectionGridAutoScoredScoring.js → multipleSelectionGridAutoScoredScoring.smoke.js} +36 -34
  46. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.smoke.js +407 -0
  47. package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoring.js → singleSelectionGridAutoScoredScoring.smoke.js} +32 -29
  48. package/cypress/e2e/ILC/UploadResponse/{uploadResponsePreview.js → uploadResponsePreview.smoke.js} +64 -59
  49. package/cypress/e2e/ILC/VideoResponse/{videoResponsePreviewTab.js → videoResponsePreviewTab.smoke.js} +290 -281
  50. package/cypress/pages/components/additionalSettingsPanel.js +0 -27
  51. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  52. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +321 -0
  53. package/cypress/pages/components/createQuestionBasePage.js +1 -7
  54. package/cypress/pages/components/essayResponseCommonComponents.js +0 -6
  55. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -13
  56. package/cypress/pages/components/index.js +2 -1
  57. package/cypress/pages/components/mcqAdditionalSettingsBase.js +0 -10
  58. package/cypress/pages/components/scoringSectionBase.js +3 -2
  59. package/cypress/pages/createItemPage.js +3 -79
  60. package/cypress/pages/dialogBoxBase.js +8 -23
  61. package/cypress/pages/index.js +1 -4
  62. package/cypress/pages/itemPreviewSettingsPage.js +446 -0
  63. package/cypress/pages/multipleSelectionPage.js +113 -64
  64. package/cypress/pages/selectQuestionResourceToolPage.js +0 -5
  65. package/cypress/pages/shortTextResponsePage.js +0 -6
  66. package/cypress/pages/singleSelectionPage.js +0 -1
  67. package/package.json +2 -2
  68. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.js +0 -116
  69. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.js +0 -160
  70. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +0 -932
  71. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -572
  72. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.js +0 -106
  73. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +0 -76
  74. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +0 -134
  75. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +0 -133
  76. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.js +0 -457
  77. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.js +0 -143
  78. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.js +0 -178
  79. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +0 -125
  80. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.js +0 -117
  81. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +0 -207
  82. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +0 -246
  83. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +0 -185
  84. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +0 -820
  85. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +0 -936
  86. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +0 -263
  87. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.js +0 -402
  88. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.js +0 -356
  89. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.js +0 -134
  90. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.js +0 -156
@@ -33,33 +33,6 @@ const steps = {
33
33
  .click();
34
34
  additionalSettingsPanel.fontSizeListOptions(dropdownOptionIndex)
35
35
  .click();
36
- },
37
-
38
- enterTextInTeacherGuidelinesInputField: (teacherGuidelinesText) => {
39
- additionalSettingsPanel.additionalSettingsTeacherGuidelinesInputField()
40
- .click()
41
- .type(teacherGuidelinesText)
42
- .blur();
43
- additionalSettingsPanel.additionalSettingsTeacherGuidelinesInputField()
44
- .should('have.text', teacherGuidelinesText);
45
- },
46
-
47
- enterTextInSampleAnswerInputField: (sampleAnswer) => {
48
- additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
49
- .click()
50
- .type(sampleAnswer)
51
- .blur();
52
- additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
53
- .should('have.text', sampleAnswer);
54
- },
55
-
56
- enterTextInAcknowledgementsInputField: (acknowledgements) => {
57
- additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
58
- .click()
59
- .type(acknowledgements)
60
- .blur();
61
- additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
62
- .should('have.text', acknowledgements);
63
36
  }
64
37
  }
65
38
 
@@ -2,7 +2,7 @@ import { dialogBoxBase } from "../dialogBoxBase";
2
2
  import { scoringSectionBase } from "./scoringSectionBase";
3
3
  import { commonComponents } from "./commonComponents";
4
4
  const css = Cypress.env('css');
5
-
5
+ //Enhancement: This file should be deprecated, new file: autoScoredSpecifyCorrectAnswerSection.js
6
6
  const selectors = {
7
7
  setCorrectAnswerLabel: () => cy.get('.set-correct-answer-label'),
8
8
  setCorrectAnswerHelpText: () => cy.get('.edit-set-correct-answer-help-text'),
@@ -0,0 +1,321 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { dialogBoxBase } from "../dialogBoxBase";
3
+ import { commonComponents } from "./commonComponents";
4
+ import { scoringSectionBase } from "./scoringSectionBase";
5
+ const css = Cypress.env('css');
6
+
7
+ const selectors = {
8
+ specifyCorrectAnswerLabel: () => cy.get('.set-correct-answer-label'),
9
+ specifyCorrectAnswerHelpText: () => cy.get('.edit-set-correct-answer-help-text'),
10
+ alternativeAnswerButton: () => cy.get('.alternate-answer-btn-cls button'),
11
+ //TODO: Need to update the selector of correct answer accordion once a unique selector is made available
12
+ correctAnswerAccordion: () => cy.get('.correct-answer-accordion [role="button"]').eq(0),
13
+ alternativeAnswerAccordion: () => cy.get('.correct-answer-accordion [role="button"]'),
14
+ //TODO: Need to update the selector of correct answer accordion once a unique selector is made available
15
+ correctAnswerAccordionLabel: () => cy.get('[class*="AnswerAccordionstyles__Label"]').eq(0),
16
+ alternativeAnswerAccordionLabel: () => cy.get('[class*="AnswerAccordionstyles__Label"]'),
17
+ deleteAlternateAccordionButton: () => cy.get('.answer-accordion-label button'),
18
+ specifyCorrectAnswerErrorIcon: () => cy.get('[aria-label="Error in"]'),
19
+ }
20
+
21
+ const steps = {
22
+ clickOnAddAlternativeAnswerButton: () => {
23
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
24
+ .click();
25
+ },
26
+
27
+ /**
28
+ * @description Adds an alternative answer accordion at a specified index.
29
+ * @param {number} accordionIndex - The index at which the alternative answer accordion should be added.
30
+ * @example - addAlternativeAnswerAccordion(1);
31
+ */
32
+ addAlternativeAnswerAccordion: (accordionIndex) => {
33
+ autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
34
+ utilities.verifyInnerText(utilities.getNthElement(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion(), accordionIndex), `Alternative ${accordionIndex}`);
35
+ },
36
+
37
+ verifySpecifyCorrectAnswerErrorIconNotExists: () => {
38
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
39
+ },
40
+
41
+ verifySpecifyCorrectAnswerErrorIconIsVisible: () => {
42
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
43
+ },
44
+
45
+ expandCorrectAnswerAccordion: () => {
46
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
47
+ .click()
48
+ .should('have.attr', 'aria-expanded', 'true');
49
+ },
50
+
51
+ /**
52
+ * @description Expands the alternative answer accordion at the specified index.
53
+ * @param {number} accordionIndex - The index of the alternative answer accordion to be expanded.
54
+ * @example - expandAlternativeAnswerAccordion(2);
55
+ */
56
+ expandAlternativeAnswerAccordion: (accordionIndex) => {
57
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
58
+ .eq(accordionIndex + 1)
59
+ .click()
60
+ .should('have.attr', 'aria-expanded', 'true');
61
+ },
62
+
63
+ /**
64
+ * @description Deletes the alternative answer accordion at the specified index.
65
+ * @param {number} accordionIndex - The index of the alternative answer accordion to be deleted.
66
+ * @example - deleteAlternativeAnswerAccordion(3);
67
+ */
68
+ deleteAlternativeAnswerAccordion: (accordionIndex) => {
69
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
70
+ .eq(accordionIndex + 1)
71
+ .within(() => {
72
+ autoScoredSpecifyCorrectAnswerSection.deleteAlternateAccordionButton()
73
+ .click();
74
+ });
75
+ },
76
+
77
+ /**
78
+ * @param {number} accordionIndex - The index of the alternative answer accordion to be checked.
79
+ * @description - This function ensures that the alternative answer accordion at the specified index is not present in the DOM.
80
+ */
81
+ verifyAlternativeAnswerAccordionNotExists: (accordionIndex) => {
82
+ utilities.verifyElementVisibilityState(utilities.getNthElement(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion(), accordionIndex), 'notExist');
83
+ },
84
+
85
+ /**
86
+ * @param {number} accordionIndex - The index of the alternative answer accordion.
87
+ * @description - This function checks if the label of the alternative answer accordion matches the expected value.
88
+ */
89
+ verifyAlternativeAnswerAccordionLabel: (accordionIndex) => {
90
+ utilities.verifyInnerText(utilities.getNthElement(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion(), accordionIndex), `Alternative ${accordionIndex}`);
91
+ },
92
+ }
93
+
94
+ const tests = {
95
+ /**
96
+ * @description Verifies the contents and styling of the 'Specify correct answer' header section based on the given question type.
97
+ * @param {string} questionType - The type of the question (e.g., 'multiple selection', 'single selection', etc.).
98
+ * @example - verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('multiple selection');
99
+ */
100
+ verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents: (questionType) => {
101
+ it('\'Specify correct answer\' label and help text should be displayed in \'Specify correct answer\' section', () => {
102
+ utilities.verifyInnerText(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerLabel(), 'Specify correct answer');
103
+
104
+ let helpText;
105
+ switch (questionType) {
106
+ case 'multiple selection':
107
+ helpText = 'You can set the correct answer by selecting the correct answer option.';
108
+ break;
109
+ case 'single selection':
110
+ helpText = 'You can set the correct answer by selecting the correct answer option.';
111
+ break;
112
+ case 'fill in the gaps - text':
113
+ helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
114
+ break;
115
+ case 'short text response':
116
+ helpText = 'You can set the correct answer by entering the correct answer in the input field.';
117
+ break;
118
+ case 'fill in the gaps - dropdown':
119
+ helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
120
+ break;
121
+ case 'fill in the gaps - drag and drop':
122
+ helpText = 'You can set the correct answer by dragging the correct answer(s) in the response area(s).';
123
+ break;
124
+ case 'single selection grid':
125
+ helpText = 'You can set the correct answer(s) by selecting the correct answer option(s).';
126
+ break;
127
+ case 'multiple selection grid':
128
+ helpText = 'You can set the correct answer(s) by selecting the correct answer option(s).';
129
+ break;
130
+ case 'drag and drop into categories':
131
+ helpText = 'You can set the correct answer by dragging the correct answer(s) in the response area(s).';
132
+ break;
133
+ case 'list matching':
134
+ helpText = 'You can set the correct answer by dragging the correct answer(s) in the response area(s).'
135
+ break;
136
+ case 'list ordering':
137
+ helpText = 'You can set the correct answer by ordering the correct answer(s) in the response area(s).';
138
+ break;
139
+ case 'list sorting':
140
+ helpText = 'You can set the correct answer by sorting the correct answer(s) in the response area(s).';
141
+ break;
142
+ case 'highlight':
143
+ helpText = 'You can set the correct answer by highlighting the correct answer(s) in the response area(s).';
144
+ break;
145
+ case 'highlight image':
146
+ helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
147
+ break;
148
+ case 'fill in the gaps over image - text':
149
+ helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
150
+ break;
151
+ case 'fill in the gaps over image - dropdown':
152
+ helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
153
+ break;
154
+ default:
155
+ throw new Error('Invalid question type');
156
+ }
157
+ utilities.verifyInnerText(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerHelpText(), helpText);
158
+ });
159
+
160
+ it('CSS of \'Specify correct answer\' header section', { tags: 'css' }, () => {
161
+ utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerLabel(), {
162
+ 'color': css.color.sectionHeading,
163
+ 'font-size': css.fontSize.default,
164
+ 'font-weight': css.fontWeight.semibold
165
+ });
166
+ utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerHelpText(), {
167
+ 'color': css.color.helperText,
168
+ 'font-size': css.fontSize.normal,
169
+ 'font-weight': css.fontWeight.regular
170
+ });
171
+ utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordionLabel(), {
172
+ 'color': css.color.activeButtons,
173
+ 'font-size': css.fontSize.default,
174
+ 'font-weight': css.fontWeight.bold
175
+ });
176
+ });
177
+
178
+ it('\'Correct\' accordion should be present and by default it should be in expanded state', () => {
179
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
180
+ .should('have.attr', 'aria-expanded', 'true');
181
+ });
182
+ },
183
+
184
+ /**
185
+ * @description Verifies the behavior of points input field and error messages when the points field is empty.
186
+ * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
187
+ * @example - verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty('Correct');
188
+ */
189
+ verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty: (accordionName) => {
190
+ it(`When the user focuses in and out of the empty points input field, \'Error: Please enter points.\' validation text should be displayed below the points input field and error icon should be displayed on the \'${accordionName}\' accordion`, () => {
191
+ scoringSectionBase.pointsInputField()
192
+ .focus();
193
+ scoringSectionBase.pointsInputField()
194
+ .blur();
195
+ utilities.verifyElementVisibilityState(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'visible')
196
+ utilities.verifyInnerText(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'Error: Please enter points.');
197
+ if (accordionName == 'Correct') {
198
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
199
+ .within(() => {
200
+ autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
201
+ });
202
+ } else {
203
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
204
+ .eq(1)
205
+ .within(() => {
206
+ autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
207
+ });
208
+ };
209
+ });
210
+
211
+ it('When the user enters point in Points input field then the \'Error: Please enter points.\' validation text and error icon displayed on the \'Correct\' tab the should disappear', () => {
212
+ scoringSectionBase.steps.allotPoints(20);
213
+ utilities.verifyElementVisibilityState(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'notExist');
214
+ autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
215
+ });
216
+ },
217
+
218
+ verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y: () => {
219
+ it('CSS of \'Error: Please set a correct answer\' error message and error icon', { tags: 'css' }, () => {
220
+ utilities.verifyCSS(commonComponents.errorMessage(), {
221
+ 'color': css.color.errorText,
222
+ 'font-size': css.fontSize.small,
223
+ 'font-weight': css.fontWeight.regular
224
+ });
225
+ utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon().find('path'), {
226
+ 'fill': css.color.errorText
227
+ });
228
+ });
229
+
230
+ it('Accessibility of \'Error: Please set a correct answer\' error message and error icon', { tags: 'a11y' }, () => {
231
+ cy.checkAccessibility(commonComponents.errorMessage());
232
+ cy.checkAccessibility(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon());
233
+ });
234
+ },
235
+
236
+ /**
237
+ * @description Verifies the behavior of the 'Add alternative answer' button, warning popups, and validation error messages
238
+ * in the 'Specify correct answer' section for alternative answers in auto-scored questions.
239
+ * @param {string|null} questionType - The type of the question (e.g., 'list ordering'). Pass `null` if not applicable.
240
+ * @example - verifyAutoScoredAddAlternativeAnswerButtonAndValidation();
241
+ */
242
+ verifyAutoScoredAddAlternativeAnswerButtonAndValidation: (questionType = null) => {
243
+ it('\'+ Add alternative answer\' button should be present', () => {
244
+ utilities.verifyInnerText(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton(), 'Add alternative answer');
245
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton(), 'visible');
246
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
247
+ .verifyPseudoClassBeforeProperty('content', '""');
248
+ });
249
+
250
+ it('CSS of \'Add Alternative answer\' button', { tags: 'css' }, () => {
251
+ utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton(), {
252
+ 'color': css.color.activeButtons,
253
+ 'font-size': css.fontSize.default,
254
+ 'font-weight': css.fontWeight.medium
255
+ });
256
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
257
+ .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
258
+ });
259
+
260
+ it('If user has not added points and/or selected correct answer in the correct accordion, the user should get a warning popup', () => {
261
+ autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
262
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
263
+ });
264
+
265
+ it('CSS of warning popup', { tags: 'css' }, () => {
266
+ utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
267
+ 'color': css.color.flyoutTitle,
268
+ 'font-size': css.fontSize.heading,
269
+ 'font-weight': css.fontWeight.semibold
270
+ });
271
+ utilities.verifyCSS(dialogBoxBase.dialogBoxContent(), {
272
+ 'color': css.color.labels,
273
+ 'font-size': css.fontSize.default,
274
+ 'font-weight': css.fontWeight.regular
275
+ });
276
+ utilities.verifyCSS(dialogBoxBase.buttonClose().find('svg'), {
277
+ 'fill': css.color.closeIcon
278
+ });
279
+ });
280
+
281
+ it('Accessibility of warning popup', { tags: 'a11y' }, () => {
282
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
283
+ });
284
+
285
+ it('Warning popup should close on clicking the Close icon button', () => {
286
+ dialogBoxBase.steps.closeWarningPopup();
287
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
288
+ });
289
+
290
+ it('\'Error: Please set a correct answer.\' and \'Error: Please enter points.\' validation error messages should be displayed in the correct accordion', () => {
291
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
292
+ .within(() => {
293
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
294
+ });
295
+ utilities.verifyInnerText(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'Error: Please enter points.');
296
+ utilities.verifyElementVisibilityState(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'visible');
297
+ if (questionType != 'list ordering') {
298
+ utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), 1), 'Error: Please set a correct answer.');
299
+ utilities.verifyElementVisibilityState(utilities.getNthElement(commonComponents.errorMessage(), 1), 'visible');
300
+ }
301
+ });
302
+ },
303
+
304
+ verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion: () => {
305
+ it('When user tries to expand correct accordion when all the mandatory fields are not filled in the alternative accordion, then a warning popup should be displayed and on closing the popup, alternative 2 accordion should be in expanded state', () => {
306
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
307
+ .click();
308
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
309
+ dialogBoxBase.steps.closeWarningPopup();
310
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
311
+ .eq(2)
312
+ .should('have.attr', 'aria-expanded', 'true');
313
+ });
314
+ },
315
+ }
316
+
317
+ export const autoScoredSpecifyCorrectAnswerSection = {
318
+ ...selectors,
319
+ steps,
320
+ tests
321
+ }
@@ -69,7 +69,7 @@ const steps = {
69
69
  createQuestionBasePage.previewTab()
70
70
  .should('have.attr', 'aria-selected', 'true');
71
71
  },
72
-
72
+
73
73
  clickOnSaveQuestionButton: () => {
74
74
  createQuestionBasePage.saveQuestionButton()
75
75
  .click();
@@ -83,12 +83,6 @@ const steps = {
83
83
  verifyPreviewTabNotSelectedState: () => {
84
84
  createQuestionBasePage.previewTab()
85
85
  .should('have.attr', 'aria-selected', 'false');
86
- },
87
-
88
- verifySavedSuccessfullySnackbar: () => {
89
- commonComponents.snackbar()
90
- .should('have.text', 'Saved successfully!')
91
- .should('be.visible');
92
86
  }
93
87
  }
94
88
 
@@ -96,12 +96,6 @@ const steps = {
96
96
  .type('{backspace}');
97
97
  },
98
98
 
99
- enterTextInPredefinedTextInputField: (predefinedText) => {
100
- essayResponseCommonComponents.predefinedTextInputField()
101
- .type(predefinedText)
102
- .should('have.text', predefinedText);
103
- },
104
-
105
99
  verifyGradingViewResponseFieldIsNonEditable: () => {
106
100
  essayResponseCommonComponents.responseField()
107
101
  .should('have.attr', 'contenteditable', 'false');
@@ -178,19 +178,6 @@ const steps = {
178
178
  fillInTheGapsCommonComponents.previewTabCorrectAnswerResponseWrapper()
179
179
  .should('have.length', correctAnswerArray.length);
180
180
  },
181
-
182
- setPlaceholderText: (placeholder) => {
183
- fillInTheGapsCommonComponents.placeholderTextInputField()
184
- .type(placeholder)
185
- .should('have.value', placeholder);
186
- },
187
-
188
- setResponseContainerHeight: (height) => {
189
- fillInTheGapsCommonComponents.heightInputField()
190
- .type(height)
191
- .should('have.value', height)
192
- .blur();
193
- }
194
181
  }
195
182
 
196
183
  const tests = {
@@ -36,4 +36,5 @@ export * from './figOverImageCommonComponent';
36
36
  export * from './uploadImageSectionComponent';
37
37
  export * from './colorPopupComponent';
38
38
  export * from './customizeHighlightPropertiesComponent';
39
- export * from './browseItemsPage';
39
+ export * from './browseItemsPage';
40
+ export * from './autoScoredSpecifyCorrectAnswerSection';
@@ -39,15 +39,6 @@ const selectors = {
39
39
  optionOrientationListOptions: (optionIndex) => cy.get('[aria-labelledby="Option-Orientation-dropdown-label Option-Orientation-placeholder"] li[role="option"]').eq(optionIndex)
40
40
  }
41
41
 
42
- const steps = {
43
- selectNumberOfOptionColumnsFromDropdown: (optionNumber) => {
44
- mcqAdditionalSettingsBase.numberOfOptionColumnsDropdown()
45
- .click();
46
- mcqAdditionalSettingsBase.numberOfOptionColumnsListOptions(optionNumber)
47
- .click();
48
- }
49
- }
50
-
51
42
  const tests = {
52
43
  verifyNumberOfOptionsColumns: (orientation) => {
53
44
  let option = [2, 3, 4, 5, 6];
@@ -395,6 +386,5 @@ const tests = {
395
386
 
396
387
  export const mcqAdditionalSettingsBase = {
397
388
  ...selectors,
398
- steps,
399
389
  tests
400
390
  }
@@ -11,8 +11,9 @@ const selectors = {
11
11
  minimumScoreIfAttemptedLabel: () => cy.get('[class*="min-score-points-label"]'),
12
12
  minimumScoreIfAttemptedInputField: () => cy.get('.min-score-points-input-field input[type="text"]'),
13
13
  pointsLabel: () => cy.get('.points-label'),
14
- pointsInputField: () => cy.get('.points-input-field input[type="text"]'),
15
- pleaseEnterPointsErrorMessage: () => cy.get('[class*="ErrorBlockstyles__ErrorText"]'),
14
+ //TODO: Need to update below selectors, once https://redmine.zeuslearning.com/issues/553983 gets resolved
15
+ pointsInputField: () => cy.get('[class*="points-input-field"]:visible input[type="text"]'),
16
+ pleaseEnterPointsErrorMessage: () => cy.get('[class*="ErrorBlockstyles__ErrorText"]:visible'),
16
17
  pointsWrapper: () => cy.get('.set-correct-answer-points-wrapper'),
17
18
  minimumScoringLabel: () => cy.get('#minimum-scoring-dropdown-label'),
18
19
  minimumScoringDropdown: () => cy.get('#minimum-scoring-select'),
@@ -1,5 +1,3 @@
1
- import utilities from "../support/helpers/utilities";
2
-
3
1
  const css = Cypress.env('css');
4
2
 
5
3
  const selectors = {
@@ -15,13 +13,7 @@ const selectors = {
15
13
  itemTitle: () => cy.get('.ItemLevel-Header'),
16
14
  tagsButton: () => cy.get('.ngie-button').contains('Tags'),
17
15
  tagsInputField: () => cy.get('.tags-chip-container'),
18
- editItemPageWrapper: () => cy.get('.edit-wrapper'),
19
- editItemReferenceId: () => cy.get('.edit-item-reference-id'),
20
- applyChangesButton: () => cy.get('.ngie-btn-contained').contains('Apply changes'),
21
- editTitleIcon: () => cy.get('.icon-pencil'),
22
- titleInputField: () => cy.get('.edit-box-header-input-wrapper'),
23
- submitButton: () => cy.get('[class*="StudentViewstyles__ButtonsWrapper"] button').eq(1),
24
- studentViewReferenceId: () => cy.get('[class*="StudentViewstyles__ViewInfoWrapper"]')
16
+ settingsBtn: () => cy.get('.ngie-btn-link').eq(3)
25
17
  }
26
18
 
27
19
  const steps = {
@@ -39,23 +31,6 @@ const steps = {
39
31
  cy.visit('/item-engine/demo/create-item');
40
32
  },
41
33
 
42
- /**
43
- * @param {string} reference id of the question to be navigated
44
- * @description this function navigates to the edit item page of the
45
- */
46
- navigateToEditItemUsingReferenceID: (reference) => {
47
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(reference)}`);
48
- },
49
-
50
- navigateToEditItemPage: () => {
51
- createItemPage.referenceId()
52
- .invoke('text')
53
- .then(text => {
54
- const referenceId = text;
55
- steps.navigateToEditItemUsingReferenceID(referenceId);
56
- });
57
- },
58
-
59
34
  verifyCreateItemContainerIsVisible: () => {
60
35
  createItemPage.createItemContainer()
61
36
  .should('be.visible');
@@ -80,60 +55,9 @@ const steps = {
80
55
  .should('have.text', arrayOfTags.sort().join(''));
81
56
  },
82
57
 
83
- /**
84
- * @param {string[]} arrayOfTags of text that need to enter in tags input field
85
- * @description set tags for an item
86
- */
87
- setTags: (arrayOfTags) => {
88
- steps.clickOnTagsButton()
89
- for (let index = 0; index < arrayOfTags.length; index++) {
90
- createItemPage.tagsInputField()
91
- .type(`${arrayOfTags[index]}{enter}`);
92
- }
93
- createItemPage.applyChangesButton()
58
+ clickOnSettingsButton: () => {
59
+ createItemPage.settingsBtn()
94
60
  .click();
95
- },
96
-
97
- /**
98
- * @param {string[]} value of text that need to enter in title input field
99
- * @description this function enters text in title input field
100
- */
101
- enterTitle: (value) => {
102
- createItemPage.titleInputField()
103
- .type(value);
104
- },
105
-
106
- clickOnSubmitButton: () => {
107
- createItemPage.submitButton()
108
- .click();
109
- },
110
-
111
-
112
- navigateToStudentViewPage: () => {
113
- createItemPage.referenceId()
114
- .invoke('text')
115
- .then(text => {
116
- const referenceId = text;
117
- steps.navigateToStudentViewUsingReferenceID(referenceId);
118
- });
119
- },
120
-
121
- navigateToEditItemPageFromStudentView: () => {
122
- createItemPage.studentViewReferenceId()
123
- .invoke('text')
124
- .then(text => {
125
- let value = text;
126
- let referenceId = value.split(':')[1].trim();
127
- steps.navigateToEditItemUsingReferenceID(referenceId);
128
- });
129
- },
130
-
131
- /**
132
- * @param {string} reference id of the question to be navigated
133
- * @description this function navigates to the student view page
134
- */
135
- navigateToStudentViewUsingReferenceID: (reference) => {
136
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(reference)}`);
137
61
  }
138
62
  }
139
63
 
@@ -13,21 +13,16 @@ const selectors = {
13
13
 
14
14
  const steps = {
15
15
  allFieldsRequiredWarningPopupContents: () => {
16
- dialogBoxBase.dialogBox()
17
- .should('be.visible');
18
- dialogBoxBase.dialogBoxTitle()
19
- .verifyInnerText('Warning!');
20
- dialogBoxBase.dialogBoxContent()
21
- .verifyInnerText('Please fill the required fields.');
22
- dialogBoxBase.buttonClose()
23
- .should('be.visible');
16
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
17
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Warning!');
18
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxContent(), 'Please fill the required fields.');
19
+ utilities.verifyElementVisibilityState(dialogBoxBase.closeButton(), 'visible');
24
20
  },
25
21
 
26
22
  closeWarningPopup: () => {
27
23
  dialogBoxBase.buttonClose()
28
24
  .click();
29
- dialogBoxBase.dialogBox()
30
- .should('not.exist');
25
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
31
26
  },
32
27
 
33
28
  clickOnAcceptButtonInDialogBox: () => {
@@ -46,21 +41,12 @@ const tests = {
46
41
  it('When user has made no edits and clicks on Save Question button, the user should get a warning popup', () => {
47
42
  createQuestionBasePage.saveQuestionButton()
48
43
  .click();
49
- dialogBoxBase.dialogBox()
50
- .should('exist');
51
- dialogBoxBase.dialogBoxTitle()
52
- .verifyInnerText('Warning!');
53
- dialogBoxBase.dialogBoxContent()
54
- .verifyInnerText('Please fill the required fields.');
55
- dialogBoxBase.buttonClose()
56
- .should('be.visible');
44
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
57
45
  });
58
46
 
59
47
  it('Warning popup should close on clicking the Close icon button', () => {
60
- dialogBoxBase.buttonClose()
61
- .click();
62
- dialogBoxBase.dialogBox()
63
- .should('not.exist');
48
+ dialogBoxBase.steps.closeWarningPopup();
49
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
64
50
  });
65
51
  },
66
52
 
@@ -71,7 +57,6 @@ const tests = {
71
57
  utilities.verifyInnerText(dialogBoxBase.buttonReject(), 'No, I\'d like to go back');
72
58
  });
73
59
 
74
- //Failing due to https://redmine.zeuslearning.com/issues/542700
75
60
  it('CSS of popup', { tags: 'css' }, () => {
76
61
  utilities.verifyCSS(dialogBoxBase.dialogBox(), {
77
62
  'background-color': css.color.defaultBackground,
@@ -1,5 +1,4 @@
1
1
  export * from './multipleSelectionPage';
2
- export * from './singleSelectionPage';
3
2
  export * from './createItemPage';
4
3
  export * from './selectQuestionResourceToolPage';
5
4
  export * from './dialogBoxBase';
@@ -29,9 +28,7 @@ export * from './audioPlayerPage';
29
28
  export * from './highlightImagePage';
30
29
  export * from './fillInTheGapsOverImageDropdownPage';
31
30
  export * from './fillInTheGapsOverImageTextPage';
32
- export * from './multipleSelectionGridPage';
33
- export * from './singleSelectionGridPage';
34
- export * from './feedbackScalePage';
31
+ export * from './itemPreviewSettingsPage';
35
32
  export * from './itemPreviewPage';
36
33
  export * from './studentViewPage';
37
34
  export * from './gradingViewPage';