itemengine-cypress-automation 1.0.248-23rdSeptUpdates-8103a8f.0 → 1.0.249-repoUpdated26thSept-7283964.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +5 -5
  4. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +8 -0
  5. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +2 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +1 -1
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +1 -2
  8. package/cypress/e2e/ILC/ImageHighlight/additionalSettingsBasic.js +0 -2
  9. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationDropDown.js +166 -0
  10. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSameList.js +1 -0
  11. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSeperateList.js +344 -0
  12. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +4 -17
  13. package/cypress/e2e/ILC/UploadResponse/thumbNail.smoke.js +121 -0
  14. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +6 -3
  15. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  16. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +1 -2
  17. package/cypress/pages/components/imageCanvasComponent.js +4 -7
  18. package/cypress/pages/components/listOrderingCommonStyleAndLayoutComponent.js +287 -53
  19. package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -1
  20. package/cypress/pages/listOrderingPage.js +1 -1
  21. package/cypress/pages/matchingPage.js +1 -1
  22. package/cypress/pages/uploadResponsePage.js +49 -4
  23. package/deploy/e2e/deploy.yaml +2 -2
  24. package/deploy/smoke/deploy.yaml +2 -2
  25. package/package.json +1 -1
@@ -0,0 +1,344 @@
1
+ import { listOrderingPage } from "../../../pages";
2
+ import { colorPopupComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+
8
+ describe('Create item page - List ordering: Style and layout Component', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Style and layout Component - Options - Fill color, border color, border style', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
17
+ cy.barsPreLoaderWait();
18
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
19
+ });
20
+
21
+ listOrderingPage.tests.verifyStyleAndLayoutCustomizationAccordionProperties();
22
+
23
+ listOrderingPage.tests.verifyFillColorSectionContents();
24
+
25
+ listOrderingPage.tests.verifyBorderColorSectionContents();
26
+
27
+ listOrderingPage.tests.verifyBorderStyleSectionContents('Solid');
28
+
29
+ listOrderingPage.tests.verifyFillColorTooltips();
30
+
31
+ listOrderingPage.tests.verifyBorderColorTooltips();
32
+
33
+ it('When user clicks on edit color then color pop up panel will be visible', () => {
34
+ listOrderingPage.steps.editColor(0);
35
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
36
+ colorPopupComponent.tests.verifyColorPopupSelectColorTitle();
37
+ colorPopupComponent.tests.verifySaturationAndOpacityGradientPalette('rgb(255, 255, 255)');
38
+ colorPopupComponent.tests.verifyColorHuePaletteAndHexInputField('rgb(255, 0, 0)', '#ffffff');
39
+ colorPopupComponent.tests.verifyColorPopupFunctionality();
40
+ });
41
+
42
+ it('When the user moves the color picker in the color saturation palette, color in the selected color block and the hex code should change, color in the hue color palette and the opacity value should not change', () => {
43
+ colorPopupComponent.steps.clickInColorSaturationPalette();
44
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(121, 60, 60)');
45
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(119, 60, 60)');
46
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
47
+ colorPopupComponent.steps.verifyHexValue('#793c3c');
48
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor('rgb(119, 60, 60)');
49
+ });
50
+
51
+ it('When the user moves the color picker in the color hue palette, color in the selected color block, the hex code and the saturation color palette should change and the opacity value should not change', () => {
52
+ colorPopupComponent.steps.clickInColorHuePalette();
53
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(60, 121, 121)');
54
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 255, 255)');
55
+ colorPopupComponent.steps.verifyHexValue('#3c7979');
56
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor('rgb(60, 119, 119)');
57
+ });
58
+
59
+ it('When the user changes the color using hex code, the color in color saturation palette and color hue palette should change and the opacity value should not change', () => {
60
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
61
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
62
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
63
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
64
+ colorPopupComponent.steps.verifyOpacityGradientPaletteColor('rgb(255, 0, 0)');
65
+ });
66
+ });
67
+
68
+ describe('Style and Layout customization accordion: Options - Fill color, border color, border style - Edit Tab', () => {
69
+ abortEarlySetup();
70
+ before(() => {
71
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
72
+ cy.barsPreLoaderWait();
73
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
74
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
75
+ });
76
+
77
+ listOrderingPage.tests.verifyFillColorFunctionalityEditTab('SeperateList');
78
+
79
+ listOrderingPage.tests.verifyBorderColorFunctionalityEditTab('SeperateList');
80
+
81
+ listOrderingPage.tests.verifyBorderStyleFunctionalityEditTab('SeperateList');
82
+ });
83
+
84
+ describe('Style and Layout customization accordion: Options - Fill color, border color, border style - Preview Tab', () => {
85
+ abortEarlySetup();
86
+ before(() => {
87
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
88
+ cy.barsPreLoaderWait();
89
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
90
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
91
+ });
92
+
93
+ listOrderingPage.tests.verifyFillColorFunctionalityPreviewTab('SeperateList');
94
+
95
+ listOrderingPage.tests.verifyBorderColorFunctionalityPreviewTab('SeperateList');
96
+
97
+ listOrderingPage.tests.verifyBorderStyleFunctionalityPreviewTab('SeperateList');
98
+ });
99
+
100
+ describe('Style and Layout customization accordion: Options - Drag handle icon - Edit Tab', () => {
101
+ abortEarlySetup();
102
+ before(() => {
103
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
104
+ cy.barsPreLoaderWait();
105
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
106
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
107
+ });
108
+
109
+ it('\'Options\' label will be displayed', () => {
110
+ utilities.verifyElementVisibilityState(listOrderingPage.optionsLabel(), 'visible');
111
+ utilities.verifyInnerText(listOrderingPage.optionsLabel(), 'Options');
112
+ });
113
+
114
+ it('Drag handle icon label will be displayed with 3 options and by default the first option will be selected draggable options', () => {
115
+ utilities.verifyInnerText(listOrderingPage.dragHandleIconLabel(), 'Drag handle icon');
116
+ utilities.verifyElementCount(listOrderingPage.dragHandleOptions(), 3);
117
+ listOrderingPage.steps.verifyDragHandleOptionSelected(0);
118
+ });
119
+
120
+ it('By default, the default selected drag handle will be displayed in the specify correct answer section draggable options', () => {
121
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('drag icon', 'SeperateList');
122
+ });
123
+
124
+ it('When user selects arrows drag handle icon then arrow icons will be displayed the specify correct answer section draggable options', () => {
125
+ listOrderingPage.steps.selectDragHandleOption(1);
126
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('arrow icon', 'SeperateList');
127
+ });
128
+
129
+ it('When user selects none option then drag handles will not be displayed for the specify correct answer section draggable options', () => {
130
+ listOrderingPage.steps.selectDragHandleOption(2);
131
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('none', 'SeperateList');
132
+ });
133
+ });
134
+
135
+ describe('Style and Layout customization accordion: Options - Drag handle icon - Preview Tab', () => {
136
+ abortEarlySetup();
137
+ before(() => {
138
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
139
+ cy.barsPreLoaderWait();
140
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
141
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
142
+ });
143
+
144
+ it('By default, the default selected drag handle will be displayed in the preview tab', () => {
145
+ listOrderingPage.steps.switchToPreviewTab();
146
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('drag icon', 'SeperateList');
147
+ });
148
+
149
+ it('When user selects arrows drag handle icon then arrow icons will be displayed in preview tab', () => {
150
+ listOrderingPage.steps.switchToEditTab();
151
+ listOrderingPage.steps.selectDragHandleOption(1);
152
+ listOrderingPage.steps.switchToPreviewTab();
153
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('arrow icon', 'SeperateList');
154
+ });
155
+
156
+ it('When user selects none option then drag handles will not be displayed in the preview tab', () => {
157
+ listOrderingPage.steps.switchToEditTab();
158
+ listOrderingPage.steps.selectDragHandleOption(2);
159
+ listOrderingPage.steps.switchToPreviewTab();
160
+ listOrderingPage.steps.verifyDragHandleIconSpecifyCorrectAnswer('none', 'SeperateList');
161
+ });
162
+ });
163
+
164
+ describe('Style and Layout customization accordion: Options - Options Style - Edit Tab', () => {
165
+ abortEarlySetup();
166
+ before(() => {
167
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
168
+ cy.barsPreLoaderWait();
169
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
170
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
171
+ });
172
+
173
+ it('\'Options style\' label will be displayed', () => {
174
+ utilities.verifyElementVisibilityState(listOrderingPage.optionStyleLabel(), 'visible');
175
+ utilities.verifyInnerText(listOrderingPage.optionStyleLabel(), 'Option style');
176
+ });
177
+
178
+ it('\'With Border\' and \'Without Border\' option style button will be present', () => {
179
+ utilities.verifyElementVisibilityState(listOrderingPage.withBorderOptionStyleButton(), 'visible');
180
+ utilities.verifyInnerText(listOrderingPage.withBorderOptionStyleButton(), 'With border');
181
+ utilities.verifyElementVisibilityState(listOrderingPage.withoutBorderOptionStyleButton(), 'visible');
182
+ utilities.verifyInnerText(listOrderingPage.withoutBorderOptionStyleButton(), 'Without border');
183
+ });
184
+
185
+ it('By default, \'With Border\' option style will be selected and the borders will be present in the specify correct answer section', () => {
186
+ listOrderingPage.steps.verifyWithBorderOptionStyleButtonSelected();
187
+ listOrderingPage.steps.verifyBorderStyleInSpecifyCorrectAnswerForSeperateList("1px solid rgb(107, 139, 255)");
188
+ });
189
+
190
+ it('When user selects \'Without Border\' option style the borders will not be present in the specify correct answer section', () => {
191
+ listOrderingPage.steps.selectWithoutBorderOptionStyleButton();
192
+ listOrderingPage.steps.verifyWithoutBorderOptionStyleButtonSelected();
193
+ listOrderingPage.steps.verifyBorderStyleInSpecifyCorrectAnswerForSeperateList("0px none rgba(0, 0, 0, 0.87)");
194
+ });
195
+
196
+ it('When user selects \'Without Border\' option style like \'Fill color\', \'Border color\' and \'Border style\' will be removed from style and Layout customization accordion', () => {
197
+ utilities.verifyElementVisibilityState(listOrderingPage.fillAndBorderColorWrapper(), 'notExist');
198
+ });
199
+ });
200
+
201
+ describe('Style and Layout customization accordion: Options - Options Style - Preview Tab', () => {
202
+ abortEarlySetup();
203
+ before(() => {
204
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
205
+ cy.barsPreLoaderWait();
206
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
207
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
208
+ });
209
+
210
+ it('By default, \'With Border\' option style will be selected and the borders will be present in the preview tab', () => {
211
+ listOrderingPage.steps.verifyWithBorderOptionStyleButtonSelected();
212
+ listOrderingPage.steps.switchToPreviewTab();
213
+ listOrderingPage.steps.verifyBorderStyleInSpecifyCorrectAnswerForSeperateList("1px solid rgb(107, 139, 255)");
214
+ });
215
+
216
+ it('When user selects \'Without Border\' option style the borders will not be present in the preview tab', () => {
217
+ listOrderingPage.steps.switchToEditTab();
218
+ listOrderingPage.steps.selectWithoutBorderOptionStyleButton();
219
+ listOrderingPage.steps.verifyWithoutBorderOptionStyleButtonSelected();
220
+ listOrderingPage.steps.switchToPreviewTab();
221
+ listOrderingPage.steps.verifyBorderStyleInSpecifyCorrectAnswerForSeperateList("0px none rgb(0, 0, 46)");
222
+ });
223
+ });
224
+
225
+ describe('Style and Layout customization accordion: Options - List Container - Edit Tab', () => {
226
+ abortEarlySetup();
227
+ before(() => {
228
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
229
+ cy.barsPreLoaderWait();
230
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
231
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
232
+ });
233
+
234
+ it('\'List container\' label will be displayed', () => {
235
+ utilities.verifyElementVisibilityState(listOrderingPage.listContainerAndDropDownLabel(), 'visible');
236
+ utilities.verifyInnerText(listOrderingPage.listContainerAndDropDownLabel(), 'List container');
237
+ });
238
+
239
+ it('"Fill color" label and two color blocks and an "Edit color" button should be displayed. The selected color block should be of color "rgb(245, 248, 255)" and the other color block should have "No color"', () => {
240
+ utilities.verifyInnerText(listOrderingPage.fillColorLabelListContainerAndDropDown(), 'Fill color');
241
+ listOrderingPage.steps.verifyColorBlockColor(4, "rgb(245, 248, 255)");
242
+ listOrderingPage.steps.verifyColorBlockSelectedState(4);
243
+ listOrderingPage.steps.verifyColorBlockColor(5, css.color.none);
244
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.editColorButton(), 2), 'Edit color');
245
+ utilities.verifyElementVisibilityState(listOrderingPage.editColorButton().eq(2), 'visible');
246
+ });
247
+
248
+ listOrderingPage.tests.verifyFillColorFunctionalityOfListContainerOrDropDownEditTab("ListContainer");
249
+
250
+ it('"Border color" label and two color blocks and an "Edit color" button should be displayed. The selected color block should be of color "rgb(82, 0, 255)" and the other color block should have "No color"', () => {
251
+ utilities.verifyInnerText(listOrderingPage.borderColorLabelListContainerAndDropDown(), 'Border color');
252
+ utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.editColorButton(), 3), 'Edit color');
253
+ utilities.verifyElementVisibilityState(listOrderingPage.editColorButton().eq(3), 'visible');
254
+ listOrderingPage.steps.verifyColorBlockColor(6, "rgb(82, 0, 255)");
255
+ listOrderingPage.steps.verifyColorBlockSelectedState(6);
256
+ listOrderingPage.steps.verifyColorBlockColor(7, css.color.none);
257
+ });
258
+
259
+ listOrderingPage.tests.verifyBorderColorFunctionalityOfListOrDropDownContainerEditTab("ListContainer");
260
+
261
+ it(`"Border style" label and three toggle buttons should be displayed - "Dotted", "Solid", "None". By default "Dotted" button should be in selected state`, () => {
262
+ utilities.verifyInnerText(listOrderingPage.borderStyleLabelListContainer(), 'Border style');
263
+ utilities.verifyElementVisibilityState(listOrderingPage.dottedBorderStyleToggleButtonListContainerAndDropDown(), 'visible');
264
+ utilities.verifyInnerText(listOrderingPage.dottedBorderStyleToggleButtonListContainerAndDropDown(), 'Dotted');
265
+ utilities.verifyElementVisibilityState(listOrderingPage.solidBorderStyleToggleButtonListContainerAndDropDown(), 'visible');
266
+ utilities.verifyInnerText(listOrderingPage.solidBorderStyleToggleButtonListContainerAndDropDown(), 'Solid');
267
+ utilities.verifyElementVisibilityState(listOrderingPage.noneBorderStyleToggleButton(), 'visible');
268
+ utilities.verifyInnerText(listOrderingPage.noneBorderStyleToggleButton(), 'None');
269
+ listOrderingPage.steps.verifyBorderStyleToggleButtonSelectedStateListContainer('Dotted');
270
+ });
271
+
272
+ listOrderingPage.tests.verifyBorderStyleFunctionalityOfListContainerOrDropDownContainerEditTab("ListContainer");
273
+ });
274
+
275
+ describe('Style and Layout customization accordion: Options - List Container - Preview Tab', () => {
276
+ abortEarlySetup();
277
+ before(() => {
278
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
279
+ cy.barsPreLoaderWait();
280
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
281
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
282
+ });
283
+
284
+ listOrderingPage.tests.verifyFillColorFunctionalityOfListContainerPreviewTab("ListContainer");
285
+
286
+ listOrderingPage.tests.verifyBorderColorFunctionalityOfListConatinerPreviewTab("ListContainer");
287
+
288
+ listOrderingPage.tests.verifyBorderStyleFunctionalityOfListContainerPreviewTab("ListContainer");
289
+ });
290
+
291
+ describe('Style and Layout customization accordion: Options - Draggable Option Panel - Edit Tab', () => {
292
+ abortEarlySetup();
293
+ before(() => {
294
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
295
+ cy.barsPreLoaderWait();
296
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
297
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
298
+ });
299
+
300
+ it('\'Draggable Option Panel\' label and \'Panel placement\' label will be displayed', () => {
301
+ utilities.verifyElementVisibilityState(listOrderingPage.draggableOptionPanelLabel(), 'visible');
302
+ utilities.verifyInnerText(listOrderingPage.draggableOptionPanelLabel(), 'Draggable option panel');
303
+ utilities.verifyElementVisibilityState(listOrderingPage.panelPlacementLabel(), 'visible');
304
+ utilities.verifyInnerText(listOrderingPage.panelPlacementLabel(), 'Panel placement');
305
+ });
306
+
307
+ it('\'Left\' toggle button and \'Right\' toggle button should be visible and by default \'Left\' toggle button is selected', () => {
308
+ utilities.verifyElementVisibilityState(listOrderingPage.leftToggleButton(), 'visible');
309
+ utilities.verifyElementVisibilityState(listOrderingPage.rightToggleButton(), 'visible');
310
+ listOrderingPage.steps.verifyLeftToggleButtonSelected();
311
+ utilities.verifyElementVisibilityState(listOrderingPage.pannelPlacementRightToggle(), 'notExist');
312
+ });
313
+
314
+ it('When \'Right\' toggle button is selected then the options should shift to the right side of the container in specify correct answer section', () => {
315
+ listOrderingPage.steps.selectRightToggleButton();
316
+ listOrderingPage.steps.verifyRightToggleButtonSelected();
317
+ utilities.verifyElementVisibilityState(listOrderingPage.pannelPlacementRightToggle(), 'visible');
318
+ });
319
+ });
320
+
321
+ describe('Style and Layout customization accordion: Options - Draggable Option Panel - Preview Tab', () => {
322
+ abortEarlySetup();
323
+ before(() => {
324
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
325
+ cy.barsPreLoaderWait();
326
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
327
+ listOrderingPage.steps.expandStyleAndLayoutCustomizationAccordion();
328
+ });
329
+
330
+ it('By default \'Left\' toggle button is selected and options should be at left side of the container in preview tab', () => {
331
+ listOrderingPage.steps.verifyLeftToggleButtonSelected();
332
+ listOrderingPage.steps.switchToPreviewTab();
333
+ utilities.verifyElementVisibilityState(listOrderingPage.pannelPlacementRightToggle(), 'notExist');
334
+ });
335
+
336
+ it('When \'Right\' toggle button is selected then the options should shift to the right side of the container in preview tab', () => {
337
+ listOrderingPage.steps.switchToEditTab();
338
+ listOrderingPage.steps.selectRightToggleButton();
339
+ listOrderingPage.steps.verifyRightToggleButtonSelected();
340
+ listOrderingPage.steps.switchToPreviewTab();
341
+ utilities.verifyElementVisibilityState(listOrderingPage.pannelPlacementRightToggle(), 'visible');
342
+ });
343
+ });
344
+ });
@@ -56,7 +56,7 @@ describe('Create Item page - Matching : Question Instructions and prompt section
56
56
  'font-size': css.fontSize.normal,
57
57
  'font-weight': css.fontWeight.semibold
58
58
  })
59
- utilities.getNthElement(matchingPage.promptInputFieldWrapper(), 0)
59
+ utilities.getNthElement( matchingPage.promptInputFieldWrapper(),0)
60
60
  .within(() => {
61
61
  utilities.verifyCSS(matchingPage.dragHandleButton(), {
62
62
  'color': css.color.secondaryBtnActive,
@@ -76,7 +76,7 @@ describe('Create Item page - Matching : Question Instructions and prompt section
76
76
  'font-size': css.fontSize.normal,
77
77
  'font-weight': css.fontWeight.semibold
78
78
  });
79
- utilities.verifyCSS(utilities.getNthElement(matchingPage.promptInputField(), 0), {
79
+ utilities.verifyCSS(utilities.getNthElement( matchingPage.promptInputField(),0), {
80
80
  'color': css.color.text,
81
81
  'font-size': css.fontSize.default,
82
82
  'font-weight': css.fontWeight.regular
@@ -116,22 +116,9 @@ describe('Create Item page - Matching : Question Instructions and prompt section
116
116
  matchingPage.steps.verifyPromptContents(2);
117
117
  });
118
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\' error message should be displayed', () => {
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\' error message should disappear', () => {
120
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());
121
+ matchingPage.steps.verifyErrorMessageIsNotDisplayed();
135
122
  });
136
123
 
137
124
  it('When user enters text in question prompt input field then error message should disappear', () => {
@@ -0,0 +1,121 @@
1
+ import { uploadResponsePage, itemPreviewPage} from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+ const filename = ['sample.csv', 'sample.xlsx', 'sample.gif', 'sample.jpg', 'sample.pdf', 'image.png', 'sample.ppt', 'sample.pub', 'sample.rtf', 'sample.txt', 'sample.doc', 'sample.xps', 'sample.zip', 'sample.heif', 'sample.heic'];
9
+ const fileThumbNail = ['notExist', 'notExist', 'visible', 'visible', 'notExist', 'visible', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist', 'notExist']
10
+
11
+ describe('Create item page - Upload response : Preview contents', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ views.forEach((view) => {
17
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ switch (view) {
21
+ case 'Question preview':
22
+ cy.log('Navigating to Upload response question type');
23
+ uploadResponsePage.steps.navigateToCreateQuestion('upload response');
24
+ cy.barsPreLoaderWait();
25
+ uploadResponsePage.steps.allotPoints(10);
26
+ uploadResponsePage.steps.addTextInQuestionInstructionsInputField('Question text');
27
+ uploadResponsePage.steps.setMaximumNumberOfFiles(1);
28
+ uploadResponsePage.steps.expandSupportedFileTypesAccordion();
29
+ uploadResponsePage.steps.selectSupportedFileTypeOption(23);
30
+ uploadResponsePage.steps.selectSupportedFileTypeOption(24);
31
+ uploadResponsePage.steps.switchToPreviewTab();
32
+ break;
33
+ case 'Item view':
34
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
35
+ break;
36
+ case 'Item preview':
37
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
38
+ uploadResponsePage.steps.switchToPreviewTab();
39
+ break;
40
+ case 'Student view':
41
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID[0])}`);
42
+ break;
43
+ };
44
+ });
45
+
46
+ if (view === 'Question preview') {
47
+ after(() => {
48
+ uploadResponsePage.steps.clickOnSaveQuestionButton();
49
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
50
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
51
+ });
52
+ };
53
+
54
+ it('Question instructions should be visible', () => {
55
+ utilities.verifyInnerText(uploadResponsePage.questionInstructionsText(), 'Question text');
56
+ utilities.verifyElementVisibilityState(uploadResponsePage.questionInstructionsText(), 'visible');
57
+ });
58
+
59
+ it('When user uploads file, then uploaded file name should be displayed, file count should get updated and thumb nail of the image should be visible', () => {
60
+ uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
61
+ uploadResponsePage.steps.verifyThumbNailExistOrNotExist('highlightImage.jpg', 'visible');
62
+ });
63
+
64
+ it('CSS of Thumb nail and File name in preview tab', { tags: 'css' }, () => {
65
+ utilities.verifyCSS(uploadResponsePage.imageThumbNail(), {
66
+ 'box-sizing': 'border-box',
67
+ 'min-height': 'auto',
68
+ 'min-width': 'auto'
69
+ });
70
+ utilities.verifyCSS(uploadResponsePage.fileName(), {
71
+ 'color': 'rgb(0, 0, 255)',
72
+ 'font-size': '16px',
73
+ 'font-weight': '400'
74
+ });
75
+ });
76
+
77
+ //Failed due to https://weldnorthed.atlassian.net/browse/IEI-4343
78
+ it.skip('Accessibility of Preview tab', { tags: 'a11y' }, () => {
79
+ cy.checkAccessibility(uploadResponsePage.questionWrapperPreviewTab());
80
+ });
81
+
82
+ it('When user clicks on the thumbnail then popup should open, and on clicking the close button the popup should close and the uploaded files should be displayed', () => {
83
+ uploadResponsePage.steps.clickOnImageThumbNail();
84
+ uploadResponsePage.steps.verifyImagePopUpDetail();
85
+ uploadResponsePage.steps.closeImagePopup();
86
+ uploadResponsePage.steps.verifyThumbNailExistOrNotExist('highlightImage.jpg', 'visible');
87
+ utilities.verifyElementCount(uploadResponsePage.fileName(), 1);
88
+ });
89
+
90
+ it('When user clicks on the file name then popup should open, and on clicking the close button the popup should close and the uploaded files should be displayed', () => {
91
+ uploadResponsePage.steps.clickOnFileName();
92
+ uploadResponsePage.steps.verifyImagePopUpDetail();
93
+ uploadResponsePage.steps.closeImagePopup();
94
+ uploadResponsePage.steps.verifyThumbNailExistOrNotExist('highlightImage.jpg', 'visible');
95
+ utilities.verifyElementCount(uploadResponsePage.fileName(), 1);
96
+ });
97
+
98
+ it('When user uploads different file types then only image files should be displayed with thumbnail', () => {
99
+ for (let number = 0; number < 13; number++) {
100
+ uploadResponsePage.steps.deleteFile();
101
+ uploadResponsePage.steps.clickAcceptButtonInPopup();
102
+ uploadResponsePage.steps.uploadFile(`uploads/${filename[number]}`);
103
+ uploadResponsePage.steps.verifyThumbNailExistOrNotExist(filename[number], fileThumbNail[number]);
104
+ }
105
+ });
106
+
107
+ it('When user uploads a file in .heif or .heic format then and info icon with tool tip should be present and image thumb nail should not be present', () => {
108
+ for (let number = 13; number < 15; number++) {
109
+ uploadResponsePage.steps.deleteFile();
110
+ uploadResponsePage.steps.clickAcceptButtonInPopup();
111
+ uploadResponsePage.steps.uploadedFileContentsNotExistPreviewTab();
112
+ uploadResponsePage.steps.uploadFile(`uploads/${filename[number]}`);
113
+ uploadResponsePage.steps.verifyThumbNailExistOrNotExist(filename[number], fileThumbNail[number]);
114
+ utilities.verifyElementVisibilityState(uploadResponsePage.unSupportedFileInfoIcon(), 'visible');
115
+ uploadResponsePage.unSupportedFileInfoIcon()
116
+ .verifyTooltip('The image format (HEIC/HEIF) is not supported on your current device or operating system version. Please click the link to download and view the image.');
117
+ }
118
+ });
119
+ });
120
+ });
121
+ });
@@ -162,7 +162,8 @@ describe('Create item page - Video response: Question instructions, Maximum reco
162
162
 
163
163
  it('When the user focuses in and out of the empty \'Maximum recording duration\' input field, \'Error: Maximum recording duration is required.\' validation error should be displayed below the \'Maximum recording duration\' input field', () => {
164
164
  videoResponsePage.steps.clearMaximumRecordingDurationInputField();
165
- utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Maximum recording duration is required.');
165
+ //Failing due to https://redmine.zeuslearning.com/issues/573549
166
+ // utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Maximum recording duration is required.');
166
167
  utilities.verifyElementVisibilityState(videoResponsePage.errorMessage(), 'visible');
167
168
  });
168
169
 
@@ -207,7 +208,8 @@ describe('Create item page - Video response: Question instructions, Maximum reco
207
208
 
208
209
  it('When the user focuses in and out of the empty \'Maximum recording duration\' input field, \'Error: Maximum recording duration is required.\' validation error should be displayed below the \'Maximum recording duration\' input field', () => {
209
210
  videoResponsePage.steps.clearMaximumRecordingDurationInputField();
210
- utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Maximum recording duration is required.');
211
+ //Failing due to https://redmine.zeuslearning.com/issues/573549
212
+ // utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Maximum recording duration is required.');
211
213
  utilities.verifyElementVisibilityState(videoResponsePage.errorMessage(), 'visible');
212
214
  });
213
215
 
@@ -221,7 +223,8 @@ describe('Create item page - Video response: Question instructions, Maximum reco
221
223
  it('When the user has set \'Maximum recording duration\' to \'0\' (zero), a validation message \'Error: Value must be greater than 0 mins.\' should be displayed', () => {
222
224
  videoResponsePage.steps.setMaximumRecordingDuration(0);
223
225
  videoResponsePage.steps.verifyMaximumRecordingDuration(0);
224
- utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Value must be greater than 0 mins.');
226
+ // Uncomment once https://redmine.zeuslearning.com/issues/583618 is resolved
227
+ // utilities.verifyInnerText(videoResponsePage.errorMessage(), 'Error: Value must be greater than 0 mins.');
225
228
  utilities.verifyElementVisibilityState(videoResponsePage.errorMessage(), 'visible');
226
229
  });
227
230
 
@@ -32,8 +32,8 @@ export const drawingToolbarOptionsAndAdditionalOptions = {
32
32
  toolType: 'dialog'
33
33
  },
34
34
  {
35
- displayName: 'Upload image ',
36
- tooltipText: 'The \'Upload image \' tool uploads an image.',
35
+ displayName: 'Insert image',
36
+ tooltipText: 'The \'Insert image\' tool uploads an image.',
37
37
  toolType: 'dialog'
38
38
  },
39
39
  {
@@ -1237,8 +1237,7 @@ const tests = {
1237
1237
 
1238
1238
  it('When user focuses in and out of the response accordion \'Answer\' input field, \'Error: Answer is required.\' error message should be displayed', () => {
1239
1239
  fillInTheGapsTextCommonComponent.steps.focusInAndFocusOutOfResponseAnswerInputFieldSpecifyCorrectAnswer(0, 0);
1240
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
1241
- utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Answer is required.');
1240
+ commonComponents.steps.verifyErrorMessageIsNotDisplayed();
1242
1241
  });
1243
1242
 
1244
1243
  it('When gives an input to \'Answer\' input field, then error message should disappear', () => {
@@ -264,8 +264,7 @@ const steps = {
264
264
  imageCanvasComponent.canvasWidthInputField()
265
265
  .invoke('attr', 'value')
266
266
  .then((value) => {
267
- imageCanvasComponent.canvasImage()
268
- .should('have.css', 'width', `${value}px`);
267
+ imageCanvasComponent.canvasImage().should('have.css', 'width', `${value}px`);
269
268
  });
270
269
  },
271
270
 
@@ -792,11 +791,10 @@ const tests = {
792
791
  * @param {"text container"|"dropzone"} response value for the error message
793
792
  */
794
793
  verifyInsertAndDeleteResponseAreaFunctionality: (response) => {
795
- it(`When user clicks on close button for response container, then response container should be removed from canvas and error message should be displayed`, () => {
794
+ it(`When user clicks on close button for response container, then response container should be removed from canvas and error message should not be displayed`, () => {
796
795
  imageCanvasComponent.steps.removeResponseArea(0);
797
796
  utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaWrapper(), 'notExist');
798
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
799
- utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
797
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
800
798
  });
801
799
 
802
800
  it('When user adds response container, then error message should disappear', () => {
@@ -856,8 +854,7 @@ const tests = {
856
854
  }
857
855
  utilities.verifyElementCount(imageCanvasComponent.responseArea(), 0);
858
856
  imageCanvasComponent.steps.verifyUndoButtonDisabled();
859
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
860
- utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
857
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
861
858
  });
862
859
 
863
860
  it('When the user reaches the latest state by performing redo actions, the \'Redo\' button should get disabled and error message should disappear', () => {