itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
  35. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  36. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
  37. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
  38. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
  39. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
  40. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
  41. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
  46. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
  47. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
  48. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
  50. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
  51. package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
  52. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
  53. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
  54. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
  55. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
  56. package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
  57. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
  58. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
  59. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
  60. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
  63. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
  64. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
  65. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
  66. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
  67. package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
  68. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
  69. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
  70. package/cypress/fixtures/theme/ilc.json +3 -1
  71. package/cypress/pages/audioResponsePage.js +2 -1
  72. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  73. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  74. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  75. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  76. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  77. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  78. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  79. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  80. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  81. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  82. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  83. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  86. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  87. package/cypress/pages/components/index.js +3 -3
  88. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  90. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  91. package/cypress/pages/components/scoringSectionBase.js +1 -1
  92. package/cypress/pages/createItemPage.js +67 -2
  93. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  94. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  95. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  96. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  97. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  98. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  99. package/cypress/pages/index.js +5 -5
  100. package/cypress/pages/multipleSelectionPage.js +1 -0
  101. package/cypress/pages/shortTextResponsePage.js +575 -33
  102. package/cypress/pages/singleSelectionGridPage.js +1 -2
  103. package/cypress/pages/singleSelectionPage.js +5 -6
  104. package/cypress/pages/textEntryMathPage.js +46 -22
  105. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  106. package/cypress/pages/uploadResponsePage.js +74 -21
  107. package/package.json +2 -2
  108. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  109. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  110. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  111. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  112. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  113. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  114. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  115. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -1,47 +1,26 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { figOverImageCanvasComponent, autoScoredScoringPreviewTab, optionsWrapperComponent, commonComponents, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from "./components";
2
+ import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel } from "./components";
3
3
  const css = Cypress.env('css');
4
4
 
5
5
  const optionsForDropdown = ['Flower', 'Petal', 'Stem', 'Branch'];
6
6
 
7
7
  const selectors = {
8
8
  ...questionInstructionsComponent,
9
- ...figOverImageCanvasComponent,
9
+ ...imageCanvasComponent,
10
10
  ...autoScoredScoringPreviewTab,
11
11
  ...correctIncorrectAnswerLabelComponent,
12
- ...autoScoredScoringSectionMultiResponseType,
13
- ...autoScoredSpecifyCorrectAnswerSection,
14
- //Dropdown options section
15
- dropdownOptionsTab: () => cy.get('.ngie-tablist-tab-button[data-ngie-testid*="dropdown"]'),
16
- dropdownOptionsInputField: () => cy.get('.input-editable input[type*="text"]'),
17
-
18
- //Specify correct answer dropdown
19
- dropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
20
- dropdownLabelSpecifyCorrectAnswerSection: () => cy.get('.response-label'),
21
-
22
- //Dropdown list
23
- dropdownListOptions: (ariaLabel = null) => {
24
- if (ariaLabel) {
25
- return cy.get(`[role="listbox"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
26
- } else {
27
- return cy.get('[role="listbox"] .dropdown-menu-item')
28
- }
29
- },
30
-
31
- //Preview tab
32
- dropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-haspopup="listbox"]'),
33
- dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Canvasstyle__DropzoneWrapper"]'),
34
- dropdownNumerationPreviewTab: () => cy.get('.answer-numeration-number-box'),
12
+ ...fillInTheGapsDropdownCommonComponent,
13
+ ...optionsWrapperComponent,
14
+ ...randomizeOptionsComponent,
15
+ ...backgroundImageUploadComponent,
16
+ dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class="Canvasstyle__DropzoneWrapper"]'),
35
17
  correctAnswerSectionWrapper: () => cy.get('.dnd-correct-answer-wrapper'),
36
- correctAnswersLabel: () => cy.get('.correct-answers-label'),
37
- correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
38
18
  correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
39
19
  correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
40
- tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
41
20
  }
42
21
 
43
22
  const steps = {
44
- ...figOverImageCanvasComponent.steps,
23
+ ...imageCanvasComponent.steps,
45
24
  ...autoScoredScoringPreviewTab.steps,
46
25
  ...correctIncorrectAnswerLabelComponent.steps,
47
26
  ...createQuestionBasePage.steps,
@@ -51,133 +30,55 @@ const steps = {
51
30
  ...autoScoredStudentViewSettings.steps,
52
31
  ...autoScoredSpecifyCorrectAnswerSection.steps,
53
32
  ...autoScoredScoringSectionMultiResponseType.steps,
33
+ ...fillInTheGapsDropdownCommonComponent.steps,
34
+ ...additionalSettingsPanel.steps,
35
+ ...optionsWrapperComponent.steps,
36
+ ...randomizeOptionsComponent.steps,
54
37
  /**
55
- * @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
56
- * @param {string[]} responseTextArray Array of text to be given as input in options input field
57
- * @description Add input to dropdown options input fields
58
- */
59
- addInputToDropdownOptionFields: (dropdownOptionsTabIndex, responseTextArray) => {
60
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
61
- .click();
62
- fillInTheGapsOverImageDropdownPage.steps.verifyDropdownOptionsTabIsSelected(dropdownOptionsTabIndex);
63
- optionsWrapperComponent.optionsSectionWrapper()
38
+ * Verify that the correct option icon is is displayed for a specific dropdown.
39
+ * @param {number} dropdownIndex - The index of the dropdown.
40
+ */
41
+ verifyCorrectOptionIcon: (dropdownIndex) => {
42
+ utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
64
43
  .within(() => {
65
- responseTextArray.forEach((responseFieldText, optionIndex) => {
66
- fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionInputField(optionIndex, responseFieldText);
44
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), {
45
+ 'fill': css.color.correctAnswer
67
46
  });
68
47
  });
69
48
  },
70
49
 
71
50
  /**
72
- * @param {number} optionIndex index of the option input field
73
- * @param {string} responseText text to be given as input in option input field
74
- * @description Add input to options input fields
75
- */
76
- addInputToDropdownOptionInputField: (optionIndex, responseFieldText) => {
77
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsInputField(), optionIndex)
78
- .clear()
79
- .type(responseFieldText, { delay: 0 })
80
- .should('have.value', responseFieldText);
81
- },
82
-
83
- /**
84
- * @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
85
- * @description Verify dropdown options tab is selected
86
- */
87
- verifyDropdownOptionsTabIsSelected: (dropdownOptionsTabIndex) => {
88
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
89
- .should('have.class', 'Mui-selected');
90
- },
91
-
92
- /**
93
- * @param {number} dropdownIndex Index of the dropdown
94
- * @param {string} dropdownOption Option to be selected in the dropdown
95
- * @description Select option from dropdown in specify correct answer section
96
- */
97
- selectResponseFromDropdownSpecifyCorrectAnswerSection: (dropdownIndex, dropdownOption) => {
98
- fillInTheGapsOverImageDropdownPage.steps.expandResponseDropdownInSpecifyCorrectAnswerSection(dropdownIndex)
99
- fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(dropdownOption);
100
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), dropdownIndex), dropdownOption);
101
- },
102
-
103
- /**
104
- * @param {string} dropdownOption Option to be selected from dropdown
105
- * @description Select option from dropdown
51
+ * Verify that both correct and incorrect option icons do not exist for a specific dropdown.
52
+ * @param {number} dropdownIndex - The index of the dropdown.
106
53
  */
107
- selectOptionFromDropdownList: (dropdownOption) => {
108
- fillInTheGapsOverImageDropdownPage.dropdownListOptions(dropdownOption)
109
- .click();
110
- utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
111
- },
112
-
113
- /**
114
- * @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
115
- * @description Expand response dropdown in specify correct answer section
116
- */
117
- expandResponseDropdownInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
118
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
119
- .click({ position: "right" });
120
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
121
- .should('have.attr', 'aria-expanded', 'true');
122
- },
123
-
124
- /**
125
- * @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
126
- * @description Verify dropdown is expanded in specify correct answer section
127
- */
128
- verifyDropdownIsExpandedInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
129
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
130
- .should('have.attr', 'aria-expanded', 'true');
131
- },
132
-
133
- /**
134
- * @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
135
- * @description Verify dropdown is collapsed in specify correct answer section
136
- */
137
- verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
138
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
139
- .should('have.attr', 'aria-expanded', 'false');
140
- utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
141
- },
142
-
143
- /**
144
- * @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
145
- * @description Expand and collapse dropdown in specify correct answer section
146
- */
147
- expandAndCollapseDropdownInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
148
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
149
- .click({ position: "right" });
150
- cy.get('body')
151
- .click();
54
+ verifyCorrectIncorrectIconNotExist: (dropdownIndex) => {
55
+ utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
56
+ .within(() => {
57
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), 'notExist');
58
+ });
152
59
  },
153
60
 
154
61
  /**
155
- * @param {Object[]} CorrectAnswerArray - An array of objects containing the dropdownIndex and dropdownOption to be selected.
156
- * @param {number} CorrectAnswerArray[].dropdownIndex - The index of dropdown in preview tab
157
- * @param {string} CorrectAnswerArray[].dropdownOption - The dropdown option to be selected from dropdown list
158
- * @description Select option from dropdown in preview tab
62
+ * Verify that the incorrect option icon is displayed for a specific dropdown.
63
+ * @param {number} dropdownIndex - The index of the dropdown.
159
64
  */
160
- selectResponseFromDropdownInPreviewTab: (CorrectAnswerArray) => {
161
- CorrectAnswerArray.forEach(({ dropdownIndex, dropdownOption }) => {
162
- fillInTheGapsOverImageDropdownPage.steps.expandDropdownInPreviewTab(dropdownIndex);
163
- fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(dropdownOption);
164
- fillInTheGapsOverImageDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownOption);
165
- });
166
- },
167
-
168
- /**
169
- * @param {number} dropdownIndex Index of dropdown in preview tab
170
- * @description Expand dropdown in preview tab
171
- */
172
- expandDropdownInPreviewTab: (dropdownIndex) => {
173
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
174
- .click();
175
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
176
- .should('have.attr', 'aria-expanded', 'true');
65
+ verifyIncorrectOptionIcon: (dropdownIndex) => {
66
+ utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
67
+ .within(() => {
68
+ utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), {
69
+ 'fill': css.color.incorrectAnswer
70
+ });
71
+ });
177
72
  },
178
73
 
179
- verifyTextDisplayedInDropdownPreviewTab: (dropdownIndex, dropdownText) => {
180
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex), dropdownText);
74
+ verifyCorrectIncorrectIconsNotExist: () => {
75
+ fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
76
+ .each(($element) => {
77
+ cy.wrap($element)
78
+ .within(() => {
79
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
80
+ });
81
+ });
181
82
  },
182
83
 
183
84
  verifyDropdownNumerationPreviewTab: () => {
@@ -185,7 +86,7 @@ const steps = {
185
86
  .each(($element, index) => {
186
87
  cy.wrap($element)
187
88
  .within(() => {
188
- utilities.verifyTextContent(fillInTheGapsOverImageDropdownPage.dropdownNumerationPreviewTab(), `${index + 1}`);
89
+ utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.dropdownNumerationPreviewTab(), `${index + 1}`);
189
90
  });
190
91
  });
191
92
  },
@@ -196,101 +97,86 @@ const steps = {
196
97
  * @example verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Petals', 'Stem']);
197
98
  */
198
99
  verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
199
- utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper(), correctAnswerArray.length);
100
+ utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponse(), correctAnswerArray.length);
200
101
  correctAnswerArray.forEach((correctAnswer, index) => {
201
102
  fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper()
202
103
  .eq(index)
203
104
  .within(() => {
204
- utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswerResponseNumeration(), `${index + 1}`);
105
+ utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
205
106
  fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
206
107
  .should('have.text', correctAnswer);
207
108
  });
208
109
  });
209
110
  },
210
111
 
211
- /**
212
- * Verify that the incorrect option icon is displayed for a specific dropdown.
213
- * @param {number} dropdownIndex - The index of the dropdown.
214
- */
215
- verifyIncorrectOptionIcon: (dropdownIndex) => {
216
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
217
- .within(() => {
218
- utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
219
- 'fill': css.color.incorrectAnswer
220
- });
221
- });
222
- },
223
-
224
- /**
225
- * Verify that the correct option icon is is displayed for a specific dropdown.
226
- * @param {number} dropdownIndex - The index of the dropdown.
227
- */
228
- verifyCorrectOptionIcon: (dropdownIndex) => {
229
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
230
- .within(() => {
231
- utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
232
- 'fill': css.color.correctAnswer
233
- });
234
- });
235
- },
236
-
237
- /**
238
- * Verify that both correct and incorrect option icons do not exist for a specific dropdown.
239
- * @param {number} dropdownIndex - The index of the dropdown.
240
- */
241
- verifyCorrectIncorrectIconNotExist: (dropdownIndex) => {
242
- utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
243
- .within(() => {
244
- utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
245
- });
246
- },
247
-
248
112
  verifyCorrectAnswerSectionNotExists: () => {
249
113
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.correctAnswerSectionWrapper(), 'notExist');
250
114
  },
251
115
 
252
- verifyCorrectIncorrectIconsNotExist: () => {
253
- fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
254
- .each(($element) => {
255
- cy.wrap($element)
256
- .within(() => {
257
- utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
258
- });
259
- });
260
- },
261
-
262
116
  /**
263
- * Verify text displayed in the dropdowns of the preview tab.
264
- * @param {Object[]} dropdownTextArray - An array of objects containing the dropdownIndex and dropdownText.
265
- * @param {number} dropdownTextArray[].dropdownIndex - The index of the dropdown.
266
- * @param {string} dropdownTextArray[].dropdownText - The text to be verified in the respective dropdown.
117
+ * @description Verify dropdown pointer style in preview tab
118
+ * @param {string} style dropdown pointer style
119
+ * @param {number} dropzoneIndex index of dropdown
267
120
  */
268
- verifyTextInDropdownsInPreviewTab: (dropdownTextArray) => {
269
- dropdownTextArray.forEach(({ dropdownIndex, dropdownText }) => {
270
- fillInTheGapsOverImageDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownText);
271
- });
121
+ verifyDropdownPointerStyleInPreviewTab: (style, dropzoneIndex) => {
122
+ const getPosition = (option) => {
123
+ switch (option) {
124
+ case 'bottom':
125
+ return { top: '-31.5px', left: '-37.5px' };
126
+ case 'bottom right':
127
+ return { top: '-25px', left: '-40px' };
128
+ case 'right':
129
+ return { top: '-21px', left: '-36.5px' };
130
+ case 'top right':
131
+ return { top: '-19px', left: '-31px' };
132
+ case 'top':
133
+ return { top: '-22.5px', left: '-25.5px' };
134
+ case 'top left':
135
+ return { top: '-27px', left: '-24px' };
136
+ case 'left':
137
+ return { bottom: '-20px', left: '-27px' };
138
+ case 'bottom left':
139
+ return { bottom: '-18px', left: '-32px' };
140
+ }
141
+ }
142
+ const expectedPosition = getPosition(style);
143
+ if (style == 'left' || style == 'bottom left') {
144
+ fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
145
+ .eq(dropzoneIndex)
146
+ .should('have.css', 'bottom', expectedPosition.bottom)
147
+ .and('have.css', 'left', expectedPosition.left);
148
+ }
149
+ else if (style == 'none') {
150
+ fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
151
+ .eq(dropzoneIndex)
152
+ .should('not.have.css', 'bottom')
153
+ .and('not.have.css', 'left');
154
+ }
155
+ else {
156
+ fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
157
+ .eq(dropzoneIndex)
158
+ .should('have.css', 'top', expectedPosition.top)
159
+ .and('have.css', 'left', expectedPosition.left);
160
+ }
272
161
  },
273
162
 
274
163
  /**
275
- * Verify that a specific dropdown is disabled in the preview tab.
276
- * @param {number} dropdownIndex - The index of the disabled dropdown.
277
- */
278
- verifyDropdownIsDisabled: (dropdownIndex) => {
279
- utilities.verifyElementDisabledClass(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex));
280
- },
281
-
282
- verifyPointsPerResponseLabel: () => {
283
- utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response: -');
284
- utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
164
+ * @param {*} width width of canvas
165
+ * @description this function verifies width of canvas
166
+ */
167
+ verifyCanvasWidthInPreviewTab: (width) => {
168
+ fillInTheGapsOverImageDropdownPage.canvasInPreviewTab()
169
+ .should('have.attr', 'width', width);
285
170
  },
286
171
 
287
172
  /**
288
- * @description Verify points per response score displayed for partial equal weights
289
- * @param {number} pointsPerResponse points per response score
173
+ * @param {*} height height of canvas
174
+ * @description this function verifies height of canvas
290
175
  */
291
- verifyPartialEqualWeightsPointsPerResponseScore: (pointsPerResponse) => {
292
- utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), `Points per response: ${pointsPerResponse}`);
293
- },
176
+ verifyCanvasHeightInPreviewTab: (height) => {
177
+ fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab()
178
+ .should('have.css', 'height', `${height}px`);
179
+ }
294
180
  }
295
181
 
296
182
  const tests = {
@@ -298,64 +184,14 @@ const tests = {
298
184
  ...autoScoredSpecifyCorrectAnswerSection.tests,
299
185
  ...scoringSectionBaseEditTab.tests,
300
186
  ...autoScoredScoringSectionMultiResponseType.tests,
301
- /**
302
- * Verifies the contents and functionality of the 'Specify correct answer' accordion for fill in the gaps over image dropdown question.
303
- * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
304
- * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
305
- */
306
- verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
307
- 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`, () => {
308
- utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), 1);
309
- fillInTheGapsOverImageDropdownPage.steps.verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection(0);
310
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), 0), 'Dropdown 1');
311
- });
312
-
313
- it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should be displayed', () => {
314
- fillInTheGapsOverImageDropdownPage.steps.expandAndCollapseDropdownInSpecifyCorrectAnswerSection(0);
315
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
316
- utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
317
- });
318
-
319
- it('When the user selects any option from the dropdown, then error message should disappear and that option should be displayed on the dropdown', () => {
320
- fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, optionsForDropdown[0]);
321
- commonComponents.steps.verifyErrorMessageIsNotDisplayed();
322
- });
323
-
324
- autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
325
-
326
- it(`CSS of ${accordionName} accordion contents`, { tags: 'css' }, () => {
327
- utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), {
328
- 'color': css.color.labels,
329
- 'font-size': css.fontSize.default,
330
- 'font-weight': css.fontWeight.regular
331
- });
332
- utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), {
333
- 'background-color': css.color.figActiveComponentBg,
334
- 'border': `1px solid ${css.color.activeComponentBorder}`
335
- });
336
- //CSS of selected dropdown option which appears on dropdown
337
- utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), {
338
- 'color': css.color.liText,
339
- 'font-size': css.fontSize.default,
340
- 'font-weight': css.fontWeight.regular
341
- });
342
- });
343
-
344
- it(`Accessibility of ${accordionName} accordion contents`, { tags: 'a11y' }, () => {
345
- cy.checkAccessibility(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), 0).parents('[aria-label="Specify correct answer section"]'));
346
- });
347
- },
348
-
349
- verifyContentsOfSpecifyCorrectAnswerSection: () => {
350
- it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
351
- fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection()
352
- .each(($element, index) => {
353
- utilities.verifyElementVisibilityState(cy.wrap($element), 'visible');
354
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), index), `Dropdown ${index + 1}`);
355
- utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), index), 'visible');
356
- })
357
- });
358
- },
187
+ ...optionsWrapperComponent.tests,
188
+ ...randomizeOptionsComponent.tests,
189
+ ...autoScoredStudentViewSettings.tests,
190
+ ...questionInstructionsComponent.tests,
191
+ ...backgroundImageUploadComponent.tests,
192
+ ...imageCanvasComponent.tests,
193
+ ...studentViewSettingsLabelComponent.tests,
194
+ ...createQuestionBasePage.tests,
359
195
  }
360
196
 
361
197
  export const fillInTheGapsOverImageDropdownPage = {