itemengine-cypress-automation 1.0.365-RCA-IEI5709-1b901dc.0 → 1.0.368-IEI-5683-and-IEI-5702-manualAndNonScoredScript-1b2d1d1.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.
@@ -201,6 +201,232 @@ describe('Create Item page - Multiple selection: All or nothing ', () => {
|
|
201
201
|
});
|
202
202
|
});
|
203
203
|
|
204
|
+
views.forEach((view) => {
|
205
|
+
describe(`Multiple selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
206
|
+
abortEarlySetup();
|
207
|
+
before(() => {
|
208
|
+
switch (view) {
|
209
|
+
case 'Question preview':
|
210
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
211
|
+
cy.barsPreLoaderWait();
|
212
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
213
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
214
|
+
multipleSelectionPage.steps.expandScoringTypeDropdown();
|
215
|
+
multipleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
216
|
+
multipleSelectionPage.steps.allotPoints(20);
|
217
|
+
multipleSelectionPage.steps.switchToPreviewTab();
|
218
|
+
break;
|
219
|
+
case 'Item preview':
|
220
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
221
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
222
|
+
break;
|
223
|
+
case 'Grading view':
|
224
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
225
|
+
break;
|
226
|
+
};
|
227
|
+
});
|
228
|
+
|
229
|
+
beforeEach(() => {
|
230
|
+
switch (view) {
|
231
|
+
case 'Question preview':
|
232
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
233
|
+
multipleSelectionPage.steps.resetQuestionPreview();
|
234
|
+
break;
|
235
|
+
case 'Item preview':
|
236
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
237
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
238
|
+
break;
|
239
|
+
case 'Grading view':
|
240
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
241
|
+
break;
|
242
|
+
}
|
243
|
+
});
|
244
|
+
|
245
|
+
if (view === 'Question preview') {
|
246
|
+
after(() => {
|
247
|
+
multipleSelectionPage.steps.clickOnSaveQuestionButtonWithForceTrue();
|
248
|
+
cy.wait(5000);
|
249
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
250
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
251
|
+
});
|
252
|
+
};
|
253
|
+
|
254
|
+
it('Question instructions should be visible', () => {
|
255
|
+
multipleSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
256
|
+
multipleSelectionPage.steps.verifyVisibityOfQuestionInstructionsText();
|
257
|
+
});
|
258
|
+
|
259
|
+
it('User should be able to attempt the question in student view and correct/incorrect icons, Your answer is correct/incorrect label, correct answer section should not be displayed in grading view', () => {
|
260
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
261
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
262
|
+
if (view === 'Grading view') {
|
263
|
+
studentViewPage.steps.submitResponse();
|
264
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
265
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
266
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
267
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
268
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
269
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
270
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
271
|
+
multipleSelectionPage.steps.verifyAnswerBannerNotExist();
|
272
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
273
|
+
};
|
274
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
275
|
+
multipleSelectionPage.steps.checkManuallyScoredScoringLabel();
|
276
|
+
};
|
277
|
+
});
|
278
|
+
});
|
279
|
+
});
|
280
|
+
|
281
|
+
views.forEach((view) => {
|
282
|
+
describe(`Multiple selection - Non scored: ${view}`, { tags: 'smoke' }, () => {
|
283
|
+
abortEarlySetup();
|
284
|
+
before(() => {
|
285
|
+
switch (view) {
|
286
|
+
case 'Question preview':
|
287
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
288
|
+
cy.barsPreLoaderWait();
|
289
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
290
|
+
multipleSelectionPage.steps.expandScoringTypeDropdown();
|
291
|
+
multipleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
292
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
293
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
294
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
295
|
+
multipleSelectionPage.steps.switchToPreviewTab();
|
296
|
+
break;
|
297
|
+
case 'Item preview':
|
298
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
299
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
300
|
+
break;
|
301
|
+
case 'Grading view':
|
302
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
303
|
+
break;
|
304
|
+
};
|
305
|
+
});
|
306
|
+
|
307
|
+
beforeEach(() => {
|
308
|
+
switch (view) {
|
309
|
+
case 'Question preview':
|
310
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
311
|
+
multipleSelectionPage.steps.resetQuestionPreview();
|
312
|
+
break;
|
313
|
+
case 'Item preview':
|
314
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
315
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
316
|
+
break;
|
317
|
+
case 'Grading view':
|
318
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
319
|
+
break;
|
320
|
+
}
|
321
|
+
});
|
322
|
+
|
323
|
+
if (view === 'Question preview') {
|
324
|
+
after(() => {
|
325
|
+
multipleSelectionPage.steps.clickOnSaveQuestionButton();
|
326
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
327
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
328
|
+
});
|
329
|
+
};
|
330
|
+
|
331
|
+
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', () => {
|
332
|
+
if (view === 'Grading view') {
|
333
|
+
studentViewPage.steps.submitResponse();
|
334
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
335
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
336
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
337
|
+
};
|
338
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
339
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
340
|
+
multipleSelectionPage.steps.switchToGradingView();
|
341
|
+
multipleSelectionPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
342
|
+
};
|
343
|
+
//Remove the if-else condition and line 346 once https://weldnorthed.atlassian.net/browse/IEI-5704 is fixed.
|
344
|
+
if(view === 'Question preview'){
|
345
|
+
utilities.verifyInnerText(multipleSelectionPage.correctAnswersLabel(), 'Correct answers');
|
346
|
+
}
|
347
|
+
else{
|
348
|
+
utilities.verifyInnerText(multipleSelectionPage.correctAnswersLabel(), 'Correct answer');
|
349
|
+
}
|
350
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
351
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
352
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
353
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
354
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
355
|
+
});
|
356
|
+
|
357
|
+
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', () => {
|
358
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(2);
|
359
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(3);
|
360
|
+
if (view === 'Grading view') {
|
361
|
+
studentViewPage.steps.submitResponse();
|
362
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
363
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
364
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
365
|
+
};
|
366
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
367
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
368
|
+
multipleSelectionPage.steps.switchToGradingView();
|
369
|
+
};
|
370
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
371
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
372
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(2);
|
373
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(3);
|
374
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
375
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
376
|
+
});
|
377
|
+
|
378
|
+
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', () => {
|
379
|
+
if (view === 'Grading view') {
|
380
|
+
studentViewPage.steps.clearResponses();
|
381
|
+
};
|
382
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
383
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
384
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(2);
|
385
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(3);
|
386
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
387
|
+
if (view === 'Grading view') {
|
388
|
+
studentViewPage.steps.submitResponse();
|
389
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
390
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
391
|
+
};
|
392
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
393
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
394
|
+
multipleSelectionPage.steps.switchToGradingView();
|
395
|
+
};
|
396
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(0);
|
397
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
398
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(2);
|
399
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(3);
|
400
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
401
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
402
|
+
});
|
403
|
+
|
404
|
+
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', () => {
|
405
|
+
if (view === 'Grading view') {
|
406
|
+
studentViewPage.steps.clearResponses();
|
407
|
+
};
|
408
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
409
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
410
|
+
if (view === 'Grading view') {
|
411
|
+
studentViewPage.steps.submitResponse();
|
412
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
413
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
414
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
415
|
+
};
|
416
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
417
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
418
|
+
multipleSelectionPage.steps.switchToGradingView();
|
419
|
+
};
|
420
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(0);
|
421
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
422
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
423
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
424
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
425
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
426
|
+
});
|
427
|
+
});
|
428
|
+
});
|
429
|
+
|
204
430
|
if (!grepTags || !grepTags.includes('smoke')) {
|
205
431
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
206
432
|
abortEarlySetup();
|
@@ -168,6 +168,198 @@ describe('Create Item page - Single Selection: Scoring cases', () => {
|
|
168
168
|
});
|
169
169
|
});
|
170
170
|
|
171
|
+
views.forEach((view) => {
|
172
|
+
describe(`Single selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
173
|
+
abortEarlySetup();
|
174
|
+
before(() => {
|
175
|
+
switch (view) {
|
176
|
+
case 'Question preview':
|
177
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
178
|
+
cy.barsPreLoaderWait();
|
179
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
180
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
181
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
182
|
+
singleSelectionPage.steps.allotPoints(20);
|
183
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
184
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
185
|
+
break;
|
186
|
+
case 'Item preview':
|
187
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
188
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
189
|
+
break;
|
190
|
+
case 'Grading view':
|
191
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
192
|
+
break;
|
193
|
+
};
|
194
|
+
});
|
195
|
+
|
196
|
+
beforeEach(() => {
|
197
|
+
switch (view) {
|
198
|
+
case 'Question preview':
|
199
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
200
|
+
singleSelectionPage.steps.resetQuestionPreview();
|
201
|
+
break;
|
202
|
+
case 'Item preview':
|
203
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
204
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
205
|
+
break;
|
206
|
+
case 'Grading view':
|
207
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
208
|
+
break;
|
209
|
+
}
|
210
|
+
});
|
211
|
+
|
212
|
+
if (view === 'Question preview') {
|
213
|
+
after(() => {
|
214
|
+
singleSelectionPage.steps.clickOnSaveQuestionButton();
|
215
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
216
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
217
|
+
});
|
218
|
+
};
|
219
|
+
|
220
|
+
it('Question instructions should be visible', () => {
|
221
|
+
singleSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
222
|
+
singleSelectionPage.steps.verifyVisibityOfQuestionInstructionsText();
|
223
|
+
});
|
224
|
+
|
225
|
+
it('User should be able to attempt the question in student view and correct/incorrect icons, Your answer is correct/incorrect label, correct answer section should not be displayed in grading view', () => {
|
226
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
227
|
+
if (view === 'Grading view') {
|
228
|
+
studentViewPage.steps.submitResponse();
|
229
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
230
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
231
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
232
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
233
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
234
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
235
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
236
|
+
singleSelectionPage.steps.verifyAnswerBannerNotExist();
|
237
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
238
|
+
};
|
239
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
240
|
+
singleSelectionPage.steps.checkManuallyScoredScoringLabel();
|
241
|
+
};
|
242
|
+
});
|
243
|
+
});
|
244
|
+
});
|
245
|
+
|
246
|
+
views.forEach((view) => {
|
247
|
+
describe(`Single selection - Non scored:${view}`, { tags: 'smoke' }, () => {
|
248
|
+
abortEarlySetup();
|
249
|
+
before(() => {
|
250
|
+
switch (view) {
|
251
|
+
case 'Question preview':
|
252
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
253
|
+
cy.barsPreLoaderWait();
|
254
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
255
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
256
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
257
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
258
|
+
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
259
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
260
|
+
break;
|
261
|
+
case 'Item preview':
|
262
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
263
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
264
|
+
break;
|
265
|
+
case 'Grading view':
|
266
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
267
|
+
break;
|
268
|
+
};
|
269
|
+
});
|
270
|
+
|
271
|
+
beforeEach(() => {
|
272
|
+
switch (view) {
|
273
|
+
case 'Question preview':
|
274
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
275
|
+
singleSelectionPage.steps.resetQuestionPreview();
|
276
|
+
break;
|
277
|
+
case 'Item preview':
|
278
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
279
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
280
|
+
break;
|
281
|
+
case 'Grading view':
|
282
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
283
|
+
break;
|
284
|
+
}
|
285
|
+
});
|
286
|
+
|
287
|
+
if (view === 'Question preview') {
|
288
|
+
after(() => {
|
289
|
+
singleSelectionPage.steps.clickOnSaveQuestionButton();
|
290
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
291
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
292
|
+
});
|
293
|
+
};
|
294
|
+
|
295
|
+
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', () => {
|
296
|
+
if (view === 'Grading view') {
|
297
|
+
studentViewPage.steps.submitResponse();
|
298
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
299
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
300
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
301
|
+
};
|
302
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
303
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
304
|
+
singleSelectionPage.steps.switchToGradingView();
|
305
|
+
singleSelectionPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
306
|
+
};
|
307
|
+
//Remove the if-else condition and line 308 once https://weldnorthed.atlassian.net/browse/IEI-5704 is fixed.
|
308
|
+
if(view === 'Question preview'){
|
309
|
+
utilities.verifyInnerText(singleSelectionPage.correctAnswersLabel(), 'Correct answers');
|
310
|
+
}
|
311
|
+
else{
|
312
|
+
utilities.verifyInnerText(singleSelectionPage.correctAnswersLabel(), 'Correct answer');
|
313
|
+
}
|
314
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
315
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
316
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
317
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
318
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
319
|
+
});
|
320
|
+
|
321
|
+
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', () => {
|
322
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(0);
|
323
|
+
if (view === 'Grading view') {
|
324
|
+
studentViewPage.steps.submitResponse();
|
325
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
326
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
327
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
328
|
+
};
|
329
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
330
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
331
|
+
singleSelectionPage.steps.switchToGradingView();
|
332
|
+
};
|
333
|
+
singleSelectionPage.steps.verifyIncorrectOptionIconGradingView(0);
|
334
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
335
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
336
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
337
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
338
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
339
|
+
});
|
340
|
+
|
341
|
+
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', () => {
|
342
|
+
if (view === 'Grading view') {
|
343
|
+
studentViewPage.steps.clearResponses();
|
344
|
+
};
|
345
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
346
|
+
if (view === 'Grading view') {
|
347
|
+
studentViewPage.steps.submitResponse();
|
348
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
349
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
350
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
351
|
+
};
|
352
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
353
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
354
|
+
singleSelectionPage.steps.switchToGradingView();
|
355
|
+
};
|
356
|
+
singleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
357
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
358
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
359
|
+
});
|
360
|
+
});
|
361
|
+
});
|
362
|
+
|
171
363
|
if (!grepTags || !grepTags.includes('smoke')) {
|
172
364
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
173
365
|
abortEarlySetup();
|
@@ -891,7 +891,15 @@ const steps = {
|
|
891
891
|
optionsTextArray.forEach((option, optionIndex) => {
|
892
892
|
utilities.verifyTextContent(utilities.getNthElement(multipleSelectionPage.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
|
893
893
|
});
|
894
|
-
}
|
894
|
+
},
|
895
|
+
|
896
|
+
/**
|
897
|
+
* Clicks on the save question button.
|
898
|
+
*/
|
899
|
+
clickOnSaveQuestionButtonWithForceTrue: () => {
|
900
|
+
createQuestionBasePage.saveQuestionButton()
|
901
|
+
.click({force:true});
|
902
|
+
},
|
895
903
|
}
|
896
904
|
|
897
905
|
const tests = {
|