itemengine-cypress-automation 1.0.21 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettings.js +709 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettingsBasic.js +151 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseControlsForRecordingResponse.js +308 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseControlsResponsePlayback.js +591 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseEditTabBasicSections.js +349 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseHeaderSection.js +80 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseMinimalPreviewSection.js +941 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseScoringSection.js +60 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseStandardPreviewSection.js +862 -0
- package/package.json +1 -1
@@ -0,0 +1,349 @@
|
|
1
|
+
import { audioResponsePage } from '../../../pages/audioResponsePage';
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
describe('Create Item page - Audio response: Question Instructions, Audio Recorder Style dropdown, Maximum recorder length, Stop recording if silence is detected after', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Question Instructions input field - Edit tab', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigating to Audio response question type');
|
14
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
15
|
+
});
|
16
|
+
|
17
|
+
audioResponsePage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
18
|
+
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Question Instructions input field - Preview tab', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Navigating to Audio response question type');
|
25
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
26
|
+
});
|
27
|
+
|
28
|
+
audioResponsePage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
29
|
+
});
|
30
|
+
|
31
|
+
describe('\'Audio Recorder Style\' dropdown', () => {
|
32
|
+
const recordingResponseButtons = [audioResponsePage.startRecordingOptionButton, audioResponsePage.pauseRecordingOptionButton, audioResponsePage.stopRecordingOptionButton, audioResponsePage.recordingCueOptionButton, audioResponsePage.recordingOverlayOptionButton];
|
33
|
+
const responsePlaybackButtons = [audioResponsePage.playOptionButton, audioResponsePage.pauseOptionButton, audioResponsePage.seekOptionButton, audioResponsePage.volumeControlOptionButton, audioResponsePage.playbackOverlayOptionButton];
|
34
|
+
const dropdownOptions = ['Standard', 'Minimal'];
|
35
|
+
abortEarlySetup();
|
36
|
+
before(() => {
|
37
|
+
cy.log('Navigating to Audio Response question type');
|
38
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
39
|
+
});
|
40
|
+
|
41
|
+
it('CSS of Audio Recorder Style section', { tags: 'css' }, () => {
|
42
|
+
audioResponsePage.audioRecorderStyleLabel()
|
43
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
44
|
+
audioResponsePage.audioRecorderStyleDropdown()
|
45
|
+
.should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`)
|
46
|
+
.find('.dropdown-label-text')
|
47
|
+
.eq(0)
|
48
|
+
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
|
49
|
+
.verifyPseudoClassBeforeProperty('color', css.color.secondaryBtn);
|
50
|
+
});
|
51
|
+
|
52
|
+
//Note: a11y is covered for Audio Recorder Style section in HeaderSection file using verifya11yOfCreateItemWrapperContents
|
53
|
+
|
54
|
+
it('\'Audio Recorder Style\' label and dropdown should be displayed and in \'Audio Recorder Style\' dropdown \'Standard\' option should be selected by default', () => {
|
55
|
+
audioResponsePage.audioRecorderStyleLabel()
|
56
|
+
.verifyInnerText('Audio recorder style')
|
57
|
+
.should('be.visible');
|
58
|
+
audioResponsePage.audioRecorderStyleDropdown()
|
59
|
+
.verifyInnerText('Standard')
|
60
|
+
.should('be.visible');
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Clicking on \'Audio Recorder Style\' dropdown should open a list of 2 options - Standard, Minimal', () => {
|
64
|
+
cy.log('Expanding the Audio recorder style dropdown list');
|
65
|
+
audioResponsePage.audioRecorderStyleDropdown()
|
66
|
+
.click();
|
67
|
+
dropdownOptions.forEach((option, count) => {
|
68
|
+
audioResponsePage.audioRecorderStyleListOptions(count)
|
69
|
+
.verifyInnerText(option);
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
it('CSS of Audio Recorder Style dropdown in active state', { tags: 'css' }, () => {
|
74
|
+
audioResponsePage.audioRecorderStyleListOptions(0)
|
75
|
+
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
|
76
|
+
.should('have.css', 'background-color', css.color.liTextSelectedBg);
|
77
|
+
audioResponsePage.audioRecorderStyleListOptions(1)
|
78
|
+
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
|
79
|
+
.should('have.css', 'background-color', css.color.transparent);
|
80
|
+
});
|
81
|
+
|
82
|
+
it('Accessibility of Audio Recorder Style section in active state', { tags: 'a11y' }, () => {
|
83
|
+
cy.checkAccessibility(audioResponsePage.audioRecorderStyleList());
|
84
|
+
});
|
85
|
+
|
86
|
+
it('When the user clicks on the Audio Recorder Style dropdown menu then the dropdown menu should close', () => {
|
87
|
+
audioResponsePage.audioRecorderStyleListOptions(0)
|
88
|
+
.click();
|
89
|
+
audioResponsePage.audioRecorderStyleList()
|
90
|
+
.should('not.exist');
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When the user selects \'Standard\' option from Audio Recorder Style dropdown then \'Start recording\', \'Pause recording\', \'Stop recording\', \'Recording cue\' options should be displayed and be selected by default in \'Controls for recording response\' section and \'Play\', \'Pause\', \'Seek\', \'Volume control\' options should be displayed and be selected by default in \'Controls for response playback\' section and \'Recording overlay\' in \'Controls for recording response\' and \'Playback overlay\' options should not be displayed in \'Controls for response playback\' section', () => {
|
94
|
+
audioResponsePage.steps.expandCustomizeRecorderAndPlaybackControlsAccordion();
|
95
|
+
audioResponsePage.recordingOverlayOptionButton()
|
96
|
+
.should('not.exist');
|
97
|
+
audioResponsePage.playbackOverlayOptionButton()
|
98
|
+
.should('not.exist');
|
99
|
+
recordingResponseButtons.slice(0, 4).forEach((button) => {
|
100
|
+
button()
|
101
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
102
|
+
.and('be.visible')
|
103
|
+
.within(() => {
|
104
|
+
audioResponsePage.tickIconForOptionButtons()
|
105
|
+
.should('be.visible');
|
106
|
+
})
|
107
|
+
});
|
108
|
+
responsePlaybackButtons.slice(0, 4).forEach((button) => {
|
109
|
+
button()
|
110
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
111
|
+
.and('be.visible')
|
112
|
+
.within(() => {
|
113
|
+
audioResponsePage.tickIconForOptionButtons()
|
114
|
+
.should('be.visible');
|
115
|
+
})
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
it('CSS of options in \'Customize recorder and playback controls (for student player)\' section', { tags: 'css' }, () => {
|
120
|
+
cy.log('CSS of button background and button label')
|
121
|
+
audioResponsePage.startRecordingOptionButton()
|
122
|
+
.should('have.css', 'background-color', css.color.activeButtons)
|
123
|
+
.within(() => {
|
124
|
+
audioResponsePage.recorderAndPlaybackControlsOptionButtonLabel()
|
125
|
+
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.regular);
|
126
|
+
});
|
127
|
+
cy.log('CSS of tick icon of selected option button');
|
128
|
+
audioResponsePage.startRecordingOptionButton()
|
129
|
+
.find('[data-name="Icon feather-check"]')
|
130
|
+
.should('have.css', 'fill', css.color.activeButtons);
|
131
|
+
cy.log('CSS of background of tick icon of selected option button');
|
132
|
+
audioResponsePage.startRecordingOptionButton()
|
133
|
+
.find('.ngie-toggle-button-tick-icon')
|
134
|
+
.should('have.css', 'background-color', css.color.defaultBackground);
|
135
|
+
cy.log('CSS of selected option button icon');
|
136
|
+
audioResponsePage.startRecordingOptionButton()
|
137
|
+
.find('.ngie-toggle-button-icon svg')
|
138
|
+
.should('have.css', 'fill', css.color.primaryBtn);
|
139
|
+
});
|
140
|
+
|
141
|
+
it('Accessibility of options in \'Customize recorder and playback controls (for student player)\' section', { tags: 'a11y' }, () => {
|
142
|
+
cy.checkAccessibility(audioResponsePage.customizeRecorderAndPlaybackControlsSection());
|
143
|
+
});
|
144
|
+
|
145
|
+
it('When the user selects \'Minimal\' option from Audio Recorder Style dropdown then \'Recording overlay\' should be displayed in selected state in \'Controls for recording response\' section and \'Playback overlay\' should be displayed in selected state in \'Controls for response playback\' section', () => {
|
146
|
+
cy.log('Pre-step : Switching to Minimal recorder style');
|
147
|
+
audioResponsePage.steps.switchToMinimalRecorderStyle();
|
148
|
+
audioResponsePage.recordingOverlayOptionButton()
|
149
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
150
|
+
.and('be.visible')
|
151
|
+
.within(() => {
|
152
|
+
audioResponsePage.tickIconForOptionButtons()
|
153
|
+
.should('be.visible');
|
154
|
+
})
|
155
|
+
audioResponsePage.playbackOverlayOptionButton()
|
156
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
157
|
+
.and('be.visible')
|
158
|
+
.within(() => {
|
159
|
+
audioResponsePage.tickIconForOptionButtons()
|
160
|
+
.should('be.visible');
|
161
|
+
})
|
162
|
+
});
|
163
|
+
|
164
|
+
it('User should be able to deselect all options from \'Controls for recordings response\' and \'Controls for response playback\' section', () => {
|
165
|
+
recordingResponseButtons.forEach((button) => {
|
166
|
+
button().click()
|
167
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
168
|
+
.within(() => {
|
169
|
+
audioResponsePage.tickIconForOptionButtons()
|
170
|
+
.should('not.be.visible');
|
171
|
+
});
|
172
|
+
});
|
173
|
+
responsePlaybackButtons.forEach((button) => {
|
174
|
+
button().click()
|
175
|
+
.should('have.class', 'ngie-toggle-button-not-selected')
|
176
|
+
.within(() => {
|
177
|
+
audioResponsePage.tickIconForOptionButtons()
|
178
|
+
.should('not.be.visible');
|
179
|
+
});
|
180
|
+
});
|
181
|
+
});
|
182
|
+
|
183
|
+
it('CSS of deselected options in \'Customize recorder and playback controls (for student player)\' section', { tags: 'css' }, () => {
|
184
|
+
cy.log('CSS of deselected option button label and background')
|
185
|
+
audioResponsePage.startRecordingOptionButton()
|
186
|
+
.should('have.css', 'background-color', css.color.defaultBackground)
|
187
|
+
.and('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`)
|
188
|
+
.within(() => {
|
189
|
+
audioResponsePage.recorderAndPlaybackControlsOptionButtonLabel()
|
190
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
|
191
|
+
});
|
192
|
+
|
193
|
+
cy.log('CSS of deselected option button icon')
|
194
|
+
audioResponsePage.startRecordingOptionButton()
|
195
|
+
.find('.ngie-toggle-button-icon svg')
|
196
|
+
.should('have.css', 'fill', css.color.secondaryBtn);
|
197
|
+
});
|
198
|
+
|
199
|
+
it('Accessibility of deselected options in \'Customize recorder and playback controls (for student player)\' section', { tags: 'a11y' }, () => {
|
200
|
+
cy.checkAccessibility(audioResponsePage.customizeRecorderAndPlaybackControlsSection());
|
201
|
+
});
|
202
|
+
});
|
203
|
+
|
204
|
+
describe('\'Maximum recorder length\': Edit tab ', () => {
|
205
|
+
abortEarlySetup();
|
206
|
+
before(() => {
|
207
|
+
cy.log('Navigating to Audio Response question type');
|
208
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
209
|
+
});
|
210
|
+
|
211
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthLabelAndInputField();
|
212
|
+
|
213
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthSectionCSS();
|
214
|
+
|
215
|
+
//Note: a11y is covered for Maximum recorder length section in HeaderSection file using verifyA11yOfCreateItemWrapperContents
|
216
|
+
|
217
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthInputFieldErrorMessages();
|
218
|
+
|
219
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthCharacterAcceptanceCriteria();
|
220
|
+
|
221
|
+
it('When user tries to add a value greater than 3600 it should be automatically set back to 3600 and should not allow to add greater than set value', () => {
|
222
|
+
audioResponsePage.steps.setMaximumRecorderLength('9999');
|
223
|
+
audioResponsePage.steps.verifyMaximumRecorderLength('3600');
|
224
|
+
});
|
225
|
+
|
226
|
+
it('When the maximum recorder length value is updated in edit tab, it should be reflected in the preview tab', () => {
|
227
|
+
audioResponsePage.steps.setMaximumRecorderLength('3600');
|
228
|
+
cy.log('Switching to Preview tab');
|
229
|
+
audioResponsePage.steps.switchToPreviewTab();
|
230
|
+
audioResponsePage.previewMaxRecordTime()
|
231
|
+
.verifyInnerText('1:00:00')
|
232
|
+
});
|
233
|
+
});
|
234
|
+
|
235
|
+
describe('\'Maximum recorder length\': Preview tab', () => {
|
236
|
+
abortEarlySetup();
|
237
|
+
before(() => {
|
238
|
+
cy.log('Navigating to audio response question type');
|
239
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
240
|
+
audioResponsePage.steps.switchToPreviewTab();
|
241
|
+
});
|
242
|
+
|
243
|
+
it('By default, maximum recorder length (15 minutes) should be displayed in minutes(mm:ss) format', () => {
|
244
|
+
audioResponsePage.previewMaxRecordTime()
|
245
|
+
.verifyInnerText('15:00')
|
246
|
+
});
|
247
|
+
|
248
|
+
it('When the maximum recorder length value is updated in edit tab, it should be reflected in the preview tab', () => {
|
249
|
+
audioResponsePage.steps.switchToEditTab();
|
250
|
+
audioResponsePage.steps.setMaximumRecorderLength('3600');
|
251
|
+
cy.log('Switching to Preview tab');
|
252
|
+
audioResponsePage.steps.switchToPreviewTab();
|
253
|
+
audioResponsePage.previewMaxRecordTime()
|
254
|
+
.verifyInnerText('1:00:00')
|
255
|
+
});
|
256
|
+
});
|
257
|
+
|
258
|
+
describe('\'Stop recording if silence is detected after\' Section', () => {
|
259
|
+
abortEarlySetup();
|
260
|
+
before(() => {
|
261
|
+
cy.log('Navigating to Audio Response question type');
|
262
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
263
|
+
});
|
264
|
+
|
265
|
+
it('\'Stop recording if silence is detected after\' label, input field and \'Secs\' text should be displayed. By default \'Stop recording if silence is detected after\' input field should be empty', () => {
|
266
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedLabel()
|
267
|
+
.verifyInnerText('Stop recording if silence is detected after')
|
268
|
+
.should('be.visible');
|
269
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
|
270
|
+
.should('be.visible')
|
271
|
+
.and('have.attr', 'value', '');
|
272
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputFieldSecsSuffix()
|
273
|
+
.verifyInnerText('Secs')
|
274
|
+
.should('be.visible');
|
275
|
+
});
|
276
|
+
|
277
|
+
it('CSS of \'Stop recording if silence is detected after\' section', { tags: 'css' }, () => {
|
278
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedLabel()
|
279
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
280
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
|
281
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
282
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputFieldSecsSuffix()
|
283
|
+
.parents('.stop-recording-on-silence-time-input-field')
|
284
|
+
.find('.css-igs3ac')
|
285
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
286
|
+
});
|
287
|
+
|
288
|
+
//Note: a11y is covered for Stop recording if silence is detected after section in HeaderSection file using verifya11yOfCreateItemWrapperContents
|
289
|
+
|
290
|
+
it('When the user has set \'Stop recording if silence is detected after\' value to \'0\' (zero) then a validation text \'Error: Value must be greater than 0 secs.\' should be displayed and once the user updates the \'Stop recording if silence is detected after\' value the validation text should disappear. User should be able to add only numeric values and should not able to add decimal points', () => {
|
291
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('0');
|
292
|
+
audioResponsePage.errorMessage()
|
293
|
+
.verifyInnerText('Error: Value must be greater than 0 secs.');
|
294
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('150');
|
295
|
+
audioResponsePage.errorMessage()
|
296
|
+
.should('not.exist');
|
297
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('.10.0');
|
298
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
|
299
|
+
.should('have.attr', 'value', '100');
|
300
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('!@#abcde236');
|
301
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
|
302
|
+
.should('have.attr', 'value', '236');
|
303
|
+
});
|
304
|
+
|
305
|
+
it('CSS of \'Stop recording if silence is detected after\' with error message \'Error: Value must be greater than 0 secs.\'', () => {
|
306
|
+
cy.log('Pre-step: Setting Stop recording if silence is detected after to 0');
|
307
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('0');
|
308
|
+
audioResponsePage.errorMessage()
|
309
|
+
.verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
|
310
|
+
cy.log('Post-step: Setting Stop recording if silence is detected after to 100');
|
311
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('100');
|
312
|
+
});
|
313
|
+
|
314
|
+
it('Accessibility of \'Stop recording if silence is detected after\' when \'Error: Value must be greater than 0 secs.\' is displayed', () => {
|
315
|
+
cy.log('Pre-step: Setting Stop recording if silence is detected after to 0');
|
316
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('0');
|
317
|
+
cy.checkAccessibility(audioResponsePage.errorMessage());
|
318
|
+
cy.log('Post-step: Setting Stop recording if silence is detected after to 100');
|
319
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('100');
|
320
|
+
});
|
321
|
+
|
322
|
+
it('When user focuses in \'Stop recording if silence is detected after\' and focuses out without entering any value, or entering a value greater than \'Maximum recorder length\' input field, no error should be displayed', () => {
|
323
|
+
audioResponsePage.stopRecordingIfSilenceIsDetectedInputField()
|
324
|
+
.clear()
|
325
|
+
.blur();
|
326
|
+
audioResponsePage.errorMessage()
|
327
|
+
.should('not.exist');
|
328
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('4000');
|
329
|
+
audioResponsePage.errorMessage()
|
330
|
+
.should('not.exist');
|
331
|
+
});
|
332
|
+
|
333
|
+
it('When silence is detected for more than value set in \'Stop recording if silence is detected after\' input field during recording, the recorder should stop automatically by the system and the recording should get saved', () => {
|
334
|
+
audioResponsePage.steps.setStopRecordingIfSilenceIsDetectedAfter('5');
|
335
|
+
cy.log('Switching to Preview tab');
|
336
|
+
audioResponsePage.steps.switchToPreviewTab();
|
337
|
+
audioResponsePage.standardPreviewStartRecordingButton()
|
338
|
+
.click();
|
339
|
+
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
340
|
+
audioResponsePage.standardPreviewPlayerHelpText()
|
341
|
+
.should('be.visible')
|
342
|
+
.verifyInnerText('Your response has been recorded');
|
343
|
+
audioResponsePage.previewPlayPlaybackButton()
|
344
|
+
.should('not.have.attr', 'disabled');
|
345
|
+
audioResponsePage.standardPreviewRecordTime()
|
346
|
+
.verifyInnerText('00:05');
|
347
|
+
});
|
348
|
+
});
|
349
|
+
});
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { audioResponsePage, dialogBoxBase } from "../../../pages";
|
3
|
+
import { commonComponents } from "../../../pages/components";
|
4
|
+
|
5
|
+
describe('Create question page - Audio Response: Header section and Saving question', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Header section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
14
|
+
});
|
15
|
+
|
16
|
+
audioResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Audio response');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Tabs section', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
23
|
+
});
|
24
|
+
|
25
|
+
audioResponsePage.tests.verifyTabsSection();
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Cancel button', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
32
|
+
});
|
33
|
+
|
34
|
+
audioResponsePage.tests.verifyCancelButton('audio response');
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('Save Question button', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
before(() => {
|
40
|
+
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
});
|
43
|
+
|
44
|
+
describe('Validation error messages', () => {
|
45
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
46
|
+
|
47
|
+
it('Validation error messages should be displayed below required input fields', () => {
|
48
|
+
audioResponsePage.questionInstructionsLabelEditTab()
|
49
|
+
.parents('.edit-question-instruction-wrapper')
|
50
|
+
.within(() => {
|
51
|
+
commonComponents.errorMessage()
|
52
|
+
.verifyInnerText('Error: Question instructions are required.')
|
53
|
+
.and('be.visible');
|
54
|
+
});
|
55
|
+
audioResponsePage.pleaseEnterPointsErrorMessage()
|
56
|
+
.verifyInnerText('Error: Please enter points.');
|
57
|
+
});
|
58
|
+
|
59
|
+
it('Validation error messages should disappear when required input fields are filled', () => {
|
60
|
+
audioResponsePage.steps.addQuestionInstructions();
|
61
|
+
audioResponsePage.questionInstructionsLabelEditTab()
|
62
|
+
.parents('.edit-question-instruction-wrapper')
|
63
|
+
.within(() => {
|
64
|
+
commonComponents.errorMessage()
|
65
|
+
.should('not.exist');
|
66
|
+
});
|
67
|
+
audioResponsePage.steps.allotPoints(20);
|
68
|
+
audioResponsePage.pleaseEnterPointsErrorMessage()
|
69
|
+
.should('not.exist');
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
describe('Saving a question', () => {
|
74
|
+
it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
75
|
+
audioResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
76
|
+
});
|
77
|
+
audioResponsePage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
|
78
|
+
});
|
79
|
+
});
|
80
|
+
});
|