itemengine-cypress-automation 1.0.131-updateILCrepo6March-02c78d1.0 → 1.0.132
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +3 -6
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +2 -4
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +3 -7
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +154 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +170 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneSettings.js +335 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +76 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +8 -8
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +341 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettingsForGroupedLayout.js +241 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +3 -3
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +350 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +356 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +402 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +4 -4
- package/cypress/e2e/ILC/SimpleCalculator/editTabFunctionality.js +242 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +11 -16
- package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +4 -6
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +3 -4
- package/cypress/fixtures/theme/ilc.json +2 -0
- package/cypress/pages/audioResponsePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +35 -5
- package/cypress/pages/components/imageCanvasComponent.js +1 -1
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/questionInputFieldComponent.js +31 -0
- package/cypress/pages/components/responseAreaSettingsPopupComponent.js +74 -0
- package/cypress/pages/drawingResponsePage.js +1 -1
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +318 -62
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -26
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +24 -1
- package/cypress/pages/simpleCalculatorPage.js +140 -10
- package/cypress/pages/textEntryMathPage.js +3 -2
- package/package.json +2 -2
@@ -236,10 +236,9 @@ describe('Preview of Audio response for bar audio recorder style', () => {
|
|
236
236
|
utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
|
237
237
|
utilities.verifyElementVisibilityState(audioResponsePage.barPreviewRetakeButton(), 'visible');
|
238
238
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
|
239
|
-
utilities.verifyElementVisibilityState(audioResponsePage.previewVolumeMeter(), 'visible');
|
240
239
|
utilities.verifyElementVisibilityState(audioResponsePage.barPreviewPlaybackTime(), 'visible');
|
241
240
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
|
242
|
-
audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:
|
241
|
+
audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:00', '00:10');
|
243
242
|
});
|
244
243
|
});
|
245
244
|
|
@@ -386,7 +385,6 @@ describe('Preview of Audio response for bar audio recorder style', () => {
|
|
386
385
|
|
387
386
|
it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
|
388
387
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
389
|
-
audioResponsePage.steps.addWaitToPlayAudio(1000);
|
390
388
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
391
389
|
});
|
392
390
|
|
@@ -394,12 +392,11 @@ describe('Preview of Audio response for bar audio recorder style', () => {
|
|
394
392
|
audioResponsePage.steps.pausePlayback();
|
395
393
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
396
394
|
audioResponsePage.steps.startPlayback();
|
397
|
-
audioResponsePage.steps.addWaitToPlayAudio(5000);
|
398
395
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
399
396
|
});
|
400
397
|
|
401
398
|
it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
|
402
|
-
audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:
|
399
|
+
audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:10', '00:10');
|
403
400
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
|
404
401
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
|
405
402
|
audioResponsePage.steps.verifyProgressBarSliderPosition(99);
|
@@ -484,7 +481,7 @@ describe('Preview of Audio response for bar audio recorder style', () => {
|
|
484
481
|
it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
|
485
482
|
audioResponsePage.steps.retakeRecordingBarPreview();
|
486
483
|
audioResponsePage.steps.confirmRetake();
|
487
|
-
audioResponsePage.steps.verifyRecordingTimeBarPreview('00:
|
484
|
+
audioResponsePage.steps.verifyRecordingTimeBarPreview('00:05', '00:10');
|
488
485
|
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
489
486
|
utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
|
490
487
|
});
|
@@ -219,6 +219,7 @@ describe('Preview of Audio response for compact audio recorder style', () => {
|
|
219
219
|
audioResponsePage.steps.switchToEditTab();
|
220
220
|
audioResponsePage.steps.setMaximumRecorderLength(5);
|
221
221
|
audioResponsePage.steps.switchToPreviewTab();
|
222
|
+
audioResponsePage.steps.startRecordingCompactPreview();
|
222
223
|
audioResponsePage.steps.waitForRecordingToStartCompactPreview();
|
223
224
|
cy.log('Starting a recording and letting it record until Maximum recording length is reached');
|
224
225
|
audioResponsePage.steps.verifyResponseIsRecordedHelpText();
|
@@ -376,7 +377,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
|
|
376
377
|
|
377
378
|
it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
|
378
379
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
379
|
-
audioResponsePage.steps.addWaitToPlayAudio(1000);
|
380
380
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
381
381
|
});
|
382
382
|
|
@@ -384,7 +384,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
|
|
384
384
|
audioResponsePage.steps.pausePlaybackCompactPreview();
|
385
385
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
386
386
|
audioResponsePage.steps.startPlaybackCompactPreview();
|
387
|
-
audioResponsePage.steps.addWaitToPlayAudio(5000);
|
388
387
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
389
388
|
});
|
390
389
|
|
@@ -450,7 +449,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
|
|
450
449
|
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
451
450
|
cy.barsPreLoaderWait();
|
452
451
|
audioResponsePage.steps.selectAudioRecorderStyle('Compact');
|
453
|
-
audioResponsePage.steps.setMaximumRecorderLength(10);
|
454
452
|
audioResponsePage.steps.switchToPreviewTab();
|
455
453
|
audioResponsePage.steps.recordAndSaveAudioCompactPreview(10000);
|
456
454
|
});
|
@@ -475,7 +473,7 @@ describe('Preview of Audio response for compact audio recorder style', () => {
|
|
475
473
|
it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
|
476
474
|
audioResponsePage.steps.retakeRecordingCompactPreview();
|
477
475
|
audioResponsePage.steps.confirmRetake();
|
478
|
-
audioResponsePage.steps.verifyRecordingTimeCompactPreview('00:
|
476
|
+
audioResponsePage.steps.verifyRecordingTimeCompactPreview('00:04', '15:00');
|
479
477
|
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
480
478
|
utilities.verifyInnerText(audioResponsePage.compactPreviewRecordingStatusText(), 'Recording...');
|
481
479
|
});
|
@@ -84,7 +84,7 @@ describe('Preview of Audio response for standard audio recorder style', () => {
|
|
84
84
|
audioResponsePage.steps.resetQuestionPreview();
|
85
85
|
audioResponsePage.steps.startRecordingStandardPreview();
|
86
86
|
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
87
|
-
utilities.verifyCSS(audioResponsePage.recordingMicIcon()
|
87
|
+
utilities.verifyCSS(audioResponsePage.recordingMicIcon(), {
|
88
88
|
'fill': css.color.microphoneIcon
|
89
89
|
});
|
90
90
|
utilities.verifyCSS(audioResponsePage.recordingStatusText(), {
|
@@ -254,7 +254,6 @@ describe('Preview of Audio response for standard audio recorder style', () => {
|
|
254
254
|
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:00', '00:04');
|
255
255
|
});
|
256
256
|
|
257
|
-
//Failing due to https://redmine.zeuslearning.com/issues/560794
|
258
257
|
it('When recording is inprogress and user has reached maximum recorder length, \'Your response has been recorded\' message should be displayed below mic icon. Retake and Play icon should be displayed along with progress bar. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'. Volume meter should not be displayed in player', () => {
|
259
258
|
audioResponsePage.steps.switchToEditTab();
|
260
259
|
audioResponsePage.steps.setMaximumRecorderLength(10);
|
@@ -262,14 +261,13 @@ describe('Preview of Audio response for standard audio recorder style', () => {
|
|
262
261
|
audioResponsePage.steps.startRecordingStandardPreview();
|
263
262
|
audioResponsePage.steps.waitForRecordingToStartStandardPreview();
|
264
263
|
cy.log('Response will keep recording until maximum recording length of 10 seconds is reached');
|
265
|
-
utilities.verifyInnerText(audioResponsePage.standardPreviewRecorderHelpText(), 'Recording...');
|
266
264
|
audioResponsePage.steps.verifyResponseIsRecordedHelpText();
|
267
265
|
utilities.verifyElementVisibilityState(audioResponsePage.standardPreviewRetakeButton(), 'visible');
|
268
266
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
|
269
267
|
utilities.verifyElementVisibilityState(audioResponsePage.previewVolumeMeter(), 'visible');
|
270
268
|
utilities.verifyElementVisibilityState(audioResponsePage.standardPreviewPlaybackTime(), 'visible');
|
271
269
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
|
272
|
-
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:
|
270
|
+
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:00', '00:10');
|
273
271
|
});
|
274
272
|
});
|
275
273
|
|
@@ -420,7 +418,6 @@ describe('Preview of Audio response for standard audio recorder style', () => {
|
|
420
418
|
|
421
419
|
it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
|
422
420
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
423
|
-
audioResponsePage.steps.addWaitToPlayAudio(1000);
|
424
421
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
425
422
|
});
|
426
423
|
|
@@ -428,12 +425,11 @@ describe('Preview of Audio response for standard audio recorder style', () => {
|
|
428
425
|
audioResponsePage.steps.pausePlayback();
|
429
426
|
audioResponsePage.steps.seekProgressBarSliderToCenter();
|
430
427
|
audioResponsePage.steps.startPlayback();
|
431
|
-
audioResponsePage.steps.addWaitToPlayAudio(5000);
|
432
428
|
audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
|
433
429
|
});
|
434
430
|
|
435
431
|
it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
|
436
|
-
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:
|
432
|
+
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:10', '00:10');
|
437
433
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
|
438
434
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
|
439
435
|
audioResponsePage.steps.verifyProgressBarSliderPosition(99);
|
@@ -21,6 +21,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
21
21
|
abortEarlySetup();
|
22
22
|
before(() => {
|
23
23
|
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
24
|
+
cy.barsPreLoaderWait();
|
24
25
|
});
|
25
26
|
|
26
27
|
it('By default \'Customize formatting options\' accordion should be collapsed and by clicking on the \'Customize formatting options (for student player)\' accordion, user should be able to expand the accordion', () => {
|
@@ -117,6 +118,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
|
|
117
118
|
abortEarlySetup();
|
118
119
|
before(() => {
|
119
120
|
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
121
|
+
cy.barsPreLoaderWait();
|
120
122
|
});
|
121
123
|
|
122
124
|
it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab}`, () => {
|
@@ -0,0 +1,154 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const fontSizeDropdownOptions = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
|
7
|
+
const fontSizes = ['12px', '14px', '16px', '18px', '22px', '26px'];
|
8
|
+
|
9
|
+
describe('Create item page - Fill in the gaps with drag and drop: Additional Settings accordion', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional Settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsDragAndDropPage.tests.verifyAdditonalSettingsAccordionProperties();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Additional settings: Font size contents', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
fillInTheGapsDragAndDropPage.tests.verifyFontSizeSectionContents();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional settings: Font size functionality edit tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
fillInTheGapsDragAndDropPage.steps.addQuestionInstructions();
|
41
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
42
|
+
});
|
43
|
+
|
44
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
45
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
|
46
|
+
fillInTheGapsDragAndDropPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
47
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.fontSizeDropdown(), `${option}`);
|
48
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.optionContainerOptionsSpecifyCorrectAnswerSection(), {
|
49
|
+
'font-size': fontSizes[fontsIndex]
|
50
|
+
});
|
51
|
+
});
|
52
|
+
});
|
53
|
+
});
|
54
|
+
|
55
|
+
describe('Additional settings: Font size functionality preview tab', () => {
|
56
|
+
abortEarlySetup();
|
57
|
+
before(() => {
|
58
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
59
|
+
cy.barsPreLoaderWait();
|
60
|
+
fillInTheGapsDragAndDropPage.steps.addQuestionInstructions();
|
61
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves']);
|
62
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1 });
|
63
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
64
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
65
|
+
});
|
66
|
+
|
67
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
68
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
|
69
|
+
fillInTheGapsDragAndDropPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
70
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.fontSizeDropdown(), `${option}`);
|
71
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
72
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.questionInstructionsText(), {
|
73
|
+
'font-size': fontSizes[fontsIndex]
|
74
|
+
});
|
75
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.questionContainerPreviewTab(), {
|
76
|
+
'font-size': fontSizes[fontsIndex]
|
77
|
+
});
|
78
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.optionContainerOptionsPreviewTab(), {
|
79
|
+
'font-size': fontSizes[fontsIndex]
|
80
|
+
});
|
81
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
82
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.dropzoneNumeration(), {
|
83
|
+
'font-size': fontSizes[fontsIndex]
|
84
|
+
});
|
85
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswersLabel(), {
|
86
|
+
'font-size': fontSizes[fontsIndex]
|
87
|
+
});
|
88
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswersNumeration(), {
|
89
|
+
'font-size': fontSizes[fontsIndex]
|
90
|
+
});
|
91
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswersOptions(), {
|
92
|
+
'font-size': fontSizes[fontsIndex]
|
93
|
+
});
|
94
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
95
|
+
});
|
96
|
+
});
|
97
|
+
});
|
98
|
+
|
99
|
+
describe('Setting tab: Accessibility section', () => {
|
100
|
+
abortEarlySetup();
|
101
|
+
before(() => {
|
102
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
103
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
104
|
+
});
|
105
|
+
|
106
|
+
it('When the user expands additional settings accordion then \'Accessibility\' label should be displayed', () => {
|
107
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.accessibilityLabel(), 'Accessibility');
|
108
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.accessibilityLabel(), 'visible');
|
109
|
+
});
|
110
|
+
|
111
|
+
it('In \'Accessibility\' section, \'Flag this question as non-accessible\' label with checkbox should be displayed and it should be unchecked by default', () => {
|
112
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.flagNonAccessibleCheckbox(), 'exist');
|
113
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.flagNonAccessibleLabel(), 'Flag this question as non-accessible');
|
114
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.flagNonAccessibleLabel(), 'visible');
|
115
|
+
fillInTheGapsDragAndDropPage.steps.verifyFlagThisItemNonAccessibleCheckboxIsUnchecked();
|
116
|
+
});
|
117
|
+
|
118
|
+
|
119
|
+
it('User should be able to check the \'Flag this question as non-accessible\' checkbox', () => {
|
120
|
+
fillInTheGapsDragAndDropPage.steps.checkFlagThisItemNonAccessibleCheckbox();
|
121
|
+
});
|
122
|
+
|
123
|
+
it('CSS of \'Accessibility\' section', { tags: 'css' }, () => {
|
124
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.accessibilityLabel(), {
|
125
|
+
'color': css.color.labels,
|
126
|
+
'font-size': css.fontSize.default,
|
127
|
+
'font-weight': css.fontWeight.semibold
|
128
|
+
});
|
129
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.flagNonAccessibleLabel(), {
|
130
|
+
'color': css.color.labelText,
|
131
|
+
'font-size': css.fontSize.normal,
|
132
|
+
'font-weight': css.fontWeight.regular
|
133
|
+
});
|
134
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.flagNonAccessibleCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
|
135
|
+
'fill': css.color.activeButtons
|
136
|
+
});
|
137
|
+
});
|
138
|
+
|
139
|
+
it('Accessibility of checked \'Flag this question as non-accessible\' checkbox and \'Alternate accessible item id\' input field', { tags: 'a11y' }, () => {
|
140
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.flagNonAccessibleCheckbox());
|
141
|
+
});
|
142
|
+
});
|
143
|
+
|
144
|
+
describe('Additional Settings: Details section', () => {
|
145
|
+
abortEarlySetup();
|
146
|
+
before(() => {
|
147
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');;
|
148
|
+
cy.barsPreLoaderWait();
|
149
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
150
|
+
});
|
151
|
+
|
152
|
+
fillInTheGapsDragAndDropPage.tests.verifyDetailsSection();
|
153
|
+
});
|
154
|
+
});
|
@@ -0,0 +1,170 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
2
|
+
import utilities from "../../../support/helpers/utilities";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page - Fill in the gaps with text: Dropzone level alternate answer popup', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Dropzone level alternate answer popup - Edit tab', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
fillInTheGapsDragAndDropPage.steps.addOption();
|
17
|
+
fillInTheGapsDragAndDropPage.steps.addOption();
|
18
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
|
19
|
+
});
|
20
|
+
|
21
|
+
it('By default a disabled \'Add alternate\' button should be displayed besides each dropzone in specify correct answer section', () => {
|
22
|
+
fillInTheGapsDragAndDropPage.steps.verifyDefaultAddAlternateAnswerButtonIsDisplayed(0);
|
23
|
+
fillInTheGapsDragAndDropPage.steps.verifyDefaultAddAlternateAnswerButtonIsDisplayed(1);
|
24
|
+
});
|
25
|
+
|
26
|
+
it('CSS of disabled \'Add alternate\' button', { tags: 'css' }, () => {
|
27
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), {
|
28
|
+
'color': css.color.secondaryBtnDisabled,
|
29
|
+
'font-size': css.fontSize.default,
|
30
|
+
'font-weight': css.fontWeight.regular
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
it('Accessibility of of disabled \'Add alternate\' button', { tags: 'css' }, () => {
|
35
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer());
|
36
|
+
});
|
37
|
+
|
38
|
+
it('When the user drops an option in the dropzone, then \'Add alternate\' button should be enabled', () => {
|
39
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
40
|
+
utilities.verifyElementNotDisabled(utilities.getNthElement(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), 0));
|
41
|
+
utilities.verifyElementDisabled(utilities.getNthElement(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), 1));
|
42
|
+
});
|
43
|
+
|
44
|
+
it('CSS of enabled \'Add alternate\' button', { tags: 'css' }, () => {
|
45
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), {
|
46
|
+
'color': css.color.secondaryBtnActive,
|
47
|
+
'font-size': css.fontSize.default,
|
48
|
+
'font-weight': css.fontWeight.regular
|
49
|
+
});
|
50
|
+
});
|
51
|
+
|
52
|
+
it('Accessibility of of enabled \'Add alternate\' button', { tags: 'css' }, () => {
|
53
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer());
|
54
|
+
});
|
55
|
+
|
56
|
+
it('When the user clicks on \'Add alternate\' button of a dropzone, then a popup should be displayed with the title \'Dropzone # alternate answer(s)\' and help text \'Select alternate answer(s).\'', () => {
|
57
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(0);
|
58
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupTitle(), 'Dropzone 1 alternate answer(s)');
|
59
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopupTitle(), 'visible');
|
60
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupHelpText(), 'Select alternate answer(s).');
|
61
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopupHelpText(), 'visible');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('The \'Dropzone # alternate answer(s)\' popup should display all the draggable options, except for the one already placed in the corresponding drop zone', () => {
|
65
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAlternateAnswerPopupOptions(['Leaves', 'Roots', 'Stem']);
|
66
|
+
});
|
67
|
+
|
68
|
+
it('User should be able to select an option by clicking on it', () => {
|
69
|
+
fillInTheGapsDragAndDropPage.steps.selectAlternateAnswerInAlternateAnswerPopup(['Leaves']);
|
70
|
+
});
|
71
|
+
|
72
|
+
it('User should be able to deselect an option by clicking on it', () => {
|
73
|
+
fillInTheGapsDragAndDropPage.steps.deselectAlternateAnswerInAlternateAnswerPopup(['Leaves']);
|
74
|
+
});
|
75
|
+
|
76
|
+
it('User should be able to select multiple alternate answer options in the dropzone level alternate answer popup', () => {
|
77
|
+
fillInTheGapsDragAndDropPage.steps.selectAlternateAnswerInAlternateAnswerPopup(['Leaves', 'Roots']);
|
78
|
+
});
|
79
|
+
|
80
|
+
it('\'Save\' and \'Cancel\' button should be displayed in the popup', () => {
|
81
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupCancelButton(), 'Cancel');
|
82
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopupCancelButton(), 'visible');
|
83
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupSaveButton(), 'Save');
|
84
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopupSaveButton(), 'visible');
|
85
|
+
});
|
86
|
+
|
87
|
+
it('When the user clicks on \'Cancel\' button, then popup should be closed and the changes made by the user should not be saved', () => {
|
88
|
+
fillInTheGapsDragAndDropPage.steps.CancelDropzoneAlternateAnswersPopup();
|
89
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopup(), 'notExist');
|
90
|
+
});
|
91
|
+
|
92
|
+
it('When the user has selected alternate options in the popup and clicks on \'Save\' button, then popup should be closed and the number of selected alternate options should be displayed beside the \'Add alternate\' button in the format \'# selected\'', () => {
|
93
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(0);
|
94
|
+
fillInTheGapsDragAndDropPage.steps.selectAlternateAnswerInAlternateAnswerPopup(['Leaves']);
|
95
|
+
fillInTheGapsDragAndDropPage.steps.saveSelectedAlternateAnswers();
|
96
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.selectedAlternateAnswerCountSpecifyCorrectAnswer(), '1 selected');
|
97
|
+
});
|
98
|
+
|
99
|
+
it('User should be able to change the selected alternate options and the number of selected alternate options should be updated accordingly', () => {
|
100
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(0);
|
101
|
+
fillInTheGapsDragAndDropPage.steps.selectAlternateAnswerInAlternateAnswerPopup(['Roots']);
|
102
|
+
fillInTheGapsDragAndDropPage.steps.saveSelectedAlternateAnswers();
|
103
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.selectedAlternateAnswerCountSpecifyCorrectAnswer(), '2 selected');
|
104
|
+
});
|
105
|
+
|
106
|
+
it('CSS of dropzone level alternate answer popup', { tags: 'css' }, () => {
|
107
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.selectedAlternateAnswerCountSpecifyCorrectAnswer(), {
|
108
|
+
'color': css.color.alternateAnswerCount,
|
109
|
+
'font-size': css.fontSize.default,
|
110
|
+
'font-weight': css.fontWeight.regular
|
111
|
+
});
|
112
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(0);
|
113
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupTitle(), {
|
114
|
+
'color': css.color.flyoutTitle,
|
115
|
+
'font-size': css.fontSize.heading,
|
116
|
+
'font-weight': css.fontWeight.semibold
|
117
|
+
});
|
118
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupHelpText(), {
|
119
|
+
'color': css.color.helperText,
|
120
|
+
'font-size': css.fontSize.normal,
|
121
|
+
'font-weight': css.fontWeight.normal,
|
122
|
+
'font-style': 'italic'
|
123
|
+
});
|
124
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupOptions().eq(0), {
|
125
|
+
'color': css.color.activeButtons,
|
126
|
+
'font-size': css.fontSize.default,
|
127
|
+
'font-weight': css.fontWeight.regular,
|
128
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
129
|
+
});
|
130
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupOptions().eq(2), {
|
131
|
+
'color': css.color.unselectedOptionText,
|
132
|
+
'font-size': css.fontSize.default,
|
133
|
+
'font-weight': css.fontWeight.regular,
|
134
|
+
'border': `1px solid ${css.color.draggableOptionBorder}`
|
135
|
+
});
|
136
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupCancelButton(), {
|
137
|
+
'color': css.color.whiteText,
|
138
|
+
'font-size': css.fontSize.default,
|
139
|
+
'font-weight': css.fontWeight.semibold,
|
140
|
+
'background-color': css.color.primaryBtnBg
|
141
|
+
});
|
142
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.alternateAnswerPopupSaveButton(), {
|
143
|
+
'color': css.color.secondaryBtn,
|
144
|
+
'font-size': css.fontSize.default,
|
145
|
+
'font-weight': css.fontWeight.semibold,
|
146
|
+
'background-color': css.color.transparent
|
147
|
+
});
|
148
|
+
});
|
149
|
+
|
150
|
+
it('Accessibility of dropzone level alternate answer popup', { tags: 'css' }, () => {
|
151
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.alternateAnswerPopup());
|
152
|
+
});
|
153
|
+
|
154
|
+
it('When user opens the alternate answer popup for another dropzone, then alternate answer popup with the title and options as per the corresponding dropzone should be displayed', () => {
|
155
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Leaves': 1 });
|
156
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(1);
|
157
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupTitle(), 'Dropzone 2 alternate answer(s)');
|
158
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.alternateAnswerPopupHelpText(), 'Select alternate answer(s).');
|
159
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAlternateAnswerPopupOptions(['Petals', 'Roots', 'Stem']);
|
160
|
+
cy.log('Post-step: Close the alternate answers popup');
|
161
|
+
fillInTheGapsDragAndDropPage.steps.CancelDropzoneAlternateAnswersPopup();
|
162
|
+
});
|
163
|
+
|
164
|
+
it('When user removes the option from the dropzone, then the add alternate button should be disabled again', () => {
|
165
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
|
166
|
+
utilities.verifyElementDisabled(utilities.getNthElement(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), 0));
|
167
|
+
utilities.verifyElementNotDisabled(utilities.getNthElement(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), 1));
|
168
|
+
});
|
169
|
+
});
|
170
|
+
});
|