itemengine-cypress-automation 1.0.368 → 1.0.369
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.
@@ -209,6 +209,226 @@ describe('Create item page - Multiple selection grid: All or nothing ', () => {
|
|
209
209
|
});
|
210
210
|
});
|
211
211
|
|
212
|
+
views.forEach((view) => {
|
213
|
+
describe(`Multiple selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
214
|
+
abortEarlySetup();
|
215
|
+
before(() => {
|
216
|
+
switch (view) {
|
217
|
+
case 'Question preview':
|
218
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
219
|
+
cy.barsPreLoaderWait();
|
220
|
+
multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
|
221
|
+
multipleSelectionGridPage.steps.expandScoringTypeDropdown();
|
222
|
+
multipleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
223
|
+
multipleSelectionGridPage.steps.allotPoints(20);
|
224
|
+
multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
225
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
226
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
227
|
+
multipleSelectionGridPage.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
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
243
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
244
|
+
break;
|
245
|
+
case 'Item preview':
|
246
|
+
multipleSelectionGridPage.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
|
+
break;
|
252
|
+
}
|
253
|
+
});
|
254
|
+
|
255
|
+
if (view === 'Question preview') {
|
256
|
+
after(() => {
|
257
|
+
multipleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
258
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
259
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
260
|
+
});
|
261
|
+
};
|
262
|
+
|
263
|
+
it('Question instructions should be visible', () => {
|
264
|
+
multipleSelectionGridPage.steps.verifyQuestionInstructionsTextPreviewTab('Please select following animals facts are correct or not');
|
265
|
+
multipleSelectionGridPage.steps.verifyVisibityOfQuestionInstructionsText();
|
266
|
+
});
|
267
|
+
|
268
|
+
it('User should be able to attempt the question in student view and correct/incorrect icons, Your answer is correct/incorrect label, and correct answer section should not be displayed in grading view', () => {
|
269
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
270
|
+
if (view === 'Grading view') {
|
271
|
+
studentViewPage.steps.submitResponse();
|
272
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
273
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
274
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
275
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 1, column: 0 });
|
276
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 1, column: 1 });
|
277
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 2, column: 1 });
|
278
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 3, column: 1 });
|
279
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 4, column: 0 });
|
280
|
+
multipleSelectionGridPage.steps.verifyAnswerStatusBannerNotExist();
|
281
|
+
multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
|
282
|
+
};
|
283
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
284
|
+
multipleSelectionGridPage.steps.checkManuallyScoredScoringLabel();
|
285
|
+
};
|
286
|
+
});
|
287
|
+
});
|
288
|
+
});
|
289
|
+
|
290
|
+
views.forEach((view) => {
|
291
|
+
describe(`Multiple selection - Non scored: ${view}`, { tags: 'smoke' }, () => {
|
292
|
+
abortEarlySetup();
|
293
|
+
before(() => {
|
294
|
+
switch (view) {
|
295
|
+
case 'Question preview':
|
296
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
297
|
+
cy.barsPreLoaderWait();
|
298
|
+
multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
|
299
|
+
multipleSelectionGridPage.steps.expandScoringTypeDropdown();
|
300
|
+
multipleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
301
|
+
multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
302
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
303
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
304
|
+
multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
305
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
306
|
+
multipleSelectionGridPage.steps.switchToPreviewTab();
|
307
|
+
break;
|
308
|
+
case 'Item preview':
|
309
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
310
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
311
|
+
break;
|
312
|
+
case 'Grading view':
|
313
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
314
|
+
break;
|
315
|
+
};
|
316
|
+
});
|
317
|
+
|
318
|
+
beforeEach(() => {
|
319
|
+
switch (view) {
|
320
|
+
case 'Question preview':
|
321
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
322
|
+
multipleSelectionGridPage.steps.resetQuestionPreview();
|
323
|
+
break;
|
324
|
+
case 'Item preview':
|
325
|
+
multipleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
326
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
327
|
+
break;
|
328
|
+
case 'Grading view':
|
329
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
330
|
+
break;
|
331
|
+
}
|
332
|
+
});
|
333
|
+
|
334
|
+
if (view === 'Question preview') {
|
335
|
+
after(() => {
|
336
|
+
multipleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
337
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
338
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
339
|
+
});
|
340
|
+
};
|
341
|
+
|
342
|
+
it('When the user selects \'Grading\' view without attempting the question, non scoring label 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 correct/incorrect icons should not be displayed', () => {
|
343
|
+
if (view === 'Grading view') {
|
344
|
+
studentViewPage.steps.submitResponse();
|
345
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
346
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
347
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
348
|
+
};
|
349
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
350
|
+
multipleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
351
|
+
multipleSelectionGridPage.steps.switchToGradingView();
|
352
|
+
multipleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
353
|
+
};
|
354
|
+
utilities.verifyInnerText(multipleSelectionGridPage.correctAnswersSectionLabel(), 'Correct answers');
|
355
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
356
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
|
357
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 1 });
|
358
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 1 });
|
359
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
|
360
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 0 });
|
361
|
+
});
|
362
|
+
|
363
|
+
it('When the user attempts the question incorrectly,and on switching to \'Grading\' view non scoring label should be displayed, incorrect icon should be displayed beside incorrect response, a status message with text \'Your answer is incorrect\' and correct answer section with correct answer should be displayed', () => {
|
364
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 2, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }]);
|
365
|
+
if (view === 'Grading view') {
|
366
|
+
studentViewPage.steps.submitResponse();
|
367
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
368
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
369
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
370
|
+
};
|
371
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
372
|
+
multipleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
373
|
+
multipleSelectionGridPage.steps.switchToGradingView();
|
374
|
+
};
|
375
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
|
376
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 3, column: 1 });
|
377
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 4, column: 0 });
|
378
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
379
|
+
multipleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
|
380
|
+
});
|
381
|
+
|
382
|
+
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 should be displayed', () => {
|
383
|
+
if (view === 'Grading view') {
|
384
|
+
studentViewPage.steps.clearResponses();
|
385
|
+
};
|
386
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }]);
|
387
|
+
if (view === 'Grading view') {
|
388
|
+
studentViewPage.steps.submitResponse();
|
389
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
390
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
391
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
392
|
+
};
|
393
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
394
|
+
multipleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
395
|
+
multipleSelectionGridPage.steps.switchToGradingView();
|
396
|
+
};
|
397
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
398
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
|
399
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
|
400
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 3, column: 1 });
|
401
|
+
multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 4, column: 0 });
|
402
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
403
|
+
multipleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
|
404
|
+
});
|
405
|
+
|
406
|
+
it('When user attempts the question correctly, and on switching to \'Grading\' view non scoring label should be displayed, correct icons should be displayed beside the correct response, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
407
|
+
if (view === 'Grading view') {
|
408
|
+
studentViewPage.steps.clearResponses();
|
409
|
+
};
|
410
|
+
multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
411
|
+
if (view === 'Grading view') {
|
412
|
+
studentViewPage.steps.submitResponse();
|
413
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
414
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
415
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
416
|
+
};
|
417
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
418
|
+
multipleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
419
|
+
multipleSelectionGridPage.steps.switchToGradingView();
|
420
|
+
};
|
421
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
422
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
|
423
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
424
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 3, column: 0 });
|
425
|
+
multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 4, column: 1 });
|
426
|
+
multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
427
|
+
multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
|
428
|
+
});
|
429
|
+
});
|
430
|
+
});
|
431
|
+
|
212
432
|
if (!grepTags || !grepTags.includes('smoke')) {
|
213
433
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
214
434
|
abortEarlySetup();
|
@@ -209,6 +209,215 @@ describe('Create item page - Single selection grid: All or nothing ', () => {
|
|
209
209
|
});
|
210
210
|
});
|
211
211
|
|
212
|
+
views.forEach((view) => {
|
213
|
+
describe(`${view}: Manually scored`, { tags: 'smoke' }, () => {
|
214
|
+
abortEarlySetup();
|
215
|
+
before(() => {
|
216
|
+
switch (view) {
|
217
|
+
case 'Question preview':
|
218
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
219
|
+
cy.barsPreLoaderWait();
|
220
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
|
221
|
+
singleSelectionGridPage.steps.expandScoringTypeDropdown();
|
222
|
+
singleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
223
|
+
singleSelectionGridPage.steps.allotPoints(20);
|
224
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
225
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
226
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
227
|
+
singleSelectionGridPage.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
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
243
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
244
|
+
break;
|
245
|
+
case 'Item preview':
|
246
|
+
singleSelectionGridPage.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
|
+
break;
|
252
|
+
}
|
253
|
+
});
|
254
|
+
|
255
|
+
if (view === 'Question preview') {
|
256
|
+
after(() => {
|
257
|
+
singleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
258
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
259
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
260
|
+
});
|
261
|
+
};
|
262
|
+
|
263
|
+
it('Question instructions should be visible', () => {
|
264
|
+
singleSelectionGridPage.steps.verifyQuestionInstructionsTextPreviewTab('Please select following animals facts are correct or not');
|
265
|
+
singleSelectionGridPage.steps.verifyVisibityOfQuestionInstructionsText();
|
266
|
+
});
|
267
|
+
|
268
|
+
it('User should be able to attempt the question in student view and correct/incoreect icons, Your answer is correct/incorrect label, and correct answer section should not be displayed in grading view', () => {
|
269
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
270
|
+
if (view === 'Grading view') {
|
271
|
+
studentViewPage.steps.submitResponse();
|
272
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
273
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
274
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
275
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 1, column: 0 });
|
276
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 2, column: 1 });
|
277
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 3, column: 1 });
|
278
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectBorderNotExists({ row: 4, column: 0 });
|
279
|
+
singleSelectionGridPage.steps.verifyAnswerStatusBannerNotExist();
|
280
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
|
281
|
+
};
|
282
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
283
|
+
singleSelectionGridPage.steps.checkManuallyScoredScoringLabel();
|
284
|
+
};
|
285
|
+
});
|
286
|
+
});
|
287
|
+
});
|
288
|
+
|
289
|
+
views.forEach((view) => {
|
290
|
+
describe(`${view}: Non scored`, { tags: 'smoke' }, () => {
|
291
|
+
abortEarlySetup();
|
292
|
+
before(() => {
|
293
|
+
switch (view) {
|
294
|
+
case 'Question preview':
|
295
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
296
|
+
cy.barsPreLoaderWait();
|
297
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not');
|
298
|
+
singleSelectionGridPage.steps.expandScoringTypeDropdown();
|
299
|
+
singleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
300
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
301
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
302
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
303
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
|
304
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
305
|
+
break;
|
306
|
+
case 'Item preview':
|
307
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
308
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
309
|
+
break;
|
310
|
+
case 'Grading view':
|
311
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
312
|
+
break;
|
313
|
+
};
|
314
|
+
});
|
315
|
+
|
316
|
+
beforeEach(() => {
|
317
|
+
switch (view) {
|
318
|
+
case 'Question preview':
|
319
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
320
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
321
|
+
break;
|
322
|
+
case 'Item preview':
|
323
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
324
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
325
|
+
break;
|
326
|
+
case 'Grading view':
|
327
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
328
|
+
break;
|
329
|
+
}
|
330
|
+
});
|
331
|
+
|
332
|
+
if (view === 'Question preview') {
|
333
|
+
after(() => {
|
334
|
+
singleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
335
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
336
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
337
|
+
});
|
338
|
+
};
|
339
|
+
|
340
|
+
it('When the user selects \'Grading\' view without attempting the question, non scoring label 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 correct/incorrect icons should not be displayed', () => {
|
341
|
+
if (view === 'Grading view') {
|
342
|
+
studentViewPage.steps.submitResponse();
|
343
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
344
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
345
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
346
|
+
};
|
347
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
348
|
+
singleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
349
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
350
|
+
singleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
351
|
+
};
|
352
|
+
utilities.verifyInnerText(singleSelectionGridPage.correctAnswersSectionLabel(), 'Correct answers');
|
353
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
354
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
|
355
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 1 });
|
356
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 1 });
|
357
|
+
});
|
358
|
+
|
359
|
+
it('When the user attempts the question incorrectly,and on switching to \'Grading\' view non scoring label should be displayed, incorrect icon should be displayed beside incorrect response, a status message with text \'Your answer is incorrect\' and correct answer section with correct answer should be displayed', () => {
|
360
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }, { row: 2, column: 0 }]);
|
361
|
+
if (view === 'Grading view') {
|
362
|
+
studentViewPage.steps.submitResponse();
|
363
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
364
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
365
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
366
|
+
};
|
367
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
368
|
+
singleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
369
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
370
|
+
};
|
371
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
|
372
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
|
373
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
374
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
|
375
|
+
});
|
376
|
+
|
377
|
+
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 should be displayed', () => {
|
378
|
+
if (view === 'Grading view') {
|
379
|
+
studentViewPage.steps.clearResponses();
|
380
|
+
};
|
381
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 0 }]);
|
382
|
+
if (view === 'Grading view') {
|
383
|
+
studentViewPage.steps.submitResponse();
|
384
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
385
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
386
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
387
|
+
};
|
388
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
389
|
+
singleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
390
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
391
|
+
};
|
392
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
393
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
|
394
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
395
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
|
396
|
+
});
|
397
|
+
|
398
|
+
it('When user attempts the question correctly, and on switching to \'Grading\' view non scoring label should be displayed, correct icons should be displayed beside the correct response, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
399
|
+
if (view === 'Grading view') {
|
400
|
+
studentViewPage.steps.clearResponses();
|
401
|
+
};
|
402
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
|
403
|
+
if (view === 'Grading view') {
|
404
|
+
studentViewPage.steps.submitResponse();
|
405
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
406
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
407
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
408
|
+
};
|
409
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
410
|
+
singleSelectionGridPage.steps.checkNonScoredScoringLabel();
|
411
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
412
|
+
};
|
413
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
414
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
415
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
416
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
|
417
|
+
});
|
418
|
+
});
|
419
|
+
});
|
420
|
+
|
212
421
|
if (!grepTags || !grepTags.includes('smoke')) {
|
213
422
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
214
423
|
abortEarlySetup();
|
@@ -92,6 +92,13 @@ const steps = {
|
|
92
92
|
clearQuestionInstructionsInputField: () => {
|
93
93
|
questionInstructionsComponent.questionInstructionsInputField()
|
94
94
|
.clear();
|
95
|
+
},
|
96
|
+
|
97
|
+
/**
|
98
|
+
* @description - verifies the visibilty of question instruction text in all views.
|
99
|
+
*/
|
100
|
+
verifyVisibityOfQuestionInstructionsText: () => {
|
101
|
+
utilities.verifyElementVisibilityState(questionInstructionsComponent.questionInstructionsText(), 'visible');
|
95
102
|
}
|
96
103
|
}
|
97
104
|
|