itemengine-cypress-automation 1.0.199-20thMayRepoUpdate-6af11c9.0 → 1.0.200-23rdMayUpdates-264dc55.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 +3 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +348 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +346 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +401 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingPenaltyScoring.js +53 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightBasic.js +251 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightBasic.js +251 -0
- package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +366 -0
- package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/ChartsLine/allOrNothingScoringForAllViews.smoke.js +367 -0
- package/cypress/e2e/ILC/ChartsLine/gradingViewAndCorrectAnswerView.smoke.js +3 -3
- package/cypress/e2e/ILC/Compass/compassEditTabBasicsSection.js +134 -0
- package/cypress/e2e/ILC/Compass/compassPreviewContent.smoke.js +88 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +2 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -0
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -2
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +3 -3
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +3 -3
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +4 -4
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +1 -16
- package/cypress/e2e/ILC/chartsDotsPlot/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/chartsDotsPlot/editTabScoring.js +223 -0
- package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +110 -0
- package/cypress/e2e/ILC/chartsDotsPlot/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +375 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +382 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +422 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/manualAndNonScoredScoring.js +159 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsBasic.js +233 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +380 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +293 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +382 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +184 -0
- package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +76 -0
- package/cypress/pages/chartsBarPage.js +23 -15
- package/cypress/pages/chartsDotPlotPage.js +130 -7
- package/cypress/pages/chartsLinePage.js +11 -11
- package/cypress/pages/compassPage.js +57 -0
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
- package/cypress/pages/components/barAndLineChartComponent.js +7 -7
- package/cypress/pages/components/chartsCommonComponent.js +55 -7
- package/cypress/pages/components/createQuestionBasePage.js +1 -1
- package/cypress/pages/components/optionsWrapperComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +2 -2
- package/cypress/pages/feedbackScalePage.js +3 -1
- package/cypress/pages/graphingPage.js +1 -1
- package/cypress/pages/imageHighlightPage.js +4 -434
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/listOrderingPage.js +9 -9
- package/cypress/pages/textEntryMathPage.js +16 -16
- package/package.json +1 -1
@@ -0,0 +1,367 @@
|
|
1
|
+
import { dialogBoxBase, chartsLinePage, 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
|
+
describe('Create item page - Charts - Line: All or nothing ', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
15
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
chartsLinePage.steps.selectLineButton();
|
21
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 0, value: 1, range: 10 });
|
22
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 1, value: 2, range: 10 });
|
23
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 2, value: 3, range: 10 });
|
24
|
+
chartsLinePage.steps.switchToPreviewTab();
|
25
|
+
});
|
26
|
+
|
27
|
+
chartsLinePage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
28
|
+
|
29
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
30
|
+
chartsLinePage.steps.switchToEditTab();
|
31
|
+
chartsLinePage.steps.allotPoints(20);
|
32
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 0, value: 2, range: 10 });
|
33
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 1, value: 5, range: 10 });
|
34
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 2, value: 1, range: 10 });
|
35
|
+
chartsLinePage.steps.switchToPreviewTab();
|
36
|
+
chartsLinePage.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
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 0, value: 7, range: 10 });
|
41
|
+
chartsLinePage.steps.resetQuestionPreview();
|
42
|
+
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 0, value: 1, range: 10 });
|
43
|
+
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 1, value: 2, range: 10 });
|
44
|
+
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 2, value: 3, range: 10 });
|
45
|
+
});
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
views.forEach((view) => {
|
50
|
+
describe(`Charts - Line: All or nothing scoring - ${view}`, { tags: 'smoke' }, () => {
|
51
|
+
abortEarlySetup();
|
52
|
+
before(() => {
|
53
|
+
switch (view) {
|
54
|
+
case 'Question preview':
|
55
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
56
|
+
cy.barsPreLoaderWait();
|
57
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Set the point on the chart for the profits of the years');
|
58
|
+
chartsLinePage.steps.selectLineButton();
|
59
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
60
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
61
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 0, value: 3, range: 10 });
|
62
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 1, value: 2, range: 10 });
|
63
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 3, value: 3, range: 10 });
|
64
|
+
chartsLinePage.steps.lockPoint(1);
|
65
|
+
chartsLinePage.steps.allotPoints(20);
|
66
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
67
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
68
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
69
|
+
chartsLinePage.steps.switchToPreviewTab();
|
70
|
+
break;
|
71
|
+
case 'Item preview':
|
72
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
73
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
74
|
+
break;
|
75
|
+
case 'Grading view':
|
76
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
beforeEach(() => {
|
82
|
+
switch (view) {
|
83
|
+
case 'Question preview':
|
84
|
+
chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
85
|
+
chartsLinePage.steps.resetQuestionPreview();
|
86
|
+
break;
|
87
|
+
case 'Item preview':
|
88
|
+
itemPreviewPage.steps.switchToStudentView();
|
89
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
90
|
+
break;
|
91
|
+
case 'Grading view':
|
92
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
});
|
96
|
+
|
97
|
+
if (view === 'Question preview') {
|
98
|
+
after(() => {
|
99
|
+
chartsLinePage.steps.clickOnSaveQuestionButton();
|
100
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
101
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
102
|
+
});
|
103
|
+
};
|
104
|
+
|
105
|
+
it('When the user selects \'Grading\' view without attempting the question, the correct answer should be displayed in the correct answer section graph and your answer is incorrect status message should be displayed', () => {
|
106
|
+
if (view === 'Grading view') {
|
107
|
+
studentViewPage.steps.submitResponse();
|
108
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
109
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
110
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
111
|
+
} else {
|
112
|
+
chartsLinePage.steps.switchToGradingView();
|
113
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
114
|
+
}
|
115
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
116
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
117
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
118
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
119
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
120
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
121
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
122
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
123
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
124
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
125
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
126
|
+
});
|
127
|
+
|
128
|
+
//Fully incorrect case
|
129
|
+
it('When the user incorrectly sets a point which was correct by default, then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
130
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 0, value: 5, range: 10 });
|
131
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 4, value: 2, range: 10 });
|
132
|
+
if (view === 'Grading view') {
|
133
|
+
studentViewPage.steps.submitResponse();
|
134
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
135
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
136
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
137
|
+
} else {
|
138
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
139
|
+
chartsLinePage.steps.switchToGradingView();
|
140
|
+
}
|
141
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'incorrect');
|
142
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
143
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
144
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
145
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'incorrect');
|
146
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
147
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
148
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
149
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
150
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
151
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
152
|
+
});
|
153
|
+
|
154
|
+
//Partially correct cases
|
155
|
+
it('When the user incorrectly sets a point which was set to 0 and correct by default, then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
156
|
+
if (view === 'Grading view') {
|
157
|
+
studentViewPage.steps.clearResponses();
|
158
|
+
}
|
159
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 4, value: 5, range: 10 });
|
160
|
+
if (view === 'Grading view') {
|
161
|
+
studentViewPage.steps.submitResponse();
|
162
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
163
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
164
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
165
|
+
} else {
|
166
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
167
|
+
chartsLinePage.steps.switchToGradingView();
|
168
|
+
}
|
169
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
170
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
171
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
172
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
173
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'incorrect');
|
174
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
175
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
176
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
177
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
178
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
179
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
180
|
+
});
|
181
|
+
|
182
|
+
it('When the user attempts the question partially correct by incorrectly setting a point which was incorrect by default, then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, correct icons should be displayed on the correctly attempted points, incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
183
|
+
if (view === 'Grading view') {
|
184
|
+
studentViewPage.steps.clearResponses();
|
185
|
+
}
|
186
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 3, value: 2, range: 10 });
|
187
|
+
if (view === 'Grading view') {
|
188
|
+
studentViewPage.steps.submitResponse();
|
189
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
190
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
191
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
192
|
+
} else {
|
193
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
194
|
+
chartsLinePage.steps.switchToGradingView();
|
195
|
+
}
|
196
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
197
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
198
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
199
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
200
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
201
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
202
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
203
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
204
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
205
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
206
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
207
|
+
});
|
208
|
+
|
209
|
+
it('When the user attempts the question partially correct by incorrectly setting a point to zero which was incorrect by default, then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, correct icons should be displayed on the correctly attempted points, incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
210
|
+
if (view === 'Grading view') {
|
211
|
+
studentViewPage.steps.clearResponses();
|
212
|
+
}
|
213
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 3, value: 0, range: 10 });
|
214
|
+
if (view === 'Grading view') {
|
215
|
+
studentViewPage.steps.submitResponse();
|
216
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
217
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
218
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
219
|
+
} else {
|
220
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
221
|
+
chartsLinePage.steps.switchToGradingView();
|
222
|
+
}
|
223
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
224
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
225
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
226
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
227
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
228
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
229
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
230
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
231
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
232
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
233
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
234
|
+
});
|
235
|
+
|
236
|
+
it('When the user attempts the question partially correct by incorrectly setting a point which was set to zero by default, then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, correct icons should be displayed on the correctly attempted points, incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
237
|
+
if (view === 'Grading view') {
|
238
|
+
studentViewPage.steps.clearResponses();
|
239
|
+
}
|
240
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 2, value: 9, range: 10 });
|
241
|
+
if (view === 'Grading view') {
|
242
|
+
studentViewPage.steps.submitResponse();
|
243
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
244
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
245
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
246
|
+
} else {
|
247
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
248
|
+
chartsLinePage.steps.switchToGradingView();
|
249
|
+
}
|
250
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
251
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
252
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
253
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'incorrect');
|
254
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
255
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
256
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
257
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
258
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
259
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
260
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
261
|
+
});
|
262
|
+
|
263
|
+
it('When the user attempts the question partially correct by setting all points correctly except 1 then the user should be awarded with 0 points and on switching to grading view \'Your answer is incorrect\' should be displayed, correct icons should be displayed on the correctly attempted points and incorrect icons should be displayed on the incorrectly attempted points and correct answer section should be displayed with the correct answers', () => {
|
264
|
+
if (view === 'Grading view') {
|
265
|
+
studentViewPage.steps.clearResponses();
|
266
|
+
}
|
267
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 3, value: 5, range: 10 });
|
268
|
+
if (view === 'Grading view') {
|
269
|
+
studentViewPage.steps.submitResponse();
|
270
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
271
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
272
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
273
|
+
} else {
|
274
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
275
|
+
chartsLinePage.steps.switchToGradingView();
|
276
|
+
}
|
277
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
278
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
279
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'incorrect');
|
280
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'correct');
|
281
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
282
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
283
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
|
284
|
+
chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
|
285
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
286
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 5, range: 10 });
|
287
|
+
chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
|
288
|
+
});
|
289
|
+
|
290
|
+
//Fully correct
|
291
|
+
it('When the user attempts the question correctly then the user should be awarded with full points and on switching to grading view \'Your answer is correct\' should be displayed, correct icons should be displayed on the correctly attempted points and the correct answer section graph should not be displayed', () => {
|
292
|
+
if (view === 'Grading view') {
|
293
|
+
studentViewPage.steps.clearResponses();
|
294
|
+
}
|
295
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 2, value: 6, range: 10 });
|
296
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 3, value: 5, range: 10 });
|
297
|
+
if (view === 'Grading view') {
|
298
|
+
studentViewPage.steps.submitResponse();
|
299
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
300
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
301
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
302
|
+
} else {
|
303
|
+
chartsLinePage.steps.verifyPreviewScore(20, 20);
|
304
|
+
chartsLinePage.steps.switchToGradingView();
|
305
|
+
}
|
306
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(0, 'correct');
|
307
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconNotExistsInPreviewTab(1);
|
308
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(2, 'correct');
|
309
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(3, 'correct');
|
310
|
+
chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
|
311
|
+
chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
312
|
+
chartsLinePage.steps.verifyCorrectAnswerSectionNotExist();
|
313
|
+
});
|
314
|
+
});
|
315
|
+
});
|
316
|
+
|
317
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
318
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
319
|
+
abortEarlySetup();
|
320
|
+
before(() => {
|
321
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
322
|
+
cy.barsPreLoaderWait();
|
323
|
+
chartsLinePage.steps.selectLineButton();
|
324
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 0, value: 1, range: 10 });
|
325
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 1, value: 2, range: 10 });
|
326
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 2, value: 3, range: 10 });
|
327
|
+
chartsLinePage.steps.allotPoints(20);
|
328
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
|
329
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 1, value: 5, range: 10 });
|
330
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 2, value: 6, range: 10 });
|
331
|
+
});
|
332
|
+
|
333
|
+
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', () => {
|
334
|
+
chartsLinePage.steps.expandMinimumScoringDropdown();
|
335
|
+
chartsLinePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
336
|
+
chartsLinePage.steps.allotMinimumPoints(2);
|
337
|
+
chartsLinePage.steps.switchToPreviewTab();
|
338
|
+
chartsLinePage.steps.switchToGradingView();
|
339
|
+
chartsLinePage.steps.verifyPreviewScore(2, 20);
|
340
|
+
chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
341
|
+
});
|
342
|
+
|
343
|
+
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', () => {
|
344
|
+
chartsLinePage.steps.resetQuestionPreview();
|
345
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 0, value: 2, range: 10 });
|
346
|
+
chartsLinePage.steps.verifyPreviewScore(2, 20);
|
347
|
+
chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
348
|
+
});
|
349
|
+
|
350
|
+
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', () => {
|
351
|
+
chartsLinePage.steps.switchToEditTab();
|
352
|
+
chartsLinePage.steps.expandMinimumScoringDropdown();
|
353
|
+
chartsLinePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
354
|
+
chartsLinePage.steps.allotMinimumPoints(2);
|
355
|
+
chartsLinePage.steps.switchToPreviewTab();
|
356
|
+
chartsLinePage.steps.switchToGradingView();
|
357
|
+
chartsLinePage.steps.verifyPreviewScore(0, 20);
|
358
|
+
chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
359
|
+
});
|
360
|
+
|
361
|
+
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', () => {
|
362
|
+
chartsLinePage.steps.setPointValueInPreviewTab({ pointIndex: 0, value: 2, range: 10 });
|
363
|
+
chartsLinePage.steps.verifyPreviewScore(2, 20);
|
364
|
+
});
|
365
|
+
});
|
366
|
+
};
|
367
|
+
});
|
@@ -96,10 +96,10 @@ describe('Create item page - Charts - Line: Grading view, Correct answer view co
|
|
96
96
|
});
|
97
97
|
|
98
98
|
it('All the points in grading view should be non-editable', () => {
|
99
|
-
chartsLinePage.steps.keyBoardUpPointInPreviewTab(0);
|
100
|
-
chartsLinePage.steps.keyBoardUpPointInPreviewTab(1);
|
99
|
+
chartsLinePage.steps.keyBoardUpPointInPreviewTab(0);
|
100
|
+
chartsLinePage.steps.keyBoardUpPointInPreviewTab(1);
|
101
101
|
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 0, value: 1, range: 20 });
|
102
|
-
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 1, value: 2, range: 20 });
|
102
|
+
chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 1, value: 2, range: 20 });
|
103
103
|
for (let index = 0; index < 5; index++) {
|
104
104
|
utilities.triggerMouseover(utilities.getNthElement(chartsLinePage.previewTabPoint(), index));
|
105
105
|
utilities.verifyElementVisibilityState(chartsLinePage.barAndPointTooltipWrapper(), 'notExist');
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import { compassPage } from "../../../pages";
|
2
|
+
import utilities from "../../../support/helpers/utilities";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env("css");
|
5
|
+
|
6
|
+
describe("Create Item page - Compass:", () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs("admin");
|
9
|
+
});
|
10
|
+
|
11
|
+
describe("Compass: Header section", () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log("Navigating to compass resource tool");
|
15
|
+
compassPage.steps.navigateToCreateResource("Compass");
|
16
|
+
});
|
17
|
+
|
18
|
+
compassPage.tests.verifyCreateQuestionPageQuestionTypeHeader("Compass");
|
19
|
+
});
|
20
|
+
|
21
|
+
describe("Compass: Edit tab basic section", () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log("Navigating to compass resource tool");
|
25
|
+
compassPage.steps.navigateToCreateResource("Compass");
|
26
|
+
});
|
27
|
+
|
28
|
+
it("\'Compass visibility\' label should be displayed in the edit tab", () => {
|
29
|
+
compassPage.steps.verifyCompassVisibilityLabel("Compass visibility");
|
30
|
+
});
|
31
|
+
|
32
|
+
it("'Add show/hide button' label and checkbox should be displayed and by default the checkbox should be unchecked", () => {
|
33
|
+
compassPage.steps.verifyAddShowHideButtonLabel();
|
34
|
+
compassPage.steps.verifyAddShowHideButtonCheckboxUnchecked();
|
35
|
+
});
|
36
|
+
|
37
|
+
it("When the user checks the 'Add show/hide button' checkbox then 'Launch the compass by default' label and checkbox should be displayed and by default it should be unchecked", () => {
|
38
|
+
compassPage.steps.checkAddShowHideButtonCheckbox();
|
39
|
+
compassPage.steps.verifyLaunchToolByDefaultLabel("compass");
|
40
|
+
compassPage.steps.verifyLaunchToolByDefaultCheckboxUnchecked();
|
41
|
+
});
|
42
|
+
|
43
|
+
it("The user should be able to check the \'Launch the compass by default\' checkbox", () => {
|
44
|
+
compassPage.steps.checkLaunchToolByDefaultCheckbox();
|
45
|
+
});
|
46
|
+
|
47
|
+
it("CSS of edit tab basic section", { tags: "css" }, () => {
|
48
|
+
utilities.verifyCSS(compassPage.compassVisibilityLabel(), {
|
49
|
+
color: css.color.labels,
|
50
|
+
"font-size": css.fontSize.default,
|
51
|
+
"font-weight": css.fontWeight.semibold,
|
52
|
+
});
|
53
|
+
utilities.verifyCSS(compassPage.addShowHideButtonLabel(), {
|
54
|
+
color: css.color.labels,
|
55
|
+
"font-size": css.fontSize.normal,
|
56
|
+
"font-weight": css.fontWeight.regular,
|
57
|
+
});
|
58
|
+
utilities.verifyCSS(compassPage.launchToolByDefaultLabel(), {
|
59
|
+
color: css.color.labels,
|
60
|
+
"font-size": css.fontSize.normal,
|
61
|
+
"font-weight": css.fontWeight.regular,
|
62
|
+
});
|
63
|
+
utilities.verifyCSS(compassPage.addShowHideButtonCheckbox().parents("span").find("svg g g"), {
|
64
|
+
fill: css.color.activeButtons,
|
65
|
+
});
|
66
|
+
utilities.verifyCSS(compassPage.launchToolByDefaultCheckbox().parents("span").find("svg g g"), {
|
67
|
+
fill: css.color.activeButtons,
|
68
|
+
});
|
69
|
+
});
|
70
|
+
|
71
|
+
it("Accessibility of edit tab contents", { tags: "a11y" }, () => {
|
72
|
+
cy.checkAccessibility(compassPage.compassVisibilityLabel().parents('[class*="TabsComponentstyles__EditTabWrapper"]'));
|
73
|
+
});
|
74
|
+
});
|
75
|
+
|
76
|
+
describe("Compass: Edit tab functionality", () => {
|
77
|
+
abortEarlySetup();
|
78
|
+
before(() => {
|
79
|
+
cy.log("Navigating to passage resource type");
|
80
|
+
compassPage.steps.navigateToCreateResource("Compass");
|
81
|
+
});
|
82
|
+
|
83
|
+
it("When the user switches to preview tab then 'Show compass' button should not be displayed and the compass should be displayed", () => {
|
84
|
+
compassPage.steps.switchToPreviewTab();
|
85
|
+
compassPage.steps.verifyCompassToolIsVisible();
|
86
|
+
utilities.verifyElementVisibilityState(compassPage.previewTabCompassVisibilityButton(),"notExist");
|
87
|
+
});
|
88
|
+
|
89
|
+
it("When the user checks the 'Add show/hide button' checkbox then 'Show compass' button should be displayed and the compass should not be displayed", () => {
|
90
|
+
compassPage.steps.switchToEditTab();
|
91
|
+
compassPage.steps.checkAddShowHideButtonCheckbox();
|
92
|
+
compassPage.steps.switchToPreviewTab();
|
93
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel("Show");
|
94
|
+
compassPage.steps.verifyCompassToolNotVisible();
|
95
|
+
});
|
96
|
+
|
97
|
+
it("When the user selects 'Show compass' button then the compass should be displayed and the button should change to 'Hide compass'", () => {
|
98
|
+
compassPage.steps.clickOnCompassToolVisibilityButton();
|
99
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel("Hide");
|
100
|
+
compassPage.steps.verifyCompassToolIsVisible();
|
101
|
+
});
|
102
|
+
|
103
|
+
it("When the user checks 'Launch the compass by default' checkbox in edit tab then on switching to preview tab the compass should be displayed along with 'Hide compass' button", () => {
|
104
|
+
compassPage.steps.switchToEditTab();
|
105
|
+
compassPage.steps.checkLaunchToolByDefaultCheckbox();
|
106
|
+
compassPage.steps.switchToPreviewTab();
|
107
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel("Hide");
|
108
|
+
compassPage.steps.verifyCompassToolIsVisible();
|
109
|
+
});
|
110
|
+
|
111
|
+
it("CSS of preview tab basic section", { tags: "css" }, () => {
|
112
|
+
utilities.verifyCSS(compassPage.previewTabCompassVisibilityButton().find("p"), {
|
113
|
+
color: css.color.activeButtons,
|
114
|
+
"font-size": css.fontSize.normal,
|
115
|
+
"font-weight": css.fontWeight.semibold,
|
116
|
+
});
|
117
|
+
utilities.verifyCSS(compassPage.previewTabCompassVisibilityButton(), {
|
118
|
+
"border-top-color": css.color.activeButtons,
|
119
|
+
"border-left-color": css.color.activeButtons,
|
120
|
+
"border-right-color": css.color.activeButtons,
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
124
|
+
it("Accessibility of preview tab compass tool", { tags: "a11y" }, () => {
|
125
|
+
cy.checkAccessibility(compassPage.previewTabCompassVisibilityButton().parents('[class*="resource-and-tool-preview-wrapper"]'));
|
126
|
+
});
|
127
|
+
|
128
|
+
it("When the user selects 'Hide compass' button then the compass should not be displayed and the button should change to 'Show compass'", () => {
|
129
|
+
compassPage.steps.clickOnCompassToolVisibilityButton();
|
130
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel("Show");
|
131
|
+
compassPage.steps.verifyCompassToolNotVisible();
|
132
|
+
});
|
133
|
+
});
|
134
|
+
});
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { compassPage, 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
|
+
|
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('Preview tab contents for all views', () => {
|
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
|
+
cy.log('Navigating to passage resource type');
|
22
|
+
compassPage.steps.navigateToCreateResource('Compass');
|
23
|
+
compassPage.steps.checkAddShowHideButtonCheckbox();
|
24
|
+
compassPage.steps.switchToPreviewTab();
|
25
|
+
break;
|
26
|
+
case 'Item view':
|
27
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
28
|
+
break;
|
29
|
+
case 'Item preview':
|
30
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
31
|
+
compassPage.steps.switchToPreviewTab();
|
32
|
+
break;
|
33
|
+
case 'Student view':
|
34
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
35
|
+
break;
|
36
|
+
case 'Grading view':
|
37
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
38
|
+
break;
|
39
|
+
case 'Correct answer view':
|
40
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
41
|
+
break;
|
42
|
+
default:
|
43
|
+
throw new Error('Invalid view');
|
44
|
+
}
|
45
|
+
});
|
46
|
+
|
47
|
+
after(() => {
|
48
|
+
if (view === 'Question preview') {
|
49
|
+
compassPage.steps.clickOnSaveQuestionButton();
|
50
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
51
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
52
|
+
}
|
53
|
+
if (view === 'Student view') {
|
54
|
+
studentViewPage.steps.submitResponse();
|
55
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'exist');
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
it('The \'Show compass\' button should be visible and \'Compass\' should not be visible',()=>{
|
60
|
+
compassPage.steps.verifyCompassToolNotVisible();
|
61
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel('Show');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('When user clicks on \'Show compass\' button then \'Compass\' should be displayed and \'Show compass\' button should change to \'Hide compass\'', () => {
|
65
|
+
compassPage.steps.clickOnCompassToolVisibilityButton();
|
66
|
+
compassPage.steps.verifyCompassToolIsVisible();
|
67
|
+
compassPage.steps.verifyPreviewTabCompassVisibilityButtonLabel('Hide');
|
68
|
+
});
|
69
|
+
|
70
|
+
it('CSS of preview tab basic section', { tags: 'css' }, () => {
|
71
|
+
utilities.verifyCSS(compassPage.previewTabCompassVisibilityButton().find('p'), {
|
72
|
+
'color': css.color.activeButtons,
|
73
|
+
'font-size': css.fontSize.normal,
|
74
|
+
'font-weight': css.fontWeight.semibold
|
75
|
+
});
|
76
|
+
utilities.verifyCSS(compassPage.previewTabCompassVisibilityButton(), {
|
77
|
+
'border-top-color': css.color.activeButtons,
|
78
|
+
'border-left-color': css.color.activeButtons,
|
79
|
+
'border-right-color': css.color.activeButtons,
|
80
|
+
});
|
81
|
+
});
|
82
|
+
|
83
|
+
it('Accessibility of preview tab compass tool', { tags: 'a11y' }, () => {
|
84
|
+
cy.checkAccessibility(compassPage.previewTabCompassVisibilityButton().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
85
|
+
});
|
86
|
+
});
|
87
|
+
});
|
88
|
+
});
|
@@ -203,8 +203,9 @@ describe('Create item page: Feedback scale - Question instructions, Legend text,
|
|
203
203
|
});
|
204
204
|
});
|
205
205
|
|
206
|
-
it('
|
206
|
+
it('On switching to the Preview tab, No scoring label or score should be displayed', () => {
|
207
207
|
feedbackScalePage.steps.switchToPreviewTab();
|
208
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.scoringTypeLabelPreviewTab(), 'notExist');
|
208
209
|
});
|
209
210
|
|
210
211
|
feedbackScalePage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
@@ -46,7 +46,7 @@ describe('Create item page - Fill in the gaps: Question instructions, Options se
|
|
46
46
|
|
47
47
|
it('The dropdown should be displayed with numeric count and a close button in the question input field, dropdown settings button should not be displayed when "User specified width" is in selected state', () => {
|
48
48
|
for (let index = 0; index < 2; index++) {
|
49
|
-
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(index)
|
49
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(index, 'notExist')
|
50
50
|
};
|
51
51
|
});
|
52
52
|
|
@@ -78,7 +78,7 @@ describe('Create item page - Fill in the gaps: Question instructions, Options se
|
|
78
78
|
fillInTheGapsDropdownPage.steps.verifyResponseAreaButtonEnabled();
|
79
79
|
fillInTheGapsDropdownPage.steps.clickOnAddResponseAreaButton();
|
80
80
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.responseArea(), 3);
|
81
|
-
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(2);
|
81
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(2, 'notExist');
|
82
82
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownOptionsTab(), 3);
|
83
83
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownSpecifyCorrectAnswerSection(), 3);
|
84
84
|
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
@@ -92,7 +92,7 @@ describe('Create item page - Fill in the gaps: Question instructions, Options se
|
|
92
92
|
cy.log('Checking if 3rd dropdown gets removed from the question input field and the numeric counts get updated')
|
93
93
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.responseArea(), 2);
|
94
94
|
for (let index = 0; index < 2; index++) {
|
95
|
-
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(index)
|
95
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaContents(index, 'notExist')
|
96
96
|
};
|
97
97
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownOptionsTab(), 2);
|
98
98
|
utilities.verifyElementCount(fillInTheGapsDropdownPage.dropdownSpecifyCorrectAnswerSection(), 2);
|