itemengine-cypress-automation 1.0.158-migrationScripts-2432c9a.0 → 1.0.158

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +49 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -8
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +7 -7
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +11 -8
  9. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +5 -5
  10. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +1 -1
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +0 -5
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +10 -10
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/specifyCorrectAnswerSection.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +0 -5
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
  18. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +3 -3
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -4
  20. package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +4 -4
  21. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +1 -0
  22. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +2 -2
  23. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/Matching/draggableOptions.js +53 -0
  25. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +302 -0
  26. package/cypress/e2e/ILC/MultipleSelectionGridNew/additionalSettingsBasic.js +146 -0
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +83 -0
  28. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +18 -22
  29. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -2
  30. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettingsBasic.js +146 -0
  31. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +83 -0
  32. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -1
  33. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  34. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
  35. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +6 -0
  36. package/cypress/fixtures/evaluationMethodsAndCustomSettings.js +1 -1
  37. package/cypress/pages/components/autoScoredScoringPreviewTab.js +6 -0
  38. package/cypress/pages/components/commonComponents.js +2 -1
  39. package/cypress/pages/components/createCustomCategoryFlyout.js +0 -1
  40. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -4
  41. package/cypress/pages/components/gridQuestionCommonComponent.js +29 -1
  42. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  43. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  44. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -4
  45. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +10 -0
  46. package/cypress/pages/graphingPage.js +4 -4
  47. package/cypress/pages/index.js +0 -3
  48. package/cypress/pages/matchingPage.js +166 -10
  49. package/cypress/pages/multipleSelectionGridPage.js +10 -2
  50. package/cypress/pages/rulerPage.js +12 -12
  51. package/cypress/pages/singleSelectionGridPage.js +10 -2
  52. package/cypress/pages/textEntryMathPage.js +2 -1
  53. package/package.json +2 -2
  54. package/cypress/pages/listMatchingPage.js +0 -1514
  55. package/cypress/pages/listMatchingScoring.js +0 -2547
  56. package/cypress/pages/passagePage.js +0 -436
@@ -116,7 +116,7 @@ describe('Create item page - Matching: Partial equal weights with alternative an
116
116
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
117
117
  });
118
118
 
119
- it.skip('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the response from the correct accordion, and no icon should be displayed beside unattempted response, a status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with dropzone cell numeration should be displayed', () => {
119
+ it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the response from the correct accordion, and no icon should be displayed beside unattempted response, a status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with dropzone cell numeration should be displayed', () => {
120
120
  matchingPage.steps.resetQuestionPreview();
121
121
  matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Cat', dropzoneIndex: 2 }])
122
122
  matchingPage.steps.verifyPreviewScore(10, 15);
@@ -43,6 +43,23 @@ describe('Create Item page - Matching: Draggable options section', () => {
43
43
 
44
44
  matchingPage.tests.verifyEnabledDeleteButtonAndTooltip();
45
45
 
46
+ it('Dropzone column header label and input field should be displayed and by default it should be empty', () => {
47
+ utilities.verifyInnerText(matchingPage.dropzoneColumnHeaderLabel(), 'Dropzone column header');
48
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnHeaderLabel(), 'visible');
49
+ utilities.verifyInnerText(matchingPage.dropzoneColumnHeaderInputField(), '');
50
+ });
51
+
52
+ it('User should be able to enter text in dropzone column header input field', () => {
53
+ matchingPage.steps.enterTextInDropzoneColumnHeaderInputField('Header');
54
+ matchingPage.steps.verifyTextInDropzoneColumnHeaderInputField('Header');
55
+ });
56
+
57
+ it('When user clears text in dropzone column input field then input field should be empty and error message should not be displayed', () => {
58
+ matchingPage.steps.clearAndFocusOutOfDropzoneColumnHeaderInputField();
59
+ matchingPage.steps.verifyTextInDropzoneColumnHeaderInputField('');
60
+ matchingPage.steps.verifyErrorMessageIsNotDisplayed();
61
+ });
62
+
46
63
  it('When user clicks on the \'Delete\' option button then the respective options input field should get deleted and option numeration should change accordingly', () => {
47
64
  cy.log('Pre step: Adding text in all option input fields')
48
65
  matchingPage.steps.enterTextInOneOptionInputField(1, 'option 2');
@@ -66,6 +83,21 @@ describe('Create Item page - Matching: Draggable options section', () => {
66
83
 
67
84
  matchingPage.tests.verifyDraggableOptionsForStandardLayoutInSpecifyCorrectAnswerSection();
68
85
 
86
+ it('When dropzone column header input field is empty, then dropzone column header should not be displayed in specify correct answer section', () => {
87
+ utilities.verifyInnerText(matchingPage.dropzoneColumnHeaderInputField(), '');
88
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperSpecifyCorrectAnswerSection(), 'notExist');
89
+ });
90
+
91
+ it('When user enters text in dropzone column header input field in edit tab, then dropzone column header should be displayed in specify correct answer section', () => {
92
+ matchingPage.steps.enterTextInDropzoneColumnHeaderInputField('Header');
93
+ matchingPage.steps.verifyDropzoneColumnHeaderTextSpecifyCorrectAnswerSection('Header');
94
+ });
95
+
96
+ it('When user clears text in dropzone column header input field then dropzone column header should be removed in specify correct answer section', () => {
97
+ matchingPage.steps.clearAndFocusOutOfDropzoneColumnHeaderInputField();
98
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperSpecifyCorrectAnswerSection(), 'notExist');
99
+ });
100
+
69
101
  it('When the user deletes an option, then the deleted option should get removed from the options container as well as from the dropzone (if any) in the \'Specify correct answer section\' section', () => {
70
102
  const optionsAfterDeleting = options.filter((el) => el !== 'option 3');
71
103
  cy.log('Setting a correct answer option')
@@ -136,6 +168,27 @@ describe('Create Item page - Matching: Draggable options section', () => {
136
168
  utilities.verifyElementCount(matchingPage.groupTab(), 2);
137
169
  matchingPage.steps.verifyGroupTabLabel(1);
138
170
  });
171
+
172
+ it('When dropzone column header input field is empty, then dropzone column header should not be displayed in preview tab', () => {
173
+ matchingPage.steps.switchToEditTab();
174
+ utilities.verifyInnerText(matchingPage.dropzoneColumnHeaderInputField(), '');
175
+ matchingPage.steps.switchToPreviewTab();
176
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
177
+ });
178
+
179
+ it('When user enters text in dropzone column header input field in edit tab, then dropzone column header should be displayed in preview tab', () => {
180
+ matchingPage.steps.switchToEditTab();
181
+ matchingPage.steps.enterTextInDropzoneColumnHeaderInputField('Header');
182
+ matchingPage.steps.switchToPreviewTab();
183
+ matchingPage.steps.verifyDropzoneColumnHeaderTextPreviewTab('Header');
184
+ });
185
+
186
+ it('When user clears text in dropzone column header input field then dropzone column header should be removed in preview tab', () => {
187
+ matchingPage.steps.switchToEditTab();
188
+ matchingPage.steps.clearAndFocusOutOfDropzoneColumnHeaderInputField();
189
+ matchingPage.steps.switchToPreviewTab();
190
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
191
+ });
139
192
  });
140
193
 
141
194
  describe('Grouped options layout - Specify correct answer section contents', () => {
@@ -0,0 +1,302 @@
1
+ import { matchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const promptArray = ['Land pollution', 'Water pollution', 'Air pollution'];
6
+
7
+ describe('Create Item page - Matching : Question Instructions and prompt section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question Instructions input field - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to Matching question type');
16
+ matchingPage.steps.navigateToCreateQuestion('matching');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ matchingPage.tests.verifyQuestionInstructionsInputFieldEditTab();
21
+ });
22
+
23
+ describe('Question Instructions input field - Preview tab', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ cy.log('Navigating to Matching question type');
27
+ matchingPage.steps.navigateToCreateQuestion('matching');
28
+ cy.barsPreLoaderWait();
29
+ });
30
+
31
+ matchingPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
32
+ });
33
+
34
+ describe('Prompt - Edit tab prompt section contents', () => {
35
+ abortEarlySetup();
36
+ before(() => {
37
+ cy.log('Navigating to Matching question type');
38
+ matchingPage.steps.navigateToCreateQuestion('matching');
39
+ cy.barsPreLoaderWait();
40
+ });
41
+
42
+ it('\'Prompt\' label should be displayed', () => {
43
+ utilities.verifyInnerText(matchingPage.promptLabel(), 'Prompt');
44
+ });
45
+
46
+ it('By default, 3 \'Prompt\' input fields should be displayed with placeholder text and numeration, Drag handle and Delete option icon buttons should be displayed besides each input field', () => {
47
+ utilities.verifyElementCount(matchingPage.promptInputField(), 3);
48
+ for (let index = 0; index < 3; index++) {
49
+ matchingPage.steps.verifyPromptContents(index);
50
+ }
51
+ });
52
+
53
+ it('CSS of prompt section', { tags: 'css' }, () => {
54
+ utilities.verifyCSS(matchingPage.promptLabel(), {
55
+ 'color': css.color.sectionHeading,
56
+ 'font-size': css.fontSize.normal,
57
+ 'font-weight': css.fontWeight.semibold
58
+ })
59
+ utilities.getNthElement( matchingPage.promptInputFieldWrapper(),0)
60
+ .within(() => {
61
+ utilities.verifyCSS(matchingPage.dragHandleButton(), {
62
+ 'color': css.color.secondaryBtnActive,
63
+ 'font-size': css.fontSize.normal,
64
+ 'font-weight': css.fontWeight.regular
65
+ });
66
+ matchingPage.deletePromptButton()
67
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
68
+ utilities.verifyCSS(matchingPage.promptNumeration(), {
69
+ 'color': css.color.labels,
70
+ 'font-size': css.fontSize.default,
71
+ 'font-weight': css.fontWeight.semibold
72
+ });
73
+ });
74
+ utilities.verifyCSS(matchingPage.promptLabel(), {
75
+ 'color': css.color.labels,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.semibold
78
+ });
79
+ utilities.verifyCSS(utilities.getNthElement( matchingPage.promptInputField(),0), {
80
+ 'color': css.color.text,
81
+ 'font-size': css.fontSize.default,
82
+ 'font-weight': css.fontWeight.regular
83
+ });
84
+ });
85
+
86
+ it('On hovering over the drag handle of the prompt, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
87
+ utilities.getNthElement(matchingPage.dragHandleButton(), 0)
88
+ .verifyTooltip('Drag to reorder');
89
+ });
90
+
91
+ it('When the user hovers over the enabled \'Delete\' icon buttons then, \'Delete prompt\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
92
+ utilities.getNthElement(matchingPage.deletePromptButton(), 0)
93
+ .verifyTooltip('Delete prompt');
94
+ });
95
+
96
+ it('When user clicks on the \'Delete\' question prompt button then the respective options input field should get deleted, option numeration should change accordingly and delete option icon buttons should be displayed in disabled state', () => {
97
+ matchingPage.steps.deletePrompt(0);
98
+ utilities.verifyElementCount(matchingPage.promptInputField(), 2);
99
+ for (let index = 0; index < 2; index++) {
100
+ matchingPage.steps.verifyPromptContents(index)
101
+ }
102
+ utilities.verifyElementDisabled(utilities.getNthElement(matchingPage.deletePromptButton(), 0));
103
+ utilities.verifyElementDisabled(utilities.getNthElement(matchingPage.deletePromptButton(), 1));
104
+ });
105
+
106
+ it('When the user hovers over the disabled \'Delete\' icon buttons then, \'Minimum two prompts are required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
107
+ matchingPage.steps.verifyTooltipText(matchingPage.deletePromptButton, 'Minimum two prompts are required');
108
+ });
109
+
110
+ it('\'Add prompt\' button should be present', () => {
111
+ utilities.verifyInnerText(matchingPage.addPromptButton(), 'Add prompt');
112
+ });
113
+
114
+ it('When user adds a question prompt using the \'Add prompt\' button then added prompt should be displayed with drag handle, placeholder text, option numeration and delete button', () => {
115
+ matchingPage.steps.addPrompt()
116
+ matchingPage.steps.verifyPromptContents(2);
117
+ });
118
+
119
+ it('When user focus in and out of any of the \'Prompt\' input field without typing anything, then an error message \'Error: Prompt is required\' should be displayed', () => {
120
+ matchingPage.steps.focusInAndFocusOutOfPromptInputField(1);
121
+ utilities.verifyInnerText(matchingPage.errorMessage(), 'Error: Prompt is required');
122
+ utilities.verifyElementVisibilityState(matchingPage.errorMessage(), 'visible');
123
+ });
124
+
125
+ it('CSS of error message', { tags: 'css' }, () => {
126
+ utilities.verifyCSS(matchingPage.errorMessage(), {
127
+ 'color': css.color.errorText,
128
+ 'font-size': css.fontSize.small,
129
+ 'font-weight': css.fontWeight.regular
130
+ });
131
+ });
132
+
133
+ it('Accessibility of error message', { tags: 'a11y' }, () => {
134
+ cy.checkAccessibility(matchingPage.errorMessage());
135
+ });
136
+
137
+ it('When user enters text in question prompt input field then error message should disappear', () => {
138
+ matchingPage.steps.enterTextInPromptInputField(promptArray);
139
+ matchingPage.steps.verifyErrorMessageIsNotDisplayed();
140
+ });
141
+
142
+ it('Prompt header label and input field should be displayed and by default it should be empty', () => {
143
+ utilities.verifyInnerText(matchingPage.promptHeaderLabel(), 'Prompt header');
144
+ utilities.verifyElementVisibilityState(matchingPage.promptHeaderLabel(), 'visible');
145
+ utilities.verifyInnerText(matchingPage.promptHeaderInputField(), '');
146
+ });
147
+
148
+ it('User should be able to enter text in prompt header input field', () => {
149
+ matchingPage.steps.enterTextInPromptHeaderInputField('Header');
150
+ matchingPage.steps.verifyTextInPromptHeaderInputField('Header');
151
+ });
152
+
153
+ it('When user clears text in prompt header input field then input field should be empty and error message should not be displayed', () => {
154
+ matchingPage.steps.clearAndFocusOutOfPromptHeaderInputField();
155
+ matchingPage.steps.verifyTextInPromptHeaderInputField('');
156
+ matchingPage.steps.verifyErrorMessageIsNotDisplayed();
157
+ });
158
+ });
159
+
160
+ describe('Prompt - Specify correct answer section', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ cy.log('Navigating to Matching question type');
164
+ matchingPage.steps.navigateToCreateQuestion('matching');
165
+ cy.barsPreLoaderWait();
166
+ });
167
+
168
+ it('When user clicks on the \'Delete\' question prompt button then deleted prompt should not be displayed in the \'Specify correct answer\' section table', () => {
169
+ matchingPage.steps.deletePrompt(0);
170
+ utilities.verifyElementCount(matchingPage.promptSpecifyCorrectAnswerSection(), 2);
171
+ });
172
+
173
+ it('When user adds a question prompt using the \'Add prompt\' button then added prompt should be displayed in the \'Specify correct answer\' section', () => {
174
+ matchingPage.steps.addPrompt();
175
+ utilities.verifyElementCount(matchingPage.promptSpecifyCorrectAnswerSection(), 3);
176
+ });
177
+
178
+ it('By default, prompt fields in specify correct answer section should be empty', () => {
179
+ matchingPage.steps.verifyPromptContainerSpecifyCorrectAnswerSection([{ index: 0, optionText: '' }, { index: 1, optionText: '' }, { index: 2, optionText: '' }]);
180
+ });
181
+
182
+ it('When user adds text to all the prompt input field, the added text should be displayed in the set correct answer section section in the prompt fields', () => {
183
+ matchingPage.steps.enterTextInPromptInputField(promptArray);
184
+ promptArray.forEach((promptText, index) => {
185
+ matchingPage.steps.verifyPromptContainerSpecifyCorrectAnswerSection([{ index: index, optionText: promptText }]);
186
+ });
187
+ });
188
+
189
+ it('When user removes text from a prompt input field, the text should also be removed from the prompt field in the set correct answer section', () => {
190
+ matchingPage.steps.clearPromptInputField(0);
191
+ matchingPage.steps.verifyPromptContainerSpecifyCorrectAnswerSection([{ index: 0, optionText: '' }, { index: 1, optionText: 'Water pollution' }, { index: 2, optionText: 'Air pollution' }]);
192
+ });
193
+
194
+ it('When prompt header input field is empty, then prompt header should not be displayed in specify correct answer section', () => {
195
+ utilities.verifyInnerText(matchingPage.promptHeaderInputField(), '');
196
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperSpecifyCorrectAnswerSection(), 'notExist');
197
+ });
198
+
199
+ it('When user enters text in prompt header input field in edit tab, then prompt header should be displayed in specify correct answer section', () => {
200
+ matchingPage.steps.enterTextInPromptHeaderInputField('Header');
201
+ matchingPage.steps.verifyPromptHeaderTextSpecifyCorrectAnswerSection('Header');
202
+ });
203
+
204
+ it('When user clears text in prompt header input field then prompt header should be removed in specify correct answer section', () => {
205
+ matchingPage.steps.clearAndFocusOutOfPromptHeaderInputField();
206
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperSpecifyCorrectAnswerSection(), 'notExist');
207
+ });
208
+
209
+ it('CSS of \'Specify correct answer\' section prompt', { tags: 'css' }, () => {
210
+ utilities.verifyCSS(matchingPage.promptSpecifyCorrectAnswerSection(), {
211
+ 'color': css.color.text,
212
+ 'font-size': css.fontSize.default,
213
+ 'font-weight': css.fontWeight.regular
214
+ });
215
+ });
216
+
217
+ it('Accessibility of \'Specify correct answer\' section prompt fields', { tags: 'a11y' }, () => {
218
+ cy.checkAccessibility(matchingPage.promptSpecifyCorrectAnswerSection());
219
+ });
220
+ });
221
+
222
+ describe('Prompt - Preview tab section', () => {
223
+ abortEarlySetup();
224
+ before(() => {
225
+ cy.log('Navigating to Matching question type');
226
+ matchingPage.steps.navigateToCreateQuestion('matching');
227
+ cy.barsPreLoaderWait();
228
+ matchingPage.steps.switchToPreviewTab();
229
+ });
230
+
231
+ it('By default, 3 question prompt should be displayed and all the containers should be empty', () => {
232
+ utilities.verifyElementCount(matchingPage.promptContainerPreviewTab(), 3);
233
+ matchingPage.steps.verifyPromptContainerPreviewTab([{ index: 0, optionText: '' }, { index: 1, optionText: '' }, { index: 2, optionText: '' }]);
234
+ });
235
+
236
+ it('When user deletes a question prompt then the deleted prompt should not be displayed in the \'Preview\' tab table', () => {
237
+ matchingPage.steps.switchToEditTab();
238
+ matchingPage.steps.deletePrompt(0);
239
+ matchingPage.steps.switchToPreviewTab();
240
+ utilities.verifyElementCount(matchingPage.promptContainerPreviewTab(), 2);
241
+ });
242
+
243
+ it('When user adds a question prompt using the \'Add prompt\' button then added prompt should be displayed in the \'Preview\' tab table', () => {
244
+ matchingPage.steps.switchToEditTab();
245
+ matchingPage.steps.addPrompt();
246
+ matchingPage.steps.switchToPreviewTab();
247
+ utilities.verifyElementCount(matchingPage.promptContainerPreviewTab(), 3);
248
+ });
249
+
250
+ it('When user adds text to all the question prompt input field, the added text should be displayed in the Preview tab table under the Question prompt column', () => {
251
+ matchingPage.steps.switchToEditTab();
252
+ matchingPage.steps.enterTextInPromptInputField(promptArray);
253
+ matchingPage.steps.switchToPreviewTab();
254
+ promptArray.forEach((promptText, index) => {
255
+ matchingPage.steps.verifyPromptContainerPreviewTab([{ index: index, optionText: promptText }]);
256
+ });
257
+ });
258
+
259
+ it('When user removes text from a prompt input field, the text should also be removed from the prompt field in the preview tab', () => {
260
+ matchingPage.steps.switchToEditTab();
261
+ matchingPage.steps.clearPromptInputField(0);
262
+ matchingPage.steps.switchToPreviewTab();
263
+ utilities.verifyInnerText(matchingPage.promptContainerPreviewTab(), '');
264
+ });
265
+
266
+ it('When prompt header input field is empty, then prompt header should not be displayed in preview tab', () => {
267
+ matchingPage.steps.switchToEditTab();
268
+ utilities.verifyInnerText(matchingPage.promptHeaderInputField(), '');
269
+ matchingPage.steps.switchToPreviewTab();
270
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
271
+ });
272
+
273
+ it('When user enters text in prompt header input field in edit tab, then prompt header should be displayed in preview tab', () => {
274
+ matchingPage.steps.switchToEditTab();
275
+ matchingPage.steps.enterTextInPromptHeaderInputField('Header');
276
+ matchingPage.steps.switchToPreviewTab();
277
+ matchingPage.steps.verifyPromptHeaderTextPreviewTab('Header');
278
+ });
279
+
280
+ it('When user clears text in prompt header input field then prompt header should be removed in preview tab', () => {
281
+ matchingPage.steps.switchToEditTab();
282
+ matchingPage.steps.clearAndFocusOutOfPromptHeaderInputField();
283
+ matchingPage.steps.switchToPreviewTab();
284
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
285
+ });
286
+
287
+ it('CSS of added prompt in \'Preview\' tab table', { tags: 'css' }, () => {
288
+ utilities.verifyCSS(matchingPage.promptContainerPreviewTab().find('.question-text-wrapper'), {
289
+ 'color': css.color.text,
290
+ 'font-size': css.fontSize.default,
291
+ 'font-weight': css.fontWeight.regular
292
+ });
293
+ utilities.verifyCSS(matchingPage.promptContainerPreviewTab(), {
294
+ 'border': `1px solid ${css.color.titleContainerBorder}`
295
+ })
296
+ });
297
+
298
+ it('Accessibility of \'Preview\' tab prompt fields', { tags: 'a11y' }, () => {
299
+ cy.checkAccessibility(matchingPage.previewTabQuestionWrapper());
300
+ });
301
+ });
302
+ });
@@ -0,0 +1,146 @@
1
+ import { multipleSelectionGridPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
5
+ const headingFontSizes = { 'Tiny': '13.5px', 'Small': '15.75px', 'Default': '18px', 'Normal': '20.25px', 'Big': '24.75px', 'Huge': '29.25px' };
6
+
7
+ describe('Multiple selection grid - Additional settings', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Additional settings accordion', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
16
+ cy.barsPreLoaderWait();
17
+ });
18
+
19
+ multipleSelectionGridPage.tests.verifyAdditionalSettingsAccordionProperties();
20
+ });
21
+
22
+ describe('Additional settings: Font size - Contents in edit tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
26
+ cy.barsPreLoaderWait();
27
+ multipleSelectionGridPage.steps.expandAdditionalSettings();
28
+ });
29
+
30
+ multipleSelectionGridPage.tests.verifyFontSizeSectionContents();
31
+ });
32
+
33
+ describe('Additional settings: Font size - functionality in edit tab', () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
37
+ cy.barsPreLoaderWait();
38
+ multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
39
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
40
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
41
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
42
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
43
+ multipleSelectionGridPage.steps.expandAdditionalSettings();
44
+ });
45
+
46
+ Object.keys(fontSizes).forEach((option) => {
47
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the question grid in the specify correct answer section should change to ${fontSizes[option]} accordingly`, () => {
48
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
49
+ utilities.verifyInnerText(multipleSelectionGridPage.fontSizeDropdown(), `${option}`);
50
+ multipleSelectionGridPage.gridSpecifyCorrectAnswerSection()
51
+ .within(() => {
52
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 3).find('.question-text-wrapper'), {
53
+ 'font-size': headingFontSizes[option]
54
+ });
55
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
56
+ 'font-size': fontSizes[option]
57
+ });
58
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
59
+ 'font-size': fontSizes[option]
60
+ });
61
+ });
62
+ });
63
+ });
64
+ });
65
+
66
+ describe('Additional settings: Font size - functionality in preview tab', () => {
67
+ abortEarlySetup();
68
+ before(() => {
69
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
70
+ cy.barsPreLoaderWait();
71
+ multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
72
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
73
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
74
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
75
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
76
+ multipleSelectionGridPage.steps.expandAdditionalSettings();
77
+ });
78
+
79
+ Object.keys(fontSizes).forEach((option) => {
80
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
81
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
82
+ utilities.verifyInnerText(multipleSelectionGridPage.fontSizeDropdown(), `${option}`);
83
+ multipleSelectionGridPage.steps.switchToPreviewTab();
84
+ utilities.verifyCSS(multipleSelectionGridPage.questionInstructionsText(), {
85
+ 'font-size': fontSizes[option]
86
+ });
87
+ multipleSelectionGridPage.gridPreviewTab()
88
+ .within(() => {
89
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 3).find('.question-text-wrapper'), {
90
+ 'font-size': headingFontSizes[option]
91
+ });
92
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
93
+ 'font-size': fontSizes[option]
94
+ });
95
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
96
+ 'font-size': fontSizes[option]
97
+ });
98
+ });
99
+ multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }])
100
+ multipleSelectionGridPage.steps.switchToGradingView();
101
+ utilities.verifyCSS(multipleSelectionGridPage.correctAnswersSectionLabel(), {
102
+ 'font-size': fontSizes[option]
103
+ });
104
+ multipleSelectionGridPage.correctAnswerGrid()
105
+ .within(() => {
106
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 3).find('.question-text-wrapper'), {
107
+ 'font-size': headingFontSizes[option]
108
+ });
109
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
110
+ 'font-size': fontSizes[option]
111
+ });
112
+ utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
113
+ 'font-size': fontSizes[option]
114
+ });
115
+ });
116
+ utilities.verifyCSS(multipleSelectionGridPage.correctIncorrectStatusMessageText(), {
117
+ 'font-size': fontSizes[option]
118
+ });
119
+ multipleSelectionGridPage.steps.switchToStudentView();
120
+ multipleSelectionGridPage.steps.switchToEditTab();
121
+ });
122
+ });
123
+ });
124
+
125
+ describe('Additional settings: Accessibility section', () => {
126
+ abortEarlySetup();
127
+ before(() => {
128
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
129
+ cy.barsPreLoaderWait();
130
+ multipleSelectionGridPage.steps.expandAdditionalSettings();
131
+ });
132
+
133
+ multipleSelectionGridPage.tests.verifyAdditionalSettingsAccessibilitySection();
134
+ });
135
+
136
+ describe('Additional Settings: Details section', () => {
137
+ abortEarlySetup();
138
+ before(() => {
139
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
140
+ cy.barsPreLoaderWait();
141
+ multipleSelectionGridPage.steps.expandAdditionalSettings();
142
+ });
143
+
144
+ multipleSelectionGridPage.tests.verifyDetailsSection();
145
+ });
146
+ });
@@ -0,0 +1,83 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { dialogBoxBase, multipleSelectionGridPage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ describe('Create item page - Multiple selection grid: Header section and Saving question', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Header section contents', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
14
+ });
15
+
16
+ multipleSelectionGridPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Multiple selection grid');
17
+ });
18
+
19
+ describe('Tabs section', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
23
+ });
24
+
25
+ multipleSelectionGridPage.tests.verifyTabsSection();
26
+ });
27
+
28
+ describe('Cancel button', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
32
+ });
33
+
34
+ multipleSelectionGridPage.tests.verifyCancelButton('multiple selection grid')
35
+ });
36
+
37
+ describe('Save Question button', () => {
38
+ abortEarlySetup();
39
+ before(() => {
40
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
41
+ cy.barsPreLoaderWait();
42
+ });
43
+
44
+ describe('Validation error messages', () => {
45
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
46
+
47
+ it('Validation error messages should be displayed below required input fields', () => {
48
+ multipleSelectionGridPage.steps.verifyQuestionInstructionsErrorMessage();
49
+ utilities.verifyInnerText(utilities.getNthElement(multipleSelectionGridPage.errorMessage(), 1), 'Error: Please enter some text.');
50
+ utilities.verifyInnerText(utilities.getNthElement(multipleSelectionGridPage.errorMessage(), 2), 'Error: Please enter points.');
51
+ for (let index = 1; index < 4; index++) {
52
+ multipleSelectionGridPage.steps.verifyErrorIconInSpecifyColumnsAndRowsGrid(index);
53
+ }
54
+ multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
55
+ multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorMessage();
56
+ });
57
+
58
+ it('Validation error messages should disappear when required input fields are filled', () => {
59
+ multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
60
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
61
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
62
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
63
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
64
+ multipleSelectionGridPage.steps.allotPoints(10);
65
+ for (let index = 1; index < 4; index++) {
66
+ multipleSelectionGridPage.steps.verifyErrorIconInSpecifyColumnsAndRowsGridNotExists(index);
67
+ }
68
+ multipleSelectionGridPage.steps.verifyErrorMessageIsNotDisplayed();
69
+ multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
70
+ });
71
+
72
+ multipleSelectionGridPage.tests.verifyCreateItemWrapperContentsA11y();
73
+ });
74
+
75
+ describe('Saving a question', () => {
76
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
77
+ multipleSelectionGridPage.steps.saveAQuestionAndVerifySnackbar();
78
+ });
79
+
80
+ multipleSelectionGridPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
81
+ });
82
+ });
83
+ });