itemengine-cypress-automation 1.0.369-IEI-5423-cypress-40eadad.0 → 1.0.369-IEI-6055-list-ordering-undefined-option-fix-e7de444.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.
@@ -470,4 +470,92 @@ describe('Create item page - List ordering: All or nothing ', () => {
470
470
  });
471
471
  });
472
472
  };
473
+
474
+ views.forEach((view) => {
475
+ describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
476
+ abortEarlySetup();
477
+ before(() => {
478
+ switch (view) {
479
+ case 'Question preview':
480
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
481
+ cy.barsPreLoaderWait();
482
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
483
+ listOrderingPage.steps.addInputToOptionsInputField(options);
484
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
485
+ listOrderingPage.steps.allotPoints(20);
486
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
487
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
488
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
489
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
490
+ listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
491
+ listOrderingPage.steps.switchToPreviewTab();
492
+ break;
493
+ case 'Item preview':
494
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
495
+ itemPreviewPage.steps.switchToPreviewTab();
496
+ break;
497
+ case 'Grading view':
498
+ cy.wait(5000);
499
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
500
+ break;
501
+ };
502
+ });
503
+
504
+ beforeEach(() => {
505
+ switch (view) {
506
+ case 'Question preview':
507
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
508
+ listOrderingPage.steps.resetQuestionPreview();
509
+ break;
510
+ case 'Item preview':
511
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
512
+ itemPreviewPage.steps.resetQuestionPreview();
513
+ break;
514
+ case 'Grading view':
515
+ cy.wait(5000);
516
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
517
+ break;
518
+ }
519
+ });
520
+
521
+ if (view === 'Question preview') {
522
+ after(() => {
523
+ listOrderingPage.steps.clickOnSaveQuestionButton();
524
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
525
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
526
+ });
527
+ };
528
+
529
+ if (view === 'Question preview' || view === 'Item preview') {
530
+ it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons and correct incorrect status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
531
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
532
+ listOrderingPage.steps.switchToGradingView();
533
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
534
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
535
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
536
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
537
+ });
538
+ };
539
+
540
+ it('When the user attempts the question partially, 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 should be displayed', () => {
541
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
542
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
543
+ if (view === 'Grading view') {
544
+ studentViewPage.steps.submitResponse();
545
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
546
+ studentViewPage.steps.clickOnGoToGradingViewButton();
547
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
548
+ };
549
+ if (view === 'Question preview' || view === 'Item preview') {
550
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
551
+ listOrderingPage.steps.switchToGradingView();
552
+ };
553
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
554
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
555
+ listOrderingPage.steps.verifyNumberOfOptionsInDropzoneOrderAsSeperateList(2);
556
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
557
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
558
+ });
559
+ });
560
+ });
473
561
  });
@@ -255,7 +255,7 @@ const steps = {
255
255
  break;
256
256
  case 'none':
257
257
  dragIcon
258
- .should('not.exist');
258
+ .should('not.be.visible');
259
259
  break;
260
260
  default:
261
261
  throw new Error('Invalid drag handle option');
@@ -773,7 +773,6 @@ const steps = {
773
773
  */
774
774
  expandPositionDropdownSpecifyCorrectAnswerSection: (dropdownIndex) => {
775
775
  utilities.getNthElement(listOrderingPage.positionDropdownSpecifyCorrectAnswerSection(), dropdownIndex)
776
- .trigger('mouseover')
777
776
  .click();
778
777
  },
779
778
 
@@ -1491,6 +1490,14 @@ const steps = {
1491
1490
  utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.dropzoneSeperateList().find('[class*="MultipleDroppedItemstyles__FlexWrapper"]'), index), option);
1492
1491
  });
1493
1492
  },
1493
+ /**
1494
+ * Verifies the number of options in the dropzone of order as separate list.
1495
+ * @param {number} expectedCount - The expected number of options in the dropzone.
1496
+ */
1497
+ verifyNumberOfOptionsInDropzoneOrderAsSeperateList: (expectedCount) => {
1498
+ listOrderingPage.dropzoneSeperateList().find('[class*="MultipleDroppedItemstyles__FlexWrapper"]')
1499
+ .should('have.length', expectedCount);
1500
+ },
1494
1501
 
1495
1502
  /**
1496
1503
  * Verifies the order of options in seperate list.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.369-IEI-5423-cypress-40eadad.0",
3
+ "version": "1.0.369-IEI-6055-list-ordering-undefined-option-fix-e7de444.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {