itemengine-cypress-automation 1.0.387 → 1.0.388

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.
@@ -222,6 +222,216 @@ describe('Create item page - Fill in the gaps - drag and drop: All or nothing ',
222
222
  });
223
223
  });
224
224
 
225
+ views.forEach((view) => {
226
+ describe(`Fill in the Gaps with drag and drop - Manually scored: ${view}`, { tags: 'smoke' }, () => {
227
+ abortEarlySetup();
228
+ before(() => {
229
+ switch (view) {
230
+ case 'Question preview':
231
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
232
+ cy.barsPreLoaderWait();
233
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
234
+ fillInTheGapsDragAndDropPage.steps.expandScoringTypeDropdown();
235
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
236
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
237
+ fillInTheGapsDragAndDropPage.steps.allotPoints(20);
238
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
239
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
240
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
241
+ break;
242
+ case 'Item preview':
243
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
244
+ itemPreviewPage.steps.switchToPreviewTab();
245
+ break;
246
+ case 'Grading view':
247
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
248
+ break;
249
+ };
250
+ });
251
+
252
+ beforeEach(() => {
253
+ switch (view) {
254
+ case 'Question preview':
255
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
256
+ fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
257
+ break;
258
+ case 'Item preview':
259
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
260
+ itemPreviewPage.steps.resetQuestionPreview();
261
+ break;
262
+ case 'Grading view':
263
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
264
+ break;
265
+ }
266
+ });
267
+
268
+ if (view === 'Question preview') {
269
+ after(() => {
270
+ fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
271
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
272
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
273
+ });
274
+ };
275
+
276
+ it('Question instructions should be visible', () => {
277
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionInstructionsTextPreviewTab('Drag and drop options into correct dropzone');
278
+ fillInTheGapsDragAndDropPage.steps.verifyVisibityOfQuestionInstructionsText();
279
+ });
280
+
281
+ 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', () => {
282
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 2 });
283
+ if (view === 'Grading view') {
284
+ studentViewPage.steps.submitResponse();
285
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
286
+ studentViewPage.steps.clickOnGoToGradingViewButton();
287
+ gradingViewPage.steps.verifyGradingViewScore('', 20);
288
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(0);
289
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(1);
290
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(2);
291
+ fillInTheGapsDragAndDropPage.steps.verifyAnswerStatusBannerNotExist();
292
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExist();
293
+ };
294
+ if (view === 'Question preview' || view === 'Item preview') {
295
+ fillInTheGapsDragAndDropPage.steps.checkManuallyScoredScoringLabel();
296
+ };
297
+ });
298
+ });
299
+ });
300
+
301
+ views.forEach((view) => {
302
+ describe(`Fill in the Gaps with Drag and drop - Non scored: ${view}`, { tags: 'smoke' }, () => {
303
+ abortEarlySetup();
304
+ before(() => {
305
+ switch (view) {
306
+ case 'Question preview':
307
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
308
+ cy.barsPreLoaderWait();
309
+ fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
310
+ fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
311
+ fillInTheGapsDragAndDropPage.steps.addResponseArea();
312
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
313
+ fillInTheGapsDragAndDropPage.steps.expandScoringTypeDropdown();
314
+ fillInTheGapsDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
315
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
316
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
317
+ break;
318
+ case 'Item preview':
319
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
320
+ itemPreviewPage.steps.switchToPreviewTab();
321
+ break;
322
+ case 'Grading view':
323
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
324
+ break;
325
+ };
326
+ });
327
+
328
+ beforeEach(() => {
329
+ switch (view) {
330
+ case 'Question preview':
331
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
332
+ fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
333
+ break;
334
+ case 'Item preview':
335
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
336
+ itemPreviewPage.steps.resetQuestionPreview();
337
+ break;
338
+ case 'Grading view':
339
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
340
+ break;
341
+ }
342
+ });
343
+
344
+ if (view === 'Question preview') {
345
+ after(() => {
346
+ fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
347
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
348
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
349
+ });
350
+ };
351
+
352
+ 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', () => {
353
+ if (view === 'Grading view') {
354
+ studentViewPage.steps.submitResponse();
355
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
356
+ studentViewPage.steps.clickOnGoToGradingViewButton();
357
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
358
+ };
359
+ if (view === 'Question preview' || view === 'Item preview') {
360
+ fillInTheGapsDragAndDropPage.steps.checkNonScoredScoringLabel();
361
+ fillInTheGapsDragAndDropPage.steps.switchToGradingView();
362
+ fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
363
+ };
364
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
365
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconsNotExist();
366
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
367
+ });
368
+
369
+ 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 answers should be displayed', () => {
370
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0, 'Leaves': 2, 'Stem': 1 });
371
+ if (view === 'Grading view') {
372
+ studentViewPage.steps.submitResponse();
373
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
374
+ studentViewPage.steps.clickOnGoToGradingViewButton();
375
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
376
+ };
377
+ if (view === 'Question preview' || view === 'Item preview') {
378
+ fillInTheGapsDragAndDropPage.steps.checkNonScoredScoringLabel();
379
+ fillInTheGapsDragAndDropPage.steps.switchToGradingView();
380
+ fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
381
+ };
382
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
383
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
384
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
385
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
386
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
387
+ });
388
+
389
+ 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', () => {
390
+ if (view === 'Grading view') {
391
+ studentViewPage.steps.clearResponses();
392
+ };
393
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 2 });
394
+ if (view === 'Grading view') {
395
+ studentViewPage.steps.submitResponse();
396
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
397
+ studentViewPage.steps.clickOnGoToGradingViewButton();
398
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
399
+ };
400
+ if (view === 'Question preview' || view === 'Item preview') {
401
+ fillInTheGapsDragAndDropPage.steps.checkNonScoredScoringLabel();
402
+ fillInTheGapsDragAndDropPage.steps.switchToGradingView();
403
+ };
404
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
405
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
406
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
407
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
408
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
409
+ });
410
+
411
+ it('When the 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', () => {
412
+ if (view === 'Grading view') {
413
+ studentViewPage.steps.clearResponses();
414
+ };
415
+ fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
416
+ if (view === 'Grading view') {
417
+ studentViewPage.steps.submitResponse();
418
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
419
+ studentViewPage.steps.clickOnGoToGradingViewButton();
420
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
421
+ };
422
+ if (view === 'Question preview' || view === 'Item preview') {
423
+ fillInTheGapsDragAndDropPage.steps.checkNonScoredScoringLabel();
424
+ fillInTheGapsDragAndDropPage.steps.switchToGradingView();
425
+ };
426
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
427
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
428
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
429
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
430
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
431
+ });
432
+ });
433
+ });
434
+
225
435
  if (!grepTags || !grepTags.includes('smoke')) {
226
436
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
227
437
  abortEarlySetup();
@@ -209,6 +209,222 @@ describe('Create item page - Fill in the gaps over image - drag and drop: All or
209
209
  });
210
210
  });
211
211
 
212
+ views.forEach((view) => {
213
+ describe(`Fill in the Gaps over Image Drag and drop - Manually scored: ${view}`, { tags: 'smoke' }, () => {
214
+ abortEarlySetup();
215
+ before(() => {
216
+ switch (view) {
217
+ case 'Question preview':
218
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
219
+ cy.barsPreLoaderWait();
220
+ fillInTheGapsOverImageDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone over the image');
221
+ fillInTheGapsOverImageDragAndDropPage.steps.expandScoringTypeDropdown();
222
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
223
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
224
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
225
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
226
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
227
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPoints(20);
228
+ fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
229
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
230
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
231
+ break;
232
+ case 'Item preview':
233
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
234
+ itemPreviewPage.steps.switchToPreviewTab();
235
+ break;
236
+ case 'Grading view':
237
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
238
+ break;
239
+ };
240
+ });
241
+
242
+ beforeEach(() => {
243
+ switch (view) {
244
+ case 'Question preview':
245
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
246
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
247
+ break;
248
+ case 'Item preview':
249
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
250
+ itemPreviewPage.steps.resetQuestionPreview();
251
+ break;
252
+ case 'Grading view':
253
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
254
+ break;
255
+ }
256
+ });
257
+
258
+ if (view === 'Question preview') {
259
+ after(() => {
260
+ fillInTheGapsOverImageDragAndDropPage.steps.clickOnSaveQuestionButton();
261
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
262
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
263
+ });
264
+ };
265
+
266
+ it('Question instructions should be visible', () => {
267
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionInstructionsTextPreviewTab('Drag and drop options into correct dropzone over the image');
268
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyVisibityOfQuestionInstructionsText();
269
+ });
270
+
271
+ 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', () => {
272
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 2 });
273
+ if (view === 'Grading view') {
274
+ studentViewPage.steps.submitResponse();
275
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
276
+ studentViewPage.steps.clickOnGoToGradingViewButton();
277
+ gradingViewPage.steps.verifyGradingViewScore('', 20);
278
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(0);
279
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(1);
280
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(2);
281
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyAnswerStatusBannerNotExist();
282
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionNotExist();
283
+ };
284
+ if (view === 'Question preview' || view === 'Item preview') {
285
+ fillInTheGapsOverImageDragAndDropPage.steps.checkManuallyScoredScoringLabel();
286
+ };
287
+ });
288
+ });
289
+ });
290
+
291
+ views.forEach((view) => {
292
+ describe(`Fill in the Gaps Over Image Drag and drop - Non scored: ${view}`, { tags: 'smoke' }, () => {
293
+ abortEarlySetup();
294
+ before(() => {
295
+ switch (view) {
296
+ case 'Question preview':
297
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
298
+ cy.barsPreLoaderWait();
299
+ fillInTheGapsOverImageDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzones over the image');
300
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
301
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
302
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
303
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
304
+ fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
305
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
306
+ fillInTheGapsOverImageDragAndDropPage.steps.expandScoringTypeDropdown();
307
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
308
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
309
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
310
+ break;
311
+ case 'Item preview':
312
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
313
+ itemPreviewPage.steps.switchToPreviewTab();
314
+ break;
315
+ case 'Grading view':
316
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
317
+ break;
318
+ };
319
+ });
320
+
321
+ beforeEach(() => {
322
+ switch (view) {
323
+ case 'Question preview':
324
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
325
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
326
+ break;
327
+ case 'Item preview':
328
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
329
+ itemPreviewPage.steps.resetQuestionPreview();
330
+ break;
331
+ case 'Grading view':
332
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
333
+ break;
334
+ }
335
+ });
336
+
337
+ if (view === 'Question preview') {
338
+ after(() => {
339
+ fillInTheGapsOverImageDragAndDropPage.steps.clickOnSaveQuestionButton();
340
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
341
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
342
+ });
343
+ };
344
+
345
+ 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', () => {
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
+ fillInTheGapsOverImageDragAndDropPage.steps.checkNonScoredScoringLabel();
354
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
355
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
356
+ };
357
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectIconsNotExist();
358
+ utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.correctAnswersLabel(), 'Correct answers');
359
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
360
+ });
361
+
362
+ 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 answers should be displayed', () => {
363
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0, 'Leaves': 2, 'Stem': 1 });
364
+ if (view === 'Grading view') {
365
+ studentViewPage.steps.submitResponse();
366
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
367
+ studentViewPage.steps.clickOnGoToGradingViewButton();
368
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
369
+ };
370
+ if (view === 'Question preview' || view === 'Item preview') {
371
+ fillInTheGapsOverImageDragAndDropPage.steps.checkNonScoredScoringLabel();
372
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
373
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
374
+ };
375
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
376
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
377
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
378
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
379
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
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
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 2, 'Stem': 1 });
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
+ fillInTheGapsOverImageDragAndDropPage.steps.checkNonScoredScoringLabel();
395
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
396
+ };
397
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectOptionIcon(0);
398
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
399
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
400
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
401
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
402
+ });
403
+
404
+ it('When the 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
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
409
+ if (view === 'Grading view') {
410
+ studentViewPage.steps.submitResponse();
411
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
412
+ studentViewPage.steps.clickOnGoToGradingViewButton();
413
+ gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
414
+ };
415
+ if (view === 'Question preview' || view === 'Item preview') {
416
+ fillInTheGapsOverImageDragAndDropPage.steps.checkNonScoredScoringLabel();
417
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
418
+ };
419
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectOptionIcon(0);
420
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectOptionIcon(1);
421
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectOptionIcon(2);
422
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
423
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
424
+ });
425
+ });
426
+ });
427
+
212
428
  if (!grepTags || !grepTags.includes('smoke')) {
213
429
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
214
430
  abortEarlySetup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.387",
3
+ "version": "1.0.388",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {