itemengine-cypress-automation 1.0.579-IEI-7193-1dd98c9.0 → 1.0.579-IEI-7046-a317a6b.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.
Files changed (32) hide show
  1. package/cypress/config-files/ilprod.json +1 -2
  2. package/cypress/config-files/ilqa.json +1 -2
  3. package/cypress/config-files/ilstage.json +1 -2
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +123 -8
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +123 -8
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +131 -14
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +138 -9
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +138 -9
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +153 -10
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +138 -9
  11. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +108 -7
  12. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +138 -9
  13. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +0 -17
  14. package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +0 -18
  15. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +0 -19
  16. package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +0 -18
  17. package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +0 -18
  18. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +0 -19
  19. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +0 -17
  20. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +0 -16
  21. package/cypress/e2e/ILC/dataApi/fetchQuestion.js +111 -150
  22. package/cypress/e2e/ILC/dataApi/saveQuestions.js +0 -53
  23. package/cypress/pages/components/ckEditorToolbar.js +0 -20
  24. package/cypress/pages/components/draggableOptionContainer.js +0 -14
  25. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -17
  26. package/cypress/pages/components/optionsWrapperComponent.js +2 -33
  27. package/cypress/pages/components/questionInputFieldComponent.js +2 -18
  28. package/cypress/pages/dragAndDropIntoCategoriesPage.js +38 -0
  29. package/cypress/pages/matchingPage.js +0 -18
  30. package/cypress/pages/numberLineLabelPage.js +0 -1
  31. package/cypress/pages/textSelectionPage.js +1 -17
  32. package/package.json +1 -1
@@ -2,10 +2,8 @@ import constants from "../../fixtures/constants";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { ckEditorToolbar } from "./ckEditorToolbar";
4
4
  import { commonComponents } from "./commonComponents";
5
- import { createQuestionBasePage } from "./createQuestionBasePage";
6
5
  import { equationEditorFlyout } from "./equationEditorFlyout";
7
6
  const css = Cypress.env('css');
8
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
7
 
10
8
  const selectors = {
11
9
  optionsLabel: () => cy.get('.options-label-wrapper .options-label'),
@@ -15,9 +13,7 @@ const selectors = {
15
13
  deleteOptionButton: () => cy.get('.ngie-button[aria-label*="Delete option"]'),
16
14
  optionsInputField: () => cy.get('.option-component [role="textbox"]'),
17
15
  //TODO: Need to update this in all TEI
18
- optionNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
19
- expandIconButton: () => cy.get('.expand-image-container .expand-image-btn[aria-label="expand image button"]'),
20
- closeImagePopup: () => cy.get('.close-popup-btn')
16
+ optionNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]')
21
17
  }
22
18
 
23
19
  const steps = {
@@ -304,23 +300,7 @@ const steps = {
304
300
 
305
301
  verifyOptionCount: (count) => {
306
302
  utilities.verifyElementCount(optionsWrapperComponent.optionsInputField(), count);
307
- },
308
-
309
- verifyExpandIconInImage: () => {
310
- utilities.verifyElementVisibilityState(optionsWrapperComponent.expandIconButton(), 'visible');
311
- },
312
-
313
- clickExpandIconInImage: () => {
314
- optionsWrapperComponent.expandIconButton()
315
- .first()
316
- .scrollIntoView()
317
- .realClick();
318
- },
319
-
320
- closeImagePopup: () => {
321
- optionsWrapperComponent.closeImagePopup()
322
- .click();
323
- }
303
+ }
324
304
  }
325
305
 
326
306
  const tests = {
@@ -407,17 +387,6 @@ const tests = {
407
387
  ckEditorToolbar.steps.addImageToInputField();
408
388
  optionsWrapperComponent.steps.verifyImageAndAltTextInOptionsInputField(inputFieldIndex);
409
389
  });
410
- if (imageExpandEnhancement === 'true') {
411
- it('When user add large image in options input field, user should be able to expand the image in preview tab', () => {
412
- createQuestionBasePage.steps.switchToPreviewTab();
413
- ckEditorToolbar.steps.verifyExpandIconInImage();
414
- ckEditorToolbar.steps.clickExpandIconInImage();
415
- utilities.verifyInnerText(ckEditorToolbar.closeImagePopup(), 'Close');
416
- ckEditorToolbar.steps.closeImagePopup();
417
- ckEditorToolbar.steps.verifyExpandIconInImage();
418
- createQuestionBasePage.steps.switchToEditTab();
419
- });
420
- }
421
390
  },
422
391
 
423
392
  /**
@@ -10,9 +10,7 @@ const selectors = {
10
10
  responseAreaNumeration: () => cy.get('marker'),
11
11
  responseAreaResponseLabel: () => cy.get('content'),
12
12
  questionContainerPreviewTab: () => cy.get('.preview-question-text-wrapper'),
13
- responseAreaSettingsButton: () => cy.get('.add_response_settings_btn'),
14
- expandIconButton: () => cy.get('.expand-image-btn'),
15
- closeImagePopup: () => cy.get('.close-popup-btn'),
13
+ responseAreaSettingsButton: () => cy.get('.add_response_settings_btn')
16
14
  }
17
15
 
18
16
  const steps = {
@@ -147,21 +145,7 @@ const steps = {
147
145
  utilities.getNthElement(questionInputFieldComponent.responseArea(), responseAreaIndex)
148
146
  .find('.add_response_element')
149
147
  .should('have.css', 'height', height);
150
- },
151
-
152
- verifyExpandIconInImage: () => {
153
- utilities.verifyElementVisibilityState(questionInputFieldComponent.expandIconButton(), 'visible');
154
- },
155
-
156
- clickExpandIconInImage: () => {
157
- questionInputFieldComponent.expandIconButton()
158
- .click();
159
- },
160
-
161
- closeImagePopup: () => {
162
- questionInputFieldComponent.closeImagePopup()
163
- .click();
164
- }
148
+ }
165
149
  }
166
150
 
167
151
  const tests = {
@@ -39,6 +39,7 @@ const selectors = {
39
39
  dropzoneCellPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="CellDropZonestyles__CellContainer"][class*="dropzone-cell"],[class*="question-preview-wrapper"] [class*="DropzoneCellstyles__StyledCell"]'),
40
40
  dropzoneCellNumeration: () => cy.get('.answer-numeration-number-box'),
41
41
  correctAnswerDropzoneCell: () => cy.get('[class*="Matrixstyles__AnswerCell"]'),
42
+ correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
42
43
  correctAnswerDropzoneCellTickIcon: () => cy.get('[class*="Matrixstyles__GreenBlock"]'),
43
44
  correctAnswersLabel: () => cy.get('.correct-answers-label'),
44
45
  correctAnswerOption: () => cy.get('[class*="Matrixstyles__AnswerWrapper"]'),
@@ -514,6 +515,43 @@ const steps = {
514
515
  });
515
516
  },
516
517
 
518
+ /**
519
+ * Verifies the content of each correct-answer dropzone in the Alternate Answer section.
520
+ *
521
+ * For every entry in `correctAnswersArray`, this function:
522
+ * - Iterates through each set of correct answers assigned to a dropzone.
523
+ * - Confirms that the dropzone displays the expected cell numeration.
524
+ * - Verifies each answer option inside the dropzone.
525
+ * - Validates that the points label for the group matches the expected value.
526
+ *
527
+ * @param {Object[]} correctAnswersArray - An array where each object represents
528
+ * a group of correct answers and its metadata.
529
+ * @param {string[][]} correctAnswersArray[].correctAnswers - A list of answer-option groups for each dropzone.
530
+ * @param {number[]} correctAnswersArray[].cellIndexArray - Expected numeration values for corresponding dropzones.
531
+ * @param {string} correctAnswersArray[].pointsText - Expected points label for this group of dropzones.
532
+ */
533
+ verifyCorrectAnswerResponsesInAlternateAnswerSection: (correctAnswersArray) => {
534
+ let dropzoneCellIndex = 0;
535
+ correctAnswersArray.forEach(({
536
+ correctAnswers,
537
+ pointsText,
538
+ }, index) => {
539
+ correctAnswers.forEach((correctAnswer) => {
540
+ dragAndDropIntoCategoriesPage.correctAnswerDropzoneCell()
541
+ .eq(dropzoneCellIndex)
542
+ .within(() => {
543
+ correctAnswer.forEach((answerOption, optionIndex) => {
544
+ utilities.verifyTextContent(utilities.getNthElement(dragAndDropIntoCategoriesPage.correctAnswerOption(), optionIndex), answerOption);
545
+ });
546
+ });
547
+ dropzoneCellIndex += 1;
548
+ });
549
+ dragAndDropIntoCategoriesPage.correctAnswerPointsLabel()
550
+ .eq(index)
551
+ .should('have.text', pointsText);
552
+ });
553
+ },
554
+
517
555
  /**
518
556
  * Verifies the presence of an incorrect option icon for a specified option in the Preview Tab.
519
557
  * @param {number} optionIndex - The index of the option to verify.
@@ -5,7 +5,6 @@ import { createItemPage } from "./createItemPage";
5
5
  const css = Cypress.env('css');
6
6
  const options = ['option 1', 'option 2', 'option 3'];
7
7
  const fourOptions = ['option 1', 'option 2', 'option 3', 'option 4'];
8
- const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
8
 
10
9
  const selectors = {
11
10
  ...correctIncorrectAnswerLabelComponent,
@@ -25,7 +24,6 @@ const selectors = {
25
24
  ...scoringSectionBaseEditTab,
26
25
  ...additionalSettingsPanel,
27
26
  ...connectorStyleStyleAndLayoutCustomizationComponent,
28
- ...ckEditorToolbar,
29
27
  //Edit tab
30
28
  promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
31
29
  promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper .edit-mcq-option-wrapper'),
@@ -2866,22 +2864,6 @@ const tests = {
2866
2864
  createQuestionBasePage.steps.switchToPreviewTab();
2867
2865
  draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(optionsAfterDeleting);
2868
2866
  });
2869
- if (imageExpandEnhancement === 'true') {
2870
- it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
2871
- createQuestionBasePage.steps.switchToEditTab();
2872
- optionsWrapperComponent.steps.addOption();
2873
- matchingPage.steps.focusInOptionsInputField(3);
2874
- matchingPage.steps.selectImageOptionFromCKEditorToolbar();
2875
- matchingPage.steps.addImageToInputField();
2876
- // matchingPage.steps.focusOutOptionsInputField(3);
2877
- createQuestionBasePage.steps.switchToPreviewTab();
2878
- matchingPage.steps.verifyExpandIconInImage();
2879
- matchingPage.steps.clickExpandIconInImage();
2880
- utilities.verifyInnerText(matchingPage.closeImagePopup(), 'Close');
2881
- matchingPage.steps.closeImagePopup();
2882
- matchingPage.steps.verifyExpandIconInImage();
2883
- });
2884
- }
2885
2867
  },
2886
2868
 
2887
2869
  //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
@@ -15,7 +15,6 @@ const selectors = {
15
15
  ...autoScoredScoringPreviewTab,
16
16
  ...randomizeOptionsComponent,
17
17
  ...additionalSettingsPanel,
18
- ...ckEditorToolbar,
19
18
  partialEqualWeightsPointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
20
19
  snapToTicksCheckbox: () => cy.get('[data-ngie-testid="snap-to-grid-nodes-checkbox"] input'),
21
20
  snapToTicksLabel: () => cy.get('[data-ngie-testid="snap-to-grid-nodes-checkbox"] .MuiFormControlLabel-label'),
@@ -102,8 +102,6 @@ const selectors = {
102
102
  optionsInputFieldInQuestionPreviewTab: () => cy.get('[class*="word-span highlight_option"]'),
103
103
  questionInstructionsPrintViewText: () => cy.get('.question-text-wrapper').eq(0),
104
104
  questionTextPrintViewParagraphs: () => cy.get('#nextgen-assess-print-view [data-testid="question-instruction-element"] p'),
105
- expandIconButton: () => cy.get('.expand-image-btn'),
106
- closeImagePopup: () => cy.get('.close-popup-btn'),
107
105
  }
108
106
 
109
107
  const steps = {
@@ -1381,21 +1379,7 @@ const steps = {
1381
1379
  textSelectionPage.questionTextPrintViewParagraphs().each(($el, index) => {
1382
1380
  utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPrintViewParagraphs(), index), `${paragraphTextArray[index]}`);
1383
1381
  });
1384
- },
1385
-
1386
- verifyExpandIconInImage: () => {
1387
- utilities.verifyElementVisibilityState(textSelectionPage.expandIconButton(), 'visible');
1388
- },
1389
-
1390
- clickExpandIconInImage: () => {
1391
- textSelectionPage.expandIconButton()
1392
- .click();
1393
- },
1394
-
1395
- closeImagePopup: () => {
1396
- textSelectionPage.closeImagePopup()
1397
- .click();
1398
- },
1382
+ }
1399
1383
  }
1400
1384
 
1401
1385
  const tests = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.579-IEI-7193-1dd98c9.0",
3
+ "version": "1.0.579-IEI-7046-a317a6b.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {