itemengine-cypress-automation 1.0.185-repoUpdate26April-b17eb46.0 → 1.0.185
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 +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +8 -5
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +28 -417
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +1 -29
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -11
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +1 -57
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +1 -2
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +1 -49
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +1 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +1 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +1 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +1 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +2 -1
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +4 -5
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +7 -6
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +18 -20
- package/cypress/pages/audioPlayerPage.js +504 -274
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
- package/cypress/pages/components/commonComponents.js +0 -1
- package/cypress/pages/components/draggableOptionContainer.js +0 -1
- package/cypress/pages/components/equationEditorFlyout.js +2 -3
- package/cypress/pages/components/essayResponseCommonComponents.js +2 -8
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +0 -1
- package/cypress/pages/components/imageCanvasComponent.js +1 -2
- package/cypress/pages/components/index.js +0 -3
- package/cypress/pages/components/optionsWrapperComponent.js +2 -13
- package/cypress/pages/components/playbackControlsBaseComponent.js +13 -20
- package/cypress/pages/components/toolSettingsComponent.js +0 -6
- package/cypress/pages/contentBlocksPage.js +2 -18
- package/cypress/pages/createItemPage.js +8 -75
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +4 -24
- package/cypress/pages/feedbackScalePage.js +0 -3
- package/cypress/pages/graphingPage.js +1 -19
- package/cypress/pages/gridFillPage.js +8 -25
- package/cypress/pages/index.js +1 -2
- package/cypress/pages/itemPreviewSettingsPage.js +0 -4
- package/cypress/pages/listOrderingPage.js +557 -435
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +1 -23
- package/cypress/pages/numberLinePage.js +132 -1370
- package/cypress/pages/rulerPage.js +2 -6
- package/cypress/pages/textSelectionPage.js +23 -461
- package/package.json +1 -1
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +0 -79
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +0 -345
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +0 -429
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +0 -162
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +0 -489
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +0 -313
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +0 -230
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +0 -124
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +0 -201
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -216
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -214
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -251
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +0 -52
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +0 -128
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -279
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +0 -109
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +0 -278
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -278
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +0 -335
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -250
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +0 -161
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +0 -216
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -252
- package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +0 -118
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +0 -243
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +0 -128
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +0 -155
- package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +0 -195
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +0 -78
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -194
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +0 -176
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +0 -112
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +0 -244
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +0 -181
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +0 -33
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +0 -46
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +0 -696
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +0 -173
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +0 -183
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +0 -73
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +0 -204
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +0 -288
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +0 -153
- package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +0 -164
- package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +0 -120
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +0 -125
- package/cypress/e2e/ILC/TextSelection/headerSection.js +0 -73
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +0 -179
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +0 -89
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +0 -436
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +0 -277
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +0 -222
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +0 -260
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +0 -380
- package/cypress/pages/components/layoutSectionComponent.js +0 -1191
- package/cypress/pages/components/numberLineCommonComponent.js +0 -36
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +0 -46
- package/cypress/pages/numberLineLabelPage.js +0 -333
@@ -1,313 +0,0 @@
|
|
1
|
-
import { audioPlayerPage } from "../../../pages";
|
2
|
-
import utilities from "../../../support/helpers/utilities";
|
3
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
-
import constants from "../../../fixtures/constants";
|
5
|
-
const css = Cypress.env('css');
|
6
|
-
|
7
|
-
describe('Audio player: Edit tab', () => {
|
8
|
-
before(() => {
|
9
|
-
cy.loginAs('admin');
|
10
|
-
});
|
11
|
-
|
12
|
-
//TODO: Update delete cases after https://redmine.zeuslearning.com/issues/569731 is resolved
|
13
|
-
describe('\'Upload audio file\' section', () => {
|
14
|
-
abortEarlySetup();
|
15
|
-
before(() => {
|
16
|
-
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
17
|
-
});
|
18
|
-
|
19
|
-
it('\'Upload audio file\' and \'Add audio URL\' radio buttons should be displayed. By default \'Upload audio file\' button should be selected', () => {
|
20
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioFileLabel(), 'Upload audio file');
|
21
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadAudioFileLabel(), 'visible');
|
22
|
-
audioPlayerPage.steps.verifyUploadAudioFileRadioButtonIsSelected();
|
23
|
-
utilities.verifyInnerText(audioPlayerPage.addAudioURLLabel(), 'Add audio URL');
|
24
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.addAudioURLLabel(), 'visible');
|
25
|
-
audioPlayerPage.steps.verifyAddAudioURLRadioButtonIsNotSelected();
|
26
|
-
});
|
27
|
-
|
28
|
-
it('\'Upload\' label should be displayed', () => {
|
29
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioFileUploadLabel(), 'Upload');
|
30
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadAudioFileUploadLabel(), 'visible');
|
31
|
-
});
|
32
|
-
|
33
|
-
it('\'File name\' label should be displayed', () => {
|
34
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioFileNameLabel(), 'File name');
|
35
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadAudioFileNameLabel(), 'visible');
|
36
|
-
});
|
37
|
-
|
38
|
-
it('\'Choose file\' button should be displayed', () => {
|
39
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioChooseFileButton(), 'Choose file');
|
40
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadAudioChooseFileButton(), 'visible');
|
41
|
-
});
|
42
|
-
|
43
|
-
it('By default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
44
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioNoFileChosenLabel(), 'No file chosen');
|
45
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadAudioNoFileChosenLabel(), 'visible');
|
46
|
-
});
|
47
|
-
|
48
|
-
it('CSS of \'Upload audio file\' section', { tags: 'css' }, () => {
|
49
|
-
utilities.verifyCSS(audioPlayerPage.uploadAudioFileRadioButton().parent().find('svg'), {
|
50
|
-
'fill': css.color.secondaryBtnActive
|
51
|
-
});
|
52
|
-
utilities.verifyCSS(audioPlayerPage.addAudioURLRadioButton().parent().find('svg path'), {
|
53
|
-
'color': css.color.uncheckedCheckbox
|
54
|
-
});
|
55
|
-
utilities.verifyCSS(audioPlayerPage.uploadAudioFileLabel(), {
|
56
|
-
'color': css.color.labels,
|
57
|
-
'font-size': css.fontSize.normal,
|
58
|
-
'font-weight': css.fontWeight.semibold
|
59
|
-
});
|
60
|
-
utilities.verifyCSS(audioPlayerPage.uploadAudioFileNameLabel(), {
|
61
|
-
'color': css.color.labels,
|
62
|
-
'font-size': css.fontSize.normal,
|
63
|
-
'font-weight': css.fontWeight.semibold
|
64
|
-
});
|
65
|
-
utilities.verifyCSS(audioPlayerPage.uploadAudioNoFileChosenLabel(), {
|
66
|
-
'color': css.color.liText,
|
67
|
-
'font-size': css.fontSize.default,
|
68
|
-
'font-weight': css.fontWeight.regular
|
69
|
-
});
|
70
|
-
utilities.verifyCSS(audioPlayerPage.uploadAudioChooseFileButton(), {
|
71
|
-
'background-color': css.color.transparent,
|
72
|
-
'border': `1px solid ${css.color.secondaryBtnBorder}`,
|
73
|
-
'color': css.color.secondaryBtn,
|
74
|
-
'font-size': css.fontSize.default,
|
75
|
-
'font-weight': css.fontWeight.regular
|
76
|
-
});
|
77
|
-
});
|
78
|
-
|
79
|
-
it('Accessibility of \'Upload audio file\' section', { tags: 'a11y' }, () => {
|
80
|
-
cy.checkAccessibility(audioPlayerPage.uploadAudioFileLabel().parents('.audio-player-resource'));
|
81
|
-
});
|
82
|
-
|
83
|
-
it('When the user adds the audio file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded', () => {
|
84
|
-
audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
|
85
|
-
utilities.verifyInnerText(audioPlayerPage.uploadedFileNameLabel(), 'sample.mp3');
|
86
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadedFileNameLabel(), 'visible');
|
87
|
-
});
|
88
|
-
|
89
|
-
it('CSS of progress bar and file name when file upload is in progress', { tags: 'css' }, () => {
|
90
|
-
audioPlayerPage.steps.attachFile('uploads/sample1.mp3');
|
91
|
-
audioPlayerPage.audioFileUploadProgressBar()
|
92
|
-
.verifyPseudoClassBeforeProperty('background-color', css.color.fileUploadProgressBarFill);
|
93
|
-
});
|
94
|
-
|
95
|
-
it('Accessibility of progress bar and file name when file upload is in progress', { tags: 'a11y' }, () => {
|
96
|
-
cy.checkAccessibility(audioPlayerPage.uploadAudioFileLabel().parents('.audio-player-resource'));
|
97
|
-
});
|
98
|
-
|
99
|
-
it('When user clicks on \'Choose file\' button again and upload another audio file, previously uploaded audio file should get replaced with new audio file', () => {
|
100
|
-
audioPlayerPage.steps.uploadFile('uploads/sample2.mp3');
|
101
|
-
utilities.verifyInnerText(audioPlayerPage.uploadedFileNameLabel(), 'sample2.mp3');
|
102
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.uploadedFileNameLabel(), 'visible');
|
103
|
-
});
|
104
|
-
|
105
|
-
it('When the user uploads a file that is not supported, following error message should be displayed: \'Error: The file type is not supported. Please upload a file with the following supported formats: MP3, WAV, AAC.\'', () => {
|
106
|
-
audioPlayerPage.steps.uploadFile('uploads/sample.mp4')
|
107
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: MP3, WAV, AAC.');
|
108
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
109
|
-
});
|
110
|
-
|
111
|
-
audioPlayerPage.tests.verifyErrorMessageCSSAndA11y();
|
112
|
-
|
113
|
-
it('When user upload supported format of audio file, error message should disappear', () => {
|
114
|
-
audioPlayerPage.steps.uploadFile('uploads/sample2.mp3');
|
115
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'notExist');
|
116
|
-
});
|
117
|
-
|
118
|
-
it('When user has uploaded an audio file, then delete button should appear beside uploaded file\'s name', () => {
|
119
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.deleteAudioFileButton(), 'visible');
|
120
|
-
});
|
121
|
-
|
122
|
-
it('When the user hovers on \'Delete\' button, \'Delete audio file\' text should be displayed in tooltip', () => {
|
123
|
-
audioPlayerPage.deleteAudioFileButton()
|
124
|
-
.verifyTooltip('Delete audio file');
|
125
|
-
});
|
126
|
-
|
127
|
-
it('CSS of tooltip', { tags: 'css' }, () => {
|
128
|
-
audioPlayerPage.deleteAudioFileButton()
|
129
|
-
.trigger('mouseover');
|
130
|
-
utilities.verifyCSS(audioPlayerPage.tooltipText(), {
|
131
|
-
'color': css.color.whiteText,
|
132
|
-
'font-size': css.fontSize.normal,
|
133
|
-
'font-weight': css.fontWeight.regular,
|
134
|
-
'background-color': css.color.tooltipBg
|
135
|
-
});
|
136
|
-
});
|
137
|
-
|
138
|
-
it('When user clicks on the \'Delete\' button, then \'Delete\' popup should be displayed', () => {
|
139
|
-
audioPlayerPage.steps.deleteAudioFile();
|
140
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.dialogBox(), 'visible');
|
141
|
-
utilities.verifyInnerText(audioPlayerPage.dialogBoxTitle(), 'Delete');
|
142
|
-
});
|
143
|
-
|
144
|
-
it('The pop up should be displayed with the message \'Are you sure you want to delete the audio file?\'', () => {
|
145
|
-
utilities.verifyInnerText(audioPlayerPage.dialogBoxContent(), 'Are you sure you want to delete the audio file?');
|
146
|
-
utilities.verifyInnerText(audioPlayerPage.buttonAccept(), 'Delete audio file');
|
147
|
-
utilities.verifyInnerText(audioPlayerPage.buttonReject(), 'Cancel');
|
148
|
-
});
|
149
|
-
|
150
|
-
it('CSS of popup', { tags: 'css' }, () => {
|
151
|
-
utilities.verifyCSS(audioPlayerPage.dialogBox(), {
|
152
|
-
'background-color': css.color.defaultBackground,
|
153
|
-
});
|
154
|
-
utilities.verifyCSS(audioPlayerPage.dialogBoxContent().find('[class*="DeletePopupWrapper"]'), {
|
155
|
-
'color': css.color.sectionHeading,
|
156
|
-
'font-size': css.fontSize.default,
|
157
|
-
'font-weight': css.fontWeight.regular
|
158
|
-
});
|
159
|
-
utilities.verifyCSS(audioPlayerPage.buttonAccept(), {
|
160
|
-
'color': css.color.primaryBtn,
|
161
|
-
'font-size': css.fontSize.default,
|
162
|
-
'font-weight': css.fontWeight.semibold
|
163
|
-
});
|
164
|
-
utilities.verifyCSS(audioPlayerPage.buttonReject(), {
|
165
|
-
'color': css.color.secondaryBtn,
|
166
|
-
'font-size': css.fontSize.default,
|
167
|
-
'font-weight': css.fontWeight.semibold,
|
168
|
-
'background-color': css.color.defaultBackground
|
169
|
-
});
|
170
|
-
});
|
171
|
-
|
172
|
-
it('Accessibility of the popup', () => {
|
173
|
-
cy.checkAccessibility(audioPlayerPage.dialogBox());
|
174
|
-
});
|
175
|
-
|
176
|
-
it('When user clicks on \'Cancel\' button, then popup should close and user should remain on the edit interface of the question', () => {
|
177
|
-
audioPlayerPage.steps.clickOnRejectButtonInDialogBox();
|
178
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.dialogBox(), 'notExist');
|
179
|
-
utilities.verifyInnerText(audioPlayerPage.uploadedFileNameLabel(), 'sample2.mp3');
|
180
|
-
});
|
181
|
-
|
182
|
-
it('When user clicks on \'Delete\' button, then popup should close and uploaded audio file should be deleted', () => {
|
183
|
-
audioPlayerPage.steps.deleteAudioFile();
|
184
|
-
audioPlayerPage.steps.clickOnAcceptButtonInDialogBox();
|
185
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.dialogBox(), 'notExist');
|
186
|
-
utilities.verifyInnerText(audioPlayerPage.uploadAudioNoFileChosenLabel(), 'No file chosen');
|
187
|
-
});
|
188
|
-
});
|
189
|
-
|
190
|
-
describe('\'Add audio URL\' section', () => {
|
191
|
-
abortEarlySetup();
|
192
|
-
before(() => {
|
193
|
-
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
194
|
-
});
|
195
|
-
|
196
|
-
it('User should be able to select \'Add audio URL\' radio button', () => {
|
197
|
-
audioPlayerPage.steps.selectAddAudioURLRadioButton();
|
198
|
-
audioPlayerPage.steps.verifyUploadAudioFileRadioButtonIsNotSelected();
|
199
|
-
})
|
200
|
-
|
201
|
-
it('\'Source URL\' label and input field should be displayed. By default, the source url input field should be empty', () => {
|
202
|
-
utilities.verifyInnerText(audioPlayerPage.sourceUrlLabel(), 'Source URL');
|
203
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.sourceUrlLabel(), 'visible');
|
204
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.sourceUrlInputField(), 'visible');
|
205
|
-
utilities.verifyInnerText(audioPlayerPage.sourceUrlInputField(), '');
|
206
|
-
});
|
207
|
-
|
208
|
-
it('CSS of \'Add audio URL\' Section', { tags: 'css' }, () => {
|
209
|
-
utilities.verifyCSS(audioPlayerPage.sourceUrlLabel(), {
|
210
|
-
'color': css.color.labels,
|
211
|
-
'font-size': css.fontSize.normal,
|
212
|
-
'font-weight': css.fontWeight.semibold
|
213
|
-
});
|
214
|
-
utilities.verifyCSS(audioPlayerPage.sourceUrlInputField(), {
|
215
|
-
'color': css.color.text,
|
216
|
-
'font-size': css.fontSize.default,
|
217
|
-
'font-weight': css.fontWeight.regular
|
218
|
-
});
|
219
|
-
});
|
220
|
-
|
221
|
-
it('Accessibility of \'Add audio URL\' section', { tags: 'a11y' }, () => {
|
222
|
-
cy.checkAccessibility(audioPlayerPage.addAudioURLLabel().parents('.audio-player-resource'));
|
223
|
-
});
|
224
|
-
|
225
|
-
it('When user focuses in and out of the \'Source URL\' input field, \'Error: Source URL is required.\' error message should be displayed below \'Source URL\' input field.', () => {
|
226
|
-
audioPlayerPage.steps.focusInAndFocusOutOfSourceURLInputField();
|
227
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error: Source URL is required.');
|
228
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
229
|
-
});
|
230
|
-
|
231
|
-
audioPlayerPage.tests.verifyErrorMessageCSSAndA11y();
|
232
|
-
|
233
|
-
it('When user adds a MP3 file in \'Source URL\' input field, \'Error: Source URL is required.\' validation message should disappear', () => {
|
234
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
|
235
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'notExist');
|
236
|
-
});
|
237
|
-
|
238
|
-
it('When user adds invalid file format URL in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should be displayed', () => {
|
239
|
-
audioPlayerPage.steps.clearTextInSourceURLInputField();
|
240
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.foxImageLink);
|
241
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.');
|
242
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
243
|
-
});
|
244
|
-
|
245
|
-
audioPlayerPage.tests.verifyErrorMessageCSSAndA11y();
|
246
|
-
|
247
|
-
it('When user adds valid file URL in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should disappear', () => {
|
248
|
-
audioPlayerPage.steps.clearTextInSourceURLInputField();
|
249
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
|
250
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'notExist');
|
251
|
-
});
|
252
|
-
|
253
|
-
it('When user adds invalid text in \'Source URL\' input field, \'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.\' validation message should be displayed', () => {
|
254
|
-
audioPlayerPage.steps.clearTextInSourceURLInputField();
|
255
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField('Invalid text');
|
256
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error: The provided URL does not link to a supported audio file. Please enter a URL for a MP3, WAV, AAC file.');
|
257
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
258
|
-
});
|
259
|
-
});
|
260
|
-
|
261
|
-
describe('\'Upload audio file\' and \'Add audio URL\' functionality in preview tab', () => {
|
262
|
-
abortEarlySetup();
|
263
|
-
before(() => {
|
264
|
-
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
265
|
-
audioPlayerPage.steps.switchToPreviewTab();
|
266
|
-
});
|
267
|
-
|
268
|
-
it('When user has not uploaded any audio file nor added any URL and clicks on \'Play\' button in preview tab, then error message \'Error loading audio\'', () => {
|
269
|
-
audioPlayerPage.steps.startPlayback();
|
270
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error loading audio');
|
271
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
272
|
-
});
|
273
|
-
|
274
|
-
audioPlayerPage.tests.verifyErrorMessageCSSAndA11y();
|
275
|
-
|
276
|
-
it('When user has uploaded an invalid file and clicks on \'Play\' button in preview tab, then error message \'Error loading audio\'', () => {
|
277
|
-
audioPlayerPage.steps.switchToEditTab();
|
278
|
-
audioPlayerPage.steps.uploadFile('uploads/sample.mp4');
|
279
|
-
audioPlayerPage.steps.switchToPreviewTab();
|
280
|
-
audioPlayerPage.steps.startPlayback();
|
281
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error loading audio');
|
282
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
283
|
-
});
|
284
|
-
|
285
|
-
it('When user adds invalid file format URL in \'Source URL\' input field and clicks on \'Play\' button in preview tab, then error message \'Error loading audio\'', () => {
|
286
|
-
audioPlayerPage.steps.switchToEditTab();
|
287
|
-
audioPlayerPage.steps.selectAddAudioURLRadioButton();
|
288
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.foxImageLink);
|
289
|
-
audioPlayerPage.steps.switchToPreviewTab();
|
290
|
-
audioPlayerPage.steps.startPlayback();
|
291
|
-
utilities.verifyInnerText(audioPlayerPage.errorMessage(), 'Error loading audio');
|
292
|
-
utilities.verifyElementVisibilityState(audioPlayerPage.errorMessage(), 'visible');
|
293
|
-
});
|
294
|
-
|
295
|
-
it('When user valid file format URL in \'Source URL\' input field, then audio player should be displayed in preview tab and user should be able to play MP3 audio file.', () => {
|
296
|
-
audioPlayerPage.steps.switchToEditTab();
|
297
|
-
audioPlayerPage.steps.clearTextInSourceURLInputField();
|
298
|
-
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.sampleWAVLink);
|
299
|
-
audioPlayerPage.steps.switchToPreviewTab();
|
300
|
-
audioPlayerPage.steps.startPlayback();
|
301
|
-
audioPlayerPage.steps.waitForPlaybackToBegin();
|
302
|
-
});
|
303
|
-
|
304
|
-
it('When user uploads a valid file, then audio player should be displayed in preview tab and user should be able to play MP3 audio file.', () => {
|
305
|
-
audioPlayerPage.steps.switchToEditTab();
|
306
|
-
audioPlayerPage.steps.selectUploadAudioFileRadioButton();
|
307
|
-
audioPlayerPage.steps.uploadFile('uploads/sample.mp3');
|
308
|
-
audioPlayerPage.steps.switchToPreviewTab();
|
309
|
-
audioPlayerPage.steps.startPlayback();
|
310
|
-
audioPlayerPage.steps.waitForPlaybackToBegin();
|
311
|
-
});
|
312
|
-
});
|
313
|
-
});
|
@@ -1,230 +0,0 @@
|
|
1
|
-
import { dialogBoxBase, listOrderingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
-
import utilities from "../../../support/helpers/utilities";
|
4
|
-
const css = Cypress.env('css');
|
5
|
-
const grepTags = Cypress.env('grepTags');
|
6
|
-
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
7
|
-
const views = utilities.getViews(correctAnswerViews);
|
8
|
-
var itemReferenceID = "";
|
9
|
-
const options = ['sprout', 'plant', 'flower', 'seed'];
|
10
|
-
const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
11
|
-
|
12
|
-
describe('Create item page - List ordering: All or nothing ', () => {
|
13
|
-
before(() => {
|
14
|
-
cy.loginAs('admin');
|
15
|
-
});
|
16
|
-
|
17
|
-
if (!grepTags || !grepTags.includes('smoke')) {
|
18
|
-
describe('Question preview modes: Student view and Grading view', () => {
|
19
|
-
abortEarlySetup();
|
20
|
-
before(() => {
|
21
|
-
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
22
|
-
cy.barsPreLoaderWait();
|
23
|
-
listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
|
24
|
-
listOrderingPage.steps.switchToPreviewTab();
|
25
|
-
});
|
26
|
-
|
27
|
-
listOrderingPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
28
|
-
|
29
|
-
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
30
|
-
listOrderingPage.steps.switchToEditTab();
|
31
|
-
listOrderingPage.steps.allotPoints(20);
|
32
|
-
listOrderingPage.steps.addInputToOptionsInputField(options);
|
33
|
-
listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }])
|
34
|
-
listOrderingPage.steps.switchToPreviewTab();
|
35
|
-
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
36
|
-
});
|
37
|
-
|
38
|
-
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
|
39
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }])
|
40
|
-
listOrderingPage.steps.resetQuestionPreview();
|
41
|
-
listOrderingPage.steps.verifySelectedOptionPositionDropdown(0, '');
|
42
|
-
});
|
43
|
-
});
|
44
|
-
};
|
45
|
-
|
46
|
-
views.forEach((view) => {
|
47
|
-
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
48
|
-
abortEarlySetup();
|
49
|
-
before(() => {
|
50
|
-
switch (view) {
|
51
|
-
case 'Question preview':
|
52
|
-
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
53
|
-
cy.barsPreLoaderWait();
|
54
|
-
listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
|
55
|
-
listOrderingPage.steps.addInputToOptionsInputField(options);
|
56
|
-
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
57
|
-
listOrderingPage.steps.allotPoints(20);
|
58
|
-
listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }])
|
59
|
-
listOrderingPage.steps.switchToPreviewTab();
|
60
|
-
break;
|
61
|
-
case 'Item preview':
|
62
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
63
|
-
itemPreviewPage.steps.switchToPreviewTab();
|
64
|
-
break;
|
65
|
-
case 'Grading view':
|
66
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
67
|
-
break;
|
68
|
-
};
|
69
|
-
});
|
70
|
-
|
71
|
-
beforeEach(() => {
|
72
|
-
switch (view) {
|
73
|
-
case 'Question preview':
|
74
|
-
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
75
|
-
listOrderingPage.steps.resetQuestionPreview();
|
76
|
-
break;
|
77
|
-
case 'Item preview':
|
78
|
-
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
79
|
-
itemPreviewPage.steps.resetQuestionPreview();
|
80
|
-
break;
|
81
|
-
case 'Grading view':
|
82
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
83
|
-
break;
|
84
|
-
}
|
85
|
-
});
|
86
|
-
|
87
|
-
if (view === 'Question preview') {
|
88
|
-
after(() => {
|
89
|
-
listOrderingPage.steps.clickOnSaveQuestionButton();
|
90
|
-
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
91
|
-
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
92
|
-
});
|
93
|
-
};
|
94
|
-
|
95
|
-
it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons should not be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
96
|
-
if (view === 'Grading view') {
|
97
|
-
utilities.verifyElementDisabledClass(studentViewPage.submitButton());
|
98
|
-
};
|
99
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
100
|
-
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
101
|
-
listOrderingPage.steps.switchToGradingView();
|
102
|
-
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
103
|
-
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(0);
|
104
|
-
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
|
105
|
-
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
|
106
|
-
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
|
107
|
-
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
108
|
-
utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers:');
|
109
|
-
listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
|
110
|
-
};
|
111
|
-
});
|
112
|
-
|
113
|
-
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
114
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
|
115
|
-
if (view === 'Grading view') {
|
116
|
-
studentViewPage.steps.submitResponse();
|
117
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
118
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
119
|
-
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
120
|
-
};
|
121
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
122
|
-
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
123
|
-
listOrderingPage.steps.switchToGradingView();
|
124
|
-
};
|
125
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(0);
|
126
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
|
127
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(2);
|
128
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
|
129
|
-
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
130
|
-
listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
|
131
|
-
});
|
132
|
-
|
133
|
-
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
134
|
-
if (view === 'Grading view') {
|
135
|
-
studentViewPage.steps.clearResponses();
|
136
|
-
};
|
137
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '3' }]);
|
138
|
-
if (view === 'Grading view') {
|
139
|
-
studentViewPage.steps.submitResponse();
|
140
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
141
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
142
|
-
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
143
|
-
};
|
144
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
145
|
-
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
146
|
-
listOrderingPage.steps.switchToGradingView();
|
147
|
-
};
|
148
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
|
149
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
|
150
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
|
151
|
-
listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
|
152
|
-
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
153
|
-
listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
|
154
|
-
});
|
155
|
-
|
156
|
-
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
157
|
-
if (view === 'Grading view') {
|
158
|
-
studentViewPage.steps.clearResponses();
|
159
|
-
};
|
160
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }]);
|
161
|
-
if (view === 'Grading view') {
|
162
|
-
studentViewPage.steps.submitResponse();
|
163
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
164
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
165
|
-
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
166
|
-
};
|
167
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
168
|
-
listOrderingPage.steps.verifyPreviewScore(20, 20);
|
169
|
-
listOrderingPage.steps.switchToGradingView();
|
170
|
-
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
171
|
-
};
|
172
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
|
173
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
|
174
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
|
175
|
-
listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
|
176
|
-
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
177
|
-
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
178
|
-
});
|
179
|
-
});
|
180
|
-
});
|
181
|
-
|
182
|
-
if (!grepTags || !grepTags.includes('smoke')) {
|
183
|
-
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
184
|
-
abortEarlySetup();
|
185
|
-
before(() => {
|
186
|
-
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
187
|
-
cy.barsPreLoaderWait();
|
188
|
-
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
189
|
-
listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
|
190
|
-
listOrderingPage.steps.allotPoints(20);
|
191
|
-
listOrderingPage.steps.addInputToOptionsInputField(options);
|
192
|
-
listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '3' }, { optionIndex: 2, position: '4' }, { optionIndex: 3, position: '1' }]);
|
193
|
-
});
|
194
|
-
|
195
|
-
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
196
|
-
listOrderingPage.steps.expandMinimumScoringDropdown();
|
197
|
-
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
198
|
-
listOrderingPage.steps.allotMinimumPoints(2);
|
199
|
-
listOrderingPage.steps.switchToPreviewTab();
|
200
|
-
listOrderingPage.steps.switchToGradingView();
|
201
|
-
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
202
|
-
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
203
|
-
});
|
204
|
-
|
205
|
-
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
206
|
-
listOrderingPage.steps.resetQuestionPreview();
|
207
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
|
208
|
-
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
209
|
-
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
210
|
-
});
|
211
|
-
|
212
|
-
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
|
213
|
-
listOrderingPage.steps.switchToEditTab();
|
214
|
-
listOrderingPage.steps.expandMinimumScoringDropdown();
|
215
|
-
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
216
|
-
listOrderingPage.steps.allotMinimumPoints(2);
|
217
|
-
listOrderingPage.steps.switchToPreviewTab();
|
218
|
-
listOrderingPage.steps.switchToGradingView();
|
219
|
-
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
220
|
-
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
221
|
-
});
|
222
|
-
|
223
|
-
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
224
|
-
listOrderingPage.steps.resetQuestionPreview();
|
225
|
-
listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '1' }, { optionIndex: 1, position: '2' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
|
226
|
-
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
227
|
-
});
|
228
|
-
});
|
229
|
-
};
|
230
|
-
});
|