itemengine-cypress-automation 1.0.68 → 1.0.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +2 -2
  2. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/essayResponseScoringSection.js +2 -2
  4. package/cypress/e2e/ILC/FeedbackScale/feedbackScaleAdditionalSettingsBasic.js +8 -9
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialEqualWeightsWithAlternateAnswer.js +0 -4
  6. package/cypress/e2e/ILC/Highlight/HighlightScoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +2 -0
  7. package/cypress/e2e/ILC/Highlight/HighlightScoring/allOrNothingScoring.js +2 -0
  8. package/cypress/e2e/ILC/Highlight/{highlightBasicScoringForTextSelectionTypes.js → HighlightScoring/highlightBasicScoringForTextSelectionTypes.js} +1 -1
  9. package/cypress/e2e/ILC/Highlight/HighlightScoring/{manualAndNonScored.js → manuallyAndNonScored.js} +1 -1
  10. package/cypress/e2e/ILC/Highlight/HighlightScoring/{partialDifferentWeightsCorrectEqualToAlternatePoints.js → partialDifferentWeightsCorrectPointsEqualToAlternatePoints.js} +2 -0
  11. package/cypress/e2e/ILC/Highlight/HighlightScoring/partialDifferentWeightsScoring.js +7 -2
  12. package/cypress/e2e/ILC/Highlight/HighlightScoring/partialEqualWeightsCorrectPointEqualToAlternatePoints.js +2 -0
  13. package/cypress/e2e/ILC/Highlight/HighlightScoring/partialEqualWeightsScoring.js +6 -1
  14. package/cypress/e2e/ILC/Highlight/highlightAdditionalSettingsBasic.js +2 -3
  15. package/cypress/e2e/ILC/Highlight/highlightAdditionalSettingsMaximumNumberOfAnswers.js +0 -2
  16. package/cypress/e2e/ILC/Highlight/highlightEditTabScoringSection.js +4 -3
  17. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +4 -4
  18. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettingsBasic.js +4 -10
  19. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +3 -3
  20. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +9 -5
  21. package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +1 -1
  22. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +14 -15
  23. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsWithAlternateAnswer.js +0 -3
  24. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +14 -14
  25. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +60 -66
  26. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +84 -109
  27. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +4 -18
  28. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +119 -150
  29. package/cypress/e2e/ILC/UploadResponse/uploadResponseScoringSection.js +2 -2
  30. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +110 -164
  31. package/cypress/e2e/ILC/VideoResponse/videoResponseAdditionalSettings.js +1 -1
  32. package/cypress/e2e/ILC/VideoResponse/videoResponseAdditionalSettingsBasic.js +11 -12
  33. package/cypress/e2e/ILC/VideoResponse/videoResponsePreviewTab.js +6 -5
  34. package/cypress/fixtures/theme/ilc.json +2 -1
  35. package/cypress/pages/audioPlayerPage.js +2 -2
  36. package/cypress/pages/components/additionalSettingsPanel.js +46 -14
  37. package/cypress/pages/components/autoScoredAdditionalSettings.js +6 -6
  38. package/cypress/pages/components/autoScoredPreviewBase.js +6 -8
  39. package/cypress/pages/components/autoScoredScoringSection.js +22 -18
  40. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +60 -9
  41. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -7
  42. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  43. package/cypress/pages/components/draggableOptionsContainer.js +2 -1
  44. package/cypress/pages/components/equationEditorFlyout.js +2 -1
  45. package/cypress/pages/components/essayResponseCommonComponents.js +10 -4
  46. package/cypress/pages/components/figOverImageCommonComponent.js +2 -1
  47. package/cypress/pages/components/fillInTheGapsCommonComponents.js +34 -14
  48. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
  49. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +7 -7
  50. package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
  51. package/cypress/pages/components/mcqAdditionalSettingsBase.js +10 -0
  52. package/cypress/pages/components/mcqQuestionCommonComponents.js +1 -1
  53. package/cypress/pages/components/mcqScoringComponent.js +1 -1
  54. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +20 -18
  55. package/cypress/pages/components/questionInstructionsComponent.js +1 -1
  56. package/cypress/pages/components/scoringSectionBase.js +30 -1
  57. package/cypress/pages/components/setPointsPopupBase.js +2 -1
  58. package/cypress/pages/components/uploadImageSectionComponent.js +8 -8
  59. package/cypress/pages/createItemPage.js +83 -1
  60. package/cypress/pages/dialogBoxBase.js +3 -7
  61. package/cypress/pages/dragAndDropIntoCategoriesPage.js +5 -4
  62. package/cypress/pages/essayResponsePage.js +1 -0
  63. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -0
  64. package/cypress/pages/fillInTheGapsScoring.js +215 -317
  65. package/cypress/pages/highlightImagePage.js +6 -4
  66. package/cypress/pages/highlightPage.js +1 -2
  67. package/cypress/pages/index.js +4 -0
  68. package/cypress/pages/listMatchingPage.js +5 -4
  69. package/cypress/pages/listMatchingScoring.js +274 -272
  70. package/cypress/pages/listOrderingPage.js +23 -14
  71. package/cypress/pages/listSortingPage.js +7 -9
  72. package/cypress/pages/multipleSelectionPage.js +2 -1
  73. package/cypress/pages/shortTextResponsePage.js +9 -0
  74. package/cypress/pages/singleSelectionPage.js +1 -0
  75. package/cypress/pages/uploadResponsePage.js +296 -15
  76. package/cypress/pages/videoResponsePage.js +5 -6
  77. package/package.json +1 -1
@@ -1,9 +1,7 @@
1
1
  import { uploadResponsePage, dialogBoxBase } from "../../../pages";
2
2
  import { commonComponents } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
- let fileTypes = ['CSV', 'Excel', 'GIF', 'JPG', 'PDF', 'PNG', 'Powerpoint', 'Publisher', 'RTF', 'TXT', 'Word', 'XPS', 'ZIP'];
5
- let fileTypesString = fileTypes.toString().replaceAll(',', ', ')
6
- let infoIconTooltipText = 'Supported file formats: ' + fileTypesString + '.';
4
+ import utilities from "../../../support/helpers/utilities";
7
5
  const css = Cypress.env('css');
8
6
 
9
7
  describe('Create question page - Upload Response: Preview', () => {
@@ -19,59 +17,39 @@ describe('Create question page - Upload Response: Preview', () => {
19
17
  });
20
18
 
21
19
  it('When user uploads any file without any virus, the system should scan the file for viruses and \'Scanning for viruses…\' message should be displayed along with a pre-loader', () => {
22
- uploadResponsePage.inputTypeFile()
23
- .attachFile('uploads/sample1.zip');
24
- uploadResponsePage.uploadedFileWrapper()
25
- .eq(0)
26
- .within(() => {
27
- uploadResponsePage.virusErrorMessageWrapper()
28
- .verifyInnerText('Scanning for viruses...')
29
- uploadResponsePage.scanningForVirusPreLoader()
30
- .should('be.visible');
31
- });
20
+ uploadResponsePage.steps.uploadFile('uploads/sample1.zip');
21
+ uploadResponsePage.steps.verifyScanningForVirusMessageAndPreLoader();
32
22
  });
33
23
 
34
24
  it('As long as the file is scanning for viruses, the users should not be able to download the file', () => {
35
- uploadResponsePage.uploadedFileWrapper()
36
- .eq(0)
37
- .parents('.uploaded-document-wrapper')
38
- .should('not.have.attr', 'href');
25
+ uploadResponsePage.steps.verifyInabilityOfFileDownloadWhenVirusScanningIsInProgress();
39
26
  });
40
27
 
41
28
  it('As soon as the scanning for viruses is complete, the preloader should disappear', () => {
42
- uploadResponsePage.scanningForVirusPreLoader()
43
- .should('not.be.visible');
29
+ utilities.verifyElementVisibilityState(uploadResponsePage.scanningForVirusPreLoader(), 'hidden');
44
30
  });
45
31
 
46
32
  it('When the user uploads a file containing virus \'Error: A virus was detected, please upload another file\' error message should be displayed inline with file name, the uploaded file count should increase after a virus file gets uploaded', () => {
47
- uploadResponsePage.inputTypeFile()
48
- .attachFile('uploads/sampleVirus.zip');
49
- uploadResponsePage.uploadedFileWrapper()
50
- .eq(1)
51
- .within(() => {
52
- uploadResponsePage.virusErrorMessageWrapper()
53
- .verifyInnerText('Error: A virus was detected, please upload another file.')
54
- .and('be.visible');
55
- });
33
+ uploadResponsePage.steps.uploadFile('uploads/sampleVirus.zip');
34
+ uploadResponsePage.steps.verifyVirusScanningErrorMessage();
56
35
  cy.log('checking if uploaded file count increases after a virus file gets uploaded')
57
- uploadResponsePage.uploadedFileCount()
58
- .verifyInnerText('2/15 File Limit');
36
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(2, 15);
59
37
  });
60
38
 
61
39
  it('CSS of virus error message', { tags: 'css' }, () => {
62
40
  uploadResponsePage.uploadedFileWrapper()
63
41
  .eq(1)
64
42
  .within(() => {
65
- uploadResponsePage.virusErrorMessageWrapper()
66
- .verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
43
+ utilities.verifyCSS(uploadResponsePage.virusErrorMessageWrapper(), {
44
+ 'color': css.color.errorText,
45
+ 'font-size': css.fontSize.small,
46
+ 'font-weight': css.fontWeight.regular
47
+ });
67
48
  });
68
49
  });
69
50
 
70
51
  it('User should not be able to download the file containing virus and the file name should be in disabled state', () => {
71
- uploadResponsePage.uploadedFileWrapper()
72
- .eq(1)
73
- .parents('.uploaded-document-wrapper')
74
- .should('not.have.attr', 'href');
52
+ uploadResponsePage.steps.verifyInabilityOfFileDownloadWhenVirusScanningIsInProgress();
75
53
  });
76
54
  });
77
55
 
@@ -85,43 +63,45 @@ describe('Create question page - Upload Response: Preview', () => {
85
63
  });
86
64
 
87
65
  it('On hovering over the \'Edit display text\' icon button, tooltip \'Edit display text\' should be displayed', () => {
88
- uploadResponsePage.editDisplayTextIcon()
89
- .realHover();
90
- commonComponents.tooltipText()
91
- .verifyInnerText('Edit display text');
66
+ utilities.hoverOverElement(uploadResponsePage.editDisplayTextIcon());
67
+ utilities.verifyInnerText(commonComponents.tooltipText(), 'Edit display text');
92
68
  });
93
69
 
94
70
  it('Clicking on the \'Edit display text\' icon button should open the \'Display Text\' popup with label \'Display Text\' and the input field in the popup should be prefilled with the name of the file and the name text should be selected by default and \'Save\' and \'Cancel\' buttons should be displayed', () => {
95
- uploadResponsePage.editDisplayTextIcon()
96
- .click();
97
- dialogBoxBase.dialogBox()
98
- .should('be.visible');
99
- dialogBoxBase.dialogBoxTitle()
100
- .verifyInnerText('Display text')
101
- uploadResponsePage.editDisplayTextPopupInputField()
102
- .should('have.value', 'image.png')
103
- .parent()
104
- .and('have.class', 'Mui-focused');
105
- uploadResponsePage.acceptButton()
106
- .verifyInnerText('Save')
107
- .and('be.visible');
108
- uploadResponsePage.rejectButton()
109
- .verifyInnerText('Cancel')
110
- .and('be.visible');
71
+ uploadResponsePage.steps.clickOnEditDisplayTextIcon();
72
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
73
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Display text');
74
+ uploadResponsePage.steps.verifyEditDisplayTextPopupInputFieldAndSelectedText();
75
+ utilities.verifyInnerText(uploadResponsePage.buttonAccept(), 'Save');
76
+ utilities.verifyElementVisibilityState(dialogBoxBase.buttonAccept(), 'visible');
77
+ utilities.verifyInnerText(dialogBoxBase.buttonReject(), 'Cancel');
78
+ utilities.verifyElementVisibilityState(dialogBoxBase.buttonReject(), 'visible');
111
79
  });
112
80
 
113
81
  it('CSS of the \'Display Text\' popup', { tags: 'css' }, () => {
114
- dialogBoxBase.dialogBoxTitle()
115
- .verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.semibold);
116
- uploadResponsePage.editDisplayTextPopupInputField()
117
- .verifyCSS(css.color.text, css.fontSize.heading, css.fontWeight.regular)
118
- .should('have.css', 'background-color', css.color.defaultBackground);
119
- uploadResponsePage.acceptButton()
120
- .verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
121
- .should('have.css', 'background-color', css.color.primaryBtnBg);
122
- uploadResponsePage.rejectButton()
123
- .verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
124
- .should('have.css', 'background-color', css.color.transparent);
82
+ utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
83
+ 'color': css.color.questionHeading,
84
+ 'font-size': css.fontSize.heading,
85
+ 'font-weight': css.fontWeight.semibold
86
+ });
87
+ utilities.verifyCSS(uploadResponsePage.editDisplayTextPopupInputField(), {
88
+ 'color': css.color.text,
89
+ 'font-size': css.fontSize.heading,
90
+ 'font-weight': css.fontWeight.regular,
91
+ 'background-color': css.color.defaultBackground
92
+ });
93
+ utilities.verifyCSS(dialogBoxBase.buttonAccept(), {
94
+ 'color': css.color.primaryBtn,
95
+ 'font-size': css.fontSize.default,
96
+ 'font-weight': css.fontWeight.semibold,
97
+ 'background-color': css.color.primaryBtnBg
98
+ });
99
+ utilities.verifyCSS(dialogBoxBase.buttonReject(), {
100
+ 'color': css.color.secondaryBtn,
101
+ 'font-size': css.fontSize.default,
102
+ 'font-weight': css.fontWeight.semibold,
103
+ 'background-color': css.color.transparent
104
+ });
125
105
  });
126
106
 
127
107
  it('Accessibility of the \'Display Text\' popup', { tags: 'a11y' }, () => {
@@ -129,46 +109,30 @@ describe('Create question page - Upload Response: Preview', () => {
129
109
  });
130
110
 
131
111
  it('When the user removes the name of the file from the input field in the \'Display Text\' popup, then placeholder text \'Enter Display Text\' should be displayed', () => {
132
- uploadResponsePage.editDisplayTextPopupInputField()
133
- .clear()
134
- .should('have.attr', 'placeholder', 'Enter display text')
135
- .and('be.visible');
112
+ uploadResponsePage.steps.clearEditDisplayTextPopupInputField();
113
+ uploadResponsePage.steps.verifyEditDisplayTextPopupInputFieldPlaceholderText();
136
114
  });
137
115
 
138
116
  it('When the user clicks on \'Save\' button, a validation error text \'Display text is required.\' should be displayed below the input field', () => {
139
- uploadResponsePage.acceptButton()
140
- .click();
141
- commonComponents.errorMessage()
142
- .verifyInnerText('Error: Display text is required.')
117
+ dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
118
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Display text is required.');
143
119
  });
144
120
 
145
121
  it('When the user enters text in Display Text input field i.e. updates the file name, then the validation text should disappear and when user clicks on \'Save\' button, the name of the file should get updated', () => {
146
- uploadResponsePage.editDisplayTextPopupInputField()
147
- .type('imageEdited.png')
148
- .should('have.value', 'imageEdited.png');
149
- commonComponents.errorMessage()
150
- .should('not.exist');
151
- uploadResponsePage.acceptButton()
152
- .click();
153
- uploadResponsePage.uploadedFileWrapper()
154
- .eq(0)
155
- .verifyInnerText('imageEdited.png')
122
+ uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField('imageEdited.png');
123
+ uploadResponsePage.steps.verifyTextInEditDisplayTextPopupInputField('imageEdited.png');
124
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
125
+ dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
126
+ uploadResponsePage.steps.verifyUploadedFileName('imageEdited.png', 0);
156
127
  });
157
128
 
158
129
  it('When the user updates the file name and clicks on the \'Cancel\' button, the latest changes should be reverted and the \'Display Text\' popup should close', () => {
159
130
  cy.log('clicking on edit display text button')
160
- uploadResponsePage.editDisplayTextIcon()
161
- .click();
162
- uploadResponsePage.editDisplayTextPopupInputField()
163
- .clear()
164
- .type('imageEdited2.png')
165
- .should('have.value', 'imageEdited2.png');
166
- uploadResponsePage.rejectButton()
167
- .click();
168
- uploadResponsePage.uploadedFileWrapper()
169
- .eq(0)
170
- .verifyInnerText('imageEdited.png')
171
- .and('not.have.text', 'imageEdited2.png');
131
+ uploadResponsePage.steps.clickOnEditDisplayTextIcon();
132
+ uploadResponsePage.steps.clearEditDisplayTextPopupInputField();
133
+ uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField('imageEdited2.png');
134
+ dialogBoxBase.steps.clickOnRejectButtonInDialogBox();
135
+ uploadResponsePage.steps.verifyUploadedFileName('imageEdited.png', 0);
172
136
  });
173
137
 
174
138
  it('If the user tries to download file after renaming, the file should get downloaded with the original name', () => {
@@ -186,23 +150,21 @@ describe('Create question page - Upload Response: Preview', () => {
186
150
  });
187
151
 
188
152
  it('On hovering over the \'Add file description\' icon button, tooltip \'Add file description\' should be displayed', () => {
189
- uploadResponsePage.addFileDescriptionIcon()
190
- .realHover();
191
- commonComponents.tooltipText()
192
- .should('have.text', 'Add file description');
153
+ utilities.hoverOverElement(uploadResponsePage.addFileDescriptionIcon());
154
+ utilities.verifyInnerText(commonComponents.tooltipText(), 'Add file description');
193
155
  });
194
156
 
195
157
  it('When the user clicks on the \'Add file description\' icon button, an input area should be displayed along with a placeholder text: \'Add file description\'', () => {
196
- uploadResponsePage.addFileDescriptionIcon()
197
- .click();
198
- uploadResponsePage.addFileDescriptionInput()
199
- .should('have.attr', 'placeholder', 'Add file description')
200
- .and('be.visible');
158
+ uploadResponsePage.steps.clickOnAddFileDescriptionIcon();
159
+ uploadResponsePage.steps.verifyAddFileDescriptionInputFieldPlaceholderText();
201
160
  });
202
161
 
203
162
  it('CSS of \'Add file description\' input field', { tags: 'css' }, () => {
204
- uploadResponsePage.addFileDescriptionInput()
205
- .verifyCSS(css.color.optionsText, css.fontSize.default, css.fontWeight.regular);
163
+ utilities.verifyCSS(uploadResponsePage.addFileDescriptionInput(), {
164
+ 'color': css.color.optionsText,
165
+ 'font-size': css.fontSize.default,
166
+ 'font-weight': css.fontWeight.regular
167
+ });
206
168
  });
207
169
 
208
170
  it('Accessibility of \'Add file description\' input field', { tags: 'a11y' }, () => {
@@ -210,16 +172,13 @@ describe('Create question page - Upload Response: Preview', () => {
210
172
  });
211
173
 
212
174
  it('User should be able to add description text for uploaded file', () => {
213
- uploadResponsePage.addFileDescriptionInput()
214
- .type('This is an image')
215
- .should('have.value', 'This is an image');
175
+ uploadResponsePage.steps.enterTextInAddFileDescriptionInputField('This is an image');
176
+ uploadResponsePage.steps.verifyTextInAddFileDescriptionInputField('This is an image');
216
177
  });
217
178
 
218
179
  it('When user again clicks on the \'Add file description\' icon button, the \'Add file description\' input field section should get hidden', () => {
219
- uploadResponsePage.addFileDescriptionIcon()
220
- .click();
221
- uploadResponsePage.addFileDescriptionInput()
222
- .should('not.exist');
180
+ uploadResponsePage.steps.clickOnAddFileDescriptionIcon();
181
+ utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionInput(), 'notExist');
223
182
  });
224
183
  });
225
184
 
@@ -232,40 +191,40 @@ describe('Create question page - Upload Response: Preview', () => {
232
191
  uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
233
192
  });
234
193
 
235
- it('On hovering over the \'Delete\' icon button, tooltip \'Delete\' should be displayed', () => {
236
- uploadResponsePage.deleteButton()
237
- .realHover();
238
- commonComponents.tooltipText()
239
- .should('have.text', 'Delete');
194
+ it('On hovering over the \'Delete\' icon button, tooltip \'Delete\' should be displayed and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
195
+ utilities.hoverOverElement(uploadResponsePage.deleteButton())
196
+ utilities.verifyInnerText(commonComponents.tooltipText(), 'Delete');
197
+ utilities.hoverAwayFromElement();
198
+ utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
240
199
  });
241
200
 
242
201
  it('When the user clicks on the \'Delete\' icon button, then \'Delete file\' popup with label \'Delete file\' and message \'Are you sure you want to delete this file?\' should be displayed and \'Delete File\' and \'Cancel\' buttons should be displayed', () => {
243
- uploadResponsePage.deleteButton()
244
- .click();
245
- dialogBoxBase.dialogBox()
246
- .should('be.visible');
247
- dialogBoxBase.dialogBoxTitle()
248
- .verifyInnerText('Delete file')
249
- dialogBoxBase.dialogBoxContent()
250
- .should('contain', 'Are you sure you want to delete this file?');
251
- uploadResponsePage.rejectButton()
252
- .should('be.visible')
253
- .verifyInnerText('Cancel');
254
- uploadResponsePage.acceptButton()
255
- .should('be.visible')
256
- .verifyInnerText('Delete file');
202
+ uploadResponsePage.steps.deleteFile();
203
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
204
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Delete file');
205
+ utilities.verifyInnerText(uploadResponsePage.deletePopupContent(), 'Are you sure you want to delete this file?');
206
+ utilities.verifyInnerText(dialogBoxBase.buttonReject(), 'Cancel');
207
+ utilities.verifyInnerText(dialogBoxBase.buttonAccept(), 'Delete file');
257
208
  });
258
209
 
259
210
  it('CSS of the \'Delete file\' popup', { tags: 'css' }, () => {
260
- dialogBoxBase.dialogBoxTitle()
261
- .find('span')
262
- .verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.bold);
263
- uploadResponsePage.rejectButton()
264
- .verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
265
- .should('have.css', 'background-color', css.color.transparent);
266
- uploadResponsePage.acceptButton()
267
- .verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
268
- .should('have.css', 'background-color', css.color.deleteBtn);
211
+ utilities.verifyCSS(dialogBoxBase.dialogBoxTitle().find('span'), {
212
+ 'color': css.color.questionHeading,
213
+ 'font-size': css.fontSize.heading,
214
+ 'font-weight': css.fontWeight.bold
215
+ });
216
+ utilities.verifyCSS(dialogBoxBase.buttonReject(), {
217
+ 'color': css.color.secondaryBtn,
218
+ 'font-size': css.fontSize.default,
219
+ 'font-weight': css.fontWeight.semibold,
220
+ 'background-color': css.color.transparent
221
+ });
222
+ utilities.verifyCSS(dialogBoxBase.buttonAccept(), {
223
+ 'color': css.color.primaryBtn,
224
+ 'font-size': css.fontSize.default,
225
+ 'font-weight': css.fontWeight.semibold,
226
+ 'background-color': css.color.deleteBtn
227
+ });
269
228
  });
270
229
 
271
230
  it('Accessibility of the \'Delete file\' popup', { tags: 'a11y' }, () => {
@@ -274,31 +233,18 @@ describe('Create question page - Upload Response: Preview', () => {
274
233
 
275
234
  it('When the user clicks on the \'Cancel\' button, then \'Delete File\' popup should close and file should not get deleted', () => {
276
235
  cy.log('Clicking on Delete icon for popup to appear')
277
- uploadResponsePage.deleteButton()
278
- .click();
236
+ uploadResponsePage.steps.deleteFile();
279
237
  cy.log('Clicking on \'Cancel\' button')
280
- uploadResponsePage.rejectButton()
281
- .click();
282
- dialogBoxBase.dialogBox()
283
- .should('not.exist');
284
- uploadResponsePage.uploadedFileWrapper()
285
- .eq(0)
286
- .should('exist');
238
+ dialogBoxBase.steps.clickOnRejectButtonInDialogBox();
239
+ utilities.verifyElementVisibilityState(uploadResponsePage.uploadedFileWrapper(), 'exist');
287
240
  });
288
241
 
289
242
  it('When the user clicks on the \'Delete File\' button, the delete confirmation dialog box should disappear and the uploaded file should get deleted', () => {
290
- uploadResponsePage.deleteButton()
291
- .click();
292
- uploadResponsePage.acceptButton()
293
- .click();
294
- dialogBoxBase.dialogBox()
295
- .should('not.exist');
296
- uploadResponsePage.uploadedFilesSectionWrapper()
297
- .should('not.have.text', 'image.png')
298
- .children()
299
- .should('have.length', 0);
300
- uploadResponsePage.uploadedFileCount()
301
- .verifyInnerText('0/15 File Limit');
243
+ uploadResponsePage.steps.deleteFile();
244
+ dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
245
+ uploadResponsePage.steps.verifyFileNotExistsInUploadedFileSection('image.png');
246
+ utilities.verifyElementVisibilityState(uploadResponsePage.uploadedFileWrapper(), 'notExist');
247
+ uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 15);
302
248
  });
303
249
  });
304
250
  });
@@ -2,7 +2,7 @@ import { videoResponsePage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
- const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
5
+ const fontSizeDropdownOptions = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
6
6
  const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
7
7
 
8
8
  describe('Create item page - Video response: Additional settings', () => {
@@ -2,8 +2,7 @@ import { videoResponsePage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
- const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
6
- const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
5
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
7
6
 
8
7
  describe('Create item page - Video response: Additional settings', () => {
9
8
  before(() => {
@@ -62,17 +61,17 @@ describe('Create item page - Video response: Additional settings', () => {
62
61
  videoResponsePage.steps.expandAdditonalSettings();
63
62
  });
64
63
 
65
- fontSizeDropdownOptions.forEach((option, fontsIndex) => {
66
- it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview content should be changed to ${option} in the preview tab`, () => {
67
- videoResponsePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
68
- utilities.verifyInnerText(videoResponsePage.fontSizeDropdown(), `${option}`)
69
- videoResponsePage.steps.switchToPreviewTab();
70
- utilities.verifyCSS(videoResponsePage.questionInstructionsText(), {
71
- 'font-size': fontSizes[fontsIndex]
72
- });
73
- videoResponsePage.steps.switchToEditTab();
64
+ Object.keys(fontSizes).forEach((option, fontsIndex) => {
65
+ it(`When the user selects '${option}' option from the Font Size dropdown, then font size of the preview content should be changed to ${fontSizes[option]} in the preview tab`, () => {
66
+ videoResponsePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
67
+ utilities.verifyInnerText(videoResponsePage.fontSizeDropdown(), option);
68
+ videoResponsePage.steps.switchToPreviewTab();
69
+ utilities.verifyCSS(videoResponsePage.questionInstructionsText(), {
70
+ 'font-size': fontSizes[option]
71
+ });
72
+ videoResponsePage.steps.switchToEditTab();
74
73
  });
75
- });
74
+ });
76
75
  });
77
76
 
78
77
  describe('Video response: Details section', () => {
@@ -218,7 +218,8 @@ describe('Create item page - Video response: Preview tab - default state, record
218
218
  videoResponsePage.steps.stopAndVerifySavingAndRecordingLength();
219
219
  });
220
220
 
221
- it('CSS of \'Preview\' section if recording is saved', { tags: 'css' }, () => {
221
+ //Adding skip here since unable to check the recording status text (Disappears too fast)
222
+ it.skip('CSS of \'Preview\' section if recording is saved', { tags: 'css' }, () => {
222
223
  videoResponsePage.steps.resetQuestionPreview();
223
224
  videoResponsePage.steps.recordAndSaveVideo(3000);
224
225
  utilities.verifyCSS(videoResponsePage.recordingStatusText(), {
@@ -448,7 +449,7 @@ describe('Create item page - Video response: Preview tab - default state, record
448
449
 
449
450
  it('CSS of volume control section', { tags: 'css' }, () => {
450
451
  utilities.verifyCSS(videoResponsePage.volumeControlSlider(), {
451
- 'background': `${css.color.transparent} linear-gradient(90deg, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 100%, ${css.color.progressBarRemainingFill} 0%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`
452
+ 'background': `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 100%, ${css.color.progressBarRemainingFill} 0%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`
452
453
  });
453
454
  utilities.verifyCSS(videoResponsePage.volumeControlButton().find('g path'), {
454
455
  'fill': css.color.secondaryBtnBg,
@@ -468,7 +469,7 @@ describe('Create item page - Video response: Preview tab - default state, record
468
469
 
469
470
  it('CSS of volume control section in muted state', { tags: 'css' }, () => {
470
471
  utilities.verifyCSS(videoResponsePage.volumeControlSlider(), {
471
- 'background': `${css.color.transparent} linear-gradient(90deg, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarRemainingFill} -100%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`
472
+ 'background': `${css.color.transparent} linear-gradient(to right, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarElapsedFill} 0%, ${css.color.progressBarRemainingFill} -100%, ${css.color.progressBarRemainingFill} 100%) repeat scroll 0% 0% / auto padding-box border-box`
472
473
  });
473
474
  utilities.verifyCSS(videoResponsePage.volumeControlButton().find('g g path'), {
474
475
  'fill': css.color.secondaryBtnBg,
@@ -517,12 +518,12 @@ describe('Create item page - Video response: Preview tab - default state, record
517
518
  utilities.verifyCSS(videoResponsePage.playbackSpeedOption().eq(0), {
518
519
  'color': css.color.liText,
519
520
  'background-color': css.color.liTextSelectedBg,
520
- 'font-size': css.fontSize.normal
521
+ 'font-size': css.fontSize.small
521
522
  });
522
523
  utilities.verifyCSS(videoResponsePage.playbackSpeedOption().eq(1), {
523
524
  'color': css.color.liText,
524
525
  'background-color': css.color.transparent,
525
- 'font-size': css.fontSize.normal
526
+ 'font-size': css.fontSize.small
526
527
  });
527
528
  });
528
529
 
@@ -84,7 +84,8 @@
84
84
  "incorrectAnswerHighlightRegion": "rgba(209, 51, 51, 0.4)",
85
85
  "fileUploadProgressBarFill": "rgb(74, 147, 224)",
86
86
  "responseContainerPointer": "rgba(0, 0, 46, 0.4)",
87
- "activeHighlightBorder": "rgb(41, 0, 128)"
87
+ "activeHighlightBorder": "rgb(41, 0, 128)",
88
+ "hoverHighlightBorder": "rgb(66, 0, 204)"
88
89
  },
89
90
  "fontSize": {
90
91
  "extraSmall": "10px",
@@ -34,10 +34,10 @@ const selectors = {
34
34
  customizeUIControlAccordion: () => cy.get('.ngie-accordion-summary[role="button"]').eq(0),
35
35
  advancedPlayerSettingsAccordion: () => cy.get('.ngie-accordion-summary[role="button"]').eq(1),
36
36
  customizeControlPlayButton: () => cy.get('[data-ngie-testid="play-toggle-button"]'),
37
- customizeControlButtonLabel: () => cy.get('.audio-response-selection-panel-details').eq(0).find('.customized_button_label'),
37
+ customizeControlButtonLabel: () => cy.get('[data-ngie-testid="play-toggle-button"]').find('.ngie-toggle-button-label'),
38
38
  customizeControlPauseButton: () => cy.get('[data-ngie-testid="pause-toggle-button"]'),
39
39
  customizeControlSeekButton: () => cy.get('[data-ngie-testid="seek-toggle-button"]'),
40
- advancedPlayerButtonLabel: () => cy.get('.audio-response-selection-panel-details').eq(1).find('.customized_button_label'),
40
+ advancedPlayerButtonLabel: () => cy.get('[data-ngie-testid="timer-toggle-button"]').find('.ngie-toggle-button-label'),
41
41
  advancedPlayerTimerButton: () => cy.get('[data-ngie-testid="timer-toggle-button"]'),
42
42
  advancedPlayerProgressBarButton: () => cy.get('[data-ngie-testid="progress-bar-toggle-button"]'),
43
43
  advancedPlayerVolumeControlButton: () => cy.get('[data-ngie-testid="volume-control-toggle-button"]'),
@@ -11,11 +11,13 @@ const selectors = {
11
11
  additionalSettingsAcknowledgementsLabel: () => cy.get('.additional-settings-detail-wrapper .additional-settings-label').eq(2),
12
12
  additionalSettingsTeacherGuidelinesInputField: () => cy.get('[title="Teacher Scoring Guidelines"]'),
13
13
  additionalSettingsSampleAnswerInputField: () => cy.get('[title="Sample Answer"]'),
14
- additionalSettingsAcknowledgementsInputField: () => cy.get('[title="Acknowledgements"]'),
14
+ additionalSettingsAcknowledgementsInputField: () => cy.get('[title="acknowledgements & reference"]'),
15
15
  //Font-size dropdown
16
16
  fontSizeLabel: () => cy.get('#Font-Size-dropdown-label'),
17
17
  fontSizeDropdown: () => cy.get('#Font-Size-select'),
18
- fontSizeListOptions: (optionIndex) => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"]').eq(optionIndex)
18
+ fontSizeListOptions: (optionIndex) => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"]').eq(optionIndex),
19
+ fontSizeListOptionLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"] .dropdown-label-text'),
20
+ fontSizesLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"] .dropdown-post-label-text'),
19
21
  }
20
22
 
21
23
  const steps = {
@@ -31,6 +33,33 @@ const steps = {
31
33
  .click();
32
34
  additionalSettingsPanel.fontSizeListOptions(dropdownOptionIndex)
33
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);
34
63
  }
35
64
  }
36
65
 
@@ -62,7 +91,7 @@ const tests = {
62
91
  .should('have.text', 'Teacher scoring guidelines');
63
92
  });
64
93
 
65
- it('\'Sample Answer\' label and input field should be displayed and user should be able to enter \'Sample Answer\'', () => {
94
+ it('\'Sample answer\' label and input field should be displayed and user should be able to enter \'Sample answer\'', () => {
66
95
  additionalSettingsPanel.additionalSettingsSampleAnswerLabel()
67
96
  .verifyInnerText('Sample answer');
68
97
  additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
@@ -70,9 +99,9 @@ const tests = {
70
99
  .should('have.text', 'Sample Answer');
71
100
  });
72
101
 
73
- it('\'Acknowledgements\' label and input field should be displayed and user should be able to enter \'Acknowledgements\'', () => {
102
+ it('\'Acknowledgements & reference\' label and input field should be displayed and user should be able to enter \'Acknowledgements\'', () => {
74
103
  additionalSettingsPanel.additionalSettingsAcknowledgementsLabel()
75
- .should('have.text', 'Acknowledgements');
104
+ .verifyInnerText('Acknowledgements & reference');
76
105
  additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
77
106
  .type('Acknowledgements')
78
107
  .should('have.text', 'Acknowledgements');
@@ -110,9 +139,8 @@ const tests = {
110
139
  },
111
140
 
112
141
  verifyFontSizeSectionContents: () => {
113
- const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
114
-
115
- it('CSS of \'Font Size\' dropdown', { tags: 'css' }, () => {
142
+ const fontSizes = { 'Tiny': '12 px', 'Small': '14 px', 'Default': '16 px', 'Normal': '18 px', 'Big': '22 px', 'Huge': '26 px' };
143
+ it('CSS of \'Font Size\' dropdown - default state', { tags: 'css' }, () => {
116
144
  additionalSettingsPanel.fontSizeLabel()
117
145
  .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
118
146
  additionalSettingsPanel.fontSizeDropdown()
@@ -128,24 +156,28 @@ const tests = {
128
156
  .verifyInnerText('Default');
129
157
  });
130
158
 
131
- it('Clicking on Font Size dropdown should open a list of 6 options - Default, Small, Normal, Large, Extra large, Huge', () => {
159
+ it(`Clicking on \'Font size\' dropdown should open a list of ${Object.keys(fontSizes).length} options - ${Object.keys(fontSizes).join(',')}`, () => {
132
160
  additionalSettingsPanel.fontSizeDropdown()
133
161
  .realClick();
134
162
  additionalSettingsPanel.fontSizeListOptions(0)
135
163
  .should('be.visible');
136
- fontsizes.forEach((index, count) => {
137
- additionalSettingsPanel.fontSizeListOptions(count)
138
- .verifyInnerText(index);
164
+ Object.keys(fontSizes).forEach((size, index) => {
165
+ additionalSettingsPanel.fontSizeListOptionLabels()
166
+ .eq(index)
167
+ .verifyInnerText(size);
168
+ additionalSettingsPanel.fontSizesLabels()
169
+ .eq(index)
170
+ .verifyInnerText(fontSizes[size]);
139
171
  });
140
172
  cy.get('body')
141
173
  .click();
142
174
  });
143
175
 
144
- it('CSS of Font size dropdown in Active state', { tags: 'css' }, () => {
176
+ it('CSS of Font size dropdown - active state', { tags: 'css' }, () => {
145
177
  cy.log('Pre step: Clicking on Font size dropdown')
146
178
  additionalSettingsPanel.fontSizeDropdown()
147
179
  .click();
148
- additionalSettingsPanel.fontSizeListOptions(0)
180
+ additionalSettingsPanel.fontSizeListOptions(2)
149
181
  .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
150
182
  .should('have.css', 'background-color', css.color.liTextSelectedBg);
151
183
  additionalSettingsPanel.fontSizeListOptions(1)