itemengine-cypress-automation 1.0.190-repoUpdate3May-f180558.0 → 1.0.191-7thMayFixes-2faebef.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +2 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +3 -30
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +0 -27
- package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +9 -9
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +12 -12
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +4 -20
- package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +366 -0
- package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +181 -0
- package/cypress/e2e/ILC/ChartsBar/gradingViewAndCorrectAnswerView.smoke.js +283 -0
- package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +396 -130
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +2 -2
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +0 -3
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +3 -5
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +0 -4
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabScoring.js +0 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePageHeaderSection.js +4 -24
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -9
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +3 -3
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +0 -2
- package/cypress/e2e/ILC/EssayResponse/headerSection.js +3 -18
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +0 -1
- package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +0 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +0 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +0 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +1 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +0 -2
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +2 -1
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +6 -6
- package/cypress/e2e/ILC/GridFill/headerSection.js +4 -5
- package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +276 -0
- package/cypress/e2e/ILC/ImageHighlight/checkAnswerFunctionalityForAllViews.smoke.js +141 -0
- package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +150 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/Matching/additionalSettings.js +1 -0
- package/cypress/e2e/ILC/Matching/headerSection.js +2 -2
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +22 -20
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +4 -2
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +4 -2
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +3 -2
- package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +2 -1
- package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +1 -8
- package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -3
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +5 -4
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +4 -2
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +4 -2
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -2
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +2 -1
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +3 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +1 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +1 -7
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +0 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -2
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
- package/cypress/e2e/ILC/VideoResponseNew/customizePlaybackControls.js +2 -2
- package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/VideoResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +6 -6
- package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +6 -6
- package/cypress/e2e/ILC/VideoResponseNew/standardRecorderStyle.js +9 -9
- package/cypress/e2e/ILC/VideoResponseNew/studentViewSettings.js +2 -4
- package/cypress/pages/audioPlayerPage.js +4 -2
- package/cypress/pages/audioResponsePage.js +2 -0
- package/cypress/pages/chartsBarPage.js +289 -3
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +8 -5
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/barAndLineChartComponent.js +7 -4
- package/cypress/pages/components/chartsCommonComponent.js +33 -0
- package/cypress/pages/components/imageCanvasComponent.js +3 -3
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/questionInputFieldComponent.js +2 -1
- package/cypress/pages/components/resetPopupComponent.js +7 -3
- package/cypress/pages/components/scoringSectionBaseEditTab.js +6 -17
- package/cypress/pages/components/singleMultipleSelectionModeComponent.js +16 -0
- package/cypress/pages/contentBlocksPage.js +1 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +22 -24
- package/cypress/pages/drawingResponsePage.js +3 -2
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +14 -0
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +1 -1
- package/cypress/pages/imageHighlightPage.js +364 -0
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/matchingPage.js +2 -1
- package/cypress/pages/numberLineLabelPage.js +14 -7
- package/cypress/pages/protractorPage.js +1 -1
- package/cypress/pages/readingRulerPage.js +1 -1
- package/cypress/pages/rulerPage.js +3 -3
- package/cypress/pages/textEntryMathPage.js +2 -2
- package/cypress/pages/videoResponsePage.js +6 -5
- package/package.json +1 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -45,16 +45,15 @@ describe('Create item page - Grid fill: Header section and Saving question', ()
|
|
45
45
|
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
46
46
|
|
47
47
|
it('Validation error messages should be displayed below required input fields', () => {
|
48
|
-
gridFillPage.steps.
|
49
|
-
utilities.verifyInnerText(
|
50
|
-
gridFillPage.steps.
|
48
|
+
gridFillPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
|
49
|
+
utilities.verifyInnerText(gridFillPage.errorMessage(), 'Error: Please set a correct answer.');
|
50
|
+
gridFillPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
|
51
51
|
gridFillPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
|
52
|
-
gridFillPage.steps.verifySpecifyCorrectAnswerErrorMessage();
|
53
52
|
});
|
54
53
|
|
55
54
|
//failed due to https://redmine.zeuslearning.com/issues/564243
|
56
55
|
it('Validation error messages should disappear when required input fields are filled', () => {
|
57
|
-
gridFillPage.steps.addTextInQuestionInstructionsInputField('Grid');
|
56
|
+
gridFillPage.steps.addTextInQuestionInstructionsInputField('Grid fill');
|
58
57
|
gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
|
59
58
|
gridFillPage.steps.allotPoints(10);
|
60
59
|
gridFillPage.steps.verifyErrorMessageIsNotDisplayed();
|
@@ -0,0 +1,276 @@
|
|
1
|
+
import { dialogBoxBase, imageHighlightPage, 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
|
+
|
10
|
+
const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
|
11
|
+
const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
12
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
13
|
+
|
14
|
+
describe('Create item page - Image highlight: 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
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
24
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
25
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
26
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
27
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
28
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
29
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
30
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
31
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
32
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
33
|
+
});
|
34
|
+
|
35
|
+
imageHighlightPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
36
|
+
|
37
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
38
|
+
imageHighlightPage.steps.switchToEditTab();
|
39
|
+
imageHighlightPage.steps.allotPoints(20);
|
40
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
41
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
42
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
43
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
44
|
+
});
|
45
|
+
|
46
|
+
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', () => {
|
47
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
48
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
49
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(0);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
};
|
53
|
+
|
54
|
+
//Failing due to https://redmine.zeuslearning.com/issues/571054
|
55
|
+
views.forEach((view) => {
|
56
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
57
|
+
abortEarlySetup();
|
58
|
+
before(() => {
|
59
|
+
switch (view) {
|
60
|
+
case 'Question preview':
|
61
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
62
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
63
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
64
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
65
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
66
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
67
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
68
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
69
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
70
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
71
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
72
|
+
imageHighlightPage.steps.allotPoints(20);
|
73
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
74
|
+
break;
|
75
|
+
case 'Item preview':
|
76
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
77
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
78
|
+
break;
|
79
|
+
case 'Grading view':
|
80
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
81
|
+
break;
|
82
|
+
};
|
83
|
+
});
|
84
|
+
|
85
|
+
beforeEach(() => {
|
86
|
+
switch (view) {
|
87
|
+
case 'Question preview':
|
88
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
89
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
90
|
+
break;
|
91
|
+
case 'Item preview':
|
92
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
93
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
94
|
+
break;
|
95
|
+
case 'Grading view':
|
96
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
});
|
100
|
+
|
101
|
+
if (view === 'Question preview') {
|
102
|
+
after(() => {
|
103
|
+
imageHighlightPage.steps.clickOnSaveQuestionButton();
|
104
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
105
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
106
|
+
});
|
107
|
+
};
|
108
|
+
|
109
|
+
it('When the user selects \'Grading\' view without attempting the question, highlight numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
110
|
+
if (view === 'Grading view') {
|
111
|
+
studentViewPage.steps.submitResponse();
|
112
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
113
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
114
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
115
|
+
};
|
116
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
117
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
118
|
+
imageHighlightPage.steps.switchToGradingView();
|
119
|
+
imageHighlightPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
120
|
+
};
|
121
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
122
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
123
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
124
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
125
|
+
utilities.verifyInnerText(imageHighlightPage.correctAnswersLabel(), 'Correct answers');
|
126
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 3'], [1, 2]);
|
127
|
+
});
|
128
|
+
|
129
|
+
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', () => {
|
130
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
131
|
+
if (view === 'Grading view') {
|
132
|
+
studentViewPage.steps.submitResponse();
|
133
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
134
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
135
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
136
|
+
};
|
137
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
138
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
139
|
+
imageHighlightPage.steps.switchToGradingView();
|
140
|
+
};
|
141
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
142
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
143
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
144
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
145
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
146
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 3'], [1, 2]);
|
147
|
+
});
|
148
|
+
|
149
|
+
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, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
150
|
+
if (view === 'Grading view') {
|
151
|
+
studentViewPage.steps.clearResponses();
|
152
|
+
};
|
153
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
154
|
+
if (view === 'Grading view') {
|
155
|
+
studentViewPage.steps.submitResponse();
|
156
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
157
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
158
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
159
|
+
};
|
160
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
161
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
162
|
+
imageHighlightPage.steps.switchToGradingView();
|
163
|
+
};
|
164
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
165
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
166
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
167
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
|
168
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
169
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 3'], [1, 2]);
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When the user attempts the question correct with an incorrect response, 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', () => {
|
173
|
+
if (view === 'Grading view') {
|
174
|
+
studentViewPage.steps.clearResponses();
|
175
|
+
};
|
176
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
177
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
178
|
+
if (view === 'Grading view') {
|
179
|
+
studentViewPage.steps.submitResponse();
|
180
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
181
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
182
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
183
|
+
};
|
184
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
185
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
186
|
+
imageHighlightPage.steps.switchToGradingView();
|
187
|
+
};
|
188
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
189
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
190
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
191
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
192
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
193
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 3'], [1, 2]);
|
194
|
+
});
|
195
|
+
|
196
|
+
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', () => {
|
197
|
+
if (view === 'Grading view') {
|
198
|
+
studentViewPage.steps.clearResponses();
|
199
|
+
};
|
200
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
201
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
202
|
+
if (view === 'Grading view') {
|
203
|
+
studentViewPage.steps.submitResponse();
|
204
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
205
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
206
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
207
|
+
};
|
208
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
209
|
+
imageHighlightPage.steps.verifyPreviewScore(20, 20);
|
210
|
+
imageHighlightPage.steps.switchToGradingView();
|
211
|
+
imageHighlightPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
212
|
+
};
|
213
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
|
214
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
215
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
216
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
217
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
218
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
219
|
+
});
|
220
|
+
});
|
221
|
+
});
|
222
|
+
|
223
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
224
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
225
|
+
abortEarlySetup();
|
226
|
+
before(() => {
|
227
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
228
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
229
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
230
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
231
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
232
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
233
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
234
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
235
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
236
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
237
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
238
|
+
imageHighlightPage.steps.allotPoints(20);
|
239
|
+
});
|
240
|
+
|
241
|
+
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', () => {
|
242
|
+
imageHighlightPage.steps.expandMinimumScoringDropdown();
|
243
|
+
imageHighlightPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
244
|
+
imageHighlightPage.steps.allotMinimumPoints(2);
|
245
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
246
|
+
imageHighlightPage.steps.switchToGradingView();
|
247
|
+
imageHighlightPage.steps.verifyPreviewScore(2, 20);
|
248
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
249
|
+
});
|
250
|
+
|
251
|
+
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', () => {
|
252
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
253
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
254
|
+
imageHighlightPage.steps.verifyPreviewScore(2, 20);
|
255
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
256
|
+
});
|
257
|
+
|
258
|
+
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', () => {
|
259
|
+
imageHighlightPage.steps.switchToEditTab();
|
260
|
+
imageHighlightPage.steps.expandMinimumScoringDropdown();
|
261
|
+
imageHighlightPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
262
|
+
imageHighlightPage.steps.allotMinimumPoints(2);
|
263
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
264
|
+
imageHighlightPage.steps.switchToGradingView();
|
265
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
266
|
+
imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
267
|
+
});
|
268
|
+
|
269
|
+
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', () => {
|
270
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
271
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
272
|
+
imageHighlightPage.steps.verifyPreviewScore(2, 20);
|
273
|
+
});
|
274
|
+
});
|
275
|
+
};
|
276
|
+
});
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import { imageHighlightPage, 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
|
+
const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
|
8
|
+
const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
9
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
10
|
+
|
11
|
+
describe('Create item page - Image highlight - Check answer functionality', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
views.forEach((view) => {
|
17
|
+
//Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
|
18
|
+
const checkAnswer = (view) => {
|
19
|
+
switch (view) {
|
20
|
+
case 'Question preview':
|
21
|
+
case 'Item preview':
|
22
|
+
imageHighlightPage.steps.checkAnswer();
|
23
|
+
break;
|
24
|
+
case 'Student view':
|
25
|
+
studentViewPage.steps.checkAnswer();
|
26
|
+
break;
|
27
|
+
default:
|
28
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
before(() => {
|
35
|
+
switch (view) {
|
36
|
+
case 'Question preview':
|
37
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
38
|
+
cy.barsPreLoaderWait();
|
39
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
40
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
41
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
42
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
43
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
44
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
45
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
46
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
47
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
48
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
49
|
+
imageHighlightPage.steps.allotPoints(20);
|
50
|
+
imageHighlightPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
51
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
52
|
+
break;
|
53
|
+
case 'Item preview':
|
54
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
55
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
56
|
+
break;
|
57
|
+
case 'Student view':
|
58
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
59
|
+
break;
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
beforeEach(() => {
|
64
|
+
switch (view) {
|
65
|
+
case 'Question preview':
|
66
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
67
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
68
|
+
break;
|
69
|
+
case 'Item preview':
|
70
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
71
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
72
|
+
break;
|
73
|
+
case 'Student view':
|
74
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
|
79
|
+
if (view === 'Question preview') {
|
80
|
+
after(() => {
|
81
|
+
imageHighlightPage.steps.clickOnSaveQuestionButton();
|
82
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
83
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
84
|
+
});
|
85
|
+
};
|
86
|
+
|
87
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message, correct answer section and highlight regions should not be displayed', () => {
|
88
|
+
checkAnswer(view);
|
89
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
90
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
91
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
92
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.crossMarkIcon(), 'notExist');
|
93
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.checkMarkIcon(), 'notExist');
|
94
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.correctIncorrectAnswerTextWrapper(), 'notExist');
|
95
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
96
|
+
});
|
97
|
+
|
98
|
+
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', () => {
|
99
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
100
|
+
checkAnswer(view);
|
101
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
102
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
103
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
104
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
105
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
106
|
+
});
|
107
|
+
|
108
|
+
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', () => {
|
109
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
110
|
+
checkAnswer(view);
|
111
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
112
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
113
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
114
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
115
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user attempts the question partially correct with an incorrect response, 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', () => {
|
119
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
120
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
121
|
+
checkAnswer(view);
|
122
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
123
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
|
124
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
125
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
126
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
127
|
+
});
|
128
|
+
|
129
|
+
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', () => {
|
130
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
131
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
132
|
+
checkAnswer(view);
|
133
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
134
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
135
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
136
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
137
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
138
|
+
});
|
139
|
+
});
|
140
|
+
});
|
141
|
+
});
|
@@ -0,0 +1,150 @@
|
|
1
|
+
import { imageHighlightPage, 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 previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
6
|
+
const views = utilities.getViews(previewContentViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
|
10
|
+
const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
11
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
12
|
+
|
13
|
+
describe('Create item page - Image highlight - 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
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
25
|
+
imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
|
26
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
27
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
28
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
29
|
+
imageHighlightPage.steps.enterAndVerifyImageAlternativeTextInInputField('Image alternative text');
|
30
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
31
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
32
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
33
|
+
imageHighlightPage.steps.selectMultipleSelectionToggle();
|
34
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
35
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
36
|
+
imageHighlightPage.steps.allotPoints(10);
|
37
|
+
imageHighlightPage.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
|
+
imageHighlightPage.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
|
+
imageHighlightPage.steps.clickOnSaveQuestionButton();
|
63
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
64
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
65
|
+
}
|
66
|
+
if (view === 'Student view') {
|
67
|
+
studentViewPage.steps.submitResponse();
|
68
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'exist');
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
it('Question instructions should be visible', () => {
|
73
|
+
utilities.verifyInnerText(imageHighlightPage.questionInstructionsText(), 'Select the appropriate highlight in the image below');
|
74
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.questionInstructionsText(), 'visible');
|
75
|
+
});
|
76
|
+
|
77
|
+
it('The uploaded image should be displayed and the highlighted sections should be present in the preview tab', () => {
|
78
|
+
imageHighlightPage.steps.verifyImageUploadedPreviewTab();
|
79
|
+
imageHighlightPage.steps.verifyHighlightRegionCountInPreviewTab(3);
|
80
|
+
imageHighlightPage.steps.verifyImageUploadedAltTextPreviewTab('Image alternative text');
|
81
|
+
imageHighlightPage.steps.verifyImageUploadedWidthAndHeightPreviewTab('768', '432');
|
82
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
83
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, branchesHighlightRegion);
|
84
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, leafHighlightRegion);
|
85
|
+
});
|
86
|
+
|
87
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
88
|
+
it('By default the highlighted sections should be hidden and when the user hovers over any highlighted section it should be visible', () => {
|
89
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
90
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
91
|
+
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
92
|
+
utilities.hoverOverElement(utilities.getNthElement(imageHighlightPage.highlightPreviewTab(), 0))
|
93
|
+
imageHighlightPage.steps.verifyHoverStateOfHighlightRegion(0);
|
94
|
+
utilities.hoverAwayFromElement();
|
95
|
+
});
|
96
|
+
|
97
|
+
it('User should be able to select or de-select any highlighted section', () => {
|
98
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
99
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
100
|
+
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(0);
|
101
|
+
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(1);
|
102
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
103
|
+
imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(0);
|
104
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(0);
|
105
|
+
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(1);
|
106
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
107
|
+
});
|
108
|
+
} else if (view === 'Grading view') {
|
109
|
+
it('The highlight regions should be displayed', () => {
|
110
|
+
imageHighlightPage.steps.verifyHoverStateOfHighlightRegion(0);
|
111
|
+
imageHighlightPage.steps.verifyHoverStateOfHighlightRegion(2);
|
112
|
+
});
|
113
|
+
|
114
|
+
it('User should not be able to select, de-select any highlight sections', () => {
|
115
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
116
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(2);
|
117
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(0);
|
118
|
+
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
119
|
+
});
|
120
|
+
} else {
|
121
|
+
it('The highlight regions should be displayed with correct answers', () => {
|
122
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
123
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
124
|
+
});
|
125
|
+
}
|
126
|
+
|
127
|
+
it('CSS of highlight region in preview tab in default, hover and active state', { tags: 'css' }, () => {
|
128
|
+
cy.log('Default state')
|
129
|
+
utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(2), {
|
130
|
+
'color': css.color.successBtn,
|
131
|
+
'stroke': css.color.transparent,
|
132
|
+
});
|
133
|
+
cy.log('Active state')
|
134
|
+
utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(1), {
|
135
|
+
'stroke': css.color.activeHighlightBorder,
|
136
|
+
});
|
137
|
+
cy.log('Hover state')
|
138
|
+
utilities.hoverOverElement(imageHighlightPage.highlightPreviewTab().eq(0))
|
139
|
+
utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(0), {
|
140
|
+
'stroke': css.color.hoverHighlightBorder,
|
141
|
+
});
|
142
|
+
utilities.hoverAwayFromElement();
|
143
|
+
});
|
144
|
+
|
145
|
+
it('Accessibility of preview tab highlight regions', { tags: 'a11y' }, () => {
|
146
|
+
cy.checkAccessibility(imageHighlightPage.highlightPreviewTab());
|
147
|
+
});
|
148
|
+
});
|
149
|
+
});
|
150
|
+
});
|
@@ -104,7 +104,7 @@ describe('Create item page - List ordering: All or nothing ', () => {
|
|
104
104
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
|
105
105
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
|
106
106
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
|
107
|
-
listOrderingPage.steps.
|
107
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
108
108
|
utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers:');
|
109
109
|
listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['2', '3', '4', '1']);
|
110
110
|
};
|
@@ -83,7 +83,7 @@ describe('Create item page - list ordering - Check answer functionality', () =>
|
|
83
83
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
|
84
84
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
|
85
85
|
listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
|
86
|
-
listOrderingPage.steps.
|
86
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
87
87
|
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
88
88
|
});
|
89
89
|
|
@@ -169,6 +169,7 @@ describe('Create Item page - matching : Additional settings', () => {
|
|
169
169
|
matchingPage.steps.switchToGradingView();
|
170
170
|
matchingPage.steps.verifyDropzoneEnumeration(enumerationOptions[option]);
|
171
171
|
matchingPage.steps.verifyCorrectAnswerDropzoneEnumeration(enumerationOptions[option]);
|
172
|
+
matchingPage.steps.switchToEditTab();
|
172
173
|
});
|
173
174
|
});
|
174
175
|
|
@@ -47,14 +47,14 @@ describe('Create item page - Matching : Header section and Saving question', ()
|
|
47
47
|
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
48
48
|
|
49
49
|
it('Validation error messages should be displayed below required input fields', () => {
|
50
|
-
matchingPage.steps.
|
50
|
+
matchingPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
|
51
51
|
matchingPage.steps.verifyPromptInputFieldErrorMessage(0);
|
52
52
|
matchingPage.steps.verifyPromptInputFieldErrorMessage(1);
|
53
53
|
matchingPage.steps.verifyPromptInputFieldErrorMessage(2);
|
54
54
|
matchingPage.steps.verifyOptionsInputFieldErrorMessage(3);
|
55
55
|
matchingPage.steps.verifyOptionsInputFieldErrorMessage(4);
|
56
56
|
matchingPage.steps.verifyOptionsInputFieldErrorMessage(5);
|
57
|
-
matchingPage.steps.
|
57
|
+
matchingPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
|
58
58
|
matchingPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
|
59
59
|
matchingPage.steps.verifySpecifyCorrectAnswerErrorMessage();
|
60
60
|
});
|