itemengine-cypress-automation 1.0.369-IEI-5423-cypress-40eadad.0 → 1.0.369-IEI-6055-list-ordering-undefined-option-fix-47a6e20.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.
@@ -12,7 +12,6 @@ const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
12
12
 
13
13
  const defaultStateColor = 'rgb(120, 60, 60)';
14
14
  const activeStateColor = 'rgb(60, 120, 120)';
15
- const defaultStateBorderColorWithOpacity = 'rgba(120, 61, 61, 0.5)';
16
15
 
17
16
  describe('Create Item page - Image highlight: Customize image highlight style', () => {
18
17
  before(() => {
@@ -157,34 +156,6 @@ describe('Create Item page - Image highlight: Customize image highlight style',
157
156
  });
158
157
  });
159
158
 
160
- describe('Border opacity image highlight style : Edit tab content and functionality', () => {
161
- abortEarlySetup();
162
- before(() => {
163
- imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
164
- imageHighlightPage.steps.uploadFile('highlightImage.jpg');
165
- imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
166
- imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
167
- imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
168
- imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
169
- imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
170
- imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
171
- imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
172
- imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
173
- });
174
-
175
- it('When user changes the opacity in color picker the changes should be displayed', () => {
176
- imageHighlightPage.steps.clickOnBorderColorIcon();
177
- imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
178
- colorPopupComponent.steps.clickInColorSaturationPalette();
179
- imageHighlightPage.steps.clickInAlphaPicker();
180
- imageHighlightPage.steps.clickOnOkButton();
181
- imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
182
- imageHighlightPage.steps.verifyEditedBorderOpacityInSpecifyCorrectAnswerSection(2, defaultStateBorderColorWithOpacity);
183
- imageHighlightPage.steps.switchToPreviewTab();
184
- imageHighlightPage.steps.verifyEditedBorderOpacityInPreviewtabSection(2, defaultStateBorderColorWithOpacity);
185
- });
186
-
187
- });
188
159
  // Change 'Stroke color' to 'Border color' in the following tests after https://redmine.zeuslearning.com/issues/580697 has been resolved.
189
160
 
190
161
  describe('Border color image highlight style : Edit tab content and functionality', () => {
@@ -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
  });
@@ -6,7 +6,6 @@ const selectors = {
6
6
  ...dialogBoxBase,
7
7
  colorBlock: () => cy.get('.color-picker-block'),
8
8
  colorSaturationPalette: () => cy.get('.react-colorful__saturation'),
9
- alphaPicker : () => cy.get('.react-colorful__alpha'),
10
9
  colorSaturationPicker: () => cy.get('.react-colorful__saturation-pointer .react-colorful__pointer-fill'),
11
10
  colorHuePalette: () => cy.get('.react-colorful__hue'),
12
11
  colorHuePicker: () => cy.get('.react-colorful__hue-pointer .react-colorful__pointer-fill'),
@@ -98,11 +97,6 @@ const steps = {
98
97
  .click();
99
98
  },
100
99
 
101
- clickInAlphaPicker: () => {
102
- colorPopupComponent.alphaPicker()
103
- .click();
104
- },
105
-
106
100
  clickInColorHuePalette: () => {
107
101
  colorPopupComponent.colorHuePalette()
108
102
  .click();
@@ -1349,21 +1349,6 @@ const steps = {
1349
1349
  });
1350
1350
  },
1351
1351
 
1352
- /**
1353
- * @param {number} index index of highlight region
1354
- * @param {string} colorWithOpacity color to be checked in rgba format
1355
- * @description this function verifiies the border color of highlight regions in specify correct answer section.
1356
- */
1357
- verifyEditedBorderOpacityInSpecifyCorrectAnswerSection: (index, colorWithOpacity) => {
1358
- imageHighlightPage.specifyCorrectAnswerSectionHighlight()
1359
- .eq(index)
1360
- .within(() => {
1361
- utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon(), {
1362
- 'stroke': colorWithOpacity
1363
- });
1364
- });
1365
- },
1366
-
1367
1352
  /**
1368
1353
  * @param {number} index index of highlight region
1369
1354
  * @param {string} color color to be checked in rgb/rgba format
@@ -1381,23 +1366,6 @@ const steps = {
1381
1366
  });
1382
1367
  });
1383
1368
  },
1384
- /**
1385
- * @param {number} index index of highlight region
1386
- * @param {string} colorWithOpacity color to be checked in rgba format
1387
- * @description this function verifies the border color of highlight regions in preview tab.
1388
- */
1389
- verifyEditedBorderOpacityInPreviewtabSection: (index, colorWithOpacity) => {
1390
- imageHighlightPage.previewTabQuestionWrapper()
1391
- .within(() => {
1392
- imageHighlightPage.previewSectionHighlight()
1393
- .eq(index)
1394
- .within(() => {
1395
- utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon(), {
1396
- 'stroke': colorWithOpacity
1397
- });
1398
- });
1399
- });
1400
- },
1401
1369
 
1402
1370
  verifyBorderStyleButtonsVisible: () => {
1403
1371
  utilities.verifyElementVisibilityState(imageHighlightPage.popupBorderStyleButtons().eq(0), 'visible');
@@ -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-47a6e20.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {