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,224 @@
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsDropdownPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const grepTags = Cypress.env('grepTags');
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
10
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
11
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
12
|
+
const incorrectAnswerArray = ['Branch', 'Seed'];
|
13
|
+
|
14
|
+
describe('Create item page - Fill in the gaps with dropdown: All or nothing ', () => {
|
15
|
+
before(() => {
|
16
|
+
cy.loginAs('admin');
|
17
|
+
});
|
18
|
+
|
19
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
20
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
26
|
+
});
|
27
|
+
|
28
|
+
fillInTheGapsDropdownPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
29
|
+
|
30
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
31
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
32
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
33
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
34
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
35
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
36
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
37
|
+
});
|
38
|
+
|
39
|
+
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', () => {
|
40
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
|
41
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
42
|
+
fillInTheGapsDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(0, '');
|
43
|
+
});
|
44
|
+
});
|
45
|
+
};
|
46
|
+
|
47
|
+
views.forEach((view) => {
|
48
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
49
|
+
abortEarlySetup();
|
50
|
+
before(() => {
|
51
|
+
switch (view) {
|
52
|
+
case 'Question preview':
|
53
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
54
|
+
cy.barsPreLoaderWait();
|
55
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
56
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
57
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
58
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
59
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
60
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
61
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
62
|
+
break;
|
63
|
+
case 'Item preview':
|
64
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
65
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
66
|
+
break;
|
67
|
+
case 'Grading view':
|
68
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
69
|
+
break;
|
70
|
+
};
|
71
|
+
});
|
72
|
+
|
73
|
+
beforeEach(() => {
|
74
|
+
switch (view) {
|
75
|
+
case 'Question preview':
|
76
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
77
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
78
|
+
break;
|
79
|
+
case 'Item preview':
|
80
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
81
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
82
|
+
break;
|
83
|
+
case 'Grading view':
|
84
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
85
|
+
break;
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
if (view === 'Question preview') {
|
90
|
+
after(() => {
|
91
|
+
fillInTheGapsDropdownPage.steps.clickOnSaveQuestionButton();
|
92
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
93
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
94
|
+
});
|
95
|
+
};
|
96
|
+
|
97
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
98
|
+
if (view === 'Grading view') {
|
99
|
+
studentViewPage.steps.submitResponse();
|
100
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
101
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
102
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
103
|
+
};
|
104
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
105
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
106
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
107
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
108
|
+
};
|
109
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
110
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
111
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
112
|
+
});
|
113
|
+
|
114
|
+
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', () => {
|
115
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
116
|
+
if (view === 'Grading view') {
|
117
|
+
studentViewPage.steps.submitResponse();
|
118
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
119
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
120
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
121
|
+
};
|
122
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
123
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
124
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
125
|
+
};
|
126
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
127
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
128
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
129
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
130
|
+
});
|
131
|
+
|
132
|
+
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', () => {
|
133
|
+
if (view === 'Grading view') {
|
134
|
+
studentViewPage.steps.clearResponses();
|
135
|
+
};
|
136
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
137
|
+
if (view === 'Grading view') {
|
138
|
+
studentViewPage.steps.submitResponse();
|
139
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
140
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
141
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
142
|
+
};
|
143
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
144
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
145
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
146
|
+
};
|
147
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
148
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
149
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
150
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
151
|
+
});
|
152
|
+
|
153
|
+
it('When the user attempts the question correctly, then the user should be awarded with full points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
154
|
+
if (view === 'Grading view') {
|
155
|
+
studentViewPage.steps.clearResponses();
|
156
|
+
};
|
157
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
158
|
+
if (view === 'Grading view') {
|
159
|
+
studentViewPage.steps.submitResponse();
|
160
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
161
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
162
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
163
|
+
};
|
164
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
165
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
166
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
167
|
+
};
|
168
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
169
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
170
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
171
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
172
|
+
});
|
173
|
+
});
|
174
|
+
});
|
175
|
+
|
176
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
177
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
178
|
+
abortEarlySetup();
|
179
|
+
before(() => {
|
180
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
181
|
+
cy.barsPreLoaderWait();
|
182
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
183
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
184
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
185
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
186
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
187
|
+
});
|
188
|
+
|
189
|
+
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', () => {
|
190
|
+
fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
|
191
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
192
|
+
fillInTheGapsDropdownPage.steps.allotMinimumPoints(2);
|
193
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
194
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
195
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 20);
|
196
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
197
|
+
});
|
198
|
+
|
199
|
+
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', () => {
|
200
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
201
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
202
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 20);
|
203
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
204
|
+
});
|
205
|
+
|
206
|
+
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', () => {
|
207
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
208
|
+
fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
|
209
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
210
|
+
fillInTheGapsDropdownPage.steps.allotMinimumPoints(2);
|
211
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
212
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
213
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
214
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
215
|
+
});
|
216
|
+
|
217
|
+
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', () => {
|
218
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
219
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
220
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 20);
|
221
|
+
});
|
222
|
+
});
|
223
|
+
};
|
224
|
+
});
|
@@ -0,0 +1,120 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
var itemReferenceID = "";
|
5
|
+
const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(checkAnswerViews);
|
7
|
+
|
8
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
9
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
10
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
11
|
+
const incorrectAnswerArray = ['Branch', 'Seed'];
|
12
|
+
|
13
|
+
describe('Create item page - Fill in the gaps with dropdown - Check answer functionality', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
views.forEach((view) => {
|
19
|
+
//Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
|
20
|
+
const checkAnswer = (view) => {
|
21
|
+
switch (view) {
|
22
|
+
case 'Question preview':
|
23
|
+
case 'Item preview':
|
24
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
25
|
+
break;
|
26
|
+
case 'Student view':
|
27
|
+
studentViewPage.steps.checkAnswer();
|
28
|
+
break;
|
29
|
+
default:
|
30
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
|
35
|
+
abortEarlySetup();
|
36
|
+
before(() => {
|
37
|
+
switch (view) {
|
38
|
+
case 'Question preview':
|
39
|
+
cy.log('Navigate to fill in the gaps over image - dropdown question type');
|
40
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
43
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
44
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
45
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
46
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
47
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
48
|
+
fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
49
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
50
|
+
break;
|
51
|
+
case 'Item preview':
|
52
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
53
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
54
|
+
break;
|
55
|
+
case 'Student view':
|
56
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
beforeEach(() => {
|
62
|
+
switch (view) {
|
63
|
+
case 'Question preview':
|
64
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
65
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
66
|
+
break;
|
67
|
+
case 'Item preview':
|
68
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
69
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
70
|
+
break;
|
71
|
+
case 'Student view':
|
72
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
});
|
76
|
+
|
77
|
+
if (view === 'Question preview') {
|
78
|
+
after(() => {
|
79
|
+
fillInTheGapsDropdownPage.steps.clickOnSaveQuestionButton();
|
80
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
81
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
82
|
+
});
|
83
|
+
};
|
84
|
+
|
85
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message and correct answer section should not be displayed', () => {
|
86
|
+
checkAnswer(view);
|
87
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconsNotExist();
|
88
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
89
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
90
|
+
});
|
91
|
+
|
92
|
+
it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
93
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
94
|
+
checkAnswer(view);
|
95
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
96
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
97
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
98
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
99
|
+
});
|
100
|
+
|
101
|
+
it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
102
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
103
|
+
checkAnswer(view);
|
104
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
105
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
106
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
107
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
108
|
+
});
|
109
|
+
|
110
|
+
it('When user attempts the question correctly, and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, a status message with text \'Your answer is correct\' should be displayed. Correct answer section should not be displayed', () => {
|
111
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
112
|
+
checkAnswer(view);
|
113
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
114
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
115
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
116
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
117
|
+
});
|
118
|
+
});
|
119
|
+
});
|
120
|
+
});
|
@@ -0,0 +1,158 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
5
|
+
const views = utilities.getViews(previewContentViews);
|
6
|
+
var itemReferenceID = "";
|
7
|
+
const css = Cypress.env('css');
|
8
|
+
|
9
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
10
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
11
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
12
|
+
|
13
|
+
describe('Create item page - Fill in the gaps with dropdown - Preview contents in all views', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
views.forEach((view) => {
|
19
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
switch (view) {
|
23
|
+
case 'Question preview':
|
24
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
27
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
28
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
29
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
30
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
31
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
32
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
33
|
+
break;
|
34
|
+
case 'Item view':
|
35
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
36
|
+
break;
|
37
|
+
case 'Item preview':
|
38
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
39
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
40
|
+
break;
|
41
|
+
case 'Student view':
|
42
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
43
|
+
break;
|
44
|
+
case 'Grading view':
|
45
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
46
|
+
break;
|
47
|
+
case 'Correct answer view':
|
48
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
49
|
+
break;
|
50
|
+
default:
|
51
|
+
throw new Error('Invalid view');
|
52
|
+
}
|
53
|
+
});
|
54
|
+
|
55
|
+
after(() => {
|
56
|
+
if (view === 'Question preview') {
|
57
|
+
fillInTheGapsDropdownPage.steps.clickOnSaveQuestionButton();
|
58
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
59
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
60
|
+
}
|
61
|
+
if (view === 'Student view') {
|
62
|
+
studentViewPage.steps.submitResponse();
|
63
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
it('Question instructions should be visible', () => {
|
68
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.questionInstructionsText(), 'Fill in the gaps');
|
69
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.questionInstructionsText(), 'visible');
|
70
|
+
});
|
71
|
+
|
72
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
73
|
+
it('The sample \'Lorem Ipsum\' text along with two response dropdowns should be displayed', () => {
|
74
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownPreviewTab(), 2);
|
75
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.questionContainerPreviewTab(), 'Lorem ipsum dolor sit amet, \n\n\nonsectetur adipiscing elit. Ut pellentesque tinciduntornare. Integer porttitor est quis urna porttitor, eget tempus tellus dapibus \n\n');
|
76
|
+
});
|
77
|
+
|
78
|
+
it('User should be able to select an option from the dropdown', () => {
|
79
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
80
|
+
});
|
81
|
+
} else if (view === 'Grading view') {
|
82
|
+
it('The dropdowns should be displayed filled with answers', () => {
|
83
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownPreviewTab(), 2);
|
84
|
+
fillInTheGapsDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownText: correctAnswerArray[1] }]);
|
85
|
+
});
|
86
|
+
|
87
|
+
it('The dropdowns should not be editable', () => {
|
88
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownIsDisabled(0);
|
89
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownIsDisabled(1);
|
90
|
+
});
|
91
|
+
} else {
|
92
|
+
it('The dropdowns should be displayed filled with correct answers', () => {
|
93
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownPreviewTab(), 2);
|
94
|
+
fillInTheGapsDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownText: correctAnswerArray[1] }]);
|
95
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
96
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
|
100
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
101
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.questionContainerPreviewTab(), {
|
102
|
+
'color': css.color.text,
|
103
|
+
'font-size': css.fontSize.default,
|
104
|
+
'font-weight': css.fontWeight.regular
|
105
|
+
});
|
106
|
+
switch (view) {
|
107
|
+
case 'Question preview':
|
108
|
+
case 'Item preview':
|
109
|
+
case 'Item view':
|
110
|
+
case 'Item preview':
|
111
|
+
case 'Student view':
|
112
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownPreviewTab(), {
|
113
|
+
'background-color': css.color.optionsBg,
|
114
|
+
'border': `1px solid ${css.color.optionsSelectedText}`
|
115
|
+
});
|
116
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownPreviewTab().find('.dropdown-label-text'), {
|
117
|
+
'color': css.color.liText,
|
118
|
+
'font-size': css.fontSize.default,
|
119
|
+
'font-weight': css.fontWeight.regular
|
120
|
+
});
|
121
|
+
fillInTheGapsDropdownPage.steps.expandDropdownInPreviewTab(0);
|
122
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownListOptions().eq(0), {
|
123
|
+
'color': css.color.liText,
|
124
|
+
'background-color': css.color.liTextSelectedBg,
|
125
|
+
'font-size': css.fontSize.default,
|
126
|
+
'font-weight': css.fontWeight.regular
|
127
|
+
});
|
128
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownListOptions().eq(1), {
|
129
|
+
'color': css.color.liText,
|
130
|
+
'background-color': css.color.transparent,
|
131
|
+
'font-size': css.fontSize.default,
|
132
|
+
'font-weight': css.fontWeight.regular
|
133
|
+
});
|
134
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(optionsForDropdown1[0]);
|
135
|
+
break;
|
136
|
+
case 'Grading view':
|
137
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownPreviewTab(), {
|
138
|
+
'background-color': css.color.optionsBg,
|
139
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
140
|
+
});
|
141
|
+
break;
|
142
|
+
case 'Correct answer view':
|
143
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownPreviewTab(), {
|
144
|
+
'background-color': css.color.optionsBg,
|
145
|
+
'border': `1px solid ${css.color.optionsSelectedText}`
|
146
|
+
});
|
147
|
+
break;
|
148
|
+
default:
|
149
|
+
throw new Error('Invalid view');
|
150
|
+
}
|
151
|
+
});
|
152
|
+
|
153
|
+
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
154
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.dropdownPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
155
|
+
});
|
156
|
+
});
|
157
|
+
});
|
158
|
+
});
|
package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js
CHANGED
@@ -3,7 +3,7 @@ import utilities from "../../../support/helpers/utilities";
|
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
4
|
const css = Cypress.env('css');
|
5
5
|
|
6
|
-
const dropzonePointerStyles = ['
|
6
|
+
const dropzonePointerStyles = ['none', 'bottom', 'bottom right', 'right', 'top right', 'top', 'top left', 'left', 'bottom left'];
|
7
7
|
|
8
8
|
describe('Create item page - Fill in the gaps: Question instructions, Options section', () => {
|
9
9
|
before(() => {
|
@@ -296,10 +296,7 @@ describe('Create Item page - Fill in the gaps over image - drag and drop: Studen
|
|
296
296
|
|
297
297
|
fillInTheGapsOverImageDragAndDropPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
|
298
298
|
|
299
|
-
|
300
|
-
fillInTheGapsOverImageDragAndDropPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
301
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.maximumCheckAnswerAttemptsDropdown(), 'visible');
|
302
|
-
});
|
299
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyMaximumAttemptsDropdownDisplayedWhenAllowStudentsToCheckAnswerIsChecked();
|
303
300
|
|
304
301
|
fillInTheGapsOverImageDragAndDropPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
|
305
302
|
|