itemengine-cypress-automation 1.0.119 → 1.0.121
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
- package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
- package/cypress/e2e/migration/migration.js +6 -5
- package/cypress/e2e/migration/migration2.js +4 -3
- package/cypress/e2e/migration/migration3.js +4 -3
- package/cypress/e2e/migration/migration4.js +4 -3
- package/cypress/e2e/migration/migration5.js +4 -3
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioResponsePage.js +2 -1
- package/cypress/pages/components/additionalSettingsPanel.js +27 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredScoringSection.js +1 -1
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
- package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
- package/cypress/pages/components/index.js +3 -3
- package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +49 -23
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/createItemPage.js +67 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
- package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
- package/cypress/pages/fillInTheGapsTextPage.js +52 -199
- package/cypress/pages/index.js +5 -5
- package/cypress/pages/multipleSelectionPage.js +1 -0
- package/cypress/pages/shortTextResponsePage.js +575 -33
- package/cypress/pages/singleSelectionGridPage.js +1 -2
- package/cypress/pages/singleSelectionPage.js +5 -6
- package/cypress/pages/textEntryMathPage.js +46 -22
- package/cypress/pages/textEntryMathWithImagePage.js +212 -0
- package/cypress/pages/uploadResponsePage.js +74 -21
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
- package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
- package/cypress/pages/fillInTheGapsScoring.js +0 -5872
- package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,166 @@
|
|
1
|
+
import { textEntryMathWithImagePage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
7
|
+
const views = utilities.getViews(previewContentViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
10
|
+
describe('Create item page - Text entry math: Preview contents', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
views.forEach((view) => {
|
16
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
switch (view) {
|
20
|
+
case 'Question preview':
|
21
|
+
textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
textEntryMathWithImagePage.steps.addBackground();
|
24
|
+
textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
25
|
+
textEntryMathWithImagePage.steps.uploadFile('highlightImage.jpg');
|
26
|
+
textEntryMathWithImagePage.steps.verifyImageIsUploaded();
|
27
|
+
textEntryMathWithImagePage.steps.insertResponseArea(10);
|
28
|
+
textEntryMathWithImagePage.steps.insertResponseArea(40);
|
29
|
+
textEntryMathWithImagePage.steps.insertTextArea(80, 'This is a text area');
|
30
|
+
textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
31
|
+
textEntryMathWithImagePage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
32
|
+
textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
33
|
+
textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
34
|
+
textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
35
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
36
|
+
textEntryMathWithImagePage.steps.allotPoints(10);
|
37
|
+
textEntryMathWithImagePage.steps.switchToPreviewTab();
|
38
|
+
break;
|
39
|
+
case 'Item view':
|
40
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
41
|
+
break;
|
42
|
+
case 'Item preview':
|
43
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
44
|
+
textEntryMathWithImagePage.steps.switchToPreviewTab();
|
45
|
+
break;
|
46
|
+
case 'Student view':
|
47
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
48
|
+
break;
|
49
|
+
case 'Grading view':
|
50
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
break;
|
52
|
+
case 'Correct answer view':
|
53
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
54
|
+
break;
|
55
|
+
default:
|
56
|
+
throw new Error('Invalid view');
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
after(() => {
|
61
|
+
if (view === 'Question preview') {
|
62
|
+
textEntryMathWithImagePage.steps.clickOnSaveQuestionButton();
|
63
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'exist');
|
64
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
65
|
+
}
|
66
|
+
if (view === 'Student view') {
|
67
|
+
studentViewPage.steps.submitResponse();
|
68
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
it('Question instructions should be visible', () => {
|
73
|
+
utilities.verifyInnerText(textEntryMathWithImagePage.questionInstructionsText(), 'Enter the correct answer in the response field');
|
74
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.questionInstructionsText(), 'visible');
|
75
|
+
});
|
76
|
+
|
77
|
+
|
78
|
+
it('The text area should be displayed on the image canvas', () => {
|
79
|
+
textEntryMathWithImagePage.steps.verifyTextInTextAreaPreviewTab('This is a text area');
|
80
|
+
});
|
81
|
+
|
82
|
+
it('The image uploaded in the \'Background image\' section should be displayed', () => {
|
83
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.canvasImage(), 'visible');
|
84
|
+
});
|
85
|
+
|
86
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
87
|
+
it(`The two empty response fields should be disabled ${view}`, () => {
|
88
|
+
utilities.verifyTextContent(textEntryMathWithImagePage.responseFieldPreviewTab(), '')
|
89
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.responseFieldPreviewTab(), 'visible');
|
90
|
+
utilities.verifyElementCount(textEntryMathWithImagePage.responseFieldPreviewTab(), '2');
|
91
|
+
});
|
92
|
+
|
93
|
+
it(`User should able to enter answers in the response fields for ${view}`, () => {
|
94
|
+
textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
95
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
96
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
97
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
98
|
+
textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
99
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
100
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
101
|
+
textEntryMathWithImagePage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
102
|
+
});
|
103
|
+
} else if (view === 'Grading view') {
|
104
|
+
it(`The response fields should be filled with the submitted responses and user should not be able to edit them`, () => {
|
105
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
106
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
107
|
+
textEntryMathWithImagePage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
108
|
+
textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
109
|
+
utilities.verifyElementVisibilityState(equationEditorFlyout.dialogBox(), 'notExist');
|
110
|
+
});
|
111
|
+
} else {
|
112
|
+
it(`The response input fields should be displayed filled with correct answers`, () => {
|
113
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
114
|
+
textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
115
|
+
textEntryMathWithImagePage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
116
|
+
});
|
117
|
+
}
|
118
|
+
|
119
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
120
|
+
switch (view) {
|
121
|
+
case 'Question preview':
|
122
|
+
case 'Item preview':
|
123
|
+
case 'Item view':
|
124
|
+
case 'Item preview':
|
125
|
+
case 'Student view':
|
126
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab().parents('.response-input-field'), 0), {
|
127
|
+
'border-color': css.color.activeButtons,
|
128
|
+
'border-bottom-style': 'dashed',
|
129
|
+
'background-color': css.color.optionsBg
|
130
|
+
});
|
131
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab().find('span'), 0), {
|
132
|
+
'color': css.color.text,
|
133
|
+
'font-size': css.fontSize.default,
|
134
|
+
'font-weight': css.fontWeight.regular
|
135
|
+
});
|
136
|
+
break;
|
137
|
+
case 'Grading view':
|
138
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab().parents('.response-input-field'), 0), {
|
139
|
+
'border-color': css.color.correctAnswer,
|
140
|
+
'border-bottom-style': 'dashed',
|
141
|
+
'background-color': css.color.optionsBg
|
142
|
+
});
|
143
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab().find('span'), 0), {
|
144
|
+
'color': css.color.text,
|
145
|
+
'font-size': css.fontSize.default,
|
146
|
+
'font-weight': css.fontWeight.regular
|
147
|
+
});
|
148
|
+
break;
|
149
|
+
case 'Correct answer view':
|
150
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab().find('p'), 0), {
|
151
|
+
'color': css.color.text,
|
152
|
+
'font-size': css.fontSize.default,
|
153
|
+
'font-weight': css.fontWeight.regular,
|
154
|
+
});
|
155
|
+
break;
|
156
|
+
default:
|
157
|
+
throw new Error('Invalid view');
|
158
|
+
}
|
159
|
+
});
|
160
|
+
|
161
|
+
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
162
|
+
cy.checkAccessibility(textEntryMathWithImagePage.questionInstructionsText().parents('[class*="__ContentWrapper"]'));
|
163
|
+
});
|
164
|
+
});
|
165
|
+
});
|
166
|
+
});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { uploadResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page -Upload response: Scoring section', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Scoring section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
uploadResponsePage.tests.verifyScoringTypeLabelAndDropdown('Manually scored');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Manually Scored scoring - Edit tab', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Add question instructions and options');
|
25
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
26
|
+
uploadResponsePage.steps.addQuestionInstructions();
|
27
|
+
});
|
28
|
+
|
29
|
+
it('When the user selects \'Manually scored\' option from the scoring Type dropdown then \'Points\' and \'Minimum scoring\' label and dropdown should be displayed', () => {
|
30
|
+
uploadResponsePage.steps.verifyDefaultPointsLabelAndInputField();
|
31
|
+
uploadResponsePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
|
32
|
+
});
|
33
|
+
|
34
|
+
uploadResponsePage.tests.verifyPointsFieldErrorState(10);
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('Non scored scoring - Edit tab', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
before(() => {
|
40
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
});
|
43
|
+
|
44
|
+
it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
|
45
|
+
uploadResponsePage.steps.expandScoringTypeDropdown();
|
46
|
+
uploadResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
47
|
+
});
|
48
|
+
|
49
|
+
uploadResponsePage.tests.verifyScoringSectionContentsForNonScoredScoringType();
|
50
|
+
});
|
51
|
+
});
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { correctAnswerViewPage, uploadResponsePage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import { gradingViewPage } from "../../../pages";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
|
7
|
+
const views = utilities.getViews(gradingAndCorrectAnsView);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
10
|
+
describe('Create item page - Upload response: Grading view, Correct answer view contents', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
if (views.includes('Grading view')) {
|
16
|
+
describe('Grading view contents', { tags: 'smoke' }, () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
cy.log('Navigating to Upload response question type');
|
20
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
uploadResponsePage.steps.addTextInQuestionInstructionsInputField('Question text');
|
23
|
+
uploadResponsePage.steps.allotPoints(10);
|
24
|
+
uploadResponsePage.steps.setMaximumNumberOfFiles(3);
|
25
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
26
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
27
|
+
//Global variable issue, not working inside before
|
28
|
+
itemPreviewPage.referenceID()
|
29
|
+
.invoke('text')
|
30
|
+
.then(($refID) => {
|
31
|
+
itemReferenceID = $refID;
|
32
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
33
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
34
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'highlightImage.jpg');
|
35
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(1, 3);
|
36
|
+
studentViewPage.steps.submitResponse();
|
37
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
it('Question instructions should be visible', () => {
|
42
|
+
utilities.verifyInnerText(uploadResponsePage.questionInstructionsText(), 'Question text');
|
43
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.questionInstructionsText(), 'visible');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('The response submitted by the student should be visible in the response field of the grading view', () => {
|
47
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'highlightImage.jpg');
|
48
|
+
utilities.verifyElementCount(uploadResponsePage.fileName(), 1);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('Empty score input field and total score should be displayed', () => {
|
52
|
+
gradingViewPage.steps.verifyGradingViewScore('', 10);
|
53
|
+
});
|
54
|
+
|
55
|
+
it('Accessibility of uploaded file', { tags: 'a11y' }, () => {
|
56
|
+
cy.checkAccessibility(uploadResponsePage.fileName());
|
57
|
+
});
|
58
|
+
|
59
|
+
it('On clicking on the file name, user should be able to download the file', () => {
|
60
|
+
cy.verifyUploadFilePreviewDownload('highlightImage.jpg');
|
61
|
+
});
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
if (views.includes('Correct answer view')) {
|
66
|
+
describe('Correct answer view contents', { tags: 'smoke' }, () => {
|
67
|
+
abortEarlySetup();
|
68
|
+
before(() => {
|
69
|
+
cy.log('Navigating to Upload response question type');
|
70
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
71
|
+
cy.barsPreLoaderWait();
|
72
|
+
uploadResponsePage.steps.addQuestionInstructions();
|
73
|
+
uploadResponsePage.steps.allotPoints(10);
|
74
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
75
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
76
|
+
itemPreviewPage.referenceID()
|
77
|
+
.invoke('text')
|
78
|
+
.then(($refID) => {
|
79
|
+
itemReferenceID = $refID
|
80
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
81
|
+
});
|
82
|
+
});
|
83
|
+
|
84
|
+
it('Question instructions should be visible', () => {
|
85
|
+
utilities.verifyTextContent(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
86
|
+
utilities.verifyElementVisibilityState(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'visible');
|
87
|
+
});
|
88
|
+
|
89
|
+
it('\'This is a manual scored question\' help text should be displayed in the correct answer view', () => {
|
90
|
+
utilities.verifyTextContent(correctAnswerViewPage.manualScoredQuestionHelpText(), 'This is a manual scored question.');
|
91
|
+
utilities.verifyElementVisibilityState(correctAnswerViewPage.manualScoredQuestionHelpText(), 'visible');
|
92
|
+
});
|
93
|
+
|
94
|
+
it('The points alloted to the question should be displayed', () => {
|
95
|
+
correctAnswerViewPage.steps.verifyAvailablePoints(10);
|
96
|
+
});
|
97
|
+
});
|
98
|
+
}
|
99
|
+
});
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { uploadResponsePage, } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create question page - Upload Response: Scoring', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Scoring Section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
14
|
+
});
|
15
|
+
|
16
|
+
uploadResponsePage.tests.verifyScoringTypeLabelAndDropdown('manuallyScored');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Manually scored scoring type', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
cy.log('Adding question instructions and correct answer response, select Manually scored scoring type and add points for the question');
|
23
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
24
|
+
uploadResponsePage.steps.addQuestionInstructions();
|
25
|
+
uploadResponsePage.steps.allotPoints(20);
|
26
|
+
uploadResponsePage.steps.expandScoringTypeDropdown();
|
27
|
+
uploadResponsePage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
28
|
+
cy.log('Switching to Preview tab')
|
29
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
30
|
+
});
|
31
|
+
|
32
|
+
it('In Preview tab, Question Instructions and file uploader section should be displayed', () => {
|
33
|
+
uploadResponsePage.steps.verifyQuestionInstructionsText();
|
34
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadFileContentWrapper(), 'visible');
|
35
|
+
});
|
36
|
+
|
37
|
+
uploadResponsePage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
|
38
|
+
});
|
39
|
+
|
40
|
+
describe('Question Preview: Non scored', () => {
|
41
|
+
abortEarlySetup();
|
42
|
+
before(() => {
|
43
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
44
|
+
uploadResponsePage.steps.addQuestionInstructions();
|
45
|
+
uploadResponsePage.steps.expandScoringTypeDropdown();
|
46
|
+
uploadResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
47
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
48
|
+
});
|
49
|
+
|
50
|
+
uploadResponsePage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
51
|
+
|
52
|
+
it('When the user selects \'Grading\' view without attempting the question, then file uploader section should be displayed', () => {
|
53
|
+
uploadResponsePage.steps.switchToGradingView();
|
54
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadFileContentWrapper(), 'visible');
|
55
|
+
uploadResponsePage.steps.switchToStudentView();
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When user attempts the question by uploading file, then on switching to \'Grading\' view, file uploader section and file name with edit icon, add description button and delete button should be displayed', () => {
|
59
|
+
uploadResponsePage.steps.resetQuestionPreview();
|
60
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
61
|
+
uploadResponsePage.steps.switchToGradingView();
|
62
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadFileContentWrapper(), 'visible');
|
63
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(0);
|
64
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'highlightImage.jpg');
|
65
|
+
uploadResponsePage.steps.switchToStudentView();
|
66
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadFileContentWrapper(), 'visible');
|
67
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(0);
|
68
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'highlightImage.jpg');
|
69
|
+
});
|
70
|
+
});
|
71
|
+
});
|
@@ -0,0 +1,155 @@
|
|
1
|
+
import { uploadResponsePage, 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
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(previewContentViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - Upload response : Preview contents', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
cy.log('Navigating to Upload response question type');
|
21
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
uploadResponsePage.steps.addTextInQuestionInstructionsInputField('Question text');
|
24
|
+
uploadResponsePage.steps.allotPoints(10);
|
25
|
+
uploadResponsePage.steps.setMaximumNumberOfFiles(3);
|
26
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
27
|
+
break;
|
28
|
+
case 'Item view':
|
29
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
|
30
|
+
break;
|
31
|
+
case 'Item preview':
|
32
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
|
33
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
34
|
+
break;
|
35
|
+
case 'Student view':
|
36
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID[0])}`);
|
37
|
+
break;
|
38
|
+
};
|
39
|
+
});
|
40
|
+
|
41
|
+
if (view === 'Question preview') {
|
42
|
+
after(() => {
|
43
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
44
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
45
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
it('Question instructions should be visible', () => {
|
50
|
+
utilities.verifyInnerText(uploadResponsePage.questionInstructionsText(), 'Question text');
|
51
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.questionInstructionsText(), 'visible');
|
52
|
+
});
|
53
|
+
|
54
|
+
it('File limit label be visible', () => {
|
55
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(0, 3);
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When user uploads file, then uploaded file name should be displayed and file count should get updated', () => {
|
59
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
60
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(0, 'highlightImage.jpg');
|
61
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(1, 3);
|
62
|
+
utilities.verifyElementCount(uploadResponsePage.fileName(), 1);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('When user deletes the uploaded file then uploaded file name, edit icon and delete button should disappear and file limit should be updated accordingly', () => {
|
66
|
+
uploadResponsePage.steps.deleteFile();
|
67
|
+
uploadResponsePage.steps.deleteFileButtonInDeleteFilePopup();
|
68
|
+
uploadResponsePage.steps.uploadedFileContentsNotExistPreviewTab();
|
69
|
+
});
|
70
|
+
|
71
|
+
it('When user uploads multiple files, then uploaded files should be visible in the uploaded file section and file limit should be updated accordingly', () => {
|
72
|
+
uploadResponsePage.steps.uploadFile(['uploads/sample.pdf', 'uploads/sample.jpg']);
|
73
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(0, 'sample.pdf');
|
74
|
+
uploadResponsePage.steps.uploadedFileContentsPreviewTab(1, 'sample.jpg');
|
75
|
+
uploadResponsePage.steps.verifyUploadedFileLimitCount(2, 3);
|
76
|
+
utilities.verifyElementCount(uploadResponsePage.fileName(), 2);
|
77
|
+
});
|
78
|
+
|
79
|
+
it('When user edits the name of uploaded file, then edited name should be visible', () => {
|
80
|
+
uploadResponsePage.steps.clickOnEditDisplayTextIcon(0);
|
81
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'exist');
|
82
|
+
uploadResponsePage.steps.enterTextInEditDisplayTextPopupInputField('image.csv');
|
83
|
+
uploadResponsePage.steps.verifyTextInEditDisplayTextPopupInputField('image.csv');
|
84
|
+
uploadResponsePage.steps.deleteFileButtonInDeleteFilePopup();
|
85
|
+
uploadResponsePage.steps.verifyUploadedFileName(0, 'image.csv');
|
86
|
+
});
|
87
|
+
|
88
|
+
it('CSS of Preview tab', { tags: 'css' }, () => {
|
89
|
+
utilities.verifyCSS(uploadResponsePage.uploadCloudIcon().find('path'), {
|
90
|
+
'fill': css.color.cloudIconFill
|
91
|
+
});
|
92
|
+
utilities.verifyCSS(uploadResponsePage.dragAndDropFilesText(), {
|
93
|
+
'color': css.color.text,
|
94
|
+
'font-size': css.fontSize.huge,
|
95
|
+
'font-weight': css.fontWeight.bold
|
96
|
+
});
|
97
|
+
utilities.verifyCSS(uploadResponsePage.fileUploadOptionsLabel(), {
|
98
|
+
'color': css.color.text,
|
99
|
+
'font-size': css.fontSize.heading,
|
100
|
+
'font-weight': css.fontWeight.semibold
|
101
|
+
});
|
102
|
+
utilities.verifyCSS(uploadResponsePage.supportedFileFormatLabel(), {
|
103
|
+
'color': css.color.text,
|
104
|
+
'font-size': css.fontSize.normal,
|
105
|
+
'font-weight': css.fontWeight.regular
|
106
|
+
});
|
107
|
+
utilities.verifyCSS(uploadResponsePage.supportedFileInfoIcon().find('path'), {
|
108
|
+
'stroke': css.color.activeButtons
|
109
|
+
});
|
110
|
+
utilities.triggerMouseover(utilities.getNthElement(uploadResponsePage.supportedFileInfoIcon(), 0));
|
111
|
+
utilities.verifyCSS(uploadResponsePage.supportedFilesTooltip(), {
|
112
|
+
'color': css.color.whiteText,
|
113
|
+
'font-size': css.fontSize.extraSmall,
|
114
|
+
'font-weight': css.fontWeight.light,
|
115
|
+
'background-color': css.color.tooltipBg
|
116
|
+
});
|
117
|
+
utilities.triggerMouseout(utilities.getNthElement(uploadResponsePage.supportedFileInfoIcon(), 0));
|
118
|
+
utilities.verifyCSS(uploadResponsePage.uploadedFileCount(), {
|
119
|
+
'color': css.color.labels,
|
120
|
+
'font-size': css.fontSize.small,
|
121
|
+
'font-weight': css.fontWeight.regular,
|
122
|
+
'background-color': css.color.fileLimitBg
|
123
|
+
});
|
124
|
+
uploadResponsePage.deviceLink()
|
125
|
+
.verifyPseudoClassBeforeProperty('color', css.color.text);
|
126
|
+
uploadResponsePage.googleDriveLink()
|
127
|
+
.verifyPseudoClassBeforeProperty('color', css.color.text);
|
128
|
+
});
|
129
|
+
|
130
|
+
//Failed due to https://redmine.zeuslearning.com/issues/562203
|
131
|
+
it('Accessibility of Preview tab', { tags: 'a11y' }, () => {
|
132
|
+
cy.checkAccessibility(uploadResponsePage.questionWrapperPreviewTab());
|
133
|
+
});
|
134
|
+
|
135
|
+
it('When user uploads file type which is not selected from the \'Supported file types\' accordion menu, then file upload error message - \'The file type is not supported. Please upload files with the following supported formats: *file format separated by commas*\' should be displayed', () => {
|
136
|
+
uploadResponsePage.steps.uploadFile('uploads/sample.heif');
|
137
|
+
uploadResponsePage.steps.verifyWarningMessage('The file type is not supported. Please upload files with the following supported formats: CSV, Excel, GIF, JPG, Open Office, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
|
138
|
+
});
|
139
|
+
|
140
|
+
it('When user tries to upload files more than the limit, then warning message \'You have reached the maximum number of files that can be uploaded.\' should be displayed', () => {
|
141
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
142
|
+
uploadResponsePage.steps.uploadFile('uploads/image.png');
|
143
|
+
uploadResponsePage.steps.verifyWarningMessage('You have reached the maximum number of files that can be uploaded.');
|
144
|
+
});
|
145
|
+
|
146
|
+
if (view != 'Question preview') {
|
147
|
+
it('On clicking on the file name, user should be able to download the file', () => {
|
148
|
+
cy.verifyUploadFilePreviewDownload('sample.pdf');
|
149
|
+
cy.log('Added wait here to pause till the file download is complete');
|
150
|
+
cy.wait(5000);
|
151
|
+
});
|
152
|
+
}
|
153
|
+
});
|
154
|
+
});
|
155
|
+
});
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { uploadResponsePage, dialogBoxBase } from "../../../pages";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create question page - Upload Response: Header section and Saving question', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Header section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
14
|
+
});
|
15
|
+
|
16
|
+
uploadResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Upload response');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Tabs section', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
23
|
+
});
|
24
|
+
|
25
|
+
uploadResponsePage.tests.verifyTabsSection();
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Cancel button', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
32
|
+
});
|
33
|
+
|
34
|
+
uploadResponsePage.tests.verifyCancelButton('upload response');
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('Save Question button', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
before(() => {
|
40
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload 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
|
+
uploadResponsePage.steps.verifyQuestionInstructionsErrorMessage();
|
49
|
+
utilities.verifyInnerText(uploadResponsePage.pleaseEnterPointsErrorMessage(), 'Error: Please enter points.');
|
50
|
+
});
|
51
|
+
|
52
|
+
it('Validation error messages should disappear when required input fields are filled', () => {
|
53
|
+
uploadResponsePage.steps.addQuestionInstructions();
|
54
|
+
uploadResponsePage.steps.allotPoints(20);
|
55
|
+
uploadResponsePage.steps.verifyErrorMessageIsNotDisplayed();
|
56
|
+
});
|
57
|
+
});
|
58
|
+
|
59
|
+
describe('Saving a question', () => {
|
60
|
+
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', () => {
|
61
|
+
uploadResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
62
|
+
});
|
63
|
+
uploadResponsePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
64
|
+
});
|
65
|
+
});
|
66
|
+
});
|