itemengine-cypress-automation 1.0.17 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettingsBasic.js +255 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAllOrNothingWithAlternateAnswer.js +731 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAutoScoredScoring.js +0 -719
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridOptionsAdditionalSettings.js +351 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeights.js +0 -930
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeightsWithAlternateAnswer.js +942 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeights.js +0 -852
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeightsWithAlternateAnswer.js +864 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridQuestionStemAdditionalSettings.js +261 -0
- package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridQuestionStemAdditionalSettings.js +0 -1
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +0 -291
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +304 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettings.js +0 -830
- /package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoringWithAlternateAnswer.js → singleSelectionGridAllOrNothingWithAlternateAnswer.js} +0 -0
package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridQuestionStemAdditionalSettings.js
ADDED
@@ -0,0 +1,261 @@
|
|
1
|
+
import { multipleSelectionGridPage } from "../../../pages/multipleSelectionGridPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
const questionStems = ['Bat', 'Ostrich', 'Platypus', 'Eagle'];
|
6
|
+
const options = ['Is mammal', 'Lays eggs', 'Can fly'];
|
7
|
+
|
8
|
+
const questionStemNumerationOptions = ['None', 'Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
9
|
+
const numbers = ['1', '2', '3', '4'];
|
10
|
+
const lowercase = ['a', 'b', 'c', 'd'];
|
11
|
+
const uppercase = ['A', 'B', 'C', 'D'];
|
12
|
+
|
13
|
+
describe('Create Item page - Multiple Selection Grid: Additional settings', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Additional settings: Student response area and layout', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
cy.log('Navigating to multiple selection grid question type');
|
22
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
23
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
24
|
+
});
|
25
|
+
|
26
|
+
multipleSelectionGridPage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
|
27
|
+
});
|
28
|
+
|
29
|
+
describe('Additional settings: Question stem numeration contents', () => {
|
30
|
+
abortEarlySetup();
|
31
|
+
before(() => {
|
32
|
+
cy.log('Navigating to multiple selection grid question type');
|
33
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
34
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
35
|
+
});
|
36
|
+
|
37
|
+
it(`\'Question stem numeration\' label and dropdown should be displayed and by default, ${questionStemNumerationOptions[0]} option should be selected in the dropdown`, () => {
|
38
|
+
multipleSelectionGridPage.questionStemNumerationLabel()
|
39
|
+
.verifyInnerText('Question stem numeration')
|
40
|
+
.should('be.visible');
|
41
|
+
multipleSelectionGridPage.questionStemNumerationDropdown()
|
42
|
+
.verifyInnerText('None')
|
43
|
+
.should('exist');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('CSS of Question stem numeration section', { tags: 'css' }, () => {
|
47
|
+
multipleSelectionGridPage.questionStemNumerationLabel()
|
48
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
49
|
+
multipleSelectionGridPage.questionStemNumerationDropdown()
|
50
|
+
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular);
|
51
|
+
});
|
52
|
+
|
53
|
+
it(`When user clicks on the Question stem numeration dropdown a list of 4 options - ${questionStemNumerationOptions} should be displayed`, () => {
|
54
|
+
multipleSelectionGridPage.steps.expandQuestionStemNumerationDropdown();
|
55
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationDropdownOptions(questionStemNumerationOptions);
|
56
|
+
});
|
57
|
+
|
58
|
+
it('CSS of Question stem numeration dropdown in active state', { tags: 'css' }, () => {
|
59
|
+
multipleSelectionGridPage.questionStemNumerationDropdownOptions()
|
60
|
+
.eq(0)
|
61
|
+
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
|
62
|
+
.should('have.css', 'background-color', css.color.liTextSelectedBg);
|
63
|
+
multipleSelectionGridPage.questionStemNumerationDropdownOptions()
|
64
|
+
.eq(1)
|
65
|
+
.should('have.css', 'background-color', css.color.transparent);
|
66
|
+
});
|
67
|
+
|
68
|
+
it('Accessbility of Question stem numeration dropdown in active state', { tags: 'a11y' }, () => {
|
69
|
+
it('Accessbility of Grid style dropdown in active state', { tags: 'a11y' }, () => {
|
70
|
+
cy.checkAccessibility(multipleSelectionGridPage.dropdownList());
|
71
|
+
});
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
75
|
+
describe('Additional settings: Question stem numeration set correct answer section', () => {
|
76
|
+
abortEarlySetup();
|
77
|
+
before(() => {
|
78
|
+
cy.log('Navigating to multiple selection grid question type');
|
79
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
80
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
81
|
+
multipleSelectionGridPage.steps.addOption();
|
82
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
83
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
84
|
+
multipleSelectionGridPage.steps.allotPoints(10);
|
85
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
86
|
+
});
|
87
|
+
|
88
|
+
it(`When the user selects ${questionStemNumerationOptions[0]} option from the Option stem numeration dropdown, then numeration should not be displayed in the Set correct answer table`, () => {
|
89
|
+
multipleSelectionGridPage.questionStemNumerationDropdown()
|
90
|
+
.verifyInnerText(`${questionStemNumerationOptions[0]}`);
|
91
|
+
multipleSelectionGridPage.questionStemNumeration()
|
92
|
+
.should('not.exist');
|
93
|
+
});
|
94
|
+
|
95
|
+
it(`When the user selects ${questionStemNumerationOptions[1]} option from the Option stem numeration dropdown, then numbers should be displayed in the Set correct answer table`, () => {
|
96
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[1]}`);
|
97
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(numbers);
|
98
|
+
});
|
99
|
+
|
100
|
+
it(`When the user selects ${questionStemNumerationOptions[2]} option from the Option stem numeration dropdown, then uppercase alphabets should be displayed in the Set correct answer table`, () => {
|
101
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[2]}`);
|
102
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(uppercase);
|
103
|
+
});
|
104
|
+
|
105
|
+
it(`When the user selects ${questionStemNumerationOptions[3]} option from the Option stem numeration dropdown, then lowercase alphabets should be displayed in the Set correct answer table`, () => {
|
106
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[3]}`);
|
107
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(lowercase);
|
108
|
+
});
|
109
|
+
|
110
|
+
it('CSS for question stem numeration', { tags: 'css' }, () => {
|
111
|
+
multipleSelectionGridPage.questionStemNumeration()
|
112
|
+
.eq(0)
|
113
|
+
.verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.regular)
|
114
|
+
.should('have.css', 'background-color', css.color.optionNumerationBg);
|
115
|
+
});
|
116
|
+
|
117
|
+
it('Accessibility of question stem numeration', () => {
|
118
|
+
cy.checkAccessibility(multipleSelectionGridPage.questionStemNumeration().eq(0).parents('.stem-numeration-present'));
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
describe('Additional settings: Question stem numeration preview tab section', () => {
|
123
|
+
abortEarlySetup();
|
124
|
+
before(() => {
|
125
|
+
cy.log('Navigating to multiple selection grid question type');
|
126
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
127
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
128
|
+
multipleSelectionGridPage.steps.addOption()
|
129
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
130
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
131
|
+
multipleSelectionGridPage.steps.allotPoints(10);
|
132
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
133
|
+
});
|
134
|
+
|
135
|
+
it(`When the user selects ${questionStemNumerationOptions[0]} option from the Option stem numeration dropdown, then numeration should not be displayed in the preview tab answer table`, () => {
|
136
|
+
multipleSelectionGridPage.questionStemNumerationDropdown()
|
137
|
+
.verifyInnerText(`${questionStemNumerationOptions[0]}`);
|
138
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
139
|
+
multipleSelectionGridPage.previewTabQuestionStemNumeration()
|
140
|
+
.should('not.exist');
|
141
|
+
});
|
142
|
+
|
143
|
+
it(`When the user selects ${questionStemNumerationOptions[1]} option from the Option stem numeration dropdown, then numbers should be displayed in the preview tab answer table`, () => {
|
144
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
145
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[1]}`);
|
146
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
147
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(numbers);
|
148
|
+
});
|
149
|
+
|
150
|
+
it(`When the user selects ${questionStemNumerationOptions[2]} option from the Option stem numeration dropdown, then uppercase alphabets should be displayed in the preview tab answer table`, () => {
|
151
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
152
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[2]}`);
|
153
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
154
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(uppercase);
|
155
|
+
});
|
156
|
+
|
157
|
+
it(`When the user selects ${questionStemNumerationOptions[3]} option from the Option stem numeration dropdown, then lowercase alphabets should be displayed in the preview tab answer table`, () => {
|
158
|
+
multipleSelectionGridPage.steps.switchToEditTab()
|
159
|
+
multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[3]}`);
|
160
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
161
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(lowercase);
|
162
|
+
});
|
163
|
+
|
164
|
+
it('When user selects \'Randomize options\' the numeration should be displayed in ascending order in the preview tab answer table', () => {
|
165
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
166
|
+
multipleSelectionGridPage.steps.selectRandomizeOptionsCheckbox();
|
167
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
168
|
+
multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(lowercase);
|
169
|
+
});
|
170
|
+
|
171
|
+
it('CSS for option numeration', { tags: 'css' }, () => {
|
172
|
+
multipleSelectionGridPage.previewTabQuestionStemNumeration()
|
173
|
+
.eq(0)
|
174
|
+
.verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.regular)
|
175
|
+
.should('have.css', 'background-color', css.color.optionNumerationBg);
|
176
|
+
});
|
177
|
+
|
178
|
+
it('Accessibility of question stem numeration', () => {
|
179
|
+
cy.checkAccessibility(multipleSelectionGridPage.previewTabQuestionStemNumeration().eq(0).parents('.stem-numeration-present'));
|
180
|
+
});
|
181
|
+
});
|
182
|
+
|
183
|
+
describe('Additional settings: Title for question stems contents', () => {
|
184
|
+
abortEarlySetup();
|
185
|
+
before(() => {
|
186
|
+
cy.log('Navigating to multiple selection grid question type');
|
187
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
188
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
189
|
+
});
|
190
|
+
|
191
|
+
it('\'Title for question stems\' label and input field should be displayed and by default, the input field should be prefilled with \'Question stem\'', () => {
|
192
|
+
multipleSelectionGridPage.titleForQuestionStemsLabel()
|
193
|
+
.verifyInnerText('Title for question stems')
|
194
|
+
.should('be.visible');
|
195
|
+
multipleSelectionGridPage.titleForQuestionStemInputField()
|
196
|
+
.verifyInnerText('Question stem')
|
197
|
+
});
|
198
|
+
|
199
|
+
it('CSS of Title for question stems label and input field', { tags: 'css' }, () => {
|
200
|
+
multipleSelectionGridPage.titleForQuestionStemsLabel()
|
201
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
202
|
+
multipleSelectionGridPage.titleForQuestionStemInputField()
|
203
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
204
|
+
});
|
205
|
+
|
206
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
207
|
+
});
|
208
|
+
|
209
|
+
describe('Additional settings: Title for question stems set correct answer section', () => {
|
210
|
+
abortEarlySetup();
|
211
|
+
before(() => {
|
212
|
+
cy.log('Navigating to multiple selection grid question type');
|
213
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
214
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
215
|
+
multipleSelectionGridPage.steps.addOption();
|
216
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
217
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
218
|
+
multipleSelectionGridPage.steps.allotPoints(10);
|
219
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
220
|
+
});
|
221
|
+
|
222
|
+
it('By default, Question stem should be displayed as the question stem title in the set correct answer table', () => {
|
223
|
+
multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
|
224
|
+
.verifyInnerText('Question stem');
|
225
|
+
});
|
226
|
+
|
227
|
+
it('When user enters any text in the Title for question stems then that title should be displayed the set correct answer table', () => {
|
228
|
+
multipleSelectionGridPage.steps.addInputToTitleForQuestionStemInputField('Causes of Pollution');
|
229
|
+
multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
|
230
|
+
.verifyInnerText('Causes of Pollution');
|
231
|
+
});
|
232
|
+
});
|
233
|
+
|
234
|
+
describe('Additional settings: Title for question stems preview tab section', () => {
|
235
|
+
abortEarlySetup();
|
236
|
+
before(() => {
|
237
|
+
cy.log('Navigating to multiple selection grid question type');
|
238
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
239
|
+
multipleSelectionGridPage.steps.addQuestionInstructions();
|
240
|
+
multipleSelectionGridPage.steps.addOption()
|
241
|
+
multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
|
242
|
+
multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
|
243
|
+
multipleSelectionGridPage.steps.allotPoints(10);
|
244
|
+
multipleSelectionGridPage.steps.expandAdditonalSettings();
|
245
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
246
|
+
});
|
247
|
+
|
248
|
+
it('By default, Question stem should be displayed as the question stem title in the preview tab answer table', () => {
|
249
|
+
multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
|
250
|
+
.verifyInnerText('Question stem');
|
251
|
+
});
|
252
|
+
|
253
|
+
it('When user enters any text in the \'Title for question stems\' then that title should be displayed the preview tab answer table', () => {
|
254
|
+
multipleSelectionGridPage.steps.switchToEditTab();
|
255
|
+
multipleSelectionGridPage.steps.addInputToTitleForQuestionStemInputField('Causes of Pollution');
|
256
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
257
|
+
multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
|
258
|
+
.verifyInnerText('Causes of Pollution');
|
259
|
+
});
|
260
|
+
});
|
261
|
+
});
|
package/cypress/e2e/ILC/SingleSelectionGrid/singleSelectionGridQuestionStemAdditionalSettings.js
CHANGED
@@ -5,7 +5,6 @@ const css = Cypress.env('css');
|
|
5
5
|
const questionStems = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
6
6
|
const options = ['Fully agree as true', 'Fully agree as false'];
|
7
7
|
|
8
|
-
const gridStyleDropdownOptions = ['With border', 'Row dividers', 'No border', 'Inline', 'Inline - row dividers'];
|
9
8
|
const questionStemNumerationOptions = ['None', 'Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
10
9
|
const numbers = ['1', '2', '3', '4'];
|
11
10
|
const lowercase = ['a', 'b', 'c', 'd'];
|
@@ -321,70 +321,6 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
321
321
|
uploadResponsePage.tests.verifyErrorMessageDisappear();
|
322
322
|
});
|
323
323
|
|
324
|
-
describe('Virus Scanning', () => {
|
325
|
-
abortEarlySetup();
|
326
|
-
before(() => {
|
327
|
-
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
328
|
-
uploadResponsePage.steps.switchToPreviewTab();
|
329
|
-
});
|
330
|
-
|
331
|
-
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', () => {
|
332
|
-
uploadResponsePage.inputTypeFile()
|
333
|
-
.attachFile('uploads/sample1.zip');
|
334
|
-
uploadResponsePage.uploadedFileWrapper()
|
335
|
-
.eq(0)
|
336
|
-
.within(() => {
|
337
|
-
uploadResponsePage.virusErrorMessageWrapper()
|
338
|
-
.verifyInnerText('Scanning for viruses...')
|
339
|
-
uploadResponsePage.scanningForVirusPreLoader()
|
340
|
-
.should('be.visible');
|
341
|
-
});
|
342
|
-
});
|
343
|
-
|
344
|
-
it('As long as the file is scanning for viruses, the users should not be able to download the file', () => {
|
345
|
-
uploadResponsePage.uploadedFileWrapper()
|
346
|
-
.eq(0)
|
347
|
-
.parents('.uploaded-document-wrapper')
|
348
|
-
.should('not.have.attr', 'href');
|
349
|
-
});
|
350
|
-
|
351
|
-
it('As soon as the scanning for viruses is complete, the preloader should disappear', () => {
|
352
|
-
uploadResponsePage.scanningForVirusPreLoader()
|
353
|
-
.should('not.be.visible');
|
354
|
-
});
|
355
|
-
|
356
|
-
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', () => {
|
357
|
-
uploadResponsePage.inputTypeFile()
|
358
|
-
.attachFile('uploads/sampleVirus.zip');
|
359
|
-
uploadResponsePage.uploadedFileWrapper()
|
360
|
-
.eq(1)
|
361
|
-
.within(() => {
|
362
|
-
uploadResponsePage.virusErrorMessageWrapper()
|
363
|
-
.verifyInnerText('Error: A virus was detected, please upload another file.')
|
364
|
-
.and('be.visible');
|
365
|
-
});
|
366
|
-
cy.log('checking if uploaded file count increases after a virus file gets uploaded')
|
367
|
-
uploadResponsePage.uploadedFileCount()
|
368
|
-
.verifyInnerText('2/15 File Limit');
|
369
|
-
});
|
370
|
-
|
371
|
-
it('CSS of virus error message', { tags: 'css' }, () => {
|
372
|
-
uploadResponsePage.uploadedFileWrapper()
|
373
|
-
.eq(1)
|
374
|
-
.within(() => {
|
375
|
-
uploadResponsePage.virusErrorMessageWrapper()
|
376
|
-
.verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
|
377
|
-
});
|
378
|
-
});
|
379
|
-
|
380
|
-
it('User should not be able to download the file containing virus and the file name should be in disabled state', () => {
|
381
|
-
uploadResponsePage.uploadedFileWrapper()
|
382
|
-
.eq(1)
|
383
|
-
.parents('.uploaded-document-wrapper')
|
384
|
-
.should('not.have.attr', 'href');
|
385
|
-
});
|
386
|
-
});
|
387
|
-
|
388
324
|
describe('Supported file types- preview tab', () => {
|
389
325
|
abortEarlySetup();
|
390
326
|
before(() => {
|
@@ -421,231 +357,4 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
421
357
|
|
422
358
|
uploadResponsePage.tests.verifyErrorMessageDisappear();
|
423
359
|
});
|
424
|
-
|
425
|
-
describe('Renaming an uploaded file', () => {
|
426
|
-
abortEarlySetup();
|
427
|
-
before(() => {
|
428
|
-
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
429
|
-
cy.log('Uploading a file in preview tab');
|
430
|
-
uploadResponsePage.steps.switchToPreviewTab();
|
431
|
-
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
432
|
-
});
|
433
|
-
|
434
|
-
it('On hovering over the \'Edit display text\' icon button, tooltip \'Edit display text\' should be displayed', () => {
|
435
|
-
uploadResponsePage.editDisplayTextIcon()
|
436
|
-
.realHover();
|
437
|
-
commonComponents.tooltipText()
|
438
|
-
.verifyInnerText('Edit display text');
|
439
|
-
});
|
440
|
-
|
441
|
-
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', () => {
|
442
|
-
uploadResponsePage.editDisplayTextIcon()
|
443
|
-
.click();
|
444
|
-
dialogBoxBase.dialogBox()
|
445
|
-
.should('be.visible');
|
446
|
-
dialogBoxBase.dialogBoxTitle()
|
447
|
-
.verifyInnerText('Display text')
|
448
|
-
uploadResponsePage.editDisplayTextPopupInputField()
|
449
|
-
.should('have.value', 'image.png')
|
450
|
-
.parent()
|
451
|
-
.and('have.class', 'Mui-focused');
|
452
|
-
uploadResponsePage.acceptButton()
|
453
|
-
.verifyInnerText('Save')
|
454
|
-
.and('be.visible');
|
455
|
-
uploadResponsePage.rejectButton()
|
456
|
-
.verifyInnerText('Cancel')
|
457
|
-
.and('be.visible');
|
458
|
-
});
|
459
|
-
|
460
|
-
it('CSS of the \'Display Text\' popup', { tags: 'css' }, () => {
|
461
|
-
dialogBoxBase.dialogBoxTitle()
|
462
|
-
.verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.semibold);
|
463
|
-
uploadResponsePage.editDisplayTextPopupInputField()
|
464
|
-
.verifyCSS(css.color.text, css.fontSize.heading, css.fontWeight.regular)
|
465
|
-
.should('have.css', 'background-color', css.color.defaultBackground);
|
466
|
-
uploadResponsePage.acceptButton()
|
467
|
-
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
468
|
-
.should('have.css', 'background-color', css.color.primaryBtnBg);
|
469
|
-
uploadResponsePage.rejectButton()
|
470
|
-
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
471
|
-
.should('have.css', 'background-color', css.color.transparent);
|
472
|
-
});
|
473
|
-
|
474
|
-
it('Accessibility of the \'Display Text\' popup', { tags: 'a11y' }, () => {
|
475
|
-
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
476
|
-
});
|
477
|
-
|
478
|
-
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', () => {
|
479
|
-
uploadResponsePage.editDisplayTextPopupInputField()
|
480
|
-
.clear()
|
481
|
-
.should('have.attr', 'placeholder', 'Enter display text')
|
482
|
-
.and('be.visible');
|
483
|
-
});
|
484
|
-
|
485
|
-
it('When the user clicks on \'Save\' button, a validation error text \'Display text is required.\' should be displayed below the input field', () => {
|
486
|
-
uploadResponsePage.acceptButton()
|
487
|
-
.click();
|
488
|
-
commonComponents.errorMessage()
|
489
|
-
.verifyInnerText('Error: Display text is required.')
|
490
|
-
});
|
491
|
-
|
492
|
-
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', () => {
|
493
|
-
uploadResponsePage.editDisplayTextPopupInputField()
|
494
|
-
.type('imageEdited.png')
|
495
|
-
.should('have.value', 'imageEdited.png');
|
496
|
-
commonComponents.errorMessage()
|
497
|
-
.should('not.exist');
|
498
|
-
uploadResponsePage.acceptButton()
|
499
|
-
.click();
|
500
|
-
uploadResponsePage.uploadedFileWrapper()
|
501
|
-
.eq(0)
|
502
|
-
.verifyInnerText('imageEdited.png')
|
503
|
-
});
|
504
|
-
|
505
|
-
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', () => {
|
506
|
-
cy.log('clicking on edit display text button')
|
507
|
-
uploadResponsePage.editDisplayTextIcon()
|
508
|
-
.click();
|
509
|
-
uploadResponsePage.editDisplayTextPopupInputField()
|
510
|
-
.clear()
|
511
|
-
.type('imageEdited2.png')
|
512
|
-
.should('have.value', 'imageEdited2.png');
|
513
|
-
uploadResponsePage.rejectButton()
|
514
|
-
.click();
|
515
|
-
uploadResponsePage.uploadedFileWrapper()
|
516
|
-
.eq(0)
|
517
|
-
.verifyInnerText('imageEdited.png')
|
518
|
-
.and('not.have.text', 'imageEdited2.png');
|
519
|
-
});
|
520
|
-
|
521
|
-
it('If the user tries to download file after renaming, the file should get downloaded with the original name', () => {
|
522
|
-
cy.verifyUploadFilePreviewDownload('image.png');
|
523
|
-
});
|
524
|
-
});
|
525
|
-
|
526
|
-
describe('Add a description for a file', () => {
|
527
|
-
abortEarlySetup();
|
528
|
-
before(() => {
|
529
|
-
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
530
|
-
cy.log('Uploading a file in preview tab');
|
531
|
-
uploadResponsePage.steps.switchToPreviewTab();
|
532
|
-
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
533
|
-
});
|
534
|
-
|
535
|
-
it('On hovering over the \'Add file description\' icon button, tooltip \'Add file description\' should be displayed', () => {
|
536
|
-
uploadResponsePage.addFileDescriptionIcon()
|
537
|
-
.realHover();
|
538
|
-
commonComponents.tooltipText()
|
539
|
-
.should('have.text', 'Add file description');
|
540
|
-
});
|
541
|
-
|
542
|
-
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\'', () => {
|
543
|
-
uploadResponsePage.addFileDescriptionIcon()
|
544
|
-
.click();
|
545
|
-
uploadResponsePage.addFileDescriptionInput()
|
546
|
-
.should('have.attr', 'placeholder', 'Add file description')
|
547
|
-
.and('be.visible');
|
548
|
-
});
|
549
|
-
|
550
|
-
it('CSS of \'Add file description\' input field', { tags: 'css' }, () => {
|
551
|
-
uploadResponsePage.addFileDescriptionInput()
|
552
|
-
.verifyCSS(css.color.optionsText, css.fontSize.default, css.fontWeight.regular);
|
553
|
-
});
|
554
|
-
|
555
|
-
it('Accessibility of \'Add file description\' input field', { tags: 'a11y' }, () => {
|
556
|
-
cy.checkAccessibility(uploadResponsePage.addFileDescriptionInput().parents('.placeholder'));
|
557
|
-
});
|
558
|
-
|
559
|
-
it('User should be able to add description text for uploaded file', () => {
|
560
|
-
uploadResponsePage.addFileDescriptionInput()
|
561
|
-
.type('This is an image')
|
562
|
-
.should('have.value', 'This is an image');
|
563
|
-
});
|
564
|
-
|
565
|
-
it('When user again clicks on the \'Add file description\' icon button, the \'Add file description\' input field section should get hidden', () => {
|
566
|
-
uploadResponsePage.addFileDescriptionIcon()
|
567
|
-
.click();
|
568
|
-
uploadResponsePage.addFileDescriptionInput()
|
569
|
-
.should('not.exist');
|
570
|
-
});
|
571
|
-
});
|
572
|
-
|
573
|
-
describe('Delete the uploaded file', () => {
|
574
|
-
abortEarlySetup();
|
575
|
-
before(() => {
|
576
|
-
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
577
|
-
cy.log('Uploading a file in preview tab');
|
578
|
-
uploadResponsePage.steps.switchToPreviewTab();
|
579
|
-
uploadResponsePage.steps.fileUploadAndVerify(['image.png']);
|
580
|
-
});
|
581
|
-
|
582
|
-
it('On hovering over the \'Delete\' icon button, tooltip \'Delete\' should be displayed', () => {
|
583
|
-
uploadResponsePage.deleteButton()
|
584
|
-
.realHover();
|
585
|
-
commonComponents.tooltipText()
|
586
|
-
.should('have.text', 'Delete');
|
587
|
-
});
|
588
|
-
|
589
|
-
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', () => {
|
590
|
-
uploadResponsePage.deleteButton()
|
591
|
-
.click();
|
592
|
-
dialogBoxBase.dialogBox()
|
593
|
-
.should('be.visible');
|
594
|
-
dialogBoxBase.dialogBoxTitle()
|
595
|
-
.verifyInnerText('Delete file')
|
596
|
-
dialogBoxBase.dialogBoxContent()
|
597
|
-
.should('contain', 'Are you sure you want to delete this file?');
|
598
|
-
uploadResponsePage.rejectButton()
|
599
|
-
.should('be.visible')
|
600
|
-
.verifyInnerText('Cancel');
|
601
|
-
uploadResponsePage.acceptButton()
|
602
|
-
.should('be.visible')
|
603
|
-
.verifyInnerText('Delete file');
|
604
|
-
});
|
605
|
-
|
606
|
-
it('CSS of the \'Delete file\' popup', { tags: 'css' }, () => {
|
607
|
-
dialogBoxBase.dialogBoxTitle()
|
608
|
-
.find('span')
|
609
|
-
.verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.bold);
|
610
|
-
uploadResponsePage.rejectButton()
|
611
|
-
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
612
|
-
.should('have.css', 'background-color', css.color.transparent);
|
613
|
-
uploadResponsePage.acceptButton()
|
614
|
-
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
615
|
-
.should('have.css', 'background-color', css.color.deleteBtn);
|
616
|
-
});
|
617
|
-
|
618
|
-
it('Accessibility of the \'Delete file\' popup', { tags: 'a11y' }, () => {
|
619
|
-
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
620
|
-
});
|
621
|
-
|
622
|
-
it('When the user clicks on the \'Cancel\' button, then \'Delete File\' popup should close and file should not get deleted', () => {
|
623
|
-
cy.log('Clicking on Delete icon for popup to appear')
|
624
|
-
uploadResponsePage.deleteButton()
|
625
|
-
.click();
|
626
|
-
cy.log('Clicking on \'Cancel\' button')
|
627
|
-
uploadResponsePage.rejectButton()
|
628
|
-
.click();
|
629
|
-
dialogBoxBase.dialogBox()
|
630
|
-
.should('not.exist');
|
631
|
-
uploadResponsePage.uploadedFileWrapper()
|
632
|
-
.eq(0)
|
633
|
-
.should('exist');
|
634
|
-
});
|
635
|
-
|
636
|
-
it('When the user clicks on the \'Delete File\' button, the delete confirmation dialog box should disappear and the uploaded file should get deleted', () => {
|
637
|
-
uploadResponsePage.deleteButton()
|
638
|
-
.click();
|
639
|
-
uploadResponsePage.acceptButton()
|
640
|
-
.click();
|
641
|
-
dialogBoxBase.dialogBox()
|
642
|
-
.should('not.exist');
|
643
|
-
uploadResponsePage.uploadedFilesSectionWrapper()
|
644
|
-
.should('not.have.text', 'image.png')
|
645
|
-
.children()
|
646
|
-
.should('have.length', 0);
|
647
|
-
uploadResponsePage.uploadedFileCount()
|
648
|
-
.verifyInnerText('0/15 File Limit');
|
649
|
-
});
|
650
|
-
});
|
651
360
|
});
|