itemengine-cypress-automation 1.0.150-migrationScripts-4f6bd6a.0 → 1.0.150

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +4 -4
  2. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +3 -3
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  4. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +2 -1
  5. package/cypress/e2e/ILC/ContentBlocks/additionalSection.js +2 -2
  6. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +6 -6
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +3 -3
  10. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +2 -2
  11. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -1
  12. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  13. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +1 -1
  14. package/cypress/e2e/ILC/GridFill/additionalSettings.js +52 -0
  15. package/cypress/e2e/ILC/GridFill/headerSection.js +74 -0
  16. package/cypress/e2e/ILC/GridFill/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
  17. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -15
  18. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +3 -18
  19. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -25
  20. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingPenaltyScoring.js +4 -7
  21. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +1 -14
  22. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +1 -1
  23. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +4 -4
  24. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +256 -0
  25. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +213 -0
  26. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +258 -0
  27. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +206 -0
  28. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +198 -0
  29. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +4 -6
  30. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +10 -22
  31. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +421 -0
  32. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +247 -0
  33. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +219 -0
  34. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +247 -0
  35. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +168 -0
  36. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +227 -0
  37. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +199 -0
  38. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +227 -0
  39. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +345 -0
  40. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +340 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +421 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabScoringSection.js +292 -0
  43. package/cypress/e2e/ILC/MultipleSelectionGridNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  44. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +10 -2
  45. package/cypress/e2e/ILC/MultipleSelectionGridNew/specifyCorrectAnswerSection.js +86 -0
  46. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +189 -0
  47. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingPenaltyScoring.js +55 -0
  48. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsBasic.js +116 -0
  49. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +309 -0
  50. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +163 -0
  51. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabScoringSection.js +292 -0
  52. package/cypress/e2e/ILC/SingleSelectionGridNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  53. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +10 -2
  54. package/cypress/e2e/ILC/SingleSelectionGridNew/specifyCorrectAnswerSection.js +86 -0
  55. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +189 -0
  56. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -1
  57. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  58. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
  59. package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
  60. package/cypress/pages/audioResponsePage.js +2 -2
  61. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  62. package/cypress/pages/components/commonComponents.js +2 -1
  63. package/cypress/pages/components/customizeSpecialCharacterComponent.js +5 -5
  64. package/cypress/pages/components/desmosToolComponent.js +1 -1
  65. package/cypress/pages/components/gridQuestionCommonComponent.js +388 -35
  66. package/cypress/pages/components/maximumRecorderLengthComponent.js +4 -4
  67. package/cypress/pages/components/playbackControlsBaseComponent.js +8 -2
  68. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  69. package/cypress/pages/contentBlocksPage.js +1 -1
  70. package/cypress/pages/drawingResponsePage.js +9 -10
  71. package/cypress/pages/geoGebraActivityPage.js +2 -1
  72. package/cypress/pages/geoGebraToolsPage.js +1 -1
  73. package/cypress/pages/gridFillPage.js +108 -13
  74. package/cypress/pages/matchingPage.js +154 -2
  75. package/cypress/pages/multipleSelectionGridPage.js +10 -2
  76. package/cypress/pages/rulerPage.js +2 -5
  77. package/cypress/pages/singleSelectionGridPage.js +18 -2
  78. package/package.json +2 -2
@@ -108,7 +108,7 @@ const steps = {
108
108
  },
109
109
 
110
110
  verifyGeoGebraToolIsVisible: () => {
111
- cy.wait(7000);
111
+ cy.wait(5000);
112
112
  utilities.verifyElementVisibilityState(geoGebraToolsPage.geoGebraToolPreviewTab(), 'visible');
113
113
  },
114
114
 
@@ -1,4 +1,4 @@
1
- import { commonComponents, autoScoredScoringSectionMultiResponseType, questionInputFieldComponent, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection } from "./components";
1
+ import { commonComponents, autoScoredScoringSectionMultiResponseType, questionInputFieldComponent, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, studentViewSettingsLabelComponent } from "./components";
2
2
  import { dialogBoxBase } from ".";
3
3
  import utilities from "../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
@@ -32,11 +32,14 @@ const selectors = {
32
32
  pointsPerResponseLabel: () => cy.get('.alternate-points-points-per-text-span'),
33
33
  pointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
34
34
  pointsPerResponseWrapper: () => cy.get('.alternate-points-points-per-text-wrapper'),
35
+ penaltyPointsForEachIncorrectCellInputField: () => cy.get('input[aria-label="Penalty points for each incorrect cell"]'),
36
+ specifyPointsForEachIncorrectCellRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
37
+ cellShadeCountInputField: () => cy.get('.grid-fill-response-wrapper [aria-label="labeling"]'),
38
+ matchExactPositionOfCellsCheckbox: () => cy.get('input[aria-label="Match exact position of cells"]'),
35
39
  gridSpecifyCorrectAnswerSection: () => cy.get('[class*="AnswerAccordionstyles__AnswerPanel"] .grid-wrapper-cls'),
36
40
  gridRow: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]'),
37
41
  cellShadeCountLabel: () => cy.get('[class*="GridFillResponsestyles__CellFillCountLabel"]'),
38
42
  cellShadeCountInputField: () => cy.get('.cell-count-cls input'),
39
-
40
43
  //Customize layout accordion
41
44
  customizeLayoutAccordionButton: () => cy.get('.customize-layout-wrapper-cls .ngie-accordion-summary'),
42
45
  customizeLayoutLabel: () => cy.get('[class*="AdditionalGridFillSettingsstyles__StyledLabel"]'),
@@ -45,11 +48,16 @@ const selectors = {
45
48
  hideCellButton: () => cy.get('.single-select-toggle-group button').eq(1),
46
49
  cellInCustomizeLayout: () => cy.get('[id*="Response-cell"]'),
47
50
  rowsWrapperCustomizeLayout: () => cy.get('.customize-layout-wrapper-cls [class*="GridFillResponsestyles__RowContainer"]'),
48
-
51
+ penaltyPointsForEachIncorrectCellInputField: () => cy.get('input[aria-label="Penalty points for each incorrect cell"]'),
52
+ //student view settings
53
+ maxSelectedCellLabel: () => cy.get('[class*="MaxSelectedCellsstyles__MaxCellsLabel"]'),
54
+ maxSelectedCellInputField: () => cy.get('input[aria-label="Max selected cells"]'),
49
55
  //Preview tab
50
56
  gridWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__MatrixContainer"]:visible'),
51
57
  cellInPreviewTab: () => cy.get('[class*="GridFillResponsestyles__CellContainer"]:visible'),
52
58
  rowsWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]:visible'),
59
+ warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
60
+ warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
53
61
  }
54
62
 
55
63
  const steps = {
@@ -62,6 +70,8 @@ const steps = {
62
70
  ...autoScoredSpecifyCorrectAnswerSection.steps,
63
71
  ...dialogBoxBase.steps,
64
72
  ...autoScoredScoringSectionMultiResponseType.steps,
73
+ ...commonComponents.steps,
74
+ ...additionalSettingsPanel.steps,
65
75
 
66
76
  /**
67
77
  * @param {number} value value of columns
@@ -543,16 +553,6 @@ const steps = {
543
553
  .should('have.attr', 'aria-expanded', 'true');
544
554
  },
545
555
 
546
- /**
547
- * Verifies if the background color of a response cell in the preview tab
548
- * @param {number} index - The index of the cell to verify.
549
- */
550
- verifyResponseCellHasDefaultBackgroundColor: (index) => {
551
- utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), index), {
552
- 'background-color': css.color.gridCellDefaultStateBg
553
- });
554
- },
555
-
556
556
  /**
557
557
  * Verify the points score displayed on response
558
558
  * @param {number} pointsPerResponse Points to be displayed on response
@@ -580,6 +580,88 @@ const steps = {
580
580
  .within(() => {
581
581
  utilities.verifyElementCount(gridFillPage.cellInPreviewTab(), lengthColumns);
582
582
  });
583
+ },
584
+
585
+ /**
586
+ * @description verify the displayed penalty points for each incorrect cell
587
+ * @param {number} penaltyPoints displayed penalty points
588
+ */
589
+ verifyPenaltyPointsForEachIncorrectCell: (penaltyPoints) => {
590
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect cell: ${penaltyPoints}`);
591
+ },
592
+
593
+ /**
594
+ * @description Verifies the penalty points value for each incorrect cell
595
+ * @param {number} points - The expected penalty points value for each incorrect cell
596
+ */
597
+ verifyPenaltyPointsForEachIncorrectCellValue: (points) => {
598
+ gridFillPage.penaltyPointsForEachIncorrectCellInputField()
599
+ .should('have.value', points);
600
+ },
601
+
602
+ /**
603
+ * @description Allots penalty points for each incorrect text container
604
+ * @param {number} points - The penalty points to be allotted for each text container.
605
+ selectPenaltyPointsForEachIncorrectCell: () => {
606
+ gridFillPage.specifyPointsForEachIncorrectCellRadioButton()
607
+ .click();
608
+ },
609
+
610
+ /**
611
+ * @description Allots penalty points for each incorrect cell
612
+ * @param {number} points - The penalty points to be allotted for each cell.
613
+ */
614
+ allotPenaltyPointsForEachIncorrectCell: (points) => {
615
+ gridFillPage.penaltyPointsForEachIncorrectCellInputField()
616
+ .clear()
617
+ .type(`${points}`)
618
+ .should('have.value', points)
619
+ .blur();
620
+ },
621
+
622
+ /**
623
+ * Enters value into the input field for maximum cells selected.
624
+ * @param {number} value- The value to be entered into the input field.
625
+ */
626
+ enterTextInMaxSelectedCellInputField: (value) => {
627
+ gridFillPage.maxSelectedCellInputField()
628
+ .clear()
629
+ .type(value)
630
+ .blur();
631
+ },
632
+
633
+ /**
634
+ * Enters value into the input field for maximum cells selected.
635
+ * @param {number} value- The value to be entered into the input field.
636
+ */
637
+ VerifyTextInMaxSelectedCellInputField: (value) => {
638
+ gridFillPage.maxSelectedCellInputField()
639
+ .should('have.value', value);
640
+ },
641
+
642
+ /**
643
+ * Verifies if the count of selected cells in the preview tab matches the expected value.
644
+ * @param {number} expectedValue - The expected count of selected cells.
645
+ */
646
+ verifySelectedCellCountPreviewTab: (expectedValue) => {
647
+ let count = 0;
648
+ gridFillPage.cellInPreviewTab()
649
+ .each((cell) => {
650
+ cy.wrap(cell)
651
+ .invoke('attr', 'aria-label')
652
+ .then((ariaLabel) => {
653
+ if (ariaLabel && ariaLabel.includes('response')) {
654
+ count++;
655
+ }
656
+ });
657
+ }).then(() => {
658
+ expect(count).to.equal(expectedValue);
659
+ });
660
+ },
661
+
662
+ clickOutsideGrid: () => {
663
+ cy.get('body')
664
+ .click();
583
665
  }
584
666
  }
585
667
 
@@ -589,6 +671,12 @@ const tests = {
589
671
  ...autoScoredScoringPreviewTab.tests,
590
672
  ...autoScoredScoringSectionMultiResponseType.tests,
591
673
  ...scoringSectionBaseEditTab.tests,
674
+ ...additionalSettingsPanel.tests,
675
+ ...createQuestionBasePage.tests,
676
+ ...commonComponents.tests,
677
+ ...additionalSettingsAccessibilitySectionComponent.tests,
678
+ ...studentViewSettingsLabelComponent.tests,
679
+ ...autoScoredStudentViewSettings.tests,
592
680
 
593
681
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
594
682
  it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
@@ -758,6 +846,13 @@ const tests = {
758
846
  gridFillPage.steps.checkMatchExactPositionOfCellsCheckbox();
759
847
  cy.checkAccessibility(gridFillPage.matchExactPositionLabel().parents('[aria-label="Specify correct answer section"]'));
760
848
  });
849
+ },
850
+
851
+ verifyWarningMessageDisappear: () => {
852
+ it('The error message should disappear if the user clicks anywhere outside the grid', () => {
853
+ gridFillPage.steps.clickOutsideGrid();
854
+ utilities.verifyElementVisibilityState(gridFillPage.warningMessage(), 'notExist');
855
+ });
761
856
  }
762
857
  }
763
858
 
@@ -1,7 +1,6 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
- import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents } from "./components";
4
- import { dialogBoxBase } from "./dialogBoxBase";
3
+ import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType } from "./components";
5
4
  const css = Cypress.env('css');
6
5
 
7
6
  const selectors = {
@@ -9,11 +8,24 @@ const selectors = {
9
8
  ...questionInstructionsComponent,
10
9
  ...commonComponents,
11
10
  ...autoScoredScoringPreviewTab,
11
+ ...autoScoredScoringSectionMultiResponseType,
12
+ ...autoScoredSpecifyCorrectAnswerSection,
13
+ ...draggableOptionContainer,
12
14
  //Edit tab
13
15
  promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
14
16
  optionInputField: () => cy.get('.edit-mcq-options-wrapper').eq(1).find('[data-rbd-draggable-id*="option-draggable"] [role="textbox"]'),
17
+ addPromptButton: () => cy.get('.add-option-wrapper-cls button').contains('Add prompt'),
18
+ deletePromptButton: () => cy.get('.edit-mcq-stems-wrapper [type="button"]'),
19
+
20
+ //Penalty points
21
+ penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
22
+ specifyPointsForEachIncorrectDropzoneRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
23
+ partialEqualWeightsPerResponseScore: () => cy.get('[class*="PointsPerResponseValue"]'),
24
+ partialDifferentWeightsPointsLabel: () => cy.get('.cloze-with-dropdown-partial-points-per-response-label'),
25
+
15
26
  //Specify correct answer section
16
27
  dropzoneSpecifyCorrectAnswerSection: () => cy.get('.authoring-droppable-hotspot-wrapper'),
28
+ promptSpecifyCorrectAnswerSection: () => cy.get('.stem-container [data-testid="question-instruction-element"]'),
17
29
 
18
30
  //Preview tab
19
31
  promptContainerPreviewTab: () => cy.get('.stem-container'),
@@ -38,7 +50,23 @@ const steps = {
38
50
  ...equationEditorFlyout.steps,
39
51
  ...autoScoredStudentViewSettings.steps,
40
52
  ...autoScoredSpecifyCorrectAnswerSection.steps,
53
+ ...autoScoredScoringSectionMultiResponseType.steps,
41
54
  //Edit tab
55
+ addPrompt: () => {
56
+ matchingPage.addPromptButton()
57
+ .click();
58
+ },
59
+
60
+ /**
61
+ * This function deletes the prompt option
62
+ * @param {number} index pf the prompt option
63
+ */
64
+ deletePrompt: (index) => {
65
+ matchingPage.deletePromptButton()
66
+ .eq(index)
67
+ .click();
68
+ },
69
+
42
70
  /**
43
71
  * Enters text into multiple prompt input fields.
44
72
  * @param {string[]} promptTextArray - Array of text to enter into the prompt input fields.
@@ -158,6 +186,54 @@ const steps = {
158
186
  .should('have.text', '​​​​​​​This is a bold option');
159
187
  },
160
188
 
189
+ /**
190
+ * @description Allots penalty points for each incorrect dropzone
191
+ * @param {number} points - The penalty points to be allotted for each dropzone.
192
+ */
193
+ allotPenaltyPointsForEachIncorrectDropzone: (points) => {
194
+ matchingPage.penaltyPointsForEachIncorrectDropzoneInputField()
195
+ .clear()
196
+ .type(`${points}`)
197
+ .should('have.value', points)
198
+ .blur();
199
+ },
200
+
201
+ selectPenaltyPointsForEachIncorrectDropzone: () => {
202
+ matchingPage.specifyPointsForEachIncorrectDropzoneRadioButton()
203
+ .click();
204
+ },
205
+
206
+ verifyPointsPerResponseLabel: () => {
207
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response:\n-');
208
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
209
+ },
210
+
211
+ /**
212
+ * @param {number} pointsPerResponse - The expected points value to be verified.
213
+ * @description Verifies the partial equal weights points per response score for a specific option in the specify correct answer section for a multi-response type question.
214
+ */
215
+ verifyPartialEqualWeightsPointsPerResponseScore: (pointsPerResponse) => {
216
+ matchingPage.partialEqualWeightsPerResponseScore()
217
+ .should('have.text', pointsPerResponse);
218
+ },
219
+
220
+ /**
221
+ * @description verify the displayed penalty points for each incorrect dropzone
222
+ * @param {number} penaltyPoints displayed penalty points
223
+ */
224
+ verifyPenaltyPointsForEachIncorrectDropzone: (penaltyPoints) => {
225
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect dropzone: ${penaltyPoints}`);
226
+ },
227
+
228
+ /**
229
+ * @description Verifies the penalty points value for each incorrect dropzone
230
+ * @param {number} points - The expected penalty points value for each incorrect dropzone.
231
+ */
232
+ verifyPenaltyPointsForEachIncorrectDropzoneValue: (points) => {
233
+ matchingPage.penaltyPointsForEachIncorrectDropzoneInputField()
234
+ .should('have.value', points);
235
+ },
236
+
161
237
  //Specify correct answer section
162
238
  /**
163
239
  * Enter text in the answer input fields of the specify correct answer section.
@@ -176,6 +252,40 @@ const steps = {
176
252
  });
177
253
  },
178
254
 
255
+ /**
256
+ * @param {string} groupTitle group title
257
+ * @param {string[]} optionArray array of options for a particular group
258
+ * @description add a group with title and options in the response options section
259
+ */
260
+ addGroupWithTitleAndOptionsInDraggableOptionsSection: (groupTitle, optionArray) => {
261
+ const numOptionsToAdd = Math.max(0, optionArray.length - 2);
262
+ draggableOptionsSectionComponent.steps.addGroup();
263
+ draggableOptionsSectionComponent.steps.addGroupTitle(groupTitle);
264
+ for (let i = 0; i < numOptionsToAdd; i++) {
265
+ optionsWrapperComponent.steps.addOption();
266
+ }
267
+ matchingPage.steps.enterTextInOptionInputField(optionArray);
268
+ },
269
+
270
+ setGroupedOptions: () => {
271
+ let animals = [['Elephant', 'Bear', 'Panda', 'Zebra'],
272
+ ['Peacock', 'Fish', 'Penguin', 'Tiger'],
273
+ ['Parrot', 'Cat', 'Whale', 'Elephant'],
274
+ ['Giraffe', 'Kangaroo', 'Ostrich', 'Eagle']
275
+ ];
276
+ let groupTitles = ['Group A', 'Group B', 'Group C', 'Group D'];
277
+ const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
278
+ matchingPage.steps.enterTextInPromptInputField(promptTextArray);
279
+ draggableOptionsSectionComponent.steps.expandDraggableOptionsLayoutDropdown()
280
+ draggableOptionsSectionComponent.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped')
281
+ draggableOptionsSectionComponent.steps.addGroupTitle(groupTitles[0]);
282
+ optionsWrapperComponent.steps.addMultipleOptionFields(1);
283
+ matchingPage.steps.enterTextInOptionInputField(animals[0]);
284
+ matchingPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[1], animals[1]);
285
+ matchingPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[2], animals[2]);
286
+ matchingPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[3], animals[3]);
287
+ },
288
+
179
289
  //Preview tab
180
290
  /**
181
291
  * Enter text in the answer input fields of the specify correct answer section.
@@ -198,6 +308,28 @@ const steps = {
198
308
  });
199
309
  },
200
310
 
311
+ /**
312
+ * Sets options in dropzone in the Preview Tab based on the provided optionsObject.
313
+ * @param {Object[]} responses - An array of objects containing the responseIndex, responseText and dropzone index
314
+ * @param {number} responses[].groupIndex - The index of the group
315
+ * @param {string} responses[].responseText - The text of the option
316
+ * @param {string} responses[].dropzoneIndex - The index of the dropzone
317
+ */
318
+ clickAndDropOptionFromNthGroupInDropzonePreviewTab: (responses) => {
319
+ responses.forEach(({ responseText, groupIndex, dropzoneIndex }) => {
320
+ draggableOptionContainer.groupedOptionsContainerPreviewTab()
321
+ .eq(groupIndex)
322
+ .within(() => {
323
+ draggableOptionContainer.draggableOption()
324
+ .contains(responseText)
325
+ .click();
326
+ });
327
+ matchingPage.dropzonePreviewTab()
328
+ .eq(dropzoneIndex)
329
+ .click({ force: true });
330
+ });
331
+ },
332
+
201
333
  /**
202
334
  * Verifies the text content of a dropzone in the Preview Tab.
203
335
  * @param {number} dropzoneIndex - Index of the dropzone to verify.
@@ -285,6 +417,7 @@ const steps = {
285
417
  */
286
418
  verifyDraggableOptionWithEquationTextInPreviewTab: (optionIndex) => {
287
419
  matchingPage.correctAnswersOptionContainer()
420
+ .eq(optionIndex)
288
421
  .find('[role="math"]')
289
422
  .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
290
423
  .contains(constants.CKEditorInputFieldEnteredEquationText);
@@ -320,6 +453,7 @@ const steps = {
320
453
  */
321
454
  verifyPromptWithEquationTextInPreviewTab: (optionIndex) => {
322
455
  matchingPage.promptContainerPreviewTab()
456
+ .eq(optionIndex)
323
457
  .find('[role="math"]')
324
458
  .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
325
459
  .contains(constants.CKEditorInputFieldEnteredEquationText);
@@ -424,6 +558,24 @@ const steps = {
424
558
 
425
559
  const tests = {
426
560
  ...autoScoredScoringPreviewTab.tests,
561
+ ...scoringSectionBaseEditTab.tests,
562
+ ...autoScoredScoringSectionMultiResponseType.tests,
563
+ verifyContentsOfSpecifyCorrectAnswerSection: () => {
564
+ it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
565
+ const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
566
+ const dropzoneOptions = ['Elephant', 'Fish', 'Cat'];
567
+ const optionsArray = ['Bear', 'Eagle', 'Penguin'];
568
+ promptTextArray.forEach((promptOption, index) => {
569
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.promptSpecifyCorrectAnswerSection(), index), promptOption);
570
+ });
571
+ dropzoneOptions.forEach((dropzoneOption, index) => {
572
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.dropzoneSpecifyCorrectAnswerSection(), index), dropzoneOption);
573
+ });
574
+ optionsArray.forEach((dropzoneOption, index) => {
575
+ utilities.verifyInnerText(utilities.getNthElement(draggableOptionContainer.draggableOption(), index), dropzoneOption);
576
+ });
577
+ });
578
+ }
427
579
  }
428
580
 
429
581
  export const matchingPage = {
@@ -1,5 +1,5 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { createQuestionBasePage, questionInstructionsComponent, gridQuestionCommonComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, specifyRowsAndColumnsComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from "./components";
2
+ import { createQuestionBasePage, questionInstructionsComponent, gridQuestionCommonComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, specifyRowsAndColumnsComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, studentViewSettingsLabelComponent, randomizeOptionsComponent } from "./components";
3
3
  const css = Cypress.env('css');
4
4
 
5
5
  const selectors = {
@@ -8,6 +8,8 @@ const selectors = {
8
8
  ...correctIncorrectAnswerLabelComponent,
9
9
  ...autoScoredSpecifyCorrectAnswerSection,
10
10
  ...autoScoredScoringSectionMultiResponseType,
11
+ ...autoScoredScoringPreviewTab,
12
+ ...randomizeOptionsComponent,
11
13
  }
12
14
 
13
15
  const steps = {
@@ -21,6 +23,7 @@ const steps = {
21
23
  ...specifyRowsAndColumnsComponent.steps,
22
24
  ...autoScoredSpecifyCorrectAnswerSection.steps,
23
25
  ...autoScoredScoringSectionMultiResponseType.steps,
26
+ ...randomizeOptionsComponent.steps,
24
27
  /**
25
28
  * Modifies the property of an option cell in the grid for checkbox settings.
26
29
  * @param {Object} position - The position of the option cell.
@@ -111,7 +114,12 @@ const tests = {
111
114
  ...questionInstructionsComponent.tests,
112
115
  ...autoScoredScoringPreviewTab.tests,
113
116
  ...scoringSectionBaseEditTab.tests,
114
- ...autoScoredScoringSectionMultiResponseType.tests
117
+ ...autoScoredScoringSectionMultiResponseType.tests,
118
+ ...gridQuestionCommonComponent.tests,
119
+ ...autoScoredSpecifyCorrectAnswerSection.tests,
120
+ ...autoScoredStudentViewSettings.tests,
121
+ ...studentViewSettingsLabelComponent.tests,
122
+ ...randomizeOptionsComponent.tests
115
123
  }
116
124
 
117
125
  export const multipleSelectionGridPage = {
@@ -312,8 +312,7 @@ const steps = {
312
312
  }
313
313
  };
314
314
  rulerPage.rulerPreviewTab()
315
- .find('svg g')
316
- .eq(2)
315
+ .find('svg rect')
317
316
  .should('have.css', 'fill', fillColor());
318
317
  },
319
318
 
@@ -349,9 +348,7 @@ const steps = {
349
348
  */
350
349
  verifyRulerOpacityInPreview: (opacity) => {
351
350
  rulerPage.rulerPreviewTab()
352
- .find('svg g')
353
- .eq(2)
354
- .find('rect')
351
+ .find('svg rect')
355
352
  .should('have.css', 'opacity', opacity);
356
353
  },
357
354
 
@@ -1,5 +1,5 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { createQuestionBasePage, questionInstructionsComponent, gridQuestionCommonComponent, scoringSectionBaseEditTab, ckEditorToolbar, equationEditorFlyout, autoScoredScoringPreviewTab, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings } from "./components";
2
+ import { createQuestionBasePage, questionInstructionsComponent, gridQuestionCommonComponent, scoringSectionBaseEditTab, ckEditorToolbar, equationEditorFlyout, autoScoredScoringPreviewTab, correctIncorrectAnswerLabelComponent, autoScoredScoringSectionMultiResponseType, autoScoredStudentViewSettings, specifyRowsAndColumnsComponent, autoScoredSpecifyCorrectAnswerSection, randomizeOptionsComponent, studentViewSettingsLabelComponent} from "./components";
3
3
  const css = Cypress.env('css');
4
4
 
5
5
  const selectors = {
@@ -8,6 +8,11 @@ const selectors = {
8
8
  ...ckEditorToolbar,
9
9
  ...autoScoredScoringPreviewTab,
10
10
  ...correctIncorrectAnswerLabelComponent,
11
+ ...scoringSectionBaseEditTab,
12
+ ...specifyRowsAndColumnsComponent,
13
+ ...autoScoredScoringSectionMultiResponseType,
14
+ ...autoScoredSpecifyCorrectAnswerSection,
15
+ ...randomizeOptionsComponent,
11
16
  }
12
17
 
13
18
  const steps = {
@@ -19,7 +24,11 @@ const steps = {
19
24
  ...equationEditorFlyout.steps,
20
25
  ...autoScoredScoringPreviewTab.steps,
21
26
  ...correctIncorrectAnswerLabelComponent.steps,
27
+ ...autoScoredScoringSectionMultiResponseType.steps,
22
28
  ...autoScoredStudentViewSettings.steps,
29
+ ...specifyRowsAndColumnsComponent.steps,
30
+ ...autoScoredSpecifyCorrectAnswerSection.steps,
31
+ ...randomizeOptionsComponent.steps,
23
32
  /**
24
33
  * Modifies the property of an option cell in the grid for radio button settings.
25
34
  * @param {Object} position - The position of the option cell.
@@ -108,7 +117,14 @@ const steps = {
108
117
 
109
118
  const tests = {
110
119
  ...questionInstructionsComponent.tests,
111
- ...autoScoredScoringPreviewTab.tests
120
+ ...autoScoredScoringPreviewTab.tests,
121
+ ...scoringSectionBaseEditTab.tests,
122
+ ...autoScoredScoringSectionMultiResponseType.tests,
123
+ ...gridQuestionCommonComponent.tests,
124
+ ...autoScoredSpecifyCorrectAnswerSection.tests,
125
+ ...randomizeOptionsComponent.tests,
126
+ ...studentViewSettingsLabelComponent.tests,
127
+ ...autoScoredStudentViewSettings.tests
112
128
  }
113
129
 
114
130
  export const singleSelectionGridPage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.150-migrationScripts-4f6bd6a.0",
3
+ "version": "1.0.150",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,4 +35,4 @@
35
35
  "node-fetch": "^3.3.2",
36
36
  "react-uuid": "^2.0.0"
37
37
  }
38
- }
38
+ }