itemengine-cypress-automation 1.0.190-repoUpdate3May-f180558.0 → 1.0.190

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +2 -0
  2. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +3 -30
  3. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +0 -27
  4. package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +9 -9
  5. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +12 -12
  6. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +1 -1
  8. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +1 -0
  9. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +4 -20
  10. package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +366 -0
  11. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +181 -0
  12. package/cypress/e2e/ILC/ChartsBar/gradingViewAndCorrectAnswerView.smoke.js +283 -0
  13. package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +396 -130
  14. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +1 -1
  15. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +2 -2
  16. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +0 -3
  17. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +3 -5
  18. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +0 -4
  19. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabScoring.js +0 -1
  20. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePageHeaderSection.js +4 -24
  21. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -9
  22. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +3 -3
  23. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +0 -2
  24. package/cypress/e2e/ILC/EssayResponse/headerSection.js +3 -18
  25. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +0 -1
  26. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +0 -1
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +0 -5
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +0 -4
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +3 -3
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +5 -5
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +3 -3
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +0 -4
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +1 -2
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +0 -2
  35. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +2 -1
  36. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +6 -6
  37. package/cypress/e2e/ILC/GridFill/headerSection.js +4 -5
  38. package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +276 -0
  39. package/cypress/e2e/ILC/ImageHighlight/checkAnswerFunctionalityForAllViews.smoke.js +141 -0
  40. package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +150 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +1 -1
  42. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  43. package/cypress/e2e/ILC/Matching/additionalSettings.js +1 -0
  44. package/cypress/e2e/ILC/Matching/headerSection.js +2 -2
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +22 -20
  46. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +4 -2
  47. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +4 -2
  48. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +3 -2
  49. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +2 -1
  50. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +1 -8
  51. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -3
  52. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  53. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +5 -4
  54. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +4 -2
  55. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +4 -2
  56. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -2
  57. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +2 -1
  58. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +3 -2
  59. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +1 -1
  60. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +1 -7
  61. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +0 -1
  62. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -2
  63. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  64. package/cypress/e2e/ILC/VideoResponseNew/customizePlaybackControls.js +2 -2
  65. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +2 -2
  66. package/cypress/e2e/ILC/VideoResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +6 -6
  67. package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +6 -6
  68. package/cypress/e2e/ILC/VideoResponseNew/standardRecorderStyle.js +9 -9
  69. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettings.js +2 -4
  70. package/cypress/pages/audioPlayerPage.js +4 -2
  71. package/cypress/pages/audioResponsePage.js +2 -0
  72. package/cypress/pages/chartsBarPage.js +289 -3
  73. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +8 -5
  74. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  75. package/cypress/pages/components/barAndLineChartComponent.js +7 -4
  76. package/cypress/pages/components/chartsCommonComponent.js +33 -0
  77. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  78. package/cypress/pages/components/index.js +2 -1
  79. package/cypress/pages/components/questionInputFieldComponent.js +2 -1
  80. package/cypress/pages/components/resetPopupComponent.js +7 -3
  81. package/cypress/pages/components/scoringSectionBaseEditTab.js +6 -17
  82. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +16 -0
  83. package/cypress/pages/contentBlocksPage.js +1 -1
  84. package/cypress/pages/dragAndDropIntoCategoriesPage.js +22 -24
  85. package/cypress/pages/drawingResponsePage.js +3 -2
  86. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +14 -0
  87. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +1 -1
  88. package/cypress/pages/imageHighlightPage.js +364 -0
  89. package/cypress/pages/index.js +2 -1
  90. package/cypress/pages/matchingPage.js +2 -1
  91. package/cypress/pages/numberLineLabelPage.js +14 -7
  92. package/cypress/pages/protractorPage.js +1 -1
  93. package/cypress/pages/readingRulerPage.js +1 -1
  94. package/cypress/pages/rulerPage.js +3 -3
  95. package/cypress/pages/textEntryMathPage.js +2 -2
  96. package/cypress/pages/videoResponsePage.js +6 -5
  97. package/package.json +1 -1
  98. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  99. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -646,11 +646,11 @@ const tests = {
646
646
  },
647
647
 
648
648
  verifyCanvasResponseAreaContents: () => {
649
- it('When user clicks inside canvas, then one response container should be added with pointer, close button and numeration.', () => {
649
+ it('When user clicks inside canvas, then one response container should be added with close button, numeration and without pointer.', () => {
650
650
  imageCanvasComponent.steps.insertResponseArea(80);
651
651
  utilities.verifyElementCount(imageCanvasComponent.responseAreaWrapper(), 1);
652
652
  utilities.verifyElementVisibilityState(imageCanvasComponent.responseArea(), 'visible');
653
- utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaPointer(), 'visible');
653
+ utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaPointer(), 'notExist');
654
654
  utilities.verifyElementVisibilityState(imageCanvasComponent.removeResponseAreaButton(), 'visible');
655
655
  utilities.verifyInnerText(imageCanvasComponent.responseAreaNumerationText(), '1');
656
656
  utilities.verifyElementVisibilityState(imageCanvasComponent.responseAreaNumerationText(), 'visible');
@@ -823,7 +823,7 @@ const tests = {
823
823
  it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
824
824
  utilities.verifyInnerText(colorPopupComponent.cancelButton(), 'Cancel');
825
825
  utilities.verifyElementVisibilityState(colorPopupComponent.cancelButton(), 'visible');
826
- utilities.verifyInnerText(colorPopupComponent.okButton(), 'OK');
826
+ utilities.verifyInnerText(colorPopupComponent.okButton(), 'Ok');
827
827
  utilities.verifyElementVisibilityState(colorPopupComponent.okButton(), 'visible');
828
828
  });
829
829
 
@@ -70,4 +70,5 @@ export * from './barAndLineChartComponent';
70
70
  export * from './chartsCommonComponent';
71
71
  export * from './numberLineCommonComponent';
72
72
  export * from './limitNumberOfRetakeComponent';
73
- export * from './allowTeachersToDownloadStudentResponseComponent';
73
+ export * from './allowTeachersToDownloadStudentResponseComponent';
74
+ export * from './singleMultipleSelectionModeComponent';
@@ -138,7 +138,8 @@ const tests = {
138
138
  questionInputFieldComponent.steps.clearQuestionInputField();
139
139
  questionInputFieldComponent.steps.verifyQuestionInputFieldPlaceholder();
140
140
  questionInputFieldComponent.steps.addInputToQuestionInputField('Lorem Ipsum');
141
- utilities.verifyTextContent(questionInputFieldComponent.questionInputField(), '​​​​​​​Lorem Ipsum');
141
+ questionInputFieldComponent.questionInputField()
142
+ .contains('Lorem Ipsum');
142
143
  questionInputFieldComponent.steps.verifyQuestionInputFieldPlaceholderNotDisplayed();
143
144
  });
144
145
  },
@@ -20,14 +20,18 @@ const steps = {
20
20
  }
21
21
 
22
22
  const tests = {
23
- verifyResetPopupContentWithCSSAndA11y: () => {
23
+ /**
24
+ * @description Verify reset popup content with css and accessibility
25
+ * @param {("graph"|"chart")} representation
26
+ */
27
+ verifyResetPopupContentWithCSSAndA11y: (representation) => {
24
28
  it('When the user clicks on the \'Reset\' button then a dialog box should appear with title \'Reset\'', () => {
25
29
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
26
30
  utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Reset');
27
31
  });
28
32
 
29
- it('The dialog box should have content \'Are you sure you want to reset the graph? This will clear all objects and revert all settings to their default values.\' with \'Cancel\' and \'Confirm reset\' buttons should be displayed', () => {
30
- utilities.verifyInnerText(dialogBoxBase.dialogBoxContent(), 'Are you sure you want to reset the graph? This will clear all objects and revert all settings to their default values.');
33
+ it(`The dialog box should have content \'Are you sure you want to reset the ${representation}? This will clear all objects and revert all settings to their default values.\' with \'Cancel\' and \'Confirm reset\' buttons should be displayed`, () => {
34
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxContent(), `Are you sure you want to reset the ${representation}? This will clear all objects and revert all settings to their default values.`);
31
35
  utilities.verifyInnerText(resetPopupComponent.resetPopupConfirmResetButton(), 'Confirm reset');
32
36
  utilities.verifyInnerText(resetPopupComponent.resetPopupCancelButton(), 'Cancel');
33
37
  });
@@ -123,7 +123,10 @@ const steps = {
123
123
  },
124
124
 
125
125
  verifyPointsFieldErrorMessageIsNotDisplayed: () => {
126
- utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
126
+ scoringSectionBaseEditTab.pointsWrapper()
127
+ .within(() => {
128
+ utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
129
+ });
127
130
  },
128
131
 
129
132
  /**
@@ -248,25 +251,11 @@ const tests = {
248
251
  scoringSectionBaseEditTab.pointsInputField()
249
252
  .focus()
250
253
  .blur();
251
- utilities.verifyInnerText(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'Error: Please enter points.');
252
- utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'visible');
253
- });
254
-
255
- it('CSS of points field error message', { tags: 'css' }, () => {
256
- utilities.verifyCSS(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), {
257
- 'color': css.color.errorText,
258
- 'font-size': css.fontSize.small,
259
- 'font-weight': css.fontWeight.regular
260
- });
261
- });
262
-
263
- it('Accessibility of points field error message', { tags: 'a11y' }, () => {
264
- cy.checkAccessibility(commonComponents.errorMessage());
254
+ utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
265
255
  });
266
256
 
267
- it('When the user enters point in Points input field then the \'Please enter points.\' validation text should disappear', () => {
257
+ it('User should be able to enter points in the points input fields', () => {
268
258
  scoringSectionBaseEditTab.steps.allotPoints(10);
269
- utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
270
259
  });
271
260
  },
272
261
 
@@ -0,0 +1,16 @@
1
+ const selectors = {
2
+ multipleSelectionToggleButton: () => cy.get('.response-toggle-wrapper button[aria-label*="Multiple selection"]'),
3
+ singleSelectionToggleButton: () => cy.get('.response-toggle-wrapper button[aria-label*="Single selection"]'),
4
+ }
5
+
6
+ const steps = {
7
+ selectMultipleSelectionToggle: () => {
8
+ singleMultipleSelectionModeComponent.multipleSelectionToggleButton()
9
+ .click();
10
+ }
11
+ }
12
+
13
+ export const singleMultipleSelectionModeComponent = {
14
+ ...selectors,
15
+ steps
16
+ }
@@ -56,7 +56,7 @@ const selectors = {
56
56
  groupDividerPreviewTab: () => cy.get('.content-wrapper .group-divider'),
57
57
  previousPageButton: () => cy.get('.pagination-button[data-at="previous"]'),
58
58
  nextPageButton: () => cy.get('.pagination-button[data-at="next"]'),
59
- noPreviewText: () => cy.get('[class*="PassagePreviewstyles__NoPreview"]'),
59
+ noPreviewText: () => cy.get('[class*="__NoPreview"]'),
60
60
  paginationText: () => cy.get('.pagination-text'),
61
61
  previewWrapper: () => cy.get('[class*="TabsComponentstyles__PreviewWrapper"]'),
62
62
  sliderButtonPreviewTab: () => cy.get('.slider-indicators button'),
@@ -28,21 +28,20 @@ const selectors = {
28
28
  cellSubheadingTextArea: () => cy.get('.heading-field-wrapper [role="textbox"]'),
29
29
  cellTextTextArea: () => cy.get('.matrix-text-field [role="textbox"]'),
30
30
  tableCellContainer: () => cy.get('[class*="DragAndDropTablestyles__CellContainer"]'),
31
- //Note: remove :visible after https://redmine.zeuslearning.com/issues/556304 gets fixed
32
- dropzoneCellSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__CellContainer"][class*="dropzone-cell"]:visible'),
31
+ dropzoneCellSpecifyCorrectAnswerSection: () => cy.get('[class*="CellDropZonestyles__CellContainer"][class*="dropzone-cell"]'),
33
32
  //Note: Items render twice in student view, need to remove .first()
34
- dropzoneCellPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DragAndDropMatrixstyles__CellContainer"][class*="dropzone-cell"]'),
33
+ dropzoneCellPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="CellDropZonestyles__CellContainer"][class*="dropzone-cell"]'),
35
34
  dropzoneCellNumeration: () => cy.get('.answer-numeration-number-box'),
36
- correctAnswerDropzoneCell: () => cy.get('[class*="DragAndDropMatrixstyles__AnswerCell"]'),
37
- correctAnswerDropzoneCellTickIcon: () => cy.get('[class*="DragAndDropMatrixstyles__GreenBlock"]'),
35
+ correctAnswerDropzoneCell: () => cy.get('[class*="Matrixstyles__AnswerCell"]'),
36
+ correctAnswerDropzoneCellTickIcon: () => cy.get('[class*="Matrixstyles__GreenBlock"]'),
38
37
  correctAnswersLabel: () => cy.get('.correct-answers-label'),
39
- correctAnswerOption: () => cy.get('[class*="DragAndDropMatrixstyles__AnswerWrapper"]'),
38
+ correctAnswerOption: () => cy.get('[class*="Matrixstyles__AnswerWrapper"]'),
40
39
  //Note: Items render twice in student view, need to remove .first()
41
- categoryGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DragAndDropMatrixstyles__TableWrapper"]').first(),
42
- optionsWrapper: () => cy.get('[class*="DragAndDropMatrixstyles__DraggableItemWrapper"]'),
40
+ categoryGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Matrixstyles__TableWrapper"]').first(),
41
+ optionsWrapper: () => cy.get('[class*="CellDropZonestyles__DraggableItemWrapper"]'),
43
42
  correctIncorrectAnswerBlock: () => cy.get('[class*="correct-answer-block"]'),
44
- correctIncorrectStatusMessageText: () => cy.get('[class*="DragAndDropMatrixstyles__AnswerStatusText"]'),
45
- correctIncorrectAnswerLabel: () => cy.get('[class*="DragAndDropMatrixstyles__CorrectIncorrectLabel"]'),
43
+ correctIncorrectStatusMessageText: () => cy.get('[class*="Matrixstyles__AnswerStatusText"]'),
44
+ correctIncorrectAnswerLabel: () => cy.get('[class*="Matrixstyles__CorrectIncorrectLabel"]'),
46
45
  correctAnswerContainer: () => cy.get('[class*="_CorrectAnswerWrapper"]'),
47
46
 
48
47
  //Specify columns and rows
@@ -57,8 +56,8 @@ const selectors = {
57
56
  rightArrowNavigationButton: () => cy.get('[class*="DragAndDropTablestyles__PaginationRightControl"]'),
58
57
 
59
58
  //Specify correct answer matrix
60
- tableCellContainerSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__CellContainer"]'),
61
- tableRowContainerSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__RowContainer"]'),
59
+ tableCellContainerSpecifyCorrectAnswerSection: () => cy.get('[class*="Matrixstyles__CellContainer"]'),
60
+ tableRowContainerSpecifyCorrectAnswerSection: () => cy.get('[class*="Matrixstyles__RowContainer"]'),
62
61
  leftArrowNavigationButtonSpecifyCorrectAnswerSection: () => cy.get('.classification-set-correct-answer-wrapper [aria-label="Left Pagination Button"]'),
63
62
  rightArrowNavigationButtonSpecifyCorrectAnswerSection: () => cy.get('.classification-set-correct-answer-wrapper [aria-label="Right Pagination Button"]'),
64
63
  tableCellLabel: () => cy.get('.cell-label'),
@@ -67,11 +66,11 @@ const selectors = {
67
66
  dropzoneAriaLabelInputField: () => cy.get('[type="text"][aria-label*="Enter ARIA label"]'),
68
67
 
69
68
  //Preview tab table
70
- tableRowContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DragAndDropMatrixstyles__RowContainer"]'),
71
- leftArrowNavigationButtonPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-label="Left Pagination Button"][class*="DragAndDropMatrixstyles__PaginationControl"]'),
72
- rightArrowNavigationButtonPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-label="Right Pagination Button"][class*="DragAndDropMatrixstyles__PaginationControl"]'),
73
- cellContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DragAndDropMatrixstyles__CellContainer"]'),
74
- cellContainerSpecifyCorrectAnswer: () => cy.get('[class*="DragAndDropMatrixstyles__CellContainer"]'),
69
+ tableRowContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Matrixstyles__RowContainer"]'),
70
+ leftArrowNavigationButtonPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-label="Left Pagination Button"][class*="Matrixstyles__PaginationControl"]'),
71
+ rightArrowNavigationButtonPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-label="Right Pagination Button"][class*="Matrixstyles__PaginationControl"]'),
72
+ cellContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Matrixstyles__CellContainer"]'),
73
+ cellContainerSpecifyCorrectAnswer: () => cy.get('[class*="Matrixstyles__CellContainer"]'),
75
74
  incorrectOptionWrapper: () => cy.get('[class*="question-preview-wrapper"] .incorrect-answer-item'),
76
75
  correctOptionWrapper: () => cy.get('[class*="question-preview-wrapper"] .correct-answer-item'),
77
76
  perDropzoneRadioButton: () => cy.get('input[aria-label="per dropzone"]'),
@@ -88,10 +87,9 @@ const selectors = {
88
87
  penaltyPointsForIncorrectOptionInputField: () => cy.get('input[aria-label="penalty points for each incorrect option"]'),
89
88
  penaltyPointsForEachIncorrectOptionOrDropzoneLabel: () => cy.get('[class*="PenaltyScoreForEachIncorrectstyles__PointsLabel"]'),
90
89
  tableOuterBorder: () => cy.get('.table-border'),
91
- categoryGridSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__TableWrapper"]'),
92
- maxLimitInEachDropzoneHelpText: () => cy.get('[class*="DragAndDropMatrixstyles__MaxLimitWrapper"]'),
93
- dropzoneGridSpecifyCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__TableWrapper"]'),
94
- dropzoneGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DragAndDropMatrixstyles__TableWrapper"]'),
90
+ maxLimitInEachDropzoneHelpText: () => cy.get('[class*="Matrixstyles__MaxLimitWrapper"]'),
91
+ dropzoneGridSpecifyCorrectAnswerSection: () => cy.get('[class*="Matrixstyles__TableWrapper"]'),
92
+ dropzoneGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Matrixstyles__TableWrapper"]'),
95
93
  }
96
94
 
97
95
  const steps = {
@@ -618,7 +616,7 @@ const steps = {
618
616
  dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
619
617
  .eq(0)
620
618
  .within(($element) => {
621
- utilities.verifyElementCount(cy.wrap($element).find('[class*="DragAndDropMatrixstyles__CellContainer"]'), numberOfColumns);
619
+ utilities.verifyElementCount(cy.wrap($element).find('[class*="Matrixstyles__CellContainer"]'), numberOfColumns);
622
620
  });
623
621
  },
624
622
 
@@ -638,7 +636,7 @@ const steps = {
638
636
  dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
639
637
  .eq(0)
640
638
  .within(($element) => {
641
- utilities.verifyElementCount(cy.wrap($element).find('[class*="DragAndDropMatrixstyles__CellContainer"]'), numberOfColumns);
639
+ utilities.verifyElementCount(cy.wrap($element).find('[class*="Matrixstyles__CellContainer"]'), numberOfColumns);
642
640
  });
643
641
  },
644
642
 
@@ -1149,7 +1147,7 @@ const steps = {
1149
1147
  },
1150
1148
 
1151
1149
  clickAndDropOptionFromDropzoneToOptionContainerSpecifyCorrectAnswerSection: (optionText) => {
1152
- dragAndDropIntoCategoriesPage.categoryGridSpecifyCorrectAnswerSection()
1150
+ dragAndDropIntoCategoriesPage.dropzoneGridSpecifyCorrectAnswerSection()
1153
1151
  .within(() => {
1154
1152
  draggableOptionContainer.draggableOption()
1155
1153
  .contains(optionText)
@@ -60,7 +60,7 @@ const selectors = {
60
60
  },
61
61
  previewTabToolbarOptionTooltip: () => cy.get('.edit-question-preview-wrapper [role="tooltip"][class*="Tooltipstyles__TooltipContent"]'),
62
62
  previewTabLowerCanvas: () => cy.get('.question-preview-wrapper .lower-canvas'),
63
- previewTabUpperCanvas: () => cy.get('.question-preview-wrapper .upper-canvas'),
63
+ previewTabUpperCanvas: () => cy.get('.edit-question-preview-wrapper .upper-canvas'),
64
64
  previewTabSecondaryToolbarOptionLabel: () => cy.get('.edit-question-preview-wrapper .drawing-tool__secondary-toolbar__tool-name'),
65
65
  previewTabSecondaryToolbarOption: (ariaLabel = null) => {
66
66
  if (ariaLabel) {
@@ -194,6 +194,7 @@ const selectors = {
194
194
  specialCharactersPopupCategoryTitle: () => cy.get('[class*="characters__container"] [class="drawing-tool-options__options__accordion__header"]'),
195
195
  specialCharactersPopupCategoryAccordionIcon: () => cy.get('[class*="characters__container"] [aria-label="AccordionIcon"]'),
196
196
 
197
+ //TODO - update selectors https://redmine.zeuslearning.com/issues/571423
197
198
  //Edit tab color picker popup
198
199
  editTabColorPickerPopupOpacityPalette: () => cy.get('.react-colorful__last-control .react-colorful__interactive'),
199
200
  editTabColorPickerPopupOpacityPicker: () => cy.get('.react-colorful__last-control .react-colorful__pointer'),
@@ -636,7 +637,7 @@ const steps = {
636
637
  verifySecondaryPopupLineType: (lineType, index) => {
637
638
  drawingResponsePage.previewTabSecondaryOptionPopupOptions()
638
639
  .eq(index)
639
- .should('have.attr', 'aria-label', `Line Type ${lineType}`);
640
+ .should('have.attr', 'aria-label', `Line type ${lineType}`);
640
641
  },
641
642
 
642
643
  /**
@@ -546,6 +546,20 @@ const steps = {
546
546
  fillInTheGapsOverImageDragAndDropPage.dropzonePreviewTab()
547
547
  .should('be.visible');
548
548
  },
549
+
550
+ /**
551
+ * @param {number} index of option input field
552
+ * @param {string} textContent to enter text in the options input field
553
+ */
554
+ enterTextInOptionInputField: (index, textContent) => {
555
+ optionsWrapperComponent.optionsSectionWrapper()
556
+ .within(() => {
557
+ optionsWrapperComponent.optionsInputField()
558
+ .eq(index)
559
+ .type(textContent)
560
+ .blur();
561
+ });
562
+ },
549
563
  }
550
564
 
551
565
  const tests = {
@@ -157,7 +157,7 @@ const steps = {
157
157
  * @description this function verifies width of canvas
158
158
  */
159
159
  verifyCanvasWidthInPreviewTab: (width) => {
160
- fillInTheGapsOverImageDropdownPage.canvasInPreviewTab()
160
+ fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab()
161
161
  .should('have.attr', 'width', width);
162
162
  },
163
163
 
@@ -0,0 +1,364 @@
1
+ import utilities from "../support/helpers/utilities";
2
+ import { autoScoredScoringPreviewTab, autoScoredStudentViewSettings, backgroundImageUploadComponent, createQuestionBasePage, imageCanvasComponent, questionInstructionsComponent, scoringSectionBaseEditTab, singleMultipleSelectionModeComponent } from "./components"
3
+ const css = Cypress.env('css');
4
+ let imageWidth = 768;
5
+ let imageHeight = 432;
6
+
7
+ const selectors = {
8
+ ...questionInstructionsComponent,
9
+
10
+ //Specify possible options
11
+ specifyPossibleOptionsImageWrapper: () => cy.get('.drawing-tool__wrapper .drawing-tool__canvas'),
12
+ specifyPossibleOptionsImageCanvas: () => cy.get('.drawing-tool__wrapper .upper-canvas'),
13
+ freeformTool: () => cy.get('.drawing-tool__button-polygon'),
14
+ //Specify correct answer section
15
+ specifyCorrectAnswerSectionImage: () => cy.get('.highlight-svg-responseive image'),
16
+ specifyCorrectAnswerSectionHighlight: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a'),
17
+ //preview tab
18
+ imagePreviewTab: () => cy.get('[class*="question-preview-wrapper"] .highlight-svg-responseive image'),
19
+ highlightPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="HighlightImageControlstyles__ShapeWrapper"] a'),
20
+ highlightPolygonPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="HighlightImageControlstyles__PolygonWrapper"]'),
21
+ checkMarkIcon: () => cy.get('.correct-option-icon [data-name*="Rectangle"]'),
22
+ crossMarkIcon: () => cy.get('.incorrect-option-icon [data-name*="Rectangle"]'),
23
+ correctAnswersLabel: () => cy.get('[class*="__AnswerLabel"]'),
24
+ highlightNumerationPreviewTab: () => cy.get('[class*="__TextWrapper"]'),
25
+ correctAnswerContainerAnswerWrapper: () => cy.get('[class*="__AnswersWrapper"]'),
26
+ correctAnswerNumeration: () => cy.get('[class*="CellIndexWrapper"]'),
27
+ correctIncorrectAnswerTextWrapper: () => cy.get('[class*="_CorrectIncorrectWrapper"]'),
28
+ incorrectIcon: () => cy.get('[data-icon="Incorrect"]'),
29
+ correctIcon: () => cy.get('[data-icon="CorrectAnswer"]')
30
+ }
31
+
32
+ const steps = {
33
+ ...createQuestionBasePage.steps,
34
+ ...questionInstructionsComponent.steps,
35
+ ...backgroundImageUploadComponent.steps,
36
+ ...singleMultipleSelectionModeComponent.steps,
37
+ ...scoringSectionBaseEditTab.steps,
38
+ ...imageCanvasComponent.steps,
39
+ ...autoScoredScoringPreviewTab.steps,
40
+ ...autoScoredStudentViewSettings.steps,
41
+ //Specify possible options
42
+ clickOnFreeformTool: () => {
43
+ imageHighlightPage.freeformTool()
44
+ .click()
45
+ .blur();
46
+ },
47
+
48
+ verifyImageUploadedInSpecifyPossibleOptionsSection: () => {
49
+ imageHighlightPage.specifyPossibleOptionsImageWrapper()
50
+ .should('be.visible')
51
+ .and('have.css', 'background-image');
52
+ imageHighlightPage.specifyPossibleOptionsImageWrapper()
53
+ .should('have.css', 'background-size')
54
+ .and('eq', 'auto');
55
+ imageHighlightPage.specifyPossibleOptionsImageCanvas()
56
+ .should('be.visible')
57
+ .should('have.css', 'cursor');
58
+ },
59
+
60
+ /**
61
+ * @param {number[]} arrayOfPoints co-ordinates of the region to be highlighted
62
+ * @description this function draws the region to be highlighted
63
+ */
64
+ highlightRegionInImage: (arrayOfPoints) => {
65
+ imageHighlightPage.steps.clickOnFreeformTool();
66
+ imageHighlightPage.specifyPossibleOptionsImageCanvas()
67
+ .then(($element) => {
68
+ const clientWidth = $element[0].clientWidth;
69
+ arrayOfPoints.forEach((coordinates) => {
70
+ imageHighlightPage.specifyPossibleOptionsImageCanvas()
71
+ .click(coordinates[0] * clientWidth / 100, coordinates[1] * clientWidth / 100);
72
+ });
73
+ imageHighlightPage.specifyPossibleOptionsImageCanvas()
74
+ .click(arrayOfPoints[0][0] * clientWidth / 100, arrayOfPoints[0][1] * clientWidth / 100);
75
+ });
76
+ cy.wait(200);
77
+ },
78
+
79
+ //Specify correct answer section
80
+ verifyImageUploadedSpecifyCorrectAnswer: () => {
81
+ utilities.verifyElementVisibilityState(imageHighlightPage.specifyCorrectAnswerSectionImage(), 'visible')
82
+ },
83
+
84
+ /**
85
+ * @param {number} index of region to be highlighted in set correct answer section
86
+ * @description this function verifies if the region is highlighted
87
+ */
88
+ verifySelectedHighlightRegionInSetCorrectAnswerSection: (index) => {
89
+ imageHighlightPage.specifyCorrectAnswerSectionHighlight()
90
+ .eq(index)
91
+ .should('have.attr', 'aria-checked', 'true');
92
+ },
93
+
94
+ /**
95
+ * @param {number} index of highlight region
96
+ * @description this function verifies if a highlight region is not selected
97
+ */
98
+ verifyRegionIsNotHighlightedInSetCorrectAnswerSection: (index) => {
99
+ imageHighlightPage.specifyCorrectAnswerSectionHighlight()
100
+ .eq(index)
101
+ .should('have.attr', 'aria-checked', 'false');
102
+ },
103
+
104
+ /**
105
+ * @param {number} index of highlight region
106
+ * @description this functions highlights a region in set correct answer section
107
+ */
108
+ highlightARegionInSpecifyCorrectAnswerSection: (index) => {
109
+ imageHighlightPage.specifyCorrectAnswerSectionHighlight()
110
+ .eq(index)
111
+ .click();
112
+ steps.verifySelectedHighlightRegionInSetCorrectAnswerSection(index);
113
+ },
114
+
115
+ /**
116
+ * @param {number} index of highlight region
117
+ * @description this functions highlights a region in set correct answer section
118
+ */
119
+ removeHighlightOfARegionInSetCorrectAnswerSection: (index) => {
120
+ imageHighlightPage.specifyCorrectAnswerSectionHighlight()
121
+ .eq(index)
122
+ .click();
123
+ steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(index);
124
+ },
125
+
126
+ //Preview tab
127
+ verifyImageUploadedPreviewTab: () => {
128
+ utilities.verifyElementVisibilityState(imageHighlightPage.imagePreviewTab(), 'visible')
129
+ },
130
+
131
+ /**
132
+ * This function verifies the alt text of the image
133
+ * @param {string} altText for the image in preview tab
134
+ */
135
+ verifyImageUploadedAltTextPreviewTab: (altText) => {
136
+ imageHighlightPage.imagePreviewTab()
137
+ .should('have.attr', 'alt', altText)
138
+ },
139
+
140
+ /**
141
+ * This function verifies the image width and height
142
+ * @param {number} width of the image
143
+ * @param {number} height of the image
144
+ */
145
+ verifyImageUploadedWidthAndHeightPreviewTab: (width, height) => {
146
+ imageHighlightPage.imagePreviewTab()
147
+ .should('have.attr', 'width', width)
148
+ .should('have.attr', 'height', height)
149
+ },
150
+
151
+ /**
152
+ * @description verify count of highlight in preview tab
153
+ * @param {number} count count of the highlight
154
+ */
155
+ verifyHighlightRegionCountInPreviewTab: (count) => {
156
+ imageHighlightPage.highlightPreviewTab()
157
+ .should('have.length', count);
158
+ },
159
+
160
+ /**
161
+ * @description verify hidden state of highlight in preview tab
162
+ * @param {number} count count of the highlight
163
+ */
164
+ verifyHiddenHighlightRegion: (index) => {
165
+ utilities.getNthElement(imageHighlightPage.highlightPolygonPreviewTab(), index)
166
+ .should('have.attr', 'stroke-opacity', 'transparent');
167
+ },
168
+
169
+ /**
170
+ * @description verify hover state of highlight in preview tab
171
+ * @param {number} count count of the highlight
172
+ */
173
+ verifyHoverStateOfHighlightRegion: (index) => {
174
+ utilities.getNthElement(imageHighlightPage.highlightPolygonPreviewTab(), index)
175
+ .should('have.attr', 'stroke-opacity', '100')
176
+ .and('have.attr', 'fill-opacity', '40');
177
+ },
178
+
179
+ /**
180
+ * @param {number} index of highlighted region
181
+ * @param {number[]} hotspotCoordsInPercentage co-ordinates of the highlighted image in preview tab
182
+ * @description this function verifies the co-ordinates of region highlighted in preview tab
183
+ */
184
+ verifyHighlightRegionsInPreviewTab: (index, hotspotCoordsInPercentage) => {
185
+ let flattenedArr = hotspotCoordsInPercentage.flat();
186
+ imageHighlightPage.highlightPolygonPreviewTab()
187
+ .eq(index)
188
+ .then(($element) => {
189
+ const pointsValue = $element.attr('points');
190
+ const pointsArray = pointsValue.split(',');
191
+ let wholeNumbersArray = pointsArray.map((point) => {
192
+ return Math.floor(Number(point))
193
+ });
194
+ wholeNumbersArray.forEach((actualValue, index) => {
195
+ const targetValue = flattenedArr[index] * imageWidth / 100;
196
+ cy.wrap(actualValue).should('be.closeTo', targetValue, 2);
197
+ });
198
+ });
199
+ },
200
+
201
+ /**
202
+ * @param {number} index of region to be highlighted in set correct answer section
203
+ * @description this function verifies if the region is highlighted
204
+ */
205
+ verifySelectedHighlightRegionInPreviewTab: (index) => {
206
+ imageHighlightPage.highlightPreviewTab()
207
+ .eq(index)
208
+ .should('have.attr', 'aria-checked', 'true');
209
+ },
210
+
211
+ /**
212
+ * @param {number} index of highlight region
213
+ * @description this function verifies if aa highlight region is not selected
214
+ */
215
+ verifyRegionIsNotHighlightedPreviewTab: (index) => {
216
+ imageHighlightPage.highlightPreviewTab()
217
+ .eq(index)
218
+ .should('have.attr', 'aria-checked', 'false');
219
+ },
220
+
221
+ /**
222
+ * @param {number} index of highlight region
223
+ * @description this functions highlights a region in preview tab
224
+ */
225
+ clickOnARegionInPreviewTab: (index) => {
226
+ imageHighlightPage.highlightPolygonPreviewTab()
227
+ .eq(index)
228
+ .click();
229
+ },
230
+
231
+ /**
232
+ * @param {number} index of highlight region
233
+ * @description this functions highlights a region in preview tab
234
+ */
235
+ highlightARegionInPreviewTab: (index) => {
236
+ imageHighlightPage.highlightPolygonPreviewTab()
237
+ .eq(index)
238
+ .click();
239
+ steps.verifySelectedHighlightRegionInPreviewTab(index);
240
+ },
241
+
242
+ /**
243
+ * @param {number} index of highlight region
244
+ * @description this functions highlights a region in set correct answer section
245
+ */
246
+ removeHighlightOfARegionInPreviewTab: (index) => {
247
+ imageHighlightPage.highlightPolygonPreviewTab()
248
+ .eq(index)
249
+ .click();
250
+ steps.verifyRegionIsNotHighlightedPreviewTab(index)
251
+ },
252
+
253
+ /**
254
+ * @param {*} index of highlight region
255
+ * @description this function verifies the highlight region is in default state
256
+ */
257
+ verifyDefaultHighlightRegion: (index) => {
258
+ utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(index), {
259
+ 'stroke': css.color.activeButtons
260
+ });
261
+ },
262
+
263
+ /**
264
+ * @param {*} index of highlight region
265
+ * @description this function verifies the highlight region is correct
266
+ */
267
+ verifyCorrectHighlightRegion: (index) => {
268
+ utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(index), {
269
+ 'fill': css.color.correctAnswerHighlightRegion,
270
+ 'stroke': css.color.correctAnswer
271
+ });
272
+ imageHighlightPage.highlightPreviewTab()
273
+ .eq(index)
274
+ .within(() => {
275
+ utilities.verifyCSS(imageHighlightPage.checkMarkIcon(), {
276
+ 'fill': css.color.correctAnswer
277
+ });
278
+ });
279
+ },
280
+
281
+ /**
282
+ * @param {*} index of highlight region
283
+ * @description this function verifies the highlight region is incorrect
284
+ */
285
+ verifyIncorrectHighlightRegion: (index) => {
286
+ utilities.verifyCSS(imageHighlightPage.highlightPolygonPreviewTab().eq(index), {
287
+ 'fill': css.color.incorrectAnswerHighlightRegion,
288
+ 'stroke': css.color.incorrectAnswer
289
+ });
290
+ imageHighlightPage.highlightPreviewTab()
291
+ .eq(index)
292
+ .within(() => {
293
+ utilities.verifyCSS(imageHighlightPage.crossMarkIcon(), {
294
+ 'fill': css.color.incorrectAnswer
295
+ });
296
+ });
297
+ },
298
+
299
+ verifyHighlightRegionNumerationPreviewTab: () => {
300
+ imageHighlightPage.highlightNumerationPreviewTab()
301
+ .each(($el, index) => {
302
+ cy.wrap($el)
303
+ .should('have.text', `${index + 1}`);
304
+ });
305
+ },
306
+
307
+ /**
308
+ * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
309
+ * @description this function verifies the numeration of Correct Answer Container
310
+ */
311
+ verifyCorrectAnswerContainerNumeration: (numerationArray) => {
312
+ numerationArray.forEach((optionNumeration, index) => {
313
+ imageHighlightPage.correctAnswerNumeration()
314
+ .eq(index)
315
+ .should('have.text', optionNumeration);
316
+ });
317
+ },
318
+
319
+ /**
320
+ * @param {string[]} optionsTextArray array of options in the correct answer container
321
+ * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
322
+ * @description this function verifies the contents of Correct Answer Container
323
+ */
324
+ verifyCorrectAnswerContainerContents: (optionsTextArray, numerationArray) => {
325
+ optionsTextArray.forEach((optionsText, index) => {
326
+ imageHighlightPage.correctAnswerContainerAnswerWrapper()
327
+ .eq(index)
328
+ .should('have.text', optionsText);
329
+ });
330
+ steps.verifyCorrectAnswerContainerNumeration(numerationArray);
331
+ },
332
+
333
+ verifyCorrectAnswerSectionNotExists: () => {
334
+ utilities.verifyElementVisibilityState(imageHighlightPage.correctAnswerContainerAnswerWrapper(), 'notExist');
335
+ },
336
+
337
+ /**
338
+ * @param {("correct" | "incorrect")} answerStatus - The status of the answer.
339
+ * @description Verifies the visibility and content of the correct/incorrect answer label block.
340
+ * If the answer is correct, it also verifies the visibility of the correct icon;
341
+ * otherwise, it verifies the visibility of the incorrect icon.
342
+ */
343
+ verifyCorrectIncorrectAnswerLabel: (answerStatus) => {
344
+ utilities.verifyInnerText(imageHighlightPage.correctIncorrectAnswerTextWrapper(), `Your answer is\n${answerStatus}`)
345
+ imageHighlightPage.correctIncorrectAnswerTextWrapper()
346
+ .within(() => {
347
+ if (answerStatus === 'correct') {
348
+ utilities.verifyElementVisibilityState(imageHighlightPage.correctIcon(), 'visible');
349
+ } else {
350
+ utilities.verifyElementVisibilityState(imageHighlightPage.incorrectIcon(), 'visible');
351
+ }
352
+ });
353
+ },
354
+ }
355
+
356
+ const tests = {
357
+ ...autoScoredScoringPreviewTab.tests,
358
+ }
359
+
360
+ export const imageHighlightPage = {
361
+ ...selectors,
362
+ steps,
363
+ tests
364
+ }