itemengine-cypress-automation 1.0.290 → 1.0.292

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -0
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editQuestion.smoke.js +74 -0
  3. package/cypress/e2e/ILC/DrawingResponse/editQuestion.smoke.js +46 -0
  4. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +0 -1
  5. package/cypress/e2e/ILC/EssayResponse/editQuestion.smoke.js +46 -0
  6. package/cypress/e2e/ILC/EssayResponseBasic/editQuestion.smoke.js +46 -0
  7. package/cypress/e2e/ILC/EssayResponseMath/editQuestion.smoke.js +46 -0
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editQuestion.smoke.js +76 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  10. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editQuestion.smoke.js +68 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editQuestion.smoke.js +78 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +4 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editQuestion.smoke.js +72 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editQuestion.smoke.js +65 -0
  15. package/cypress/e2e/ILC/FillInTheGapsTextNew/editQuestion.smoke.js +60 -0
  16. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +1 -0
  17. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +1 -1
  18. package/cypress/e2e/ILC/GridFill/editQuestion.smoke.js +66 -0
  19. package/cypress/e2e/ILC/GridFill/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -5
  20. package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +0 -1
  21. package/cypress/e2e/ILC/ListOrderingNew/editQuestion.smoke.js +72 -0
  22. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +3 -0
  23. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +2 -0
  24. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +1 -0
  25. package/cypress/e2e/ILC/Matching/editQuestion.smoke.js +72 -0
  26. package/cypress/e2e/ILC/Matching/previewTabContentsForAllViews.smoke.js +4 -2
  27. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -4
  28. package/cypress/e2e/ILC/MultipleSelection/editQuestion.smoke.js +73 -0
  29. package/cypress/e2e/ILC/MultipleSelection/manuallyAndNonScoredScoring.js +123 -117
  30. package/cypress/e2e/ILC/MultipleSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -1
  31. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +0 -2
  32. package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +2 -3
  33. package/cypress/e2e/ILC/MultipleSelection/specifyCorrectAnswerSection.js +0 -2
  34. package/cypress/e2e/ILC/MultipleSelectionGridNew/editQuestion.smoke.js +82 -0
  35. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +2 -0
  36. package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/allOrNothingForAllViews.smoke.js +2 -0
  37. package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +0 -1
  38. package/cypress/e2e/ILC/SingleSelectionGridNew/editQuestion.smoke.js +74 -0
  39. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +0 -1
  40. package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodMatchValue.js → evaluationMethodMatchValue.smoke.js} +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodsWithoutSetResponse.js → evaluationMethodsWithoutSetResponse.smoke.js} +2 -13
  42. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +0 -1
  43. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +1 -2
  44. package/cypress/e2e/ILC/TextSelection/editQuestion.smoke.js +88 -0
  45. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +0 -1
  46. package/cypress/e2e/ILC/VideoResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -3
  47. package/cypress/e2e/ILC/VideoResponseNew/headerSection.js +1 -1
  48. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettingsStandardRecorderStyle.js +2 -3
  49. package/cypress/pages/components/autoScoredScoringPreviewTab.js +6 -1
  50. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -1
  51. package/cypress/pages/components/browseItemsPage.js +27 -2
  52. package/cypress/pages/components/commonComponents.js +2 -1
  53. package/cypress/pages/components/createQuestionBasePage.js +31 -2
  54. package/cypress/pages/components/draggableOptionContainer.js +6 -4
  55. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +12 -1
  56. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +1 -2
  57. package/cypress/pages/components/gridQuestionCommonComponent.js +23 -0
  58. package/cypress/pages/components/imageCanvasComponent.js +0 -1
  59. package/cypress/pages/components/optionsWrapperComponent.js +15 -0
  60. package/cypress/pages/dragAndDropIntoCategoriesPage.js +15 -1
  61. package/cypress/pages/drawingResponsePage.js +2 -1
  62. package/cypress/pages/essayResponseBasicPage.js +3 -1
  63. package/cypress/pages/essayResponsePage.js +2 -0
  64. package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -0
  65. package/cypress/pages/fillInTheGapsDropdownPage.js +4 -2
  66. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -0
  67. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -1
  68. package/cypress/pages/fillInTheGapsOverImageTextPage.js +2 -0
  69. package/cypress/pages/fillInTheGapsTextPage.js +2 -0
  70. package/cypress/pages/gridFillPage.js +2 -1
  71. package/cypress/pages/listOrderingPage.js +13 -0
  72. package/cypress/pages/matchingPage.js +13 -2
  73. package/cypress/pages/multipleSelectionGridPage.js +33 -0
  74. package/cypress/pages/multipleSelectionPage.js +27 -0
  75. package/cypress/pages/singleSelectionGridPage.js +25 -0
  76. package/cypress/pages/singleSelectionPage.js +30 -4
  77. package/cypress/pages/studentViewPage.js +2 -2
  78. package/cypress/pages/textSelectionPage.js +13 -0
  79. package/cypress/pages/videoResponsePage.js +14 -1
  80. package/package.json +1 -1
  81. /package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodEquivalentStructures.js → evaluationMethodEquivalentStructures.smoke.js} +0 -0
  82. /package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodMatchExact.js → evaluationMethodMatchExact.smoke.js} +0 -0
  83. /package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodSymbolsAreEquivalent.js → evaluationMethodSymbolsAreEquivalent.smoke.js} +0 -0
  84. /package/cypress/e2e/ILC/TextEntryMath/{evaluationMethodValueIsEquivalent.js → evaluationMethodValueIsEquivalent.smoke.js} +0 -0
@@ -0,0 +1,88 @@
1
+ import { textSelectionPage } from "../../../pages/textSelectionPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
6
+ const paragraphTextArray1 = ['All dog are not domestic animal', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'all the animals are not same.'];
7
+
8
+
9
+ describe('Edit item - Text selection', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Edit Text selection Question', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
18
+ cy.barsPreLoaderWait();
19
+ textSelectionPage.steps.addQuestionInstructions();;
20
+ textSelectionPage.steps.allotPoints(20);
21
+ textSelectionPage.steps.clearQuestionInputField();
22
+ paragraphTextArray.forEach((paragraphText) => {
23
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
24
+ });
25
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
26
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
27
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
28
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
29
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
30
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
31
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
32
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
33
+ });
34
+
35
+ it('User should be able to edit question instruction and save the question', () => {
36
+ textSelectionPage.steps.editItem();
37
+ textSelectionPage.steps.clearQuestionInstructionsInputField();
38
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Text selection question instruction Updated');
39
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
40
+ textSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Text selection question instruction Updated');
41
+ });
42
+
43
+ it('User should be able to edit specify possible options and save the question', () => {
44
+ textSelectionPage.steps.editItem();
45
+ textSelectionPage.steps.clearQuestionInputField();
46
+ paragraphTextArray1.forEach((paragraphText) => {
47
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
48
+ });
49
+ textSelectionPage.steps.clickOnConfirmButton();
50
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
51
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
52
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray1[1]);
53
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray1[2]);
54
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray1[2]);
55
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
56
+ textSelectionPage.steps.verifyOptionFieldContentsInOptionsSectionQuestionPreviewTab(paragraphTextArray1);
57
+ });
58
+
59
+ it('User should be able to edit correct answer and save the question', () => {
60
+ textSelectionPage.steps.editItem();
61
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray1[3]);
62
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray1[3]);
63
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
64
+ });
65
+
66
+ it('User should be able to edit points and save the question', () => {
67
+ textSelectionPage.steps.editItem();
68
+ textSelectionPage.steps.allotPoints(30);
69
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
70
+ textSelectionPage.steps.verifyPointInQuestionPreview(30);
71
+ });
72
+
73
+ it('User should be able to change scoring type to manually and save the question', () => {
74
+ textSelectionPage.steps.editItem();
75
+ textSelectionPage.steps.expandScoringTypeDropdown();
76
+ textSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
77
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
78
+ });
79
+
80
+ it('User should be able to change scoring type to non scored and save the question', () => {
81
+ textSelectionPage.steps.editItem();
82
+ textSelectionPage.steps.expandScoringTypeDropdown();
83
+ textSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
84
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
85
+ textSelectionPage.steps.verifyPointInQuestionPreview(0);
86
+ });
87
+ });
88
+ });
@@ -157,7 +157,6 @@ describe('Create item page - Upload response : Preview contents', () => {
157
157
  cy.checkAccessibility(uploadResponsePage.questionWrapperPreviewTab());
158
158
  });
159
159
 
160
- //Failed due to https://redmine.zeuslearning.com/issues/563182
161
160
  it('When user uploads file type which is not selected from the \'Supported file types\' accordion menu, then file upload error message - \'The file type is not supported. Please upload files with the following supported formats: *file format separated by commas*\' should be displayed', () => {
162
161
  uploadResponsePage.steps.uploadFile('uploads/sample.heif');
163
162
  uploadResponsePage.steps.verifyWarningMessage('The file type is not supported. Please upload files with the following supported formats: CSV, Excel, GIF, JPG, Open Office, PDF, PNG, Powerpoint, Publisher, RTF, TXT, Word, XPS, ZIP.');
@@ -86,9 +86,10 @@ describe('Create item page - Video response: Grading view, Correct answer view c
86
86
 
87
87
  it('When volume is not set as 0 and user clicks on volume control button, then the video should be muted and the volume control button should change to a muted state', () => {
88
88
  videoResponsePage.steps.clickOnVolumeButton();
89
- videoResponsePage.steps.hoverOnVolumeControlButton();
90
- videoResponsePage.steps.verifyVolumeOfPlaybackPlayer('0');
91
- utilities.hoverAwayFromElement();
89
+ // Flakiness issue, hover is not working properly
90
+ // videoResponsePage.steps.hoverOnVolumeControlButton();
91
+ // videoResponsePage.steps.verifyVolumeOfPlaybackPlayer('0');
92
+ // utilities.hoverAwayFromElement();
92
93
  utilities.verifyElementVisibilityState(videoResponsePage.volumeControlSlider(), 'notExist');
93
94
  utilities.verifyElementVisibilityState(videoResponsePage.muteVolumeIcon(), 'visible');
94
95
  });
@@ -14,7 +14,7 @@ describe('Create question page - Video response: Header section and Saving quest
14
14
  videoResponsePage.steps.navigateToCreateQuestion('video response')
15
15
  });
16
16
 
17
- videoResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('video response');
17
+ videoResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Video response');
18
18
  });
19
19
 
20
20
  describe('Tabs section', () => {
@@ -164,9 +164,8 @@ describe('Create item page - Audio response: Student view settings for Standard
164
164
  videoResponsePage.steps.startRecording();
165
165
  videoResponsePage.steps.waitForRecordingToStart();
166
166
  videoResponsePage.steps.stopRecording();
167
- //need to remove comment after https://redmine.zeuslearning.com/issues/578315 is resolved
168
- // videoResponsePage.retakeRecordingButton()
169
- // .verifyTooltip('Retake recording(1 retakes remaining)');
167
+ videoResponsePage.retakeRecordingButton()
168
+ .verifyTooltip('Retake recording(1 retakes remaining)');
170
169
  });
171
170
 
172
171
  it('For "Standard" mode, When the user removes the retake limit, then the user should be able to retake the recording for n number of times', () => {
@@ -14,7 +14,7 @@ const selectors = {
14
14
  correctIncorrectAnswerLabel: () => cy.get('.answer-label-text'),
15
15
  checkAnswerButton: () => cy.get('.check-answer-and-status-wrapper button'),
16
16
  correctIncorrectAnswerBorder: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answer-border"]'),
17
- scoringTypeLabelPreviewTab: () => cy.get('[class*="ScoringPreviewBandstyles__ScoreWrapper"]')
17
+ scoringTypeLabelPreviewTab: () => cy.get('[class*="ScoringPreviewBandstyles__ScoreWrapper"]'),
18
18
  }
19
19
 
20
20
  const steps = {
@@ -144,6 +144,11 @@ const steps = {
144
144
  'color': css.color.whiteText,
145
145
  'background-color': css.color.correctAnswer
146
146
  });
147
+ },
148
+
149
+ checkManuallyScoredScoringLabel: () => {
150
+ autoScoredScoringPreviewTab.scoringTypeLabelPreviewTab()
151
+ .should('have.text', 'Manually scored');
147
152
  }
148
153
  }
149
154
 
@@ -16,7 +16,7 @@ const selectors = {
16
16
  deleteAlternateAccordionButton: () => cy.get('.answer-accordion-label button'),
17
17
  specifyCorrectAnswerErrorIcon: () => cy.get('[id="Icon_material-error"]'),
18
18
  pointsLabelAnswerAccordion: () => cy.get('[class*="AnswerAccordionstyles__PointsLabel"]'),
19
- pointsAnswerAccordion: () => cy.get('[class*="PointsLabel"]').next('[class*="AnswerAccordionstyles__Points"]')
19
+ pointsAnswerAccordion: () => cy.get('[class*="PointsLabel"]').next('[class*="AnswerAccordionstyles__Points"]'),
20
20
  }
21
21
 
22
22
  const steps = {
@@ -131,6 +131,16 @@ const steps = {
131
131
 
132
132
  verifySpecifyCorrectAnswerErrorMessage: () => {
133
133
  utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Please set a correct answer.');
134
+ },
135
+
136
+ checkAlternativeButtonDisabled: () => {
137
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
138
+ .should('be.disabled');
139
+ },
140
+
141
+ checkAlternativeButtonEnabled: () => {
142
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
143
+ .should('be.enabled');
134
144
  }
135
145
  }
136
146
 
@@ -1,10 +1,15 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { commonComponents } from "./commonComponents";
3
+
1
4
  const selectors = {
5
+ ...commonComponents,
2
6
  browseItemPageWrapper: () => cy.get('.browse-item-page'),
3
7
  itemLabel: () => cy.get('#reference-header'),
4
8
  lastUpdatedLabel: () => cy.get('#updated-header'),
5
9
  searchInputField: () => cy.get('.ngie-search input'),
6
10
  sortArrow: () => cy.get('.table-header-sort-arrow'),
7
- browseItemsLabel: () => cy.get('.browse-title-wrapper')
11
+ browseItemsLabel: () => cy.get('.browse-title-wrapper'),
12
+ browseItemPageReferenceId: () => cy.get('[class*="ItemTitleCellstyles__ReferenceId"]'),
8
13
  }
9
14
 
10
15
  const steps = {
@@ -44,7 +49,27 @@ const steps = {
44
49
  search: (value) => {
45
50
  browseItemsPage.searchInputField()
46
51
  .type(`${value}{enter}`);
47
- }
52
+ },
53
+
54
+ /**
55
+ * This function verifies the warning icon in browse item save as you go
56
+ * @param {string} referenceID reference id of the saved question
57
+ */
58
+ verifyWarningIconInBrowseItemPage: (referenceID) => {
59
+ browseItemsPage.browseItemPageReferenceId()
60
+ .should('exist')
61
+ .each(($el) => {
62
+ const text = $el.text().trim();
63
+ if (text === referenceID) {
64
+ cy.get($el)
65
+ .parents("[class*=ItemTitleCellstyles__ItemCellWrapper]")
66
+ .within(() => {
67
+ utilities.verifyElementVisibilityState(browseItemsPage.warningIcon(), 'visible');
68
+ });
69
+ return false;
70
+ }
71
+ });
72
+ },
48
73
  }
49
74
 
50
75
  export const browseItemsPage = {
@@ -92,7 +92,8 @@ const steps = {
92
92
  utilities.verifyTextContent(commonComponents.tooltipText(), warningMessage);
93
93
  utilities.hoverAwayFromElement(commonComponents.warningIcon());
94
94
  utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
95
- }
95
+ },
96
+
96
97
  }
97
98
 
98
99
  const tests = {
@@ -18,7 +18,10 @@ const selectors = {
18
18
  //Note: Adding visible as this is hidden in tools and does not exist in questions
19
19
  editTabWrapper: () => cy.get('[class*="EditTabWrapper"]:visible'),
20
20
  canvasLabel: () => cy.get('[class*="Canvasstyle__CanvasTxt"]'),
21
- backgroundImageLabel: () => cy.get('[class*="Background"][class*="LabelWrapper"]')
21
+ backgroundImageLabel: () => cy.get('[class*="Background"][class*="LabelWrapper"]'),
22
+ editButton: () => cy.get('[aria-label="Edit"]'),
23
+ questionPreviewPoint: () => cy.get('[class*="PreviewTabstyles__PointsValue"]'),
24
+ confirmButton: () => cy.get('[data-testid="accept-button"]'),
22
25
  }
23
26
 
24
27
  const steps = {
@@ -56,6 +59,12 @@ const steps = {
56
59
  .should('be.visible');
57
60
  },
58
61
 
62
+ saveAQuestionWithIncompleteAuthoring: () => {
63
+ createQuestionBasePage.saveQuestionButton()
64
+ .click();
65
+ dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
66
+ },
67
+
59
68
  //V3 - This function should be updated in all files
60
69
  resetQuestionPreview: () => {
61
70
  cy.log('Switching to edit tab and back to preview tab to reset the question preview')
@@ -139,7 +148,27 @@ const steps = {
139
148
  });
140
149
  }
141
150
  })
142
- }
151
+ },
152
+
153
+
154
+ clickOnEditQuestionButton: () => {
155
+ createQuestionBasePage.editButton()
156
+ .click();
157
+ },
158
+
159
+ /**
160
+ * @param {number} point points set by the user
161
+ * @description this function verifies score displayed in the question preview tab
162
+ */
163
+ verifyPointInQuestionPreview: (point) => {
164
+ createQuestionBasePage.questionPreviewPoint()
165
+ .should('have.text', point);
166
+ },
167
+
168
+ clickOnConfirmButton: () => {
169
+ createQuestionBasePage.confirmButton()
170
+ .click();
171
+ },
143
172
  }
144
173
 
145
174
  const tests = {
@@ -9,6 +9,7 @@ const threeOptions = ['option 1', 'option 2', 'option 3'];
9
9
 
10
10
  //TODO update option container selectors when https://redmine.zeuslearning.com/issues/563159 is resolved
11
11
  const selectors = {
12
+ draggableOptionQuestionPreviewTab: () => cy.get('[class*="DraggableItemstyles__DraggableItemWrapper"] [role="menu"],[class*="DraggableItemstyles__DraggableItemWrapper"][role="button"],[class*="DraggableItems"][class*="__ItemWrapper"]'),
12
13
  draggableOption: () => cy.get('[class*="DraggableItemstyles__DraggableItemWrapper"] [role="menu"],[class*="DraggableItemstyles__DraggableItemWrapper"][role="button"],[class*="DraggableItems"][class*="__ItemWrapper"]'),
13
14
  optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.option-drag-and-drop'),
14
15
  optionsContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .option-drag-and-drop,[class*="question-preview-wrapper"] .standard-options-dropzone'),
@@ -20,7 +21,8 @@ const selectors = {
20
21
  draggableOptionText: () => cy.get('.icon-container-wrapper [class*="DraggableItems"][class*="__QuestionTextWrapper"]:visible'),
21
22
  optionContainerItemListPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .item-list'),
22
23
  optionContainerItemListSpecifyCorrectAnswerSection: () => cy.get('.item-list'),
23
- draggableOptionDragIcon: () => cy.get('.drag-icon-button')
24
+ draggableOptionDragIcon: () => cy.get('.drag-icon-button'),
25
+ draggableOptionSpecifyCorrectAnswerSection: () => cy.get('.options-flex-wrapper [class*="DraggableItemstyle__ItemWrapper"],[class*="DraggableItemstyles__DraggableItemWrapper"]')
24
26
  }
25
27
 
26
28
  const steps = {
@@ -135,10 +137,10 @@ const steps = {
135
137
  .eq(groupIndex)
136
138
  .should('be.visible')
137
139
  .within(() => {
138
- utilities.verifyElementCount(draggableOptionContainer.draggableOption(), draggableOptionsArray.length);
139
- utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOption(), 'visible');
140
+ utilities.verifyElementCount(draggableOptionContainer.draggableOptionSpecifyCorrectAnswerSection(), draggableOptionsArray.length);
141
+ utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOptionSpecifyCorrectAnswerSection(), 'visible');
140
142
  draggableOptionsArray.forEach((draggableOption, optionIndex) => {
141
- utilities.verifyInnerText(utilities.getNthElement(draggableOptionContainer.draggableOption(), optionIndex), draggableOption);
143
+ utilities.verifyInnerText(utilities.getNthElement(draggableOptionContainer.draggableOptionSpecifyCorrectAnswerSection(), optionIndex), draggableOption);
142
144
  });
143
145
  });
144
146
  },
@@ -19,7 +19,8 @@ const selectors = {
19
19
  correctAnswerResponseWrapperWithoutEnumeration: () => cy.get('[class*="CorrectAnswers"] [class*="AnswerStatusIconAndResponseWrapper"]'),
20
20
 
21
21
  //additional settings
22
- enterAriaLabelInputField: () => cy.get('input[aria-label*="Enter ARIA label"]')
22
+ enterAriaLabelInputField: () => cy.get('input[aria-label*="Enter ARIA label"]'),
23
+ optionsInputFieldInQuestionPreviewTab: () => cy.get('.draggable-items-flex-wrapper .question-text-wrapper,.options-flex-wrapper .question-text-wrapper')
23
24
  }
24
25
 
25
26
  const steps = {
@@ -101,6 +102,16 @@ const steps = {
101
102
  draggableOptionsSectionComponent.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[2], flowers[2]);
102
103
  draggableOptionsSectionComponent.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[3], flowers[3]);
103
104
  },
105
+
106
+ /**
107
+ * Verifies the contents of option fields within the options section.
108
+ * @param {Array<string>} optionsTextArray - An array of strings representing the expected text content for each option field.
109
+ */
110
+ verifyOptionFieldTextInOptionsSection: (optionsTextArray) => {
111
+ optionsTextArray.forEach((option, optionIndex) => {
112
+ utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsDragAndDropCommonComponents.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
113
+ });
114
+ }
104
115
  }
105
116
 
106
117
  export const fillInTheGapsDragAndDropCommonComponents = {
@@ -1237,8 +1237,7 @@ const tests = {
1237
1237
 
1238
1238
  it('When user focuses in and out of the response accordion \'Answer\' input field, \'Error: Answer is required.\' error message should be displayed', () => {
1239
1239
  fillInTheGapsTextCommonComponent.steps.focusInAndFocusOutOfResponseAnswerInputFieldSpecifyCorrectAnswer(0, 0);
1240
- commonComponents.errorMessage()
1241
- .should('have.text', 'Error: Answer is required.');
1240
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
1242
1241
  });
1243
1242
 
1244
1243
  it('When gives an input to \'Answer\' input field, then error message should disappear', () => {
@@ -155,6 +155,7 @@ const selectors = {
155
155
  colorBlock: () => cy.get('.color-grid-wrapper .color-picker-block'),
156
156
  editColorButton: () => cy.get('button[aria-label="edit color"]'),
157
157
  colorBlockSelectedIcon: () => cy.get('[class*="BtnSelectionWrapper"] svg'),
158
+ optionsInputFieldInQuestionPreviewTab: () => cy.get('.cell-content-text')
158
159
  }
159
160
 
160
161
  const steps = {
@@ -2044,6 +2045,28 @@ const steps = {
2044
2045
  selectColorBlock: (blockIndex) => {
2045
2046
  utilities.getNthElement(gridQuestionCommonComponent.colorBlock(), blockIndex)
2046
2047
  .click();
2048
+ },
2049
+
2050
+ verifyPointsWarningIconNotExists: () => {
2051
+ gridQuestionCommonComponent.specifyRowsAndColumnsTableHelpText()
2052
+ .within(() => {
2053
+ utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'notExist');
2054
+ });
2055
+
2056
+ scoringSectionBaseEditTab.pointsWrapper()
2057
+ .within(() => {
2058
+ utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'notExist');
2059
+ });
2060
+ },
2061
+
2062
+ /**
2063
+ * Verifies the contents of option fields within the options section.
2064
+ * @param {Array<string>} optionsTextArray - An array of strings representing the expected text content for each option field.
2065
+ */
2066
+ verifyOptionFieldContentsInOptionsSection: (optionsTextArray) => {
2067
+ optionsTextArray.forEach((option, optionIndex) => {
2068
+ utilities.verifyTextContent(utilities.getNthElement(gridQuestionCommonComponent.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
2069
+ });
2047
2070
  }
2048
2071
  }
2049
2072
 
@@ -835,7 +835,6 @@ const tests = {
835
835
  imageCanvasComponent.steps.verifyUndoButtonEnabled();
836
836
  imageCanvasComponent.steps.verifyRedoButtonDisabled();
837
837
  });
838
-
839
838
  it('When the user clicks on the \'Undo\' button, then previous action should be reversed and redo button should be in enabled state', () => {
840
839
  imageCanvasComponent.steps.undoAction();
841
840
  utilities.verifyElementCount(imageCanvasComponent.responseArea(), 3);
@@ -237,6 +237,9 @@ const steps = {
237
237
  enterTextInOptionInputField: (index, textContent) => {
238
238
  optionsWrapperComponent.optionsSectionWrapper()
239
239
  .within(() => {
240
+ optionsWrapperComponent.optionsInputField()
241
+ .eq(index)
242
+ .clear()
240
243
  optionsWrapperComponent.optionsInputField()
241
244
  .eq(index)
242
245
  .type(textContent)
@@ -250,6 +253,18 @@ const steps = {
250
253
  });
251
254
  },
252
255
 
256
+ /**
257
+ * @param {number} index of option input field
258
+ */
259
+ clearTextInOptionInputField: (index) => {
260
+ optionsWrapperComponent.optionsSectionWrapper()
261
+ .within(() => {
262
+ optionsWrapperComponent.optionsInputField()
263
+ .eq(index)
264
+ .clear();
265
+ });
266
+ },
267
+
253
268
  /**
254
269
  * @param {number} optionFieldsCount - The number of option fields to be added.
255
270
  * @description Adds multiple option fields to the component.
@@ -1,6 +1,7 @@
1
1
  import { optionsWrapperComponent, createQuestionBasePage, autoScoredSpecifyCorrectAnswerSection, scoringSectionBaseEditTab, autoScoredScoringSectionMultiResponseType, questionInstructionsComponent, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, commonComponents, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, draggableOptionContainer, draggableOptionsSectionComponent, maximumCapacityPerDropzoneComponent, enableOuterBorderComponent, specifyRowsAndColumnsComponent, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent } from "./components";
2
2
  import utilities from "../support/helpers/utilities";
3
3
  import constants from "../fixtures/constants";
4
+ import { createItemPage } from "./createItemPage";
4
5
  const css = Cypress.env('css');
5
6
 
6
7
  const cellPropertyMenuOptions = ['Heading', 'subheading', 'text', 'dropzone', 'none'];
@@ -23,6 +24,7 @@ const selectors = {
23
24
  ...additionalSettingsPanel,
24
25
  ...gradingViewEnumerationComponent,
25
26
  ...ariaLabelSectionComponent,
27
+ ...scoringSectionBaseEditTab,
26
28
 
27
29
  editCellPropertyButton: () => cy.get('.action-menu button'),
28
30
  editCellPropertyList: () => cy.get('.ngie-action-cell-container [role="menu"]'),
@@ -156,7 +158,8 @@ const selectors = {
156
158
  optionsPreviewTab: () => cy.get('[class*="CellDropZonestyles__DraggableItemWrapper"]'),
157
159
  iconWrapperInPreviewTab: () => cy.get('[class*="DragAndDropMatrixstyles__TickIconWrapper"]'),
158
160
  gridBoxInPreviewTab: () => cy.get('[class*="CellDropZonestyles__DraggableWrapper"]'),
159
- optionPanelWrapper: () => cy.get('.option-drag-and-drop')
161
+ optionPanelWrapper: () => cy.get('.option-drag-and-drop'),
162
+ optionsInputFieldInQuestionPreviewTab: () => cy.get('.draggable-items-flex-wrapper .question-text-wrapper,.options-flex-wrapper .question-text-wrapper')
160
163
  }
161
164
 
162
165
  const steps = {
@@ -183,6 +186,7 @@ const steps = {
183
186
  ...styleAndLayoutCustomizationAccordionComponent.steps,
184
187
  ...gradingViewEnumerationComponent.steps,
185
188
  ...ariaLabelSectionComponent.steps,
189
+ ...createItemPage.steps,
186
190
 
187
191
  /**
188
192
  * @description Modifies the dropzone property based on the specified list option.
@@ -2252,6 +2256,16 @@ const steps = {
2252
2256
  scoringSectionBaseEditTab.pointsInputField()
2253
2257
  .blur();
2254
2258
  },
2259
+
2260
+ /**
2261
+ * Verifies the contents of option fields within the options section.
2262
+ * @param {Array<string>} optionsTextArray - An array of strings representing the expected text content for each option field.
2263
+ */
2264
+ verifyOptionFieldTextInOptionsSection: (optionsTextArray) => {
2265
+ optionsTextArray.forEach((option, optionIndex) => {
2266
+ utilities.verifyTextContent(utilities.getNthElement(dragAndDropIntoCategoriesPage.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
2267
+ });
2268
+ }
2255
2269
  }
2256
2270
 
2257
2271
  const tests = {
@@ -1,5 +1,6 @@
1
1
  import utilities from "../support/helpers/utilities"
2
2
  import { questionInstructionsComponent, createQuestionBasePage, commonComponents, additionalSettingsPanel, scoringSectionBaseEditTab, customizeSpecialCharacterComponent, customizeMathCharacterComponent } from "./components"
3
+ import { createItemPage } from "./createItemPage";
3
4
  import { dialogBoxBase } from "./dialogBoxBase";
4
5
 
5
6
  const css = Cypress.env('css');
@@ -226,10 +227,10 @@ const steps = {
226
227
  ...additionalSettingsPanel.steps,
227
228
  ...questionInstructionsComponent.steps,
228
229
  ...scoringSectionBaseEditTab.steps,
229
- ...createQuestionBasePage.steps,
230
230
  ...commonComponents.steps,
231
231
  ...customizeSpecialCharacterComponent.steps,
232
232
  ...customizeMathCharacterComponent.steps,
233
+ ...createItemPage.steps,
233
234
  /**
234
235
  * @param {string[]} arrayOfToolbarOptions array of toolbar options to be selected
235
236
  * @description this function selects toolbar options from edit tab
@@ -1,5 +1,6 @@
1
1
  import { createQuestionBasePage, scoringSectionBaseEditTab, additionalSettingsPanel, essayResponseCommonComponents } from "./components";
2
2
  import { questionInstructionsComponent } from "./components/questionInstructionsComponent";
3
+ import { createItemPage } from "./createItemPage";
3
4
 
4
5
  const selectors = {
5
6
  ...createQuestionBasePage,
@@ -14,7 +15,8 @@ const steps = {
14
15
  ...questionInstructionsComponent.steps,
15
16
  ...additionalSettingsPanel.steps,
16
17
  ...scoringSectionBaseEditTab.steps,
17
- ...essayResponseCommonComponents.steps
18
+ ...essayResponseCommonComponents.steps,
19
+ ...createItemPage.steps,
18
20
  };
19
21
 
20
22
  const tests = {
@@ -4,6 +4,7 @@ import { equationEditorFlyout } from "./components/equationEditorFlyout";
4
4
  import { dialogBoxBase } from "../pages/dialogBoxBase";
5
5
  import { essayResponseCommonComponents } from "./components/essayResponseCommonComponents";
6
6
  import utilities from "../support/helpers/utilities";
7
+ import { createItemPage } from "./createItemPage";
7
8
  const css = Cypress.env('css');
8
9
 
9
10
  const allCategories = Object.values(equationEditorCategoriesAndSymbols);
@@ -140,6 +141,7 @@ const steps = {
140
141
  ...customizeSpecialCharacterComponent.steps,
141
142
  ...dialogBoxBase.steps,
142
143
  ...equationEditorSectionCommonComponent.steps,
144
+ ...createItemPage.steps,
143
145
 
144
146
  clickOnSpecialCharactersPopupCloseButton: () => {
145
147
  essayResponsePage.specialCharactersPopupCloseButton()
@@ -2,6 +2,7 @@ import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
3
  const css = Cypress.env('css');
4
4
  import { createQuestionBasePage, optionsWrapperComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, fillInTheGapsDragAndDropCommonComponents, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, draggableOptionContainer, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, draggableOptionsSectionComponent, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, draggableOptionsStyleAndLayoutComponent } from "./components"
5
+ import { createItemPage } from "./createItemPage";
5
6
 
6
7
  //TODO update option container selectors when https://redmine.zeuslearning.com/issues/563159 is resolved
7
8
  const selectors = {
@@ -90,6 +91,7 @@ const steps = {
90
91
  ...styleAndLayoutCustomizationAccordionComponent.steps,
91
92
  ...figCommonStyleAndLayoutComponent.steps,
92
93
  ...draggableOptionsStyleAndLayoutComponent.steps,
94
+ ...createItemPage.steps,
93
95
  /**
94
96
  * Sets options in dropzone in the Preview Tab based on the provided optionsObject.
95
97
  * @param {Object} optionsObject - An object where keys are option texts and values are dropzone indices.
@@ -1,5 +1,6 @@
1
1
  import utilities from "../support/helpers/utilities";
2
2
  import { autoScoredScoringPreviewTab, createQuestionBasePage, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, questionInputFieldComponent, commonComponents, additionalSettingsPanel, optionsWrapperComponent, randomizeOptionsComponent, studentViewSettingsLabelComponent, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent } from "./components";
3
+ import { createItemPage } from "./createItemPage";
3
4
  const css = Cypress.env('css');
4
5
 
5
6
  const selectors = {
@@ -64,6 +65,7 @@ const steps = {
64
65
  ...additionalSettingsAccessibilitySectionComponent.steps,
65
66
  ...styleAndLayoutCustomizationAccordionComponent.steps,
66
67
  ...figCommonStyleAndLayoutComponent.steps,
68
+ ...createItemPage.steps,
67
69
  /**
68
70
  * Verify that the correct option icon is is displayed for a specific dropdown.
69
71
  * @param {number} dropdownIndex - The index of the dropdown.
@@ -289,7 +291,7 @@ const steps = {
289
291
  fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
290
292
  .contains(alternateAnswer)
291
293
  .click();
292
- fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
294
+ fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
293
295
  .contains(alternateAnswer)
294
296
  .parent()
295
297
  .should('have.class', 'selected');
@@ -305,7 +307,7 @@ const steps = {
305
307
  fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
306
308
  .contains(alternateAnswer)
307
309
  .click();
308
- fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
310
+ fillInTheGapsDropdownPage.alternateAnswerPopupOptions()
309
311
  .contains(alternateAnswer)
310
312
  .parent()
311
313
  .should('not.have.class', 'selected');
@@ -1,6 +1,7 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
3
  import { createQuestionBasePage, questionInstructionsComponent, uploadImageSectionComponent, scoringSectionBaseEditTab, optionsWrapperComponent, equationEditorFlyout, ckEditorToolbar, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, maximumCapacityPerDropzoneComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, imageCanvasComponent, backgroundImageUploadComponent, correctIncorrectAnswerLabelComponent, draggableOptionsSectionComponent, draggableOptionContainer, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, opacityComponent, imageActionsComponent, colorPopupComponent, fillInTheGapsDragAndDropCommonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent } from "./components";
4
+ import { createItemPage } from "./createItemPage";
4
5
  import { dialogBoxBase } from "./dialogBoxBase";
5
6
  const css = Cypress.env('css');
6
7
 
@@ -132,6 +133,7 @@ const steps = {
132
133
  ...connectorStyleStyleAndLayoutCustomizationComponent.steps,
133
134
  ...gradingViewEnumerationComponent.steps,
134
135
  ...ariaLabelSectionComponent.steps,
136
+ ...createItemPage.steps,
135
137
 
136
138
  verifyDropzoneNumerationNotExists: () => {
137
139
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.dropzoneNumeration(), 'notExist');
@@ -1,5 +1,6 @@
1
1
  import utilities from "../support/helpers/utilities";
2
2
  import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, placeholderTextSectionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, commonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent } from "./components";
3
+ import { createItemPage } from "./createItemPage";
3
4
  const css = Cypress.env('css');
4
5
 
5
6
  const selectors = {
@@ -61,6 +62,7 @@ const steps = {
61
62
  ...styleAndLayoutCustomizationAccordionComponent.steps,
62
63
  ...figCommonStyleAndLayoutComponent.steps,
63
64
  ...connectorStyleStyleAndLayoutCustomizationComponent.steps,
65
+ ...createItemPage.steps,
64
66
  /**
65
67
  * Verify that the correct option icon is is displayed for a specific dropdown.
66
68
  * @param {number} dropdownIndex - The index of the dropdown.
@@ -204,7 +206,7 @@ const steps = {
204
206
  });
205
207
  },
206
208
 
207
- verifyVisibilityOfCorrectAnswerLabel: ()=>{
209
+ verifyVisibilityOfCorrectAnswerLabel: () => {
208
210
  utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
209
211
  },
210
212