itemengine-cypress-automation 1.0.119 → 1.0.121

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) 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/e2e/migration/migration.js +6 -5
  71. package/cypress/e2e/migration/migration2.js +4 -3
  72. package/cypress/e2e/migration/migration3.js +4 -3
  73. package/cypress/e2e/migration/migration4.js +4 -3
  74. package/cypress/e2e/migration/migration5.js +4 -3
  75. package/cypress/fixtures/theme/ilc.json +3 -1
  76. package/cypress/pages/audioResponsePage.js +2 -1
  77. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  78. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  79. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  80. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  81. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  84. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  85. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  86. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  87. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  88. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  89. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  90. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  91. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  92. package/cypress/pages/components/index.js +3 -3
  93. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  94. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  95. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  96. package/cypress/pages/components/scoringSectionBase.js +1 -1
  97. package/cypress/pages/createItemPage.js +67 -2
  98. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  99. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  100. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  101. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  102. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  103. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  104. package/cypress/pages/index.js +5 -5
  105. package/cypress/pages/multipleSelectionPage.js +1 -0
  106. package/cypress/pages/shortTextResponsePage.js +575 -33
  107. package/cypress/pages/singleSelectionGridPage.js +1 -2
  108. package/cypress/pages/singleSelectionPage.js +5 -6
  109. package/cypress/pages/textEntryMathPage.js +46 -22
  110. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  111. package/cypress/pages/uploadResponsePage.js +74 -21
  112. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
  113. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
  114. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
  115. package/package.json +1 -1
  116. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  117. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  118. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  119. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  120. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  121. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  122. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  123. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -1,1113 +0,0 @@
1
- import utilities from "../../support/helpers/utilities";
2
- import { commonComponents } from "./commonComponents";
3
- import { createQuestionBasePage } from "./createQuestionBasePage";
4
- import { scoringSectionBase } from "./scoringSectionBase";
5
- import { uploadImageSectionComponent } from "./uploadImageSectionComponent";
6
- const css = Cypress.env('css');
7
-
8
- const pointerDropdownList = ['Left', 'Right', 'Top', 'Bottom', 'Top left', 'Top right', 'None'];
9
-
10
- const selectors = {
11
- addResponseContainerButton: () => cy.get('[class*="ResponseOnImagestyles"] .ngie-icon-with-label-btn').eq(0),
12
- addResponseContainerButtonWrapper: () => cy.get('[class*="ResponseOnImagestyles__ButtonWrapper"]'),
13
- //Change selectors after https://redmine.zeuslearning.com/issues/518498 is fixed
14
- responseContainer: () => cy.get('.react-draggable'),
15
- responseContainerCloseButton: () => cy.get('.remove-button'),
16
- responseContainerNumeration: () => cy.get('marker'),
17
- responseContainerPointer: () => cy.get('[class*="PointerDiv"]'),
18
- responseContainerChevronDownArrow: () => cy.get('.icon-chevron-down'),
19
- imageHoverTextLabel: () => cy.get('[class*="Imagestyles__RowContainer"] .text-label').eq(0),
20
- imageHoverTextInputField: () => cy.get('input[aria-label="Image hover text"]'),
21
- imageAlternativeTextLabel: () => cy.get('[class*="Imagestyles__RowContainer"] .text-label').eq(1),
22
- imageAlternativeTextInputField: () => cy.get('input[aria-label="Image alternative text"]'),
23
- heightLabel: () => cy.get('[class*="AddTextResponseOnImagestyles__RowContainer"] [aria-labelledby*="Height (px)"]'),
24
- heightInputField: () => cy.get('[class*="AddTextResponseOnImagestyles__RowContainer"] input[aria-label="Height (px)"]'),
25
- widthLabel: () => cy.get('[class*="AddTextResponseOnImagestyles__RowContainer"] [aria-labelledby="Width (px)"]'),
26
- widthInputField: () => cy.get('[class*="AddTextResponseOnImagestyles__RowContainer"] input[aria-label="Width (px)"]'),
27
- editAriaLabelForResponseContainersLabel: () => cy.get('[data-ngie-testid*="edit-aria-labels-for-response"] .MuiFormControlLabel-label'),
28
- editAriaLabelForResponseContainersCheckbox: () => cy.get('[data-ngie-testid*="edit-aria-labels-for-response"] input'),
29
- ariaLabelsLabel: () => cy.get('[class*="OnImagestyles__LabelWrapper"]'),
30
- ariaLabelsInputField: () => cy.get('[class*="AriaLabelOptionComponent"] input'),
31
- ariaLabelsInputFieldNumeration: () => cy.get('.start-adornment'),
32
- pleaseAddResponseTokenHelpText: () => cy.get('[class*="ClozeWithTextResponsestyles__AddResponseLabel"]'),
33
- setCorrectAnswerResponseFieldLabel: () => cy.get('.cloze-with-text-form-control-wrapper .input-field-label'),
34
- imageSectionImageLabel: () => cy.get('[class*="LabelImage"][class*="styles__LabelWrapper"]'),
35
- imageSectionImage: () => cy.get('.image-container img'),
36
- imagePreviewTab: () => cy.get('[class*="ClozeWithTextResponsestyles__ContentWrapper"] .image-container img'),
37
- imagePropertiesContainer: () => cy.get('[class*="AddTextResponseOnImagestyles__DimensionsContainer"]'),
38
- responseNumeration: () => cy.get('.response-input-adornment'),
39
- uploadImageSectionWrapper: () => cy.get('[class*="ImagePopupWrapper"]'),
40
- imageSectionContentsWrapper: () => cy.get('[class*="ImageDisplayWrapper"]'),
41
- // Additional setting accordion
42
- advanceSettingsforAllResponseAreasLabel: () => cy.get('.additional-settings-heading-label').eq(0),
43
- placeholderTextLabel: () => cy.get('.additional-settings-container .text-label'),
44
- placeholderTextInputField: () => cy.get('.additional-option-placeholder-input [aria-label="Placeholder Text"]'),
45
- responseFieldHeightLabel: () => cy.get('[class*="style__DimensionsContainer"] [aria-labelledby*="Height (px)"]'),
46
- responseFieldHeightInputField: () => cy.get('[class*="style__DimensionsContainer"] input[aria-label="Height (px)"]'),
47
- responseFieldWidthLabel: () => cy.get('[class*="style__DimensionsContainer"] [aria-labelledby*="Width (px)"]'),
48
- responseFieldWidthInputField: () => cy.get('[class*="style__DimensionsContainer"] input[aria-label="Width (px)"]'),
49
- pointerLabel: () => cy.get('[id*="Pointer"][id*="dropdown-label"]'),
50
- pointerDropdown: () => cy.get('[id*="Pointer"][id*="select"]'),
51
- pointerDropdownListOptions: (ariaLabel = null) => {
52
- if (ariaLabel) {
53
- return cy.get(`[aria-labelledby*="Pointer"] li[role="option"][aria-label*="${ariaLabel}"]`).eq(0)
54
- } else {
55
- return cy.get('[aria-labelledby*="Pointer"] li[role="option"]')
56
- }
57
- },
58
- fixPositionOnImageLabel: () => cy.get('[data-ngie-testid="fix-position-on-image-checkbox"] .MuiFormControlLabel-label'),
59
- fixPositionOnImageCheckbox: () => cy.get('[data-ngie-testid="fix-position-on-image-checkbox"] input'),
60
- studentResponseAreaAndLayoutLabel: () => cy.get('[class*="StudentResponseLabel"]'),
61
- displayAnswerNumerationToStudentsLabel: () => cy.get('[data-ngie-testid="display-answer-numeration-to-students-checkbox"] .MuiFormControlLabel-label'),
62
- displayAnswerNumerationToStudentsCheckbox: () => cy.get('[data-ngie-testid="display-answer-numeration-to-students-checkbox"] input'),
63
- //Response accordion
64
- placeholderTextLabelResponseAccordion: () => cy.get('.dropdown-wrapper .text-label'),
65
- advanceSettingForIndividualResponsesLabel: () => cy.get('.additional-settings-heading-label').eq(1),
66
- responseAccordionWrapper: () => cy.get('.response-setting-container'),
67
- responseAccordion: () => cy.get('.response-setting-container [role="button"]'),
68
- responseAccordionLabel: () => cy.get('.response-settings-label'),
69
- responseAccordionCustomLabel: () => cy.get('.custom-label-container'),
70
- }
71
-
72
- const steps = {
73
- /**
74
- * @param {number} responseContainerIndex
75
- * @returns coordinatesArray - Array of the coordinates of the response container's position
76
- * @description Get coordinates of the response container's position
77
- */
78
- getResponseContainerPositionCoordinates: (responseContainerIndex) => {
79
- const coordinatesArray = [];
80
- figOverImageCommonComponent.responseContainer()
81
- .eq(responseContainerIndex)
82
- .invoke('attr', 'style')
83
- .then(($styleAttribute) => {
84
- let transformValue = $styleAttribute;
85
- let position = transformValue.split('(')[1]
86
- .split(')')[0]
87
- .split(',');
88
- let horizontalCoordinate = position[0].trim();
89
- let verticalCoordinate = position[1].trim();
90
- coordinatesArray.push(horizontalCoordinate)
91
- coordinatesArray.push(verticalCoordinate)
92
- });
93
- return coordinatesArray;
94
- },
95
-
96
- /**
97
- * @param {number} responseContainerIndex Index of the response container
98
- * @param {number} responseContainerPositionCoordinates Position coordinates of the response container
99
- * @description Verify the position coordinates of the response container
100
- */
101
- verifyResponseContainerPositionCoordinates: (responseContainerIndex, responseContainerPositionCoordinates) => {
102
- figOverImageCommonComponent.responseContainer()
103
- .eq(responseContainerIndex)
104
- .invoke('attr', 'style')
105
- .then(($styleAttribute) => {
106
- let transformValue = $styleAttribute;
107
- let position = transformValue.split('(')[1]
108
- .split(')')[0]
109
- .split(',');
110
- let horizontalCoordinate = position[0].trim();
111
- let verticalCoordinate = position[1].trim();
112
- expect(horizontalCoordinate).to.be.eq(responseContainerPositionCoordinates[0]);
113
- expect(verticalCoordinate).to.be.eq(responseContainerPositionCoordinates[1]);
114
- });
115
- },
116
-
117
- addResponseContainer: () => {
118
- figOverImageCommonComponent.addResponseContainerButton()
119
- .click();
120
- },
121
-
122
- /**
123
- * @param {number} responseContainerIndex Index of response container
124
- * @description Verify response container is displayed in image section
125
- */
126
- verifyResponseContainerIsDisplayedInImageSection: (responseContainerIndex) => {
127
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseContainer().eq(responseContainerIndex), 'visible');
128
- },
129
-
130
- /**
131
- * @param {number} responseContainerIndex Index of response container
132
- * @description Verify pointer of response container is displayed in image section
133
- */
134
- verifyResponseContainerPointerInImageSection: (responseContainerIndex) => {
135
- figOverImageCommonComponent.responseContainer()
136
- .eq(responseContainerIndex)
137
- .within(() => {
138
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseContainerPointer(), 'visible');
139
- });
140
- },
141
-
142
- /**
143
- * @param {number} responseContainerIndex Index of response container
144
- * @description Verify numeration of response container is displayed in image section
145
- */
146
- verifyResponseContainerNumerationInImageSection: (responseContainerIndex) => {
147
- figOverImageCommonComponent.responseContainer()
148
- .eq(responseContainerIndex)
149
- .within(() => {
150
- utilities.verifyInnerText(figOverImageCommonComponent.responseContainerNumeration(), `${responseContainerIndex + 1}`);
151
- });
152
- },
153
-
154
- /**
155
- * @param {number} responseContainerIndex Index of response container
156
- * @description Verify chevron down arrow of response container is displayed in image section
157
- */
158
- verifyResponseContainerChevronDownArrowInImageSection: (responseContainerIndex) => {
159
- figOverImageCommonComponent.responseContainer()
160
- .eq(responseContainerIndex)
161
- .within(() => {
162
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseContainerChevronDownArrow(), 'visible');
163
- });
164
- },
165
-
166
- /**
167
- * @param {number} responseContainerIndex Index of response container
168
- * @description Verify close button of response container is displayed in image section
169
- */
170
- verifyResponseContainerCloseButtonInImageSection: (responseContainerIndex) => {
171
- figOverImageCommonComponent.responseContainer()
172
- .eq(responseContainerIndex)
173
- .within(() => {
174
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseContainerCloseButton(), 'visible');
175
- });
176
- },
177
-
178
- /**
179
- * @param {number} responseContainerIndex Index of response container
180
- * @description Click on close button of response container
181
- */
182
- clickOnResponseContainerCloseButton: (responseContainerIndex) => {
183
- figOverImageCommonComponent.responseContainer()
184
- .eq(responseContainerIndex)
185
- .within(() => {
186
- figOverImageCommonComponent.responseContainerCloseButton()
187
- .click();
188
- });
189
- },
190
-
191
- /**
192
- * @param {string} imageHoverText Text to be displayed as tooltip when user hovers on image
193
- * @description Add input to image hover text input field
194
- */
195
- enterTextInImageHoverTextInputField: (imageHoverText) => {
196
- figOverImageCommonComponent.imageHoverTextInputField()
197
- .clear()
198
- .type(imageHoverText)
199
- .should('have.value', imageHoverText);
200
- },
201
-
202
- /**
203
- * @param {string} imageAlternativeText Text to be displayed as alternative text for the image
204
- * @description Add input to image alternative text input field
205
- */
206
- enterTextInImageAlternativeTextInputField: (imageAlternativeText) => {
207
- figOverImageCommonComponent.imageAlternativeTextInputField()
208
- .clear()
209
- .type(imageAlternativeText)
210
- .should('have.value', imageAlternativeText);
211
- },
212
-
213
- clearTextFromImageAlternativeTextInputField: () => {
214
- figOverImageCommonComponent.imageAlternativeTextInputField()
215
- .clear();
216
- },
217
-
218
- /**
219
- * @param {number} imageHeight Height of the displayed image
220
- * @description Add input to height input field
221
- */
222
- enterTextInHeightInputField: (imageHeight) => {
223
- figOverImageCommonComponent.heightInputField()
224
- .clear()
225
- .type(`${imageHeight}`)
226
- .should('have.value', imageHeight);
227
- },
228
-
229
- /**
230
- * @param {number} imageWidth Width of the displayed image
231
- * @description Add input to width input field
232
- */
233
- enterTextInWidthInputField: (imageWidth) => {
234
- figOverImageCommonComponent.widthInputField()
235
- .clear()
236
- .type(`${imageWidth}`)
237
- .should('have.value', imageWidth);
238
- },
239
-
240
- clearTextFromImageHoverTextInputField: () => {
241
- figOverImageCommonComponent.imageHoverTextInputField()
242
- .clear();
243
- },
244
-
245
- /**
246
- * @param {number} imageWidth Width of the displayed image
247
- * @description verify width input field value
248
- */
249
- verifyWidthInputFieldValue: (imageWidth) => {
250
- figOverImageCommonComponent.widthInputField()
251
- .should('have.value', imageWidth);
252
- },
253
-
254
- /**
255
- * @param {number} imageHeight Height of the displayed image
256
- * @description verify height input field value
257
- */
258
- verifyHeightInputFieldValue: (imageHeight) => {
259
- figOverImageCommonComponent.heightInputField()
260
- .should('have.value', imageHeight);
261
- },
262
-
263
- /**
264
- * @param {number} responseFieldIndex Index of response field
265
- * @description Verify set correct answer response field label
266
- */
267
- verifyResponseFieldLabelInSetCorrectAnswerSection: (responseFieldIndex) => {
268
- utilities.verifyInnerText(figOverImageCommonComponent.setCorrectAnswerResponseFieldLabel().eq(responseFieldIndex), `Response ${responseFieldIndex + 1}`);
269
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.setCorrectAnswerResponseFieldLabel().eq(responseFieldIndex), 'visible');
270
- },
271
-
272
- /**
273
- * Verifies the points input field in an alternate tab when the "Match from All Responses" option is checked.
274
- * @param {number} count - The index of the points input field to verify.
275
- * @param {string} points - The expected points value to check for.
276
- */
277
- verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked: (count, points) => {
278
- scoringSectionBase.pointsInputField()
279
- .eq(count)
280
- .should('have.value', points)
281
- .and('be.disabled');
282
- },
283
-
284
- /**
285
- * @param {string} altTextValue alternative text of the added image in image section
286
- * @description this function verifies the alternative text of the added image in image section
287
- */
288
- verifyImageAltTextAttributeImageSection: (altTextValue) => {
289
- figOverImageCommonComponent.imageSectionImage()
290
- .should('have.attr', 'alt', altTextValue);
291
- },
292
-
293
- /**
294
- * @param {string} altTextValue alternative text of the added image in preview tab
295
- * @description this function verifies the alternative text of the added image in preview tab
296
- */
297
- verifyImageAltTextAttributePreviewTab: (altTextValue) => {
298
- figOverImageCommonComponent.imagePreviewTab()
299
- .should('have.attr', 'alt', altTextValue);
300
- },
301
-
302
- /**
303
- * @param {number} imageWidth width of image in image section
304
- * @description this function verifies the width of image in image section
305
- */
306
- verifyImageWidthInImageSection: (imageWidth) => {
307
- figOverImageCommonComponent.imageSectionImage()
308
- .should('be.visible')
309
- .and('have.css', 'width', `${imageWidth}px`)
310
- },
311
-
312
- /**
313
- * @param {number} imageWidth width of image in preview tab
314
- * @description this function verifies the width of image in preview tab
315
- */
316
- verifyImageWidthInPreviewTab: (imageWidth) => {
317
- figOverImageCommonComponent.imagePreviewTab()
318
- .should('be.visible')
319
- .and('have.css', 'width', `${imageWidth}px`)
320
- },
321
-
322
- /**
323
- * @param {number} imageHeight height of image in image section
324
- * @description this function verifies the height of image in image section
325
- */
326
- verifyImageHeightInImageSection: (imageHeight) => {
327
- figOverImageCommonComponent.imageSectionImage()
328
- .should('be.visible')
329
- .and('have.css', 'height', `${imageHeight}px`)
330
- },
331
-
332
- /**
333
- * @param {number} imageHeight height of image in preview tab
334
- * @description this function verifies the height of image in preview tab
335
- */
336
- verifyImageHeightInPreviewTab: (imageHeight) => {
337
- figOverImageCommonComponent.imagePreviewTab()
338
- .should('be.visible')
339
- .and('have.css', 'height', `${imageHeight}px`)
340
- },
341
-
342
- /**
343
- * Verifies the value of a placeholder text input field.
344
- * @param {string} value - The expected value to match the placeholder text input field.
345
- */
346
- verifyPlaceholderTextInputFieldValue: (value) => {
347
- figOverImageCommonComponent.placeholderTextInputField()
348
- .should('have.value', value)
349
- },
350
-
351
- /**
352
- * Verifies the value of an input field for additional settings' height.
353
- * @param {string} value - The expected value to match the input field.
354
- */
355
- verifyAdditionalSettingsHeightInputFieldValue: (value) => {
356
- figOverImageCommonComponent.responseFieldHeightInputField()
357
- .should('have.attr', 'value', value)
358
- },
359
-
360
- /**
361
- * Verifies the value of an input field for additional settings' width.
362
- * @param {string} value - The expected value to match the input field.
363
- */
364
- verifyAdditionalSettingsWidthInputFieldValue: (value) => {
365
- figOverImageCommonComponent.responseFieldWidthInputField()
366
- .should('have.attr', 'value', value)
367
- },
368
-
369
- verifyFixPositionOnImageCheckboxUnchecked: () => {
370
- figOverImageCommonComponent.fixPositionOnImageCheckbox()
371
- .should('not.be.checked');
372
- },
373
-
374
- /**
375
- * Sets the placeholder text for a response field.
376
- * @param {string} placeholderText - The placeholder text to set in the response field.
377
- */
378
- setResponseFieldPlaceholderTextGlobal: (placeholderText) => {
379
- figOverImageCommonComponent.placeholderTextInputField()
380
- .eq(0)
381
- .type(placeholderText, { delay: 0 })
382
- .should('have.value', placeholderText)
383
- },
384
-
385
- clearPlaceholderTextInputFieldGlobal: () => {
386
- figOverImageCommonComponent.placeholderTextInputField()
387
- .eq(0)
388
- .clear();
389
- },
390
-
391
- /**
392
- * Set the width of a response field in the additional settings for all response areas.
393
- * @param {number} width - The width value to set for the response field.
394
- */
395
- setResponseFieldWidthGlobal: (width) => {
396
- figOverImageCommonComponent.responseFieldWidthInputField()
397
- .eq(0)
398
- .clear()
399
- .type(`${width}`, { delay: 0 })
400
- .should('have.value', width)
401
- .blur();
402
- },
403
-
404
- /**
405
- * Set the height of a response field in the additional settings for all response areas.
406
- * @param {number} height - The height value to set for the response field.
407
- */
408
- setResponseFieldHeightGlobal: (height) => {
409
- figOverImageCommonComponent.responseFieldHeightInputField()
410
- .eq(0)
411
- .clear()
412
- .type(`${height}`, { delay: 0 })
413
- .should('have.value', height)
414
- .blur();
415
- },
416
-
417
- /**
418
- * Verify the label and input field for a placeholder text in a response accordion.
419
- * @param {number} responseAccordionIndex - The index of the response accordion to verify.
420
- */
421
- verifyPlaceholderTextLabelAndInputFieldResponseAccordion: (responseAccordionIndex) => {
422
- figOverImageCommonComponent.responseAccordionWrapper()
423
- .eq(responseAccordionIndex)
424
- .within(() => {
425
- utilities.verifyInnerText(figOverImageCommonComponent.placeholderTextLabelResponseAccordion(), 'Placeholder text');
426
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.placeholderTextLabelResponseAccordion(), 'visible');
427
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.placeholderTextInputField(), 'visible');
428
- figOverImageCommonComponent.steps.verifyPlaceholderTextInputFieldValue('');
429
- });
430
- },
431
-
432
- /**
433
- * Verify the label and dropdown for a pointer in a response accordion.
434
- * @param {number} responseAccordionIndex - The index of the response accordion to verify.
435
- */
436
- verifyPointerLabelAndDropdownResponseAccordion: (responseAccordionIndex) => {
437
- figOverImageCommonComponent.responseAccordionWrapper()
438
- .eq(responseAccordionIndex)
439
- .within(() => {
440
- utilities.verifyInnerText(figOverImageCommonComponent.pointerLabel(), 'Pointer');
441
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerLabel(), 'visible');
442
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerDropdown(), 'visible');
443
- utilities.verifyInnerText(figOverImageCommonComponent.pointerDropdown(), 'Left');
444
- });
445
- },
446
-
447
- /**
448
- * Verify the label and input fields for height and width in a response accordion.
449
- * @param {number} responseAccordionIndex - The index of the response accordion to verify.
450
- */
451
- verifyHeightAndWidthLabelAndInputFieldResponseAccordion: (responseAccordionIndex) => {
452
- figOverImageCommonComponent.responseAccordionWrapper()
453
- .eq(responseAccordionIndex)
454
- .within(() => {
455
- utilities.verifyInnerText(figOverImageCommonComponent.responseFieldHeightLabel(), 'Height (px)');
456
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseFieldHeightLabel(), 'visible');
457
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseFieldHeightInputField(), 'visible');
458
- figOverImageCommonComponent.steps.verifyAdditionalSettingsHeightInputFieldValue('');
459
- utilities.verifyInnerText(figOverImageCommonComponent.responseFieldWidthLabel(), 'Width (px)');
460
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseFieldWidthLabel(), 'visible');
461
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseFieldWidthInputField(), 'visible');
462
- figOverImageCommonComponent.steps.verifyAdditionalSettingsWidthInputFieldValue('');
463
- });
464
- },
465
-
466
- /**
467
- * Verify the collapsed state of a response accordion.
468
- * @param {number} responseAccordionIndex - The index of the response accordion to verify.
469
- */
470
- verifyResponseAccordionCollapsedState: (responseAccordionIndex) => {
471
- figOverImageCommonComponent.responseAccordion()
472
- .eq(responseAccordionIndex)
473
- .should('have.attr', 'aria-expanded', 'false')
474
- },
475
-
476
- /**
477
- * Expand a response accordion.
478
- * @param {number} responseAccordionIndex - The index of the response accordion to expand.
479
- */
480
- expandResponseAccordion: (responseAccordionIndex) => {
481
- figOverImageCommonComponent.responseAccordion()
482
- .eq(responseAccordionIndex)
483
- .click()
484
- .should('have.attr', 'aria-expanded', 'true');
485
- },
486
-
487
- /**
488
- * Collapse a response accordion.
489
- * @param {number} responseAccordionIndex - The index of the response accordion to collapse.
490
- */
491
- collapseResponseAccordion: (responseAccordionIndex) => {
492
- figOverImageCommonComponent.responseAccordionWrapper()
493
- .eq(responseAccordionIndex)
494
- .click()
495
- .should('have.attr', 'aria-expanded', 'false');
496
- },
497
-
498
- /**
499
- * Set placeholder text in a response accordion.
500
- * @param {number} responseAccordionIndex - The index of the response accordion to set placeholder text in.
501
- * @param {string} textContent - The placeholder text to set.
502
- */
503
- setPlaceholderTextInResponseAccordion: (responseAccordionIndex, textContent) => {
504
- figOverImageCommonComponent.responseAccordionWrapper()
505
- .eq(responseAccordionIndex)
506
- .within(() => {
507
- figOverImageCommonComponent.placeholderTextInputField()
508
- .type(textContent)
509
- .should('have.value', textContent);
510
- });
511
- },
512
-
513
- /**
514
- * Clear placeholder text in a response accordion.
515
- * @param {number} responseAccordionIndex - The index of the response accordion to clear placeholder text in.
516
- */
517
- clearPlaceholderTextInResponseAccordion: (responseAccordionIndex) => {
518
- figOverImageCommonComponent.responseAccordionWrapper()
519
- .eq(responseAccordionIndex)
520
- .within(() => {
521
- figOverImageCommonComponent.placeholderTextInputField()
522
- .clear();
523
- });
524
- },
525
-
526
- /**
527
- * Set the width value in a response accordion.
528
- * @param {number} responseAccordionIndex - The index of the response accordion to set width value in.
529
- * @param {number} value - The width value to set.
530
- */
531
- setWidthInResponseAccordion: (responseAccordionIndex, value) => {
532
- figOverImageCommonComponent.responseAccordionWrapper()
533
- .eq(responseAccordionIndex)
534
- .within(() => {
535
- figOverImageCommonComponent.responseFieldWidthInputField()
536
- .clear()
537
- .type(`${value}`)
538
- .should('have.value', value);
539
- });
540
- },
541
-
542
- /**
543
- * Set the height value in a response accordion.
544
- * @param {number} responseAccordionIndex - The index of the response accordion to set height value in.
545
- * @param {number} value - The height value to set.
546
- */
547
- setHeightInResponseAccordion: (responseAccordionIndex, value) => {
548
- figOverImageCommonComponent.responseAccordionWrapper()
549
- .eq(responseAccordionIndex)
550
- .within(() => {
551
- figOverImageCommonComponent.responseFieldHeightInputField()
552
- .clear()
553
- .type(`${value}`)
554
- .should('have.value', value);
555
- });
556
- },
557
-
558
- verifyDisabledStateOfEditAriaLabelsForResponseContainersCheckbox: () => {
559
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.editAriaLabelForResponseContainersLabel(), 'visible');
560
- figOverImageCommonComponent.editAriaLabelForResponseContainersCheckbox()
561
- .should('be.disabled');
562
- },
563
-
564
- verifyDefaultEnabledStateOfEditAriaLabelsForResponseContainersCheckbox: () => {
565
- figOverImageCommonComponent.editAriaLabelForResponseContainersCheckbox()
566
- .should('be.enabled');
567
- figOverImageCommonComponent.editAriaLabelForResponseContainersCheckbox()
568
- .should('not.be.checked');
569
- },
570
-
571
- checkEditAriaLabelCheckbox: () => {
572
- figOverImageCommonComponent.editAriaLabelForResponseContainersCheckbox()
573
- .click()
574
- .should('be.checked');
575
- },
576
-
577
- uncheckEditAriaLabelCheckbox: () => {
578
- figOverImageCommonComponent.editAriaLabelForResponseContainersCheckbox()
579
- .click()
580
- .should('not.be.checked');
581
- },
582
-
583
- /**
584
- * @param {number} numberOfAriaLabelInputFields Total number of edit aria label input fields
585
- * @description Verify contents of edit aria label input fields
586
- */
587
- verifyEditAriaLabelInputFieldContents: (numberOfAriaLabelInputFields) => {
588
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.ariaLabelsInputField(), 'visible');
589
- figOverImageCommonComponent.ariaLabelsInputField()
590
- .each(($el) => {
591
- cy.wrap($el)
592
- .should('have.attr', 'placeholder', 'Enter label');
593
- });
594
- for (let index = 0; index < numberOfAriaLabelInputFields; index++) {
595
- utilities.verifyTextContent(figOverImageCommonComponent.ariaLabelsInputFieldNumeration().eq(index), `${index + 1}`);
596
- }
597
- utilities.verifyElementCount(figOverImageCommonComponent.ariaLabelsInputFieldNumeration(), `${numberOfAriaLabelInputFields}`);
598
- },
599
-
600
- /**
601
- * @param {number} index Index of aria-label input field
602
- * @param {string} responseContainerAriaLabel Text to be given as aria-label for response container/dropdown
603
- * @description Enter text in edit aria-label input field
604
- */
605
- enterTextInEditAriaLabelInputField: (index, responseContainerAriaLabel) => {
606
- figOverImageCommonComponent.ariaLabelsInputField()
607
- .eq(index)
608
- .clear()
609
- .type(responseContainerAriaLabel)
610
- .should('have.value', responseContainerAriaLabel);
611
- },
612
-
613
- /**
614
- * @param {number} index Index of aria-label input field
615
- * @description Clear aria-label input field
616
- */
617
- clearEditAriaLabelInputField: (index) => {
618
- figOverImageCommonComponent.ariaLabelsInputField()
619
- .eq(index)
620
- .clear();
621
- },
622
-
623
- /**
624
- * @param {number} index Index of response container
625
- * @param {string} ariaLabel Aria-label of response container
626
- * @description Verify aria-label of response container
627
- */
628
- verifyResponseContainerAriaLabelAttribute: (index, ariaLabel) => {
629
- figOverImageCommonComponent.responseContainer()
630
- .eq(index)
631
- .find('.draggable-input')
632
- .should('have.attr', 'aria-label', ariaLabel);
633
- },
634
-
635
- verifyResponseAccordionLabel: (responseAccordionIndex) => {
636
- utilities.verifyInnerText(figOverImageCommonComponent.responseAccordionLabel().eq(responseAccordionIndex), `Response ${responseAccordionIndex + 1}`);
637
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.responseAccordionLabel().eq(responseFieldIndex), 'visible');
638
- },
639
-
640
- /**
641
- * @param {string} fileFormat format of the uploaded file in the image section
642
- * @description this function verifies the attribute of the image has the expected file format
643
- */
644
- verifyUploadedImageFormatInImageSection: (fileFormat) => {
645
- figOverImageCommonComponent.imageSectionImage()
646
- .should(($element) => {
647
- const srcAttributeValue = $element.attr('src');
648
- expect(srcAttributeValue).to.include(fileFormat);
649
- });
650
- },
651
-
652
- /**
653
- * @param {string} fileFormat format of the uploaded file in the image section
654
- * @description this function verifies the attribute of the image has the expected file format
655
- */
656
- verifyUploadedImageFormatInPreviewTab: (fileFormat) => {
657
- figOverImageCommonComponent.imagePreviewTab()
658
- .should(($element) => {
659
- const srcAttributeValue = $element.attr('src');
660
- expect(srcAttributeValue).to.include(fileFormat);
661
- });
662
- },
663
-
664
- /**
665
- * @param {number} dropdownOptionIndex of the pointer dropdown option
666
- * @param {number} responseIndex index of the reponse container
667
- * @description this function verifies the pointer position of response accordion
668
- */
669
- verifyResponseContainerPointerInImageSection: (responseIndex, dropdownOptionIndex) => {
670
- figOverImageCommonComponent.responseContainerCloseButton()
671
- .eq(responseIndex)
672
- .should('have.attr', 'pointer', dropdownOptionIndex + 1)
673
- },
674
-
675
- /**
676
- * @param {number} responseAccordionIndex index of the response accordion
677
- * @param {string} dropdownOption aria-label of the dropdown option
678
- * @description this function selects the dropdown option from response accordion
679
- */
680
- selectOptionFromPointerDropdownResponseAccordion: (responseAccordionIndex, dropdownOption) => {
681
- figOverImageCommonComponent.responseAccordionWrapper()
682
- .eq(responseAccordionIndex)
683
- .within(() => {
684
- figOverImageCommonComponent.pointerDropdown()
685
- .click();
686
- figOverImageCommonComponent.pointerDropdownListOptions(dropdownOption)
687
- .click();
688
- figOverImageCommonComponent.pointerDropdown()
689
- .should('have.text', dropdownOption);
690
- });
691
- },
692
-
693
- /**
694
- * @param {string} dropdownOption aria-label of the dropdown option
695
- * @description this function selects the dropdown option from response accordion
696
- */
697
- selectOptionFromPointerDropdownGlobal: (dropdownOption) => {
698
- figOverImageCommonComponent.pointerDropdown()
699
- .eq(0)
700
- .click();
701
- figOverImageCommonComponent.pointerDropdownListOptions(dropdownOption)
702
- .click();
703
- figOverImageCommonComponent.pointerDropdown()
704
- .eq(0)
705
- .should('have.text', dropdownOption);
706
- },
707
-
708
- expandPointerDropdownGlobal: () => {
709
- figOverImageCommonComponent.pointerDropdown()
710
- .eq(0)
711
- .click();
712
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerDropdownListOptions(), 'visible');
713
- },
714
-
715
- /**
716
- * @param {number} responseAccordionIndex index of the response accordion
717
- * @description this function expands the pointer dropdown in response accordion
718
- */
719
- expandPointerDropdownResponseAccordion: (responseAccordionIndex) => {
720
- figOverImageCommonComponent.responseAccordionWrapper()
721
- .eq(responseAccordionIndex)
722
- .within(() => {
723
- figOverImageCommonComponent.pointerDropdown()
724
- .click();
725
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerDropdownListOptions(), 'visible');
726
- });
727
- },
728
-
729
- verifyDisplayAnswerNumerationToStudentsCheckboxNotChecked: () => {
730
- figOverImageCommonComponent.displayAnswerNumerationToStudentsCheckbox()
731
- .should('not.be.checked');
732
- },
733
-
734
- checkDisplayAnswerNumerationToStudentsCheckbox: () => {
735
- figOverImageCommonComponent.displayAnswerNumerationToStudentsCheckbox()
736
- .click()
737
- .should('be.checked');
738
- },
739
-
740
- verifyImageSectionErrorMessage: () => {
741
- figOverImageCommonComponent.uploadImageSectionWrapper()
742
- .within(() => {
743
- commonComponents.errorMessage()
744
- .should('have.text', 'Error: image is required.')
745
- .and('be.visible');
746
- });
747
- },
748
-
749
- verifyImageSectionErrorMessageNotExists: () => {
750
- figOverImageCommonComponent.uploadImageSectionWrapper()
751
- .within(() => {
752
- commonComponents.errorMessage()
753
- .should('not.exist');
754
- });
755
- },
756
-
757
- verifyMinimumOneResponseContainerIsRequiredErrorMessage: () => {
758
- figOverImageCommonComponent.imageSectionContentsWrapper()
759
- .within(() => {
760
- commonComponents.errorMessage()
761
- .should('have.text', 'Error: Minimum one response container is required.')
762
- .and('be.visible');
763
- });
764
- },
765
-
766
- verifyMinimumOneResponseContainerIsRequiredErrorMessageNotExists: () => {
767
- figOverImageCommonComponent.imageSectionContentsWrapper()
768
- .within(() => {
769
- commonComponents.errorMessage()
770
- .should('not.exist');
771
- });
772
- }
773
- }
774
-
775
- const tests = {
776
- verifyMaximumNumberOfTokensSnackbarCSSandA11y: () => {
777
- it('CSS of maximum number of tokens snackbar', { tags: 'css' }, () => {
778
- utilities.verifyCSS(commonComponents.snackbar(), {
779
- 'color': css.color.whiteText,
780
- 'font-size': css.fontSize.normal,
781
- 'font-weight': css.fontWeight.regular
782
- });
783
- });
784
- it('Accessibility of maximum number of tokens snackbar', { tags: 'a11y' }, () => {
785
- cy.checkAccessibility(commonComponents.snackbar());
786
- });
787
- },
788
-
789
- verifyDisabledStateOfAddResponseContainerButton: () => {
790
- it('When user has added 15 response containers in the image section, then the \'Add response container\' button should be disabled', () => {
791
- figOverImageCommonComponent.addResponseContainerButton()
792
- .should('be.disabled');
793
- });
794
-
795
- it('CSS of disabled \'Add response container\' button', { tags: 'css' }, () => {
796
- utilities.verifyCSS(figOverImageCommonComponent.addResponseContainerButton(), {
797
- 'color': css.color.secondaryBtnDisabled
798
- })
799
- });
800
-
801
- it('Accessibility of disabled \'Add response container\' button', { tags: 'a11y' }, () => {
802
- cy.checkAccessibility(figOverImageCommonComponent.addResponseContainerButton());
803
- });
804
- },
805
-
806
- verifySetCorrectAnswerSectionDefaultState: () => {
807
- it('When the user has not added any response containers over an image, A help text \'Please add response tokens\' should be displayed in the set correct answer section', () => {
808
- utilities.verifyInnerText(figOverImageCommonComponent.pleaseAddResponseTokenHelpText(), 'Please add response tokens');
809
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pleaseAddResponseTokenHelpText(), 'visible');
810
- });
811
-
812
- it(`CSS of \'Please add response tokens\' help text`, { tags: 'css' }, () => {
813
- utilities.verifyCSS(figOverImageCommonComponent.pleaseAddResponseTokenHelpText(), {
814
- 'color': css.color.helperText,
815
- 'font-size': css.fontSize.normal,
816
- 'font-weight': css.fontWeight.regular,
817
- 'font-style': 'italic'
818
- });
819
- });
820
- },
821
-
822
- verifyCustomLabelNotVisibleOnResponseAccordion: (advancedSetting) => {
823
- it(`When user has not set ${advancedSetting} in the input field then Custom label should not be displayed on the response accordion`, () => {
824
- figOverImageCommonComponent.responseAccordionCustomLabel()
825
- .should('not.exist');
826
- });
827
- },
828
-
829
- verifyCustomLabelVisibleOnResponseAccordion: (advancedSetting) => {
830
- it(`When the user sets ${advancedSetting} for a response then Custom label should be displayed on that response accordion and the other accordion should remain the same`, () => {
831
- figOverImageCommonComponent.responseAccordionWrapper()
832
- .eq(0)
833
- .within(() => {
834
- figOverImageCommonComponent.responseAccordionCustomLabel()
835
- .verifyInnerText('Custom')
836
- .should('be.visible');
837
- });
838
- figOverImageCommonComponent.responseAccordionWrapper()
839
- .eq(1)
840
- .within(() => {
841
- figOverImageCommonComponent.responseAccordionCustomLabel()
842
- .should('not.exist');
843
- });
844
- });
845
- },
846
-
847
- verifyImagePropertiesSectionContents: () => {
848
- it('When the user has not added an image, the image properties section and it\'s contents should not be displayed', () => {
849
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageSectionImage(), 'notExist');
850
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imagePropertiesContainer(), 'notExist');
851
- });
852
-
853
- it('When the user adds an image, \'Image hover text\' label and empty input field, \'Image alternative text\' label and empty input field should be displayed', () => {
854
- uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
855
- figOverImageCommonComponent.steps.clickOnImagePopupOkButton();
856
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageSectionImage(), 'visible');
857
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageHoverTextLabel(), 'visible');
858
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageHoverTextInputField(), 'visible');
859
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageAlternativeTextLabel(), 'visible');
860
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.imageAlternativeTextInputField(), 'visible');
861
- });
862
-
863
- it('When the user has added an image, \'Height (px)\' label and input field, \'Width (px)\' label and input field with prefilled values of the image height and width should be displayed', () => {
864
- utilities.verifyInnerText(figOverImageCommonComponent.heightLabel(), 'Height (px)');
865
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.heightLabel(), 'visible');
866
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.heightInputField(), 'visible');
867
- utilities.verifyInnerText(figOverImageCommonComponent.widthLabel(), 'Width (px)');
868
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.widthLabel(), 'visible');
869
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.widthInputField(), 'visible');
870
- figOverImageCommonComponent.steps.verifyHeightInputFieldValue(500);
871
- figOverImageCommonComponent.steps.verifyWidthInputFieldValue(500);
872
- });
873
-
874
- it('CSS of image properties section', { tags: 'css' }, () => {
875
- const labelCSS = {
876
- 'color': css.color.labels,
877
- 'font-size': css.fontSize.normal,
878
- 'font-weight': css.fontWeight.semibold
879
- }
880
- const inputFieldCSS = {
881
- 'color': css.color.text,
882
- 'font-size': css.fontSize.default,
883
- 'font-weight': css.fontWeight.regular
884
- }
885
- utilities.verifyCSS(figOverImageCommonComponent.imageHoverTextLabel(), labelCSS);
886
- utilities.verifyCSS(figOverImageCommonComponent.imageAlternativeTextLabel(), labelCSS);
887
- utilities.verifyCSS(figOverImageCommonComponent.widthLabel(), labelCSS);
888
- utilities.verifyCSS(figOverImageCommonComponent.heightLabel(), labelCSS);
889
- utilities.verifyCSS(figOverImageCommonComponent.imageHoverTextInputField(), inputFieldCSS);
890
- utilities.verifyCSS(figOverImageCommonComponent.imageAlternativeTextInputField(), inputFieldCSS);
891
- utilities.verifyCSS(figOverImageCommonComponent.widthInputField(), inputFieldCSS);
892
- utilities.verifyCSS(figOverImageCommonComponent.heightInputField(), inputFieldCSS);
893
- });
894
-
895
- it('Accessibility of image properties section', { tags: 'a11y' }, () => {
896
- cy.checkAccessibility(figOverImageCommonComponent.imageHoverTextLabel().parents('.common-text-wrapper'));
897
- });
898
- },
899
-
900
- verifyImageHoverAndAlternativeTextFunctionalityInEditTab: () => {
901
- it('The user should be able to enter text in the \'Image hover text\' input field, on hovering over the image, the entered text should appear on a tooltip and on hovering away from the image, the tooltip should disappear', () => {
902
- figOverImageCommonComponent.steps.enterTextInImageHoverTextInputField('Flower');
903
- figOverImageCommonComponent.imageSectionImage()
904
- .verifyTooltip('Flower');
905
- });
906
-
907
- it('CSS of the image tooltip', { tags: 'css' }, () => {
908
- utilities.hoverOverElement(figOverImageCommonComponent.imageSectionImage());
909
- utilities.verifyCSS(commonComponents.tooltipText(), {
910
- 'color': css.color.whiteText,
911
- 'font-size': css.fontSize.normal,
912
- 'font-weight': css.fontWeight.regular
913
- });
914
- utilities.hoverAwayFromElement(figOverImageCommonComponent.imageSectionImage());
915
- });
916
-
917
- it('Accessibility of the image tooltip', { tags: 'a11y' }, () => {
918
- utilities.hoverOverElement(figOverImageCommonComponent.imageSectionImage());
919
- cy.checkAccessibility(commonComponents.tooltipText());
920
- utilities.hoverAwayFromElement(figOverImageCommonComponent.imageSectionImage());
921
- });
922
-
923
- it('When the user clears the text from the \'Image hover text\' input field, on hovering over the image, no tooltip should appear', () => {
924
- figOverImageCommonComponent.steps.clearTextFromImageHoverTextInputField();
925
- utilities.hoverOverElement(figOverImageCommonComponent.imageSectionImage());
926
- utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
927
- });
928
-
929
- //Update after https://redmine.zeuslearning.com/issues/546992 is resolved
930
- it('When the user has not added any alternative text in the \'Image alternative text\' input field, the \'alt\' attribute of the added image should be blank', () => {
931
- figOverImageCommonComponent.steps.verifyImageAltTextAttributeImageSection('');
932
- });
933
-
934
- it('When the user enters text in the \'Image alternative text\' input field, the added text should appear as the \'alt\' attribute of the added image', () => {
935
- figOverImageCommonComponent.steps.enterTextInImageAlternativeTextInputField(constants.flowerImageAltText);
936
- figOverImageCommonComponent.steps.verifyImageAltTextAttributeImageSection(constants.flowerImageAltText);
937
- });
938
-
939
- it('When the user clears the text in the \'Image alternative text\' input field, the \'alt\' attribute of the added image should again appear as blank', () => {
940
- figOverImageCommonComponent.steps.clearTextFromImageAlternativeTextInputField();
941
- figOverImageCommonComponent.steps.verifyImageAltTextAttributeImageSection('');
942
- });
943
- },
944
-
945
- verifyImageHoverAndAlternativeTextFunctionalityInPreviewTab: () => {
946
- it('When the user adds text in the \'Image hover text\' input field and switches to the preview tab, on hovering over the image, the entered text should appear on a tooltip and on hovering away from the image, the tooltip should disappear', () => {
947
- figOverImageCommonComponent.steps.enterTextInImageHoverTextInputField('Flower');
948
- createQuestionBasePage.steps.switchToPreviewTab();
949
- figOverImageCommonComponent.imagePreviewTab()
950
- .verifyTooltip('Flower');
951
- });
952
-
953
- it('CSS of the image tooltip', { tags: 'css' }, () => {
954
- utilities.hoverOverElement(figOverImageCommonComponent.imagePreviewTab());
955
- utilities.verifyCSS(commonComponents.tooltipText(), {
956
- 'color': css.color.whiteText,
957
- 'font-size': css.fontSize.normal,
958
- 'font-weight': css.fontWeight.regular
959
- });
960
- utilities.hoverAwayFromElement(figOverImageCommonComponent.imagePreviewTab());
961
- });
962
-
963
- it('Accessibility of the image tooltip', { tags: 'a11y' }, () => {
964
- utilities.hoverOverElement(figOverImageCommonComponent.imagePreviewTab());
965
- cy.checkAccessibility(commonComponents.tooltipText());
966
- utilities.hoverAwayFromElement(figOverImageCommonComponent.imagePreviewTab());
967
- });
968
-
969
- it('When the user clears the text from the \'Image hover text\' input field and switches to the preview tab, on hovering over the image, no tooltip should appear', () => {
970
- createQuestionBasePage.steps.switchToEditTab();
971
- figOverImageCommonComponent.steps.clearTextFromImageHoverTextInputField();
972
- createQuestionBasePage.steps.switchToPreviewTab();
973
- utilities.hoverOverElement(figOverImageCommonComponent.imagePreviewTab());
974
- utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
975
- });
976
-
977
- it('When the user has not added any alternative text in the \'Image alternative text\' input field, the \'alt\' attribute of the added image in the preview tab should be blank', () => {
978
- figOverImageCommonComponent.steps.verifyImageAltTextAttributePreviewTab('');
979
- });
980
-
981
- it('When the user enters text in the \'Image alternative text\' input field, the added text should appear as the \'alt\' attribute of the added image in the preview tab', () => {
982
- createQuestionBasePage.steps.switchToEditTab();
983
- figOverImageCommonComponent.steps.enterTextInImageAlternativeTextInputField(constants.flowerImageAltText);
984
- createQuestionBasePage.steps.switchToPreviewTab();
985
- figOverImageCommonComponent.steps.verifyImageAltTextAttributePreviewTab(constants.flowerImageAltText);
986
- });
987
-
988
- it('When the user clears the text in the \'Image alternative text\' input field, the \'alt\' attribute of the added image should again appear as blank', () => {
989
- createQuestionBasePage.steps.switchToEditTab();
990
- figOverImageCommonComponent.steps.clearTextFromImageAlternativeTextInputField();
991
- createQuestionBasePage.steps.switchToPreviewTab();
992
- figOverImageCommonComponent.steps.verifyImageAltTextAttributePreviewTab('');
993
- });
994
- },
995
-
996
- verifyImagePropertiesHeightAndWidthInputFieldInEditTab: () => {
997
- it('When the user updates the value in the height input field, the height of the added image should update accordingly', () => {
998
- figOverImageCommonComponent.steps.enterTextInHeightInputField(250);
999
- figOverImageCommonComponent.steps.verifyImageHeightInImageSection(250);
1000
- });
1001
-
1002
- it('When the user updates the value in the width input field, the width of the added image should update accordingly', () => {
1003
- figOverImageCommonComponent.steps.enterTextInWidthInputField(250);
1004
- figOverImageCommonComponent.steps.verifyImageWidthInImageSection(250);
1005
- });
1006
- },
1007
-
1008
- verifyImagePropertiesHeightAndWidthInputFieldInPreviewTab: () => {
1009
- it('When the user updates the value in the height input field, the height of the added image should update accordingly', () => {
1010
- figOverImageCommonComponent.steps.enterTextInHeightInputField(250);
1011
- createQuestionBasePage.steps.switchToPreviewTab();
1012
- figOverImageCommonComponent.steps.verifyImageHeightInPreviewTab(250);
1013
- });
1014
-
1015
- it('When the user updates the value in the width input field, the width of the added image should update accordingly', () => {
1016
- createQuestionBasePage.steps.switchToEditTab();
1017
- figOverImageCommonComponent.steps.enterTextInWidthInputField(250);
1018
- createQuestionBasePage.steps.switchToPreviewTab();
1019
- figOverImageCommonComponent.steps.verifyImageWidthInPreviewTab(250);
1020
- });
1021
- },
1022
-
1023
- verifyPointerDropdownContentsResponseAccordion: () => {
1024
- it('Response accordion \'Pointer\' label and dropdown should be displayed and by default \'Left\' option should be selected', () => {
1025
- figOverImageCommonComponent.responseAccordionWrapper()
1026
- .eq(0)
1027
- .within(() => {
1028
- utilities.verifyInnerText(figOverImageCommonComponent.pointerLabel(), 'Pointer');
1029
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerLabel(), 'visible');
1030
- utilities.verifyInnerText(figOverImageCommonComponent.pointerDropdown(), 'Left');
1031
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerDropdown(), 'visible');
1032
- })
1033
- });
1034
-
1035
- it(`Clicking on Pointer dropdown should open a list of 6 options - ${pointerDropdownList}`, () => {
1036
- figOverImageCommonComponent.steps.expandPointerDropdownResponseAccordion(0);
1037
- pointerDropdownList.forEach((option) => {
1038
- figOverImageCommonComponent.pointerDropdownListOptions(option)
1039
- .verifyInnerText(option);
1040
- utilities.verifyInnerText(figOverImageCommonComponent.pointerDropdownListOptions(option), `${option}`);
1041
- });
1042
- cy.get('body')
1043
- .click();
1044
- });
1045
- },
1046
-
1047
- verifyPointerDropdownContentsGlobal: () => {
1048
- it('\'Pointer\' label and dropdown should be displayed and by default \'Left\' option should be selected', () => {
1049
- utilities.verifyInnerText(figOverImageCommonComponent.pointerLabel(), 'Pointer');
1050
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerLabel(), 'visible');
1051
- utilities.verifyInnerText(figOverImageCommonComponent.pointerDropdown(), 'Left');
1052
- utilities.verifyElementVisibilityState(figOverImageCommonComponent.pointerDropdown(), 'visible');
1053
- });
1054
-
1055
- it('CSS of \'Pointer\' dropdown', { tags: 'css' }, () => {
1056
- utilities.verifyCSS(figOverImageCommonComponent.pointerLabel(), {
1057
- 'color': css.color.labels,
1058
- 'font-size': css.fontSize.normal,
1059
- 'font-weight': css.fontWeight.semibold
1060
- });
1061
- utilities.verifyCSS(figOverImageCommonComponent.pointerDropdown(), {
1062
- 'color': css.color.liText,
1063
- 'font-size': css.fontSize.default,
1064
- 'font-weight': css.fontWeight.regular
1065
- });
1066
- });
1067
-
1068
- // Note: a11y is covered for the entire additional settings section
1069
-
1070
- it(`Clicking on Pointer dropdown should open a a list of 6 options - ${pointerDropdownList}`, () => {
1071
- figOverImageCommonComponent.steps.expandPointerDropdownGlobal();
1072
- pointerDropdownList.forEach((option) => {
1073
- figOverImageCommonComponent.pointerDropdownListOptions(option)
1074
- .verifyInnerText(option);
1075
- utilities.verifyInnerText(figOverImageCommonComponent.pointerDropdownListOptions(option), `${option}`);
1076
- });
1077
- cy.get('body')
1078
- .click();
1079
- });
1080
-
1081
- it('CSS of Pointer dropdown in Active state', { tags: 'css' }, () => {
1082
- cy.log('Pre step: Clicking on Pointer dropdown')
1083
- figOverImageCommonComponent.steps.expandPointerDropdownGlobal();
1084
- utilities.verifyCSS(figOverImageCommonComponent.pointerDropdownListOptions('Left'), {
1085
- 'color': css.color.liText,
1086
- 'font-size': css.fontSize.default,
1087
- 'font-weight': css.fontWeight.regular,
1088
- 'background-color': css.color.liTextSelectedBg
1089
- });
1090
- utilities.verifyCSS(figOverImageCommonComponent.pointerDropdownListOptions('Right'), {
1091
- 'background-color': css.color.transparent
1092
- });
1093
- cy.log('Post step: Closing the Pointer dropdown')
1094
- cy.get('body')
1095
- .click();
1096
- });
1097
-
1098
- it('Accessibility of Pointer dropdown in active state', { tags: 'a11y' }, () => {
1099
- cy.log('Pre step: Clicking on Pointer dropdown')
1100
- figOverImageCommonComponent.steps.expandPointerDropdownGlobal();
1101
- cy.checkAccessibility(figOverImageCommonComponent.pointerDropdownListOptions());
1102
- cy.log('Post step: Closing the Pointer dropdown')
1103
- cy.get('body')
1104
- .click();
1105
- });
1106
- }
1107
- }
1108
-
1109
- export const figOverImageCommonComponent = {
1110
- ...selectors,
1111
- steps,
1112
- tests
1113
- }