itemengine-cypress-automation 1.0.600 → 1.0.602-IEI-7279-fe9422d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +100 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +100 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +104 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +102 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +88 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +106 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +382 -2
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +24 -1
- package/cypress/pages/matchingPage.js +2 -2
- package/package.json +1 -1
|
@@ -10,6 +10,10 @@ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
|
10
10
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
11
11
|
const correctAnswerArray = ['Flower', 'Leaf'];
|
|
12
12
|
const incorrectAnswerArray = ['Branch', 'Seed'];
|
|
13
|
+
const alternateAnswerArray = ['Petal', 'Leaves'];
|
|
14
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
|
|
15
|
+
const correctAnswerLabel = 'Correct answer';
|
|
16
|
+
const alternativeAnswerLabel = 'Alternative answer';
|
|
13
17
|
|
|
14
18
|
describe('Create item page - Fill in the gaps over image - dropdown: All or nothing ', () => {
|
|
15
19
|
before(() => {
|
|
@@ -116,8 +120,12 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
116
120
|
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
117
121
|
};
|
|
118
122
|
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
119
|
-
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
120
123
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
124
|
+
if(alternativeAnswerCheck === 'true') {
|
|
125
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(20 points)', 0);
|
|
126
|
+
} else {
|
|
127
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
128
|
+
}
|
|
121
129
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
122
130
|
});
|
|
123
131
|
|
|
@@ -137,6 +145,9 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
137
145
|
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
138
146
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
139
147
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
148
|
+
if (alternativeAnswerCheck === 'true') {
|
|
149
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
150
|
+
}
|
|
140
151
|
});
|
|
141
152
|
|
|
142
153
|
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
@@ -158,6 +169,9 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
158
169
|
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
159
170
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
160
171
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
172
|
+
if (alternativeAnswerCheck === 'true') {
|
|
173
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
174
|
+
}
|
|
161
175
|
});
|
|
162
176
|
|
|
163
177
|
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', () => {
|
|
@@ -180,10 +194,188 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
180
194
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
181
195
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
182
196
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
197
|
+
if (alternativeAnswerCheck === 'true') {
|
|
198
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
199
|
+
}
|
|
183
200
|
});
|
|
184
201
|
});
|
|
185
202
|
});
|
|
186
203
|
|
|
204
|
+
if (alternativeAnswerCheck === 'true') {
|
|
205
|
+
views.forEach((view) => {
|
|
206
|
+
describe(`${view}: Auto scored - All or nothing scoring with alternative answers`, { tags: 'smoke' }, () => {
|
|
207
|
+
abortEarlySetup();
|
|
208
|
+
before(() => {
|
|
209
|
+
switch (view) {
|
|
210
|
+
case 'Question preview':
|
|
211
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image with dropdown');
|
|
212
|
+
cy.barsPreLoaderWait();
|
|
213
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
|
214
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
|
215
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
|
216
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(30);
|
|
217
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
|
218
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
|
219
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
|
220
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
|
221
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
|
222
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
|
223
|
+
fillInTheGapsOverImageDropdownPage.steps.addAlternativeAnswerAccordion(1);
|
|
224
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(10);
|
|
225
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
|
|
226
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
|
|
227
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
|
228
|
+
break;
|
|
229
|
+
case 'Item preview':
|
|
230
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
231
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
232
|
+
break;
|
|
233
|
+
case 'Grading view':
|
|
234
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
235
|
+
break;
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
beforeEach(() => {
|
|
240
|
+
switch (view) {
|
|
241
|
+
case 'Question preview':
|
|
242
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
243
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
|
244
|
+
break;
|
|
245
|
+
case 'Item preview':
|
|
246
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
247
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
248
|
+
break;
|
|
249
|
+
case 'Grading view':
|
|
250
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
251
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploadedInPreviewTab();
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
if (view === 'Question preview') {
|
|
257
|
+
after(() => {
|
|
258
|
+
fillInTheGapsOverImageDropdownPage.steps.clickOnSaveQuestionButton();
|
|
259
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
260
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
|
265
|
+
if (view === 'Grading view') {
|
|
266
|
+
studentViewPage.steps.submitResponse();
|
|
267
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
268
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
269
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
270
|
+
};
|
|
271
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
272
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
273
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
274
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
275
|
+
};
|
|
276
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
277
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
278
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(20 points)', 0);
|
|
279
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
280
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
281
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
282
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
283
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
284
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
285
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
286
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(10 points)', 1);
|
|
287
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
288
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
289
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
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', () => {
|
|
293
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
294
|
+
if (view === 'Grading view') {
|
|
295
|
+
studentViewPage.steps.submitResponse();
|
|
296
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
297
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
298
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
299
|
+
};
|
|
300
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
301
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
302
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
303
|
+
};
|
|
304
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
|
305
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
306
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
307
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
308
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(20 points)', 0);
|
|
309
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
310
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
311
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
312
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
313
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
314
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
315
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(10 points)', 1);
|
|
316
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
317
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
318
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
322
|
+
if (view === 'Grading view') {
|
|
323
|
+
studentViewPage.steps.clearResponses();
|
|
324
|
+
};
|
|
325
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
326
|
+
if (view === 'Grading view') {
|
|
327
|
+
studentViewPage.steps.submitResponse();
|
|
328
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
329
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
330
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
331
|
+
};
|
|
332
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
333
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
334
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
335
|
+
};
|
|
336
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
337
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
338
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
339
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
340
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(20 points)', 0);
|
|
341
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
342
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
343
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
344
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
345
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
346
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
347
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(10 points)', 1);
|
|
348
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
349
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
350
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
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', () => {
|
|
354
|
+
if (view === 'Grading view') {
|
|
355
|
+
studentViewPage.steps.clearResponses();
|
|
356
|
+
};
|
|
357
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
|
358
|
+
if (view === 'Grading view') {
|
|
359
|
+
studentViewPage.steps.submitResponse();
|
|
360
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
361
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
362
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
|
363
|
+
};
|
|
364
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
365
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(20, 20);
|
|
366
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
367
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
|
368
|
+
};
|
|
369
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
370
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
371
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
372
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
373
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
187
379
|
views.forEach((view) => {
|
|
188
380
|
describe(`${view}: Manually scored`, { tags: 'smoke' }, () => {
|
|
189
381
|
abortEarlySetup();
|
|
@@ -259,6 +451,9 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
259
451
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
|
260
452
|
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerStatusBannerNotExist();
|
|
261
453
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExist();
|
|
454
|
+
if (alternativeAnswerCheck === 'true') {
|
|
455
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
456
|
+
}
|
|
262
457
|
});
|
|
263
458
|
});
|
|
264
459
|
});
|
|
@@ -331,7 +526,12 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
331
526
|
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
332
527
|
};
|
|
333
528
|
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
334
|
-
|
|
529
|
+
if (alternativeAnswerCheck === 'true') {
|
|
530
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(0 points)', 0);
|
|
531
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
532
|
+
} else {
|
|
533
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
534
|
+
}
|
|
335
535
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
336
536
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
337
537
|
});
|
|
@@ -351,6 +551,9 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
351
551
|
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
352
552
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
353
553
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
554
|
+
if (alternativeAnswerCheck === 'true') {
|
|
555
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
556
|
+
}
|
|
354
557
|
});
|
|
355
558
|
|
|
356
559
|
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
@@ -371,6 +574,9 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
371
574
|
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
372
575
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
373
576
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
577
|
+
if (alternativeAnswerCheck === 'true') {
|
|
578
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
579
|
+
}
|
|
374
580
|
});
|
|
375
581
|
|
|
376
582
|
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', () => {
|
|
@@ -391,10 +597,184 @@ describe('Create item page - Fill in the gaps over image - dropdown: All or noth
|
|
|
391
597
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
392
598
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
393
599
|
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
600
|
+
if (alternativeAnswerCheck === 'true') {
|
|
601
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
602
|
+
}
|
|
394
603
|
});
|
|
395
604
|
});
|
|
396
605
|
});
|
|
397
606
|
|
|
607
|
+
if (alternativeAnswerCheck === 'true') {
|
|
608
|
+
views.forEach((view) => {
|
|
609
|
+
describe(`${view}: Non scored with alternative answers`, { tags: 'smoke' }, () => {
|
|
610
|
+
abortEarlySetup();
|
|
611
|
+
before(() => {
|
|
612
|
+
switch (view) {
|
|
613
|
+
case 'Question preview':
|
|
614
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image with dropdown');
|
|
615
|
+
cy.barsPreLoaderWait();
|
|
616
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
|
617
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
|
618
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
|
619
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(30);
|
|
620
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
|
621
|
+
fillInTheGapsOverImageDropdownPage.steps.expandScoringTypeDropdown();
|
|
622
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
|
623
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
|
624
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
|
625
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
|
626
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
|
627
|
+
fillInTheGapsOverImageDropdownPage.steps.addAlternativeAnswerAccordion(1);
|
|
628
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
|
|
629
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
|
|
630
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
|
631
|
+
break;
|
|
632
|
+
case 'Item preview':
|
|
633
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
634
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
635
|
+
break;
|
|
636
|
+
case 'Grading view':
|
|
637
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
638
|
+
break;
|
|
639
|
+
};
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
beforeEach(() => {
|
|
643
|
+
switch (view) {
|
|
644
|
+
case 'Question preview':
|
|
645
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
646
|
+
fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
|
|
647
|
+
break;
|
|
648
|
+
case 'Item preview':
|
|
649
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
650
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
651
|
+
break;
|
|
652
|
+
case 'Grading view':
|
|
653
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
654
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploadedInPreviewTab();
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
if (view === 'Question preview') {
|
|
660
|
+
after(() => {
|
|
661
|
+
fillInTheGapsOverImageDropdownPage.steps.clickOnSaveQuestionButton();
|
|
662
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
663
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
664
|
+
});
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
|
668
|
+
if (view === 'Grading view') {
|
|
669
|
+
studentViewPage.steps.submitResponse();
|
|
670
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
671
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
672
|
+
};
|
|
673
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
674
|
+
fillInTheGapsOverImageDropdownPage.steps.checkNonScoredScoringLabel();
|
|
675
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
676
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
677
|
+
};
|
|
678
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
679
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(0 points)', 0);
|
|
680
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
681
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
682
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
683
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
684
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
685
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
686
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
687
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(0 points)', 1);
|
|
688
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
689
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
690
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
691
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
692
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
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', () => {
|
|
696
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
697
|
+
if (view === 'Grading view') {
|
|
698
|
+
studentViewPage.steps.submitResponse();
|
|
699
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
700
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
701
|
+
};
|
|
702
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
703
|
+
fillInTheGapsOverImageDropdownPage.steps.checkNonScoredScoringLabel();
|
|
704
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
705
|
+
};
|
|
706
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
|
707
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
708
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
709
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
710
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(0 points)', 0);
|
|
711
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
712
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
713
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
714
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
715
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
716
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
717
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(0 points)', 1);
|
|
718
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
719
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
720
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
724
|
+
if (view === 'Grading view') {
|
|
725
|
+
studentViewPage.steps.clearResponses();
|
|
726
|
+
};
|
|
727
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
728
|
+
if (view === 'Grading view') {
|
|
729
|
+
studentViewPage.steps.submitResponse();
|
|
730
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
731
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
732
|
+
};
|
|
733
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
734
|
+
fillInTheGapsOverImageDropdownPage.steps.checkNonScoredScoringLabel();
|
|
735
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
736
|
+
};
|
|
737
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
738
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
739
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
740
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
741
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(correctAnswerLabel, '(0 points)', 0);
|
|
742
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleExists();
|
|
743
|
+
fillInTheGapsOverImageDropdownPage.steps.disableShowAlternativeAnswersToggle();
|
|
744
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
745
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
746
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
747
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
748
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAnswerLabelAndPoints(alternativeAnswerLabel, '(0 points)', 1);
|
|
749
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray, 1);
|
|
750
|
+
fillInTheGapsOverImageDropdownPage.steps.clickShowAlternativeAnswersToggle();
|
|
751
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
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', () => {
|
|
755
|
+
if (view === 'Grading view') {
|
|
756
|
+
studentViewPage.steps.clearResponses();
|
|
757
|
+
};
|
|
758
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
|
759
|
+
if (view === 'Grading view') {
|
|
760
|
+
studentViewPage.steps.submitResponse();
|
|
761
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
762
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
763
|
+
};
|
|
764
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
765
|
+
fillInTheGapsOverImageDropdownPage.steps.checkNonScoredScoringLabel();
|
|
766
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
|
767
|
+
};
|
|
768
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
769
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
770
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
771
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
772
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
773
|
+
});
|
|
774
|
+
});
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
|
|
398
778
|
if (!grepTags || !grepTags.includes('smoke')) {
|
|
399
779
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
|
400
780
|
abortEarlySetup();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
|
-
import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, placeholderTextSectionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, commonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent } from "./components";
|
|
2
|
+
import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, placeholderTextSectionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, commonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent, showAlternativeAnswersComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
5
|
|
|
@@ -21,12 +21,15 @@ const selectors = {
|
|
|
21
21
|
...autoScoredSpecifyCorrectAnswerSection,
|
|
22
22
|
...figCommonStyleAndLayoutComponent,
|
|
23
23
|
...connectorStyleStyleAndLayoutCustomizationComponent,
|
|
24
|
+
...showAlternativeAnswersComponent,
|
|
24
25
|
|
|
25
26
|
optionsInputField: () => cy.get('[class*="TextFieldWrapper"] input'),
|
|
26
27
|
optionNumeration: () => cy.get('.MuiInputAdornment-positionStart'),
|
|
27
28
|
pointsLabel: () => cy.get('.cloze-with-text-partial-points-per-response-label'),
|
|
28
29
|
dropdownWrapperPreviewTab: () => cy.get('[class*="Canvasstyle__DropzoneWrapper"]'),
|
|
29
30
|
correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
|
|
31
|
+
correctAnswersWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__CorrectAnswers"]'),
|
|
32
|
+
correctAnswersNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
30
33
|
correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
|
|
31
34
|
correctAnswerSectionWrapper: () => cy.get('.dnd-correct-answer-wrapper'),
|
|
32
35
|
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answers-label"]'),
|
|
@@ -65,6 +68,7 @@ const steps = {
|
|
|
65
68
|
...figCommonStyleAndLayoutComponent.steps,
|
|
66
69
|
...connectorStyleStyleAndLayoutCustomizationComponent.steps,
|
|
67
70
|
...createItemPage.steps,
|
|
71
|
+
...showAlternativeAnswersComponent.steps,
|
|
68
72
|
/**
|
|
69
73
|
* Verify that the correct option icon is is displayed for a specific dropdown.
|
|
70
74
|
* @param {number} dropdownIndex - The index of the dropdown.
|
|
@@ -208,6 +212,25 @@ const steps = {
|
|
|
208
212
|
});
|
|
209
213
|
},
|
|
210
214
|
|
|
215
|
+
/**
|
|
216
|
+
* @param {Array<{label: string, points: string, answers: string[][]}>} alternativeAnswers - Array of alternative answer objects.
|
|
217
|
+
* @description Verifies alternative answer sections with labels, points, enumeration, and answers.
|
|
218
|
+
* Example: verifyAlternativeAnswerSections([{label: 'Alternative answer 1', points: '(10 points)', answers: [['Elephant'], ['Fish'], ['Cat']]}])
|
|
219
|
+
*/
|
|
220
|
+
verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = [], index) => {
|
|
221
|
+
fillInTheGapsOverImageDropdownPage.correctAnswersWrapper()
|
|
222
|
+
.eq(index)
|
|
223
|
+
.within(() => {
|
|
224
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper(), alternativeAnswers.length);
|
|
225
|
+
alternativeAnswers.forEach((correctAnswer, index) => {
|
|
226
|
+
utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.correctAnswersNumeration(), index), index + 1);
|
|
227
|
+
fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
|
|
228
|
+
.eq(index)
|
|
229
|
+
.should('have.text', correctAnswer);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
|
|
211
234
|
verifyVisibilityOfCorrectAnswerLabel: () => {
|
|
212
235
|
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
213
236
|
},
|
|
@@ -966,9 +966,9 @@ const steps = {
|
|
|
966
966
|
* @description Verifies alternative answer sections with labels, points, enumeration, and answers.
|
|
967
967
|
* Example: verifyAlternativeAnswerSections([{label: 'Alternative answer 1', points: '(10 points)', answers: [['Elephant'], ['Fish'], ['Cat']]}])
|
|
968
968
|
*/
|
|
969
|
-
verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = []) => {
|
|
969
|
+
verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = [], index) => {
|
|
970
970
|
matchingPage.correctAnswersWrapper()
|
|
971
|
-
.eq(
|
|
971
|
+
.eq(index)
|
|
972
972
|
.within(() => {
|
|
973
973
|
utilities.verifyElementCount(matchingPage.correctAnswersOptions(), alternativeAnswers.length);
|
|
974
974
|
alternativeAnswers.forEach((correctAnswer, index) => {
|