itemengine-cypress-automation 1.0.128 → 1.0.130

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  2. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  3. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  4. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  6. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  50. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  51. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  52. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  53. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  59. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  60. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  61. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  62. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  71. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  72. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  73. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  74. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  75. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  76. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  77. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  78. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  79. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  80. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  81. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  82. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  83. package/cypress/e2e/migration/migration.js +4 -41
  84. package/cypress/e2e/migration/migration10.js +6 -43
  85. package/cypress/e2e/migration/migration2.js +6 -43
  86. package/cypress/e2e/migration/migration3.js +6 -43
  87. package/cypress/e2e/migration/migration4.js +6 -43
  88. package/cypress/e2e/migration/migration5.js +6 -43
  89. package/cypress/e2e/migration/migration6.js +6 -43
  90. package/cypress/e2e/migration/migration7.js +6 -43
  91. package/cypress/e2e/migration/migration8.js +6 -43
  92. package/cypress/e2e/migration/migration9.js +6 -43
  93. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  94. package/cypress/fixtures/theme/ilc.json +6 -1
  95. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  96. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  97. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  98. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  99. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  100. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  101. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  102. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  103. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  104. package/cypress/pages/contentBlocksPage.js +515 -0
  105. package/cypress/pages/drawingResponsePage.js +2 -2
  106. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  107. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  108. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  109. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  110. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  111. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  112. package/cypress/pages/graphingPage.js +484 -0
  113. package/cypress/pages/index.js +4 -1
  114. package/cypress/pages/simpleCalculatorPage.js +310 -0
  115. package/cypress/pages/uploadResponsePage.js +260 -92
  116. package/cypress/support/commands.js +33 -1
  117. package/package.json +1 -1
  118. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  119. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  120. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  121. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  122. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -2,6 +2,7 @@ import utilities from "../../support/helpers/utilities";
2
2
  import { specialCharacters } from "../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
3
3
  import { dialogBoxBase } from "../dialogBoxBase";
4
4
  const specialCharactersCategories = Object.values(specialCharacters.map((icon) => icon.categoryName));
5
+ const customSpecialCharacters = ['A', '1', '#'];
5
6
 
6
7
  const selectors = {
7
8
  customizeSpecialCharactersCheckbox: () => cy.get('[data-ngie-testid="customize-special-characters-checkbox"] .ngie-checkbox input'),
@@ -100,7 +101,7 @@ const steps = {
100
101
  .within(() => {
101
102
  customizeSpecialCharacterComponent.specialCharactersPreviewPopupCategoryLabel()
102
103
  .click();
103
- category.symbols.forEach((symbolARIALabel, index) => {
104
+ category.forEach((symbolARIALabel, index) => {
104
105
  customizeSpecialCharacterComponent.charactersPopupCharacterSymbol() //Check this
105
106
  .eq(index)
106
107
  .find('svg')
@@ -185,8 +186,7 @@ const steps = {
185
186
 
186
187
  const tests = {
187
188
  verifyCustomSpecialCharactersEditTabContent: () => {
188
- it('When the user checks the \'Customize special characters\' checkbox, \'Group by language\' and \'Show only custom special characters\' labels and radio buttons should be displayed. By default \'Group by language\' radio button should be checked', () => {
189
- customizeSpecialCharacterComponent.steps.checkCustomizeSpecialCharactersCheckbox();
189
+ it('When the user enables the \'Special characters\' functionality, \'Group by language\' and \'Show only custom special characters\' labels and radio buttons should be displayed. By default \'Group by language\' radio button should be checked', () => {
190
190
  utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.groupByLanguageRadioButton(), 'exist');
191
191
  utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.groupByLanguageLabel(), 'visible');
192
192
  utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.showOnlyCustomSpecialCharactersRadioButton(), 'exist');
@@ -201,7 +201,7 @@ const tests = {
201
201
  utilities.verifyInnerText(customizeSpecialCharacterComponent.customizeSpecialCharactersPreviewButton(), 'Preview');
202
202
  });
203
203
 
204
- it(`A total of ${specialCharactersCategories.length} options should be displayed - ${specialCharactersCategories.join('')}. By default all language options should be in selected state`, () => {
204
+ it(`A total of ${specialCharactersCategories.length} options should be displayed - ${specialCharactersCategories.join(', ')}. By default all language options should be in selected state`, () => {
205
205
  customizeSpecialCharacterComponent.steps.verifyCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
206
206
  customizeSpecialCharacterComponent.steps.verifySelectedCustomizeSpecialCharactersCategoryTiles(specialCharactersCategories);
207
207
  });
@@ -209,7 +209,7 @@ const tests = {
209
209
  it('When the user clicks on the \'Preview\' hyperlink, a special characters popup should be displayed with all the special characters segregated according to all the language options. The user should be able to close the popup by clicking on the \'Close[X]\' button', () => {
210
210
  customizeSpecialCharacterComponent.steps.clickOnCustomizeSpecialCharactersPreviewButton();
211
211
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
212
- //customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
212
+ customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
213
213
  //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
214
214
  cy.log('Post-step: Closing preview popup')
215
215
  dialogBoxBase.steps.closeWarningPopup();
@@ -220,11 +220,29 @@ const tests = {
220
220
  customizeSpecialCharacterComponent.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[0].categoryName);
221
221
  customizeSpecialCharacterComponent.steps.verifySpecialCharacterCategoryTileIsNotSelected(specialCharacters[0].categoryName);
222
222
  customizeSpecialCharacterComponent.steps.clickOnCustomizeSpecialCharactersPreviewButton();
223
- //customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
223
+ customizeSpecialCharacterComponent.steps.verifySpecialCharactersPreviewPopupInEditTab(specialCharacters);
224
224
  //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
225
225
  cy.log('Post-step: Closing preview popup')
226
226
  dialogBoxBase.steps.closeWarningPopup();
227
227
  });
228
+ },
229
+
230
+ verifyShowOnlyCustomSpecialCharactersEditTabContent: () => {
231
+ it('When the user checks the \'Show only custom special characters\' radio button, \'Custom special characters\' label and input field should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
232
+ customizeSpecialCharacterComponent.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
233
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.customSpecialCharactersInputField(), 'visible');
234
+ utilities.verifyInnerText(customizeSpecialCharacterComponent.customSpecialCharactersLabel(), 'Custom special characters');
235
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.customSpecialCharactersLabel(), 'visible');
236
+ utilities.verifyElementVisibilityState(customizeSpecialCharacterComponent.customizeSpecialCharactersPreviewButton(), 'visible');
237
+ });
238
+
239
+ it('When the user specifies custom special characters, then on clicking on the \'Preview\' hyperlink, only the specified custom special characters should be displayed in the popup', () => {
240
+ customizeSpecialCharacterComponent.steps.addInputToCustomSpecialCharactersInputField(`${customSpecialCharacters.join('')}`);
241
+ customizeSpecialCharacterComponent.steps.clickOnCustomizeSpecialCharactersPreviewButton();
242
+ customizeSpecialCharacterComponent.steps.verifyCustomSpecialCharactersDisplayedInPreviewPopupEditTab(customSpecialCharacters);
243
+ cy.log('Post-step: Closing preview popup')
244
+ dialogBoxBase.steps.closeWarningPopup();
245
+ });
228
246
  }
229
247
  }
230
248
 
@@ -7,6 +7,7 @@ const css = Cypress.env('css');
7
7
  const options = ['option 1', 'option 2'];
8
8
  const threeOptions = ['option 1', 'option 2', 'option 3'];
9
9
 
10
+ //TODO update option container selectors when https://redmine.zeuslearning.com/issues/563159 is resolved
10
11
  const selectors = {
11
12
  draggableOption: () => cy.get('[class*="DraggableItems"][class*="style__ItemWrapper"]'),
12
13
  optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.option-drag-and-drop'),
@@ -1,6 +1,13 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
+ import { autoScoredScoringSectionMultiResponseType } from "./autoScoredScoringSectionMultiResponseType";
2
3
 
3
4
  const selectors = {
5
+ dropzoneLabelSpecifyCorrectAnswerSection: () => cy.get('[class*="ResponseLabel"].title-casing'),
6
+
7
+ //Penalty points
8
+ penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
9
+ specifyPointsForEachIncorrectDropzoneRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
10
+
4
11
  correctAnswersNumeration: () => cy.get('[class*="__AnswerCell"] .answer-numeration-number-box'),
5
12
  correctAnswersOptions: () => cy.get('[class*="__AnswerWrapper"] .question-text-wrapper'),
6
13
  correctAnswersLabel: () => cy.get('.correct-answers-label'),
@@ -27,14 +34,45 @@ const steps = {
27
34
  verifyCorrectAnswerSectionNotExists: () => {
28
35
  utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropCommonComponents.correctAnswerContainer(), 'notExist');
29
36
  },
30
- }
31
37
 
32
- const tests = {
38
+ verifyPointsPerResponseLabel: () => {
39
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response:\n-');
40
+ utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
41
+ },
42
+
43
+ verifyPartialEqualWeightsPointsPerResponseScore: (pointsPerResponse) => {
44
+ autoScoredScoringSectionMultiResponseType.partialEqualWeightsPointsPerResponseScore()
45
+ .should('have.text', pointsPerResponse);
46
+ },
47
+
48
+ /**
49
+ * @description Verifies the penalty points value for each incorrect dropzone
50
+ * @param {number} points - The expected penalty points value for each incorrect dropzone.
51
+ */
52
+ verifyPenaltyPointsForEachIncorrectDropzoneValue: (points) => {
53
+ fillInTheGapsOverImageDragAndDropPage.penaltyPointsForEachIncorrectDropzoneInputField()
54
+ .should('have.value', points);
55
+ },
56
+
57
+ /**
58
+ * @description Allots penalty points for each incorrect dropzone
59
+ * @param {number} points - The penalty points to be allotted for each dropzone.
60
+ */
61
+ allotPenaltyPointsForEachIncorrectDropzone: (points) => {
62
+ fillInTheGapsOverImageDragAndDropPage.penaltyPointsForEachIncorrectDropzoneInputField()
63
+ .clear()
64
+ .type(`${points}`)
65
+ .should('have.value', points)
66
+ .blur();
67
+ },
33
68
 
69
+ selectPenaltyPointsForEachIncorrectDropzone: () => {
70
+ fillInTheGapsOverImageDragAndDropPage.specifyPointsForEachIncorrectDropzoneRadioButton()
71
+ .click();
72
+ }
34
73
  }
35
74
 
36
75
  export const fillInTheGapsDragAndDropCommonComponents = {
37
76
  ...selectors,
38
- steps,
39
- tests
77
+ steps
40
78
  }
@@ -10,13 +10,15 @@ const selectors = {
10
10
  //Dropdown options section
11
11
  dropdownOptionsLabel: () => cy.get('.dropdown-options-label'),
12
12
  dropdownOptionsTab: () => cy.get('.ngie-tablist-tab-button[data-ngie-testid*="dropdown"]'),
13
- dropdownOptionsInputField: () => cy.get('.input-editable input[type*="text"]'),
13
+ dropdownOptionsInputField: () => cy.get('.input-editable input[type*="text"]:visible'),
14
14
  dropdownOptionsInputFieldNumeration: () => cy.get('[class*="MuiInputAdornment"]'),
15
15
 
16
16
  //Specify correct answer dropdown
17
17
  dropdownWrapperSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown-wrapper'),
18
18
  dropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
19
19
  dropdownLabelSpecifyCorrectAnswerSection: () => cy.get('.response-label'),
20
+ partialDifferentWeightsPointsLabel: () => cy.get('.cloze-with-text-partial-points-per-response-label'),
21
+ penaltyPointsForEachIncorrectDropdownInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropdown"]'),
20
22
 
21
23
  //Dropdown list
22
24
  dropdownList: () => cy.get('.dropdown-list-ul'),
@@ -45,6 +47,9 @@ const selectors = {
45
47
  correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answer-label"]'),
46
48
  correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
47
49
  tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
50
+
51
+ //additional settings
52
+ enterAriaLabelInputField: () => cy.get('input[aria-label*="Enter ARIA label"]')
48
53
  }
49
54
 
50
55
  const steps = {
@@ -533,7 +538,55 @@ const steps = {
533
538
  verifyDropdownMenuOptionsNotWordWrappedPreviewTab: () => {
534
539
  fillInTheGapsDropdownCommonComponent.dropdownList()
535
540
  .should('not.have.class', 'wordwrap-dropdown-menu');
536
- }
541
+ },
542
+
543
+ verifyOptionsInputFieldContents: (index) => {
544
+ optionsWrapperComponent.optionWrapper()
545
+ .eq(index)
546
+ .within(() => {
547
+ fillInTheGapsDropdownCommonComponent.dropdownOptionsInputField()
548
+ .should('have.attr', 'placeholder', 'Enter option');
549
+ commonComponents.dragHandleButton()
550
+ .should('exist');
551
+ commonComponents.deleteButton()
552
+ .should('be.visible');
553
+ fillInTheGapsDropdownCommonComponent.dropdownOptionsInputFieldNumeration()
554
+ .should('have.text', index + 1);
555
+ });
556
+ },
557
+
558
+ getOptionCount: () => {
559
+ return fillInTheGapsDropdownCommonComponent.dropdownOptionsInputField().its('length')
560
+ },
561
+
562
+ /**
563
+ * @description verify the displayed penalty points for each incorrect dropdown
564
+ * @param {number} penaltyPoints displayed penalty points
565
+ */
566
+ verifyPenaltyPointsForEachIncorrectDropdown: (penaltyPoints) => {
567
+ utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect dropdown: ${penaltyPoints}`);
568
+ },
569
+
570
+ /**
571
+ * @description Verifies the penalty points value for each incorrect dropdown
572
+ * @param {number} points - The expected penalty points value for each incorrect dropdown.
573
+ */
574
+ verifyPenaltyPointsForEachIncorrectDropdownValue: (points) => {
575
+ fillInTheGapsDropdownCommonComponent.penaltyPointsForEachIncorrectDropdownInputField()
576
+ .should('have.value', points);
577
+ },
578
+
579
+ /**
580
+ * @description Allots penalty points for each incorrect dropdown
581
+ * @param {number} points - The penalty points to be allotted for each dropdown.
582
+ */
583
+ allotPenaltyPointsForEachIncorrectDropdown: (points) => {
584
+ fillInTheGapsDropdownCommonComponent.penaltyPointsForEachIncorrectDropdownInputField()
585
+ .clear()
586
+ .type(`${points}`)
587
+ .should('have.value', points)
588
+ .blur();
589
+ },
537
590
  }
538
591
 
539
592
  const tests = {
@@ -543,10 +596,11 @@ const tests = {
543
596
  * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
544
597
  */
545
598
  verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
546
- it(`When user has added a response token in image, then its corresponding dropdown \'Dropdown 1\' should be displayed in the ${accordionName} accordion in collapsed state`, () => {
547
- utilities.verifyElementCount(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 1);
599
+ it(`The dropdowns \'Dropdown 1\' and \'Dropdown 2\' should be displayed in the ${accordionName} accordion in collapsed state`, () => {
600
+ utilities.verifyElementCount(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 2);
548
601
  fillInTheGapsDropdownCommonComponent.steps.verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection(0);
549
602
  utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), 0), 'Dropdown 1');
603
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), 1), 'Dropdown 2');
550
604
  });
551
605
 
552
606
  it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should be displayed', () => {
@@ -594,10 +648,100 @@ const tests = {
594
648
  utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), index), 'visible');
595
649
  })
596
650
  });
651
+ },
652
+
653
+ verifyAddOptionFunctionalityForDropdownOptions: () => {
654
+ it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
655
+ let initialOptionCount;
656
+ fillInTheGapsDropdownCommonComponent.steps.getOptionCount().then((count) => {
657
+ initialOptionCount = count;
658
+ optionsWrapperComponent.steps.addOption();
659
+ fillInTheGapsDropdownCommonComponent.steps.getOptionCount().should('eq', initialOptionCount + 1);
660
+ fillInTheGapsDropdownCommonComponent.steps.verifyOptionsInputFieldContents(initialOptionCount);
661
+ });
662
+ });
663
+ },
664
+
665
+ verifyDropdownAndDropdownMenuSectionContents: () => {
666
+ it('Dropdown label, \'User specified width\' and \'Auto scale\' toggle buttons should be displayed', () => {
667
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.dropdownLabel(), 'Dropdown');
668
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.dropdownLabel(), 'visible');
669
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.userSpecifiedWidthToggleButton(), 'User specified width');
670
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.userSpecifiedWidthToggleButton(), 'visible');
671
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton(), 'Auto scale');
672
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton(), 'visible');
673
+ });
674
+
675
+ it('By default \'User specified width\' toggle button should be in selected state and \'Auto scale\' should not be in selected state', () => {
676
+ fillInTheGapsDropdownCommonComponent.steps.verifyUserSpecifiedToggleButtonIsSelected();
677
+ fillInTheGapsDropdownCommonComponent.steps.verifyAutoScaleToggleButtonNotSelected();
678
+ });
679
+
680
+ it('\'Display multiline text in dropdown\' checkbox and label should be displayed and by default it should be unchecked', () => {
681
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckbox(), 'exist');
682
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckboxLabel(), 'Display multiline text in dropdown');
683
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckboxLabel(), 'visible');
684
+ fillInTheGapsDropdownCommonComponent.steps.verifyDisplayMultilineCheckboxIsNotChecked();
685
+ });
686
+
687
+ it('\'Dropdown menu\' label should be displayed', () => {
688
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.dropdownMenuLabel(), 'Dropdown menu');
689
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.dropdownMenuLabel(), 'visible');
690
+ });
691
+
692
+ it('\'Word wrap for dropdown menu\' checkbox and label should be displayed and by default it should be checked', () => {
693
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.wordWrapCheckbox(), 'exist');
694
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.wordWrapCheckboxLabel(), 'Word wrap for dropdown menu');
695
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.wordWrapCheckboxLabel(), 'visible');
696
+ fillInTheGapsDropdownCommonComponent.steps.verifyWordWrapForDropdownMenuCheckboxIsChecked();
697
+ });
698
+
699
+ it('CSS of Dropdown and Dropdown menu section', { tags: 'css' }, () => {
700
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownLabel(), {
701
+ 'color': css.color.sectionHeading,
702
+ 'font-size': css.fontSize.normal,
703
+ 'font-weight': css.fontWeight.semibold
704
+ });
705
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.userSpecifiedWidthToggleButton(), {
706
+ 'color': css.color.whiteText,
707
+ 'font-size': css.fontSize.normal,
708
+ 'font-weight': css.fontWeight.bold,
709
+ 'background-color': css.color.toggleButtonSelectedBg
710
+ });
711
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton(), {
712
+ 'color': css.color.UnselectedToggleButton,
713
+ 'font-size': css.fontSize.normal,
714
+ 'font-weight': css.fontWeight.bold
715
+ });
716
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckboxLabel(), {
717
+ 'color': css.color.labelText,
718
+ 'font-size': css.fontSize.normal,
719
+ 'font-weight': css.fontWeight.regular
720
+ });
721
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownMenuLabel(), {
722
+ 'color': css.color.sectionHeading,
723
+ 'font-size': css.fontSize.normal,
724
+ 'font-weight': css.fontWeight.semibold
725
+ });
726
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.wordWrapCheckboxLabel(), {
727
+ 'color': css.color.labelText,
728
+ 'font-size': css.fontSize.normal,
729
+ 'font-weight': css.fontWeight.regular
730
+ });
731
+ //Checked checkbox
732
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.wordWrapCheckbox().parent().find('g g').eq(0), {
733
+ 'fill': css.color.activeButtons
734
+ });
735
+ });
736
+
737
+ it('Accessibility of Dropdown and Dropdown menu section', { tags: 'a11y' }, () => {
738
+ cy.checkAccessibility(fillInTheGapsDropdownCommonComponent.dropdownLabel().parents('.student-view-settings-container'));
739
+ });
597
740
  }
598
741
  }
599
742
 
600
743
  export const fillInTheGapsDropdownCommonComponent = {
601
744
  ...selectors,
602
- steps
745
+ steps,
746
+ tests
603
747
  }