itemengine-cypress-automation 1.0.166 → 1.0.169-uploadResponseMigration-83ab996.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +11 -22
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +7 -18
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +6 -11
  5. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -0
  6. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +36 -2
  7. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +34 -22
  8. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +24 -8
  9. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +25 -5
  10. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +114 -68
  11. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +111 -67
  12. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +123 -71
  13. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +63 -41
  14. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +25 -21
  15. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +85 -50
  16. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -68
  17. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +98 -54
  18. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +120 -72
  19. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  20. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  21. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  22. package/cypress/fixtures/theme/ilc.json +26 -14
  23. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  24. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +0 -3
  25. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  26. package/cypress/pages/components/colorPopupComponent.js +2 -2
  27. package/cypress/pages/components/gridQuestionCommonComponent.js +2 -629
  28. package/cypress/pages/components/index.js +0 -3
  29. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  30. package/cypress/pages/components/measuringToolComponent.js +2 -2
  31. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  32. package/cypress/pages/components/setPointsPopupBase.js +4 -6
  33. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +3 -60
  34. package/cypress/pages/components/toolSettingsComponent.js +12 -80
  35. package/cypress/pages/dragAndDropIntoCategoriesPage.js +8 -0
  36. package/cypress/pages/feedbackScalePage.js +449 -591
  37. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +1 -3
  38. package/cypress/pages/graphingPage.js +145 -9
  39. package/cypress/pages/gridFillPage.js +120 -135
  40. package/cypress/pages/highlightPage.js +394 -0
  41. package/cypress/pages/index.js +2 -5
  42. package/cypress/pages/matchingPage.js +20 -78
  43. package/cypress/pages/multipleSelectionGridPage.js +1 -88
  44. package/cypress/pages/singleSelectionGridPage.js +0 -86
  45. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +38 -1
  46. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
  47. package/cypress/support/migrationHelpers/migrationScript.js +4 -0
  48. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +34 -2
  49. package/package.json +2 -2
  50. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +0 -83
  51. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +0 -200
  52. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +0 -56
  53. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +0 -95
  54. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +0 -71
  55. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +0 -72
  56. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +0 -71
  57. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  58. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
  59. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  60. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +0 -308
  61. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +0 -216
  62. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +0 -336
  63. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +0 -570
  64. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +0 -214
  65. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  66. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  67. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +0 -355
  68. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +0 -309
  69. package/cypress/e2e/ILC/Matching/toolSettings.js +0 -72
  70. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +0 -1033
  71. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  72. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +0 -236
  73. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +0 -239
  74. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +0 -278
  75. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +0 -178
  76. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +0 -407
  77. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +0 -273
  78. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +0 -278
  79. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +0 -228
  80. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +0 -120
  81. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +0 -659
  82. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +0 -149
  83. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +0 -151
  84. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +0 -171
  85. package/cypress/e2e/ILC/NumberLine/headerSection.js +0 -76
  86. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -54
  87. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +0 -200
  88. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +0 -67
  89. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +0 -135
  90. package/cypress/e2e/ILC/NumberLine/toolSettings.js +0 -73
  91. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +0 -372
  92. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +0 -1014
  93. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -235
  94. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -235
  95. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -235
  96. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -457
  97. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -342
  98. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -342
  99. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -342
  100. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -155
  101. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -314
  102. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -275
  103. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -314
  104. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -290
  105. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +0 -142
  106. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +0 -137
  107. package/cypress/pages/brainingCampManipulativePage.js +0 -122
  108. package/cypress/pages/components/defaultToolDropdown.js +0 -77
  109. package/cypress/pages/components/resetPopupComponent.js +0 -74
  110. package/cypress/pages/components/toolsAndControlsComponent.js +0 -69
  111. package/cypress/pages/feedbackScalePage copy.js +0 -716
  112. package/cypress/pages/numberLinePage.js +0 -723
  113. package/cypress/pages/textSelectionPage.js +0 -582
@@ -1,582 +0,0 @@
1
- import constants from "../fixtures/constants";
2
- import utilities from "../support/helpers/utilities";
3
- import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from "./components";
4
- import { dialogBoxBase } from "./dialogBoxBase";
5
- import { setPointsPopupBase } from "./components/setPointsPopupBase";
6
- const css = Cypress.env('css');
7
- const colorLibrary = css.textSelectionColorLibrary;
8
-
9
- const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.', 'Birds are creatures with feathers, beaks, and the ability to lay eggs.', 'Many animal species are undocumented even today.', 'Research is going on to discover new species in the far corners of the earth']
10
-
11
- const selectors = {
12
- ...questionInstructionsComponent,
13
- ...autoScoredScoringSectionMultiResponseType,
14
- questionInputField: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] [title="Question"]'),
15
- highlightOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"]'),
16
- textSelectionMode: (ariaLabel = null) => {
17
- if (ariaLabel) {
18
- return cy.get(`.text-selection-mode [type="button"][aria-label*="${ariaLabel}"]`)
19
- } else {
20
- return cy.get('.text-selection-mode [type="button"]')
21
- }
22
- },
23
- highlightOptionsSpans: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] span'),
24
-
25
- //Specify correct answer section
26
- optionSpecifyCorrectAnswer: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
27
- setPointsButton: () => cy.get('[class*="Highlightstyles__SetPointsPopupWrapper"] button'),
28
-
29
- //Preview tab
30
- questionTextPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] p'),
31
- optionPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] .highlighted'),
32
- optionCorrectAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1).find('.highlighted'),
33
- correctAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1),
34
- correctIncorrectAnswerLabelWrapper: () => cy.get('[class*="AnswerStatusWrapper"]'),
35
- correctIncorrectAnswerLabel: () => cy.get('[class*="AnswerStatusText"]'),
36
- correctAnswersLabel: () => cy.get('[class*="Highlightstyles__CorrectAnswerHeader-"]'),
37
- }
38
-
39
- const steps = {
40
- ...createQuestionBasePage.steps,
41
- ...scoringSectionBaseEditTab.steps,
42
- ...autoScoredScoringPreviewTab.steps,
43
- ...questionInstructionsComponent.steps,
44
- ...autoScoredStudentViewSettings.steps,
45
- ...correctIncorrectAnswerLabelComponent.steps,
46
- ...autoScoredSpecifyCorrectAnswerSection.steps,
47
- ...autoScoredScoringSectionMultiResponseType.steps,
48
- addInputToQuestionInputField: (text) => {
49
- textSelectionPage.questionInputField()
50
- .type(text);
51
- },
52
-
53
- clearQuestionInputField: () => {
54
- textSelectionPage.questionInputField()
55
- .clear();
56
- },
57
-
58
- focusInQuestionInputField: () => {
59
- textSelectionPage.questionInputField()
60
- .focus();
61
- },
62
-
63
- focusOutOfQuestionInputField: () => {
64
- textSelectionPage.questionInputField()
65
- .blur();
66
- },
67
-
68
- verifyErroredStateOfQuestionInputField: () => {
69
- utilities.verifyCSS(textSelectionPage.questionInputField(), {
70
- 'border-color': css.color.errorFieldBorder,
71
- 'background-color': css.color.errorFieldBg
72
- });
73
- },
74
-
75
- verifyErroredStateOfHighlightOptionsSection: () => {
76
- utilities.verifyCSS(textSelectionPage.highlightOptionsTextFieldWrapper(), {
77
- 'border-color': css.color.errorFieldBorder,
78
- 'background-color': css.color.errorFieldBg
79
- });
80
- },
81
-
82
- verifyImageAndAltTextInQuestionInputField: () => {
83
- textSelectionPage.questionInputField()
84
- .find('img')
85
- .should('have.attr', 'src', constants.foxImageLink)
86
- .and('have.attr', 'alt', constants.foxImageAltText);
87
- },
88
-
89
- verifyEquationInQuestionInputField: () => {
90
- textSelectionPage.questionInputField()
91
- .find('[data-widget="ngie_equation"]')
92
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
93
- .contains(constants.CKEditorInputFieldEnteredEquationText);
94
- },
95
-
96
- verifyLinkInQuestionInputField: () => {
97
- textSelectionPage.questionInputField()
98
- .find('a')
99
- .should('have.text', 'lorem')
100
- .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
101
- },
102
-
103
- verifyBoldTextInQuestionInputField: () => {
104
- textSelectionPage.questionInputField()
105
- .find('strong')
106
- .should('exist')
107
- .should('have.text', '​​​​​​​This is Bold text input.');
108
- },
109
-
110
- verifyImageAndAltTextInHighlightOptionsSection: () => {
111
- textSelectionPage.highlightOptionsTextFieldWrapper()
112
- .find('img')
113
- .should('have.attr', 'src', constants.foxImageLink)
114
- .and('have.attr', 'alt', constants.foxImageAltText);
115
- },
116
-
117
- verifyEquationInHighlightOptionsSection: () => {
118
- textSelectionPage.highlightOptionsTextFieldWrapper()
119
- .find('span[role="math"]')
120
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
121
- .contains(constants.CKEditorInputFieldEnteredEquationText);
122
- },
123
-
124
- verifyLinkInHighlightOptionsSection: () => {
125
- textSelectionPage.highlightOptionsTextFieldWrapper()
126
- .find('a')
127
- .should('have.text', 'lorem')
128
- .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
129
- },
130
-
131
- verifyBoldTextInHighlightOptionsSection: () => {
132
- textSelectionPage.highlightOptionsTextFieldWrapper()
133
- .find('strong')
134
- .should('exist')
135
- .should('have.text', 'This is Bold text input.lorem');
136
- },
137
-
138
- verifyHighlightOptionsFieldErrorMessage: () => {
139
- textSelectionPage.highlightOptionsTextFieldWrapper()
140
- .next()
141
- .should('have.text', 'Error: Minimum one highlight option is required.');
142
- },
143
-
144
- /**
145
- * @param {string} textSelectionType Type of text selection
146
- * @description Switch text selection type in text selection dropdown
147
- */
148
- switchTextSelectionMode: (textSelectionType) => {
149
- textSelectionPage.textSelectionMode(textSelectionType)
150
- .click();
151
- },
152
-
153
- /**
154
- * @param {string} optionText Text of the option in highlight options section
155
- * @description Click on option in highlight options section
156
- */
157
- clickOnOptionInHighlightOptionsSection: (optionText) => {
158
- textSelectionPage.highlightOptionsSpans()
159
- .contains(optionText)
160
- .click();
161
- },
162
-
163
- /**
164
- * @param {string} optionText Text of the option in set correct answer section
165
- * @description Click on option in set correct answer section
166
- */
167
- clickOnOptionInSpecifyCorrectAnswerSection: (optionText) => {
168
- textSelectionPage.optionSpecifyCorrectAnswer()
169
- .contains(optionText)
170
- .click();
171
- },
172
-
173
- /**
174
- * @param {string} optionText Text of the option in preview tab
175
- * @description Click on option in preview tab
176
- */
177
- clickOnOptionInPreviewTab: (optionText) => {
178
- textSelectionPage.optionPreviewTab()
179
- .contains(optionText)
180
- .click();
181
- },
182
-
183
- /**
184
- * @param {*} optionText Text of the option in set correct answer section
185
- * @description Select an option in set correct answer section
186
- */
187
- selectOptionInSpecifyCorrectAnswerSection: (optionText) => {
188
- textSelectionPage.steps.clickOnOptionInSpecifyCorrectAnswerSection(optionText);
189
- textSelectionPage.steps.verifyOptionIsSelectedInSpecifyCorrectAnswerSection(optionText);
190
- },
191
-
192
- /**
193
- * @param {*} optionText Text of the option in set correct answer section
194
- * @description Deselect an option in set correct answer section
195
- */
196
- deselectOptionInSpecifyCorrectAnswerSection: (optionText) => {
197
- textSelectionPage.steps.clickOnOptionInSpecifyCorrectAnswerSection(optionText);
198
- textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection(optionText);
199
- },
200
-
201
- /**
202
- * @param {*} optionText Text of the option in preview tab
203
- * @description Select an option in preview tab
204
- */
205
- selectOptionInPreviewTab: (optionText) => {
206
- textSelectionPage.steps.clickOnOptionInPreviewTab(optionText);
207
- textSelectionPage.steps.verifyOptionIsSelectedInPreviewTab(optionText);
208
- },
209
-
210
- /**
211
- * @param {*} optionText Text of the option in preview tab
212
- * @description Deselect an option in preview tab
213
- */
214
- deselectOptionInPreviewTab: (optionText) => {
215
- textSelectionPage.steps.clickOnOptionInPreviewTab(optionText);
216
- textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(optionText);
217
- },
218
-
219
- /**
220
- * @param {string} optionText Text of the option in highlight options section
221
- * @description Verify that option is in selected state in highlight options section
222
- */
223
- verifyOptionIsSelectedInHighlightOptionsSection: (optionText) => {
224
- textSelectionPage.highlightOptionsSpans()
225
- .contains(optionText)
226
- .should('have.class', 'highlighted')
227
- .and('have.attr', 'aria-checked', 'true');
228
- },
229
-
230
- /**
231
- * @param {string} optionText Text of the option in highlight options section
232
- * @description Verify that option does not exist in highlight options section
233
- */
234
- verifyOptionDoesNotExistInHighlightOptionsSection: (optionText) => {
235
- utilities.verifyElementVisibilityState(textSelectionPage.highlightOptionsSpans().contains(optionText), 'notExist');
236
- },
237
-
238
- verifyCorrectAnswerSectionNotExists: () => {
239
- utilities.verifyElementVisibilityState(textSelectionPage.correctAnswerSection(), 'notExist');
240
- },
241
-
242
- /**
243
- * @param {string} optionText Text of the option in highlight options section
244
- * @description Verify hover state of the deselected option in highlight options section
245
- */
246
- verifyHoverStateOfDeselectedOptionInHighlightOptionsSection: (optionText) => {
247
- textSelectionPage.steps.hoverOnDeselectedOptionInHighlightOptionsSection(optionText);
248
- utilities.verifyCSS(textSelectionPage.highlightOptionsSpans()
249
- .contains(optionText), {
250
- 'color': css.color.text,
251
- 'font-size': css.fontSize.default,
252
- 'font-weight': css.fontWeight.regular,
253
- 'background-color': colorLibrary.selectionColor.hoverBackground,
254
- 'border': `1px solid ${colorLibrary.selectionColor.hoverBorder}`
255
- });
256
- },
257
-
258
- /**
259
- * @param {string} optionText Text of the option in highlight options section
260
- * @description Hover on deselected option in highlight options section
261
- */
262
- hoverOnDeselectedOptionInHighlightOptionsSection: (optionText) => {
263
- textSelectionPage.highlightOptionsSpans()
264
- .contains(optionText)
265
- .realHover();
266
- },
267
-
268
- /**
269
- * @param {string[]} optionArray Array of text of options in highlight options section
270
- * @description Verify the options displayed in highlight options section
271
- */
272
- verifyOptionsInHighlightOptionsSection: (optionArray) => {
273
- optionArray.forEach((optionText, optionIndex) => {
274
- utilities.verifyInnerText(textSelectionPage.highlightOptionsSpans().eq(optionIndex), optionText)
275
- });
276
- utilities.verifyElementCount(textSelectionPage.highlightOptionsSpans(), optionArray.length);
277
- },
278
-
279
- /**
280
- * @param {string} optionText Text of the option in set correct answer section
281
- * @description Verify that option is not in selected state in set correct answer section
282
- */
283
- verifyOptionIsNotSelectedInSpecifyCorrectAnswerSection: (optionText) => {
284
- textSelectionPage.optionSpecifyCorrectAnswer()
285
- .contains(optionText)
286
- .should('not.have.class', 'correct_answer')
287
- .and('have.attr', 'aria-checked', 'false');
288
- },
289
-
290
- /**
291
- * @param {string[]} optionArray Array of text of options in highlight options section
292
- * @description Verify the options displayed in highlight options section
293
- */
294
- verifyOptionsInSpecifyCorrectAnswerSection: (optionArray) => {
295
- optionArray.forEach((optionText, optionIndex) => {
296
- utilities.verifyInnerText(textSelectionPage.optionSpecifyCorrectAnswer().eq(optionIndex), optionText)
297
- });
298
- utilities.verifyElementCount(textSelectionPage.optionSpecifyCorrectAnswer(), optionArray.length);
299
- },
300
-
301
- /**
302
- * @param {string} optionText Text of the option in set correct answer section
303
- * @description Hover on deselected option in set correct answer section
304
- */
305
- hoverOnDeselectedOptionInSpecifyCorrectAnswerSection: (optionText) => {
306
- textSelectionPage.optionSpecifyCorrectAnswer()
307
- .contains(optionText)
308
- .realHover();
309
- },
310
-
311
- /**
312
- * @param {string[]} optionArray Array of text of options in preview tab
313
- * @description Verify the options displayed in preview tab
314
- */
315
- verifyOptionInPreviewTab: (optionArray) => {
316
- optionArray.forEach((optionText, optionIndex) => {
317
- utilities.verifyInnerText(textSelectionPage.optionPreviewTab().eq(optionIndex), optionText)
318
- });
319
- utilities.verifyElementCount(textSelectionPage.optionPreviewTab(), optionArray.length);
320
- },
321
-
322
- /**
323
- * @param {string} optionText Text of the option in preview tab
324
- * @description Hover on deselected option in preview tab
325
- */
326
- hoverOnDeselectedOptionInPreviewTab: (optionText) => {
327
- textSelectionPage.optionPreviewTab()
328
- .contains(optionText)
329
- .realHover();
330
- },
331
-
332
- /**
333
- * @param {string} optionText Text of the option in set correct answer section
334
- * @description Verify hover state of the deselected option in set correct answer section
335
- */
336
- verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection: (optionText) => {
337
- textSelectionPage.steps.hoverOnDeselectedOptionInSpecifyCorrectAnswerSection(optionText);
338
- utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText), {
339
- 'color': css.color.text,
340
- 'font-size': css.fontSize.default,
341
- 'font-weight': css.fontWeight.regular,
342
- 'background-color': colorLibrary.selectionColor.hoverBackground,
343
- 'border': `1px solid ${colorLibrary.selectionColor.hoverBorder}`
344
- });
345
- },
346
-
347
- /**
348
- * @param {string} optionText Text of the option in preview tab
349
- * @param {string} selectionColor type of color used for selection of option
350
- * @description Verify hover state of the deselected option in preview tab
351
- * @example verifyHoverStateOfOptionInPreviewTab('Sample text', "blue")
352
- */
353
- verifyHoverStateOfOptionInPreviewTab: (optionText, selectionColor) => {
354
- utilities.hoverOverElement(textSelectionPage.optionPreviewTab().contains(optionText));
355
- utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
356
- 'color': css.color.text,
357
- 'font-size': css.fontSize.default,
358
- 'font-weight': css.fontWeight.regular,
359
- 'background-color': colorLibrary[selectionColor].hoverBackground,
360
- 'border': `2px solid ${colorLibrary[selectionColor].hoverBorder}`
361
- });
362
- utilities.hoverAwayFromElement(textSelectionPage.optionPreviewTab().contains(optionText));
363
- },
364
-
365
- /**
366
- * @param {string} optionText Text of the option in preview tab
367
- * @param {string} selectionColor type of color used for selection of option
368
- * @example verifySelectedStateOptionInPreviewTab('Sample text', "blue")
369
- */
370
- verifySelectedStateOptionInPreviewTab: (optionText, selectionColor) => {
371
- utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
372
- 'color': css.color.whiteText,
373
- 'font-size': css.fontSize.default,
374
- 'font-weight': css.fontWeight.regular,
375
- 'background-color': colorLibrary[selectionColor].background
376
- });
377
- },
378
-
379
- /**
380
- * @param {string} optionText Text of the option in preview tab
381
- * @example verifyDeselectedStateOptionInPreviewTab('Sample text')
382
- */
383
- verifyDeselectedStateOptionInPreviewTab: (optionText) => {
384
- utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
385
- 'color': css.color.text,
386
- 'font-size': css.fontSize.default,
387
- 'font-weight': css.fontWeight.regular,
388
- 'background-color': css.color.transparent
389
- });
390
- },
391
-
392
- /**
393
- * @param {string} optionText Text of the option in preview tab
394
- * @description Verify check-mark icon is displayed for option
395
- */
396
- verifyCorrectIconForOption: (optionText) => {
397
- textSelectionPage.optionPreviewTab()
398
- .contains(optionText)
399
- .should('have.class', 'correct_answer')
400
- .within(() => {
401
- autoScoredScoringPreviewTab.correctIcon()
402
- .should('be.visible');
403
- });
404
- },
405
-
406
- /**
407
- * @param {string} optionText Text of the option in preview tab
408
- * @description Verify cross-mark icon is displayed for option
409
- */
410
- verifyIncorrectIconForOption: (optionText) => {
411
- textSelectionPage.optionPreviewTab()
412
- .contains(optionText)
413
- .should('have.class', 'correct_answer')
414
- .within(() => {
415
- autoScoredScoringPreviewTab.incorrectIcon()
416
- .should('be.visible');
417
- });
418
- },
419
-
420
- /**
421
- * @param {string} optionText Text of the option in preview tab
422
- * @description Verify check-mark icon is displayed for option
423
- */
424
- verifyCorrectIncorrectIconForOptionNotExist: (optionText) => {
425
- textSelectionPage.optionPreviewTab()
426
- .contains(optionText)
427
- .within(() => {
428
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'notExist');
429
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'notExist');
430
- });
431
- },
432
-
433
- /**
434
- * @param {string} optionText Text of the option in preview tab
435
- * @description Verify check-mark icon is displayed for option
436
- */
437
- verifyCorrectIncorrectIconForCorrectAnswerOptionNotExist: (optionText) => {
438
- textSelectionPage.optionPreviewTab()
439
- .contains(optionText)
440
- .within(() => {
441
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'notExist');
442
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'notExist');
443
- });
444
- },
445
-
446
- /**
447
- * @param {string} optionText Text of the option in correct answer section preview tab
448
- * @description Verify check-mark icon is displayed for option
449
- */
450
- verifyCorrectIconForOptionCorrectAnswerSection: (optionText) => {
451
- textSelectionPage.optionCorrectAnswerSection()
452
- .contains(optionText)
453
- .should('have.class', 'correct_answer')
454
- .within(() => {
455
- autoScoredScoringPreviewTab.correctIcon()
456
- .should('be.visible');
457
- });
458
- },
459
-
460
- /**
461
- * @param {string} optionText Text of the option in set correct answer section
462
- * @description Verify that option is in selected state in set correct answer section
463
- */
464
- verifyOptionIsSelectedInSpecifyCorrectAnswerSection: (optionText) => {
465
- textSelectionPage.optionSpecifyCorrectAnswer()
466
- .contains(optionText)
467
- .should('have.class', 'correct_answer')
468
- .and('have.attr', 'aria-checked', 'true');
469
- },
470
-
471
- /**
472
- * @param {string} optionText Text of the option in highlight options section
473
- * @description Verify that option is not in selected state in highlight options section
474
- */
475
- verifyOptionIsNotSelectedInHighlightOptionsSection: (optionText) => {
476
- textSelectionPage.highlightOptionsSpans()
477
- .contains(optionText)
478
- .should('not.have.class', 'highlighted')
479
- .and('have.attr', 'aria-checked', 'false');
480
- },
481
-
482
- /**
483
- * @param {string} optionText Text of the option in preview tab
484
- * @description Verify that option is in selected state in preview tab
485
- */
486
- verifyOptionIsSelectedInPreviewTab: (optionText) => {
487
- textSelectionPage.optionPreviewTab()
488
- .contains(optionText)
489
- .should('have.class', 'correct_answer')
490
- .and('have.attr', 'aria-checked', 'true');
491
- },
492
-
493
- /**
494
- * @param {string} optionText Text of the option in preview tab
495
- * @description Verify that option is not in selected state in preview tab
496
- */
497
- verifyOptionIsNotSelectedInPreviewTab: (optionText) => {
498
- textSelectionPage.optionPreviewTab()
499
- .contains(optionText)
500
- .should('not.have.class', 'correct_answer')
501
- .and('have.attr', 'aria-checked', 'false');
502
- },
503
-
504
- verifyNoOptionIsSelectedInPreviewTab: () => {
505
- textSelectionPage.optionPreviewTab()
506
- .should('not.have.class', 'correct_answer')
507
- .and('have.attr', 'aria-checked', 'false');
508
- },
509
-
510
- /**
511
- * @param {("correct" | "incorrect")} answerStatus - The status of the answer.
512
- * @description Verifies the visibility and content of the correct/incorrect answer label block.
513
- * If the answer is correct, it also verifies the visibility of the correct icon; otherwise, it verifies the visibility of the incorrect icon.
514
- */
515
- verifyCorrectIncorrectAnswerLabel: (answerStatus) => {
516
- utilities.verifyElementVisibilityState(textSelectionPage.correctIncorrectAnswerLabel(), 'exist');
517
- utilities.verifyInnerText(textSelectionPage.correctIncorrectAnswerLabel(), `Your answer is\n${answerStatus}`)
518
- textSelectionPage.correctIncorrectAnswerLabelWrapper()
519
- .within(() => {
520
- if (answerStatus === 'correct') {
521
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
522
- } else {
523
- utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
524
- }
525
- });
526
- },
527
-
528
- setQuestionAndOptionsInEditTab: () => {
529
- textSelectionPage.steps.clearQuestionInputField();
530
- paragraphTextArray.forEach((paragraphText) => {
531
- textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
532
- });
533
- textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
534
- textSelectionPage.steps.switchTextSelectionMode('Paragraph');
535
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[0]);
536
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[1]);
537
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[2]);
538
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[3]);
539
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[4]);
540
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[5]);
541
- },
542
-
543
- /**
544
- * @param {number[]} pointsArray Array of partial different points for options
545
- * @description Add points to options in set points popup
546
- */
547
- addPartialDifferentWeightsPointsInSetPointsPopup: (pointsArray) => {
548
- textSelectionPage.setPointsButton()
549
- .click();
550
- setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField(pointsArray);
551
- setPointsPopupBase.steps.saveSetPointsPopup();
552
- },
553
-
554
- /**
555
- * Verify non-optional text is not interactive in preview tab
556
- * @param {string} optionText Non-optional text in preview tab
557
- */
558
- verifyNonOptionTextIsNotInteractiveInPreviewTab: (optionText) => {
559
- utilities.hoverOverElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
560
- utilities.verifyCSS(textSelectionPage.questionTextPreviewTab().contains(optionText), {
561
- 'background-color': css.color.transparent
562
- });
563
- utilities.hoverAwayFromElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
564
- textSelectionPage.questionTextPreviewTab()
565
- .contains(optionText)
566
- .click();
567
- textSelectionPage.questionTextPreviewTab()
568
- .contains(optionText)
569
- .should('not.have.class', 'correct_answer')
570
- .and('have.attr', 'aria-checked', 'false');
571
- }
572
- }
573
-
574
- const tests = {
575
- ...autoScoredScoringPreviewTab.tests,
576
- }
577
-
578
- export const textSelectionPage = {
579
- ...selectors,
580
- steps,
581
- tests
582
- }