itemengine-cypress-automation 1.0.181 → 1.0.182

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -4
  3. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +3 -64
  4. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  5. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  6. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  7. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +1 -29
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  19. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -3
  20. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  21. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +0 -1
  22. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  23. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  24. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  25. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  26. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  27. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  28. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  29. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  30. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  31. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -1
  32. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  33. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  34. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  35. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  36. package/cypress/e2e/ILC/NumberLine/toolSettings.js +1 -2
  37. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  38. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +1 -49
  39. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  40. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  42. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +1 -0
  43. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +1 -0
  44. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +1 -0
  45. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +1 -0
  46. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +1 -0
  47. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -0
  48. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +4 -5
  49. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +2 -2
  50. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  51. package/cypress/fixtures/constants.js +1 -1
  52. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  53. package/cypress/fixtures/theme/ilc.json +16 -16
  54. package/cypress/pages/audioPlayerPage.js +543 -55
  55. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  56. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  57. package/cypress/pages/components/autoScoredStudentViewSettings.js +4 -4
  58. package/cypress/pages/components/commonComponents.js +0 -1
  59. package/cypress/pages/components/draggableOptionContainer.js +0 -1
  60. package/cypress/pages/components/equationEditorFlyout.js +2 -3
  61. package/cypress/pages/components/essayResponseCommonComponents.js +2 -8
  62. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +0 -1
  63. package/cypress/pages/components/imageCanvasComponent.js +1 -2
  64. package/cypress/pages/components/index.js +0 -1
  65. package/cypress/pages/components/optionsWrapperComponent.js +0 -11
  66. package/cypress/pages/components/toolSettingsComponent.js +0 -6
  67. package/cypress/pages/contentBlocksPage.js +2 -2
  68. package/cypress/pages/createItemPage.js +0 -29
  69. package/cypress/pages/dialogBoxBase.js +2 -2
  70. package/cypress/pages/drawingResponsePage.js +4 -23
  71. package/cypress/pages/feedbackScalePage.js +0 -3
  72. package/cypress/pages/graphingPage.js +0 -18
  73. package/cypress/pages/gridFillPage.js +2 -18
  74. package/cypress/pages/index.js +1 -1
  75. package/cypress/pages/itemPreviewSettingsPage.js +0 -4
  76. package/cypress/pages/listOrderingPage.js +647 -122
  77. package/cypress/pages/matchingPage.js +1 -1
  78. package/cypress/pages/multipleSelectionPage.js +1 -23
  79. package/cypress/pages/numberLinePage.js +59 -1196
  80. package/cypress/pages/rulerPage.js +2 -6
  81. package/cypress/pages/textSelectionPage.js +22 -460
  82. package/package.json +2 -2
  83. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +0 -162
  84. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -216
  85. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -214
  86. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -251
  87. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +0 -52
  88. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +0 -243
  89. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +0 -128
  90. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +0 -176
  91. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +0 -530
  92. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +0 -119
  93. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +0 -263
  94. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +0 -125
  95. package/cypress/e2e/ILC/TextSelection/headerSection.js +0 -73
  96. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.smoke.js +0 -179
  97. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +0 -89
  98. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +0 -436
  99. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +0 -277
  100. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +0 -222
  101. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +0 -260
  102. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +0 -380
  103. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +0 -46
@@ -280,15 +280,11 @@ const steps = {
280
280
  },
281
281
 
282
282
  verifyLengthOfRulerInPreview: (length) => {
283
- let lengthOfRuler = length.replace(/\s|-/g, '');
283
+ let lengthOfRuler = length.replaceAll(' ', '')
284
284
  rulerPage.rulerPreviewTab()
285
285
  .find('svg g')
286
286
  .eq(0)
287
- .invoke('attr', 'data-name')
288
- .then((dataName) => {
289
- const trimmedDataName = dataName.trim().replace(/\s|-/g, '');
290
- expect(trimmedDataName).to.equal(`Ruler${lengthOfRuler}`);
291
- });
287
+ .should('have.attr', 'data-name', `Ruler ${lengthOfRuler}`);
292
288
  },
293
289
 
294
290
  verifyColorOfRulerInPreview: (colorIndex) => {
@@ -1,6 +1,6 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
- import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents, ckEditorToolbar, equationEditorFlyout, studentViewSettingsLabelComponent, enableOuterBorderComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, colorPopupComponent } from "./components";
3
+ import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents } from "./components";
4
4
  import { dialogBoxBase } from "./dialogBoxBase";
5
5
  const css = Cypress.env('css');
6
6
  const colorLibrary = css.textSelectionColorLibrary;
@@ -12,15 +12,8 @@ const selectors = {
12
12
  ...autoScoredScoringSectionMultiResponseType,
13
13
  ...setPointsPopupBase,
14
14
  ...commonComponents,
15
- ...enableOuterBorderComponent,
16
- ...autoScoredScoringPreviewTab,
17
- ...additionalSettingsPanel,
18
- ...correctIncorrectAnswerLabelComponent,
19
- ...colorPopupComponent,
20
- questionLabel: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] .title-casing'),
21
15
  questionInputField: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] [title="Question"]'),
22
- specifyPossibleOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] .question-text-wrapper'),
23
- textSelectionModeLabel: () => cy.get('.text-selection-mode .options-label'),
16
+ specifyPossibleOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"]'),
24
17
  textSelectionMode: (ariaLabel = null) => {
25
18
  if (ariaLabel) {
26
19
  return cy.get(`.text-selection-mode [type="button"][aria-label*="${ariaLabel}"]`)
@@ -28,57 +21,15 @@ const selectors = {
28
21
  return cy.get('.text-selection-mode [type="button"]')
29
22
  }
30
23
  },
31
- textSelectionModeButtonLabel: (ariaLabel = null) => {
32
- if (ariaLabel) {
33
- return cy.get(`.text-selection-mode [type="button"][aria-label*="${ariaLabel}"] .ngie-toggle-button-label`)
34
- } else {
35
- return cy.get('.text-selection-mode [type="button"] .ngie-toggle-button-label')
36
- }
37
- },
38
- specifyPossibleOptionsLabel: () => cy.get('[class*="Highlightstyles__LabelWrapper"]'),
39
24
  specifyPossibleOptionsTextSpans: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] span'),
40
- specifyPossibleOptionsTextParagraphs: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] p'),
41
- optionSpan: () => cy.get('span'),
42
- selectedOptionSpecifyPossibleOptions: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] .highlighted'),
43
- selectedOptionCounterSpecifyPossibleOptions: () => cy.get('[class*="Highlightstyles__CountWrapper"]'),
44
- selectAllOptionsButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(0),
45
- undoButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
46
- redoButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
47
- clearOptionsButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
48
25
 
49
26
  //Specify correct answer section
50
- specifyCorrectAnswerTextWrapper: () => cy.get('[class*="Highlightstyles__Wrapper"] .question-text-wrapper'),
51
27
  specifyCorrectAnswerTextSpans: () => cy.get('[class*="Highlightstyles__Wrapper"] span'),
52
- specifyCorrectAnswerTextParagraphs: () => cy.get('[class*="Highlightstyles__Wrapper"] p'),
53
28
  optionSpecifyCorrectAnswer: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
54
29
  setPointsButton: () => cy.get('[class*="SetPointsPopupWrapper"] button'),
55
- maximumOptionsCanBeSelectedErrorMessage: () => cy.get('[class*="Highlightstyles__AuthoringErrorMsg"]'),
56
- maximumOptionsCanBeSelectedErrorMessagePreviewTab: () => cy.get('[class*="Highlightstyles__ErrorMessage"]'),
57
- maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab: () => cy.get('.preview-selection-limit-error-wrapper'),
58
-
59
- //Student view settings
60
- showAvailableOptionsToStudentsLabel: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] [class*="label"]'),
61
- showAvailableOptionsToStudentsCheckbox: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] input'),
62
- maxNumberOfPossibleSelectionsLabel: () => cy.get('#Maximum-number-of-possible-selections-dropdown-label'),
63
- maxNumberOfPossibleSelectionsDropdown: () => cy.get('#Maximum-number-of-possible-selections-select'),
64
- showStudentMaximumNumberOfPossibleSelectionsCheckbox: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] input'),
65
- showStudentMaximumNumberOfPossibleSelectionsLabel: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] [class*="label"]'),
66
- maximumNumberOfSelectionsHelpText: () => cy.get('[class*="Highlightstyles__LimitWrapper"]'),
67
-
68
- //Style and customization layout
69
- filledInStyleLabel: () => cy.get('.text-selection-style-title'),
70
- fillColorLabel: () => cy.get('[class*="StyleAndLayoutCustomizationstyles__SubSectionLabel"]'),
71
- colorBlock: () => cy.get('.color-picker-block'),
72
- editColorButton: () => cy.get('.ngie-icon-with-label-btn[aria-label="edit color"]'),
73
- changeFontColorToWhiteCheckbox: () => cy.get('[data-ngie-testid="change-font-color-to-white-checkbox"] input'),
74
- changeFontColorToWhiteCheckboxLabel: () => cy.get('[data-ngie-testid="change-font-color-to-white-checkbox"] [class*="label"]'),
75
30
 
76
31
  //Preview tab
77
- questionTextOuterBorderPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"]'),
78
32
  questionTextPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] p'),
79
- previewTabQuestionTextParagraphs: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] p'),
80
- previewTabQuestionTextSpans: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] span'),
81
- questionTextWrapperPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"]'),
82
33
  optionPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] .highlighted'),
83
34
  optionCorrectAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1).find('.highlighted'),
84
35
  correctAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1),
@@ -99,12 +50,6 @@ const steps = {
99
50
  ...setPointsPopupBase.steps,
100
51
  ...commonComponents.steps,
101
52
  ...dialogBoxBase.steps,
102
- ...ckEditorToolbar.steps,
103
- ...equationEditorFlyout.steps,
104
- ...enableOuterBorderComponent.steps,
105
- ...additionalSettingsPanel.steps,
106
- ...styleAndLayoutCustomizationAccordionComponent.steps,
107
- ...colorPopupComponent.steps,
108
53
  addInputToQuestionInputField: (text) => {
109
54
  textSelectionPage.questionInputField()
110
55
  .type(text);
@@ -133,7 +78,7 @@ const steps = {
133
78
  },
134
79
 
135
80
  verifyErroredStateOfSpecifyPossibleOptionsSection: () => {
136
- utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextFieldWrapper().parent(), {
81
+ utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextFieldWrapper(), {
137
82
  'border-color': css.color.errorFieldBorder,
138
83
  'background-color': css.color.errorFieldBg
139
84
  });
@@ -195,62 +140,6 @@ const steps = {
195
140
  .should('have.text', 'This is Bold text input.lorem');
196
141
  },
197
142
 
198
- verifyImageAndAltTextInSpecifyCorrectAnswerSection: () => {
199
- textSelectionPage.specifyCorrectAnswerTextWrapper()
200
- .find('img')
201
- .should('have.attr', 'src', constants.foxImageLink)
202
- .and('have.attr', 'alt', constants.foxImageAltText);
203
- },
204
-
205
- verifyEquationInSpecifyCorrectAnswerSection: () => {
206
- textSelectionPage.specifyCorrectAnswerTextWrapper()
207
- .find('span[role="math"]')
208
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
209
- .contains(constants.CKEditorInputFieldEnteredEquationText);
210
- },
211
-
212
- verifyLinkInSpecifyCorrectAnswerSection: () => {
213
- textSelectionPage.specifyCorrectAnswerTextWrapper()
214
- .find('a')
215
- .should('have.text', 'lorem')
216
- .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
217
- },
218
-
219
- verifyBoldTextInSpecifyCorrectAnswerSection: () => {
220
- textSelectionPage.specifyCorrectAnswerTextWrapper()
221
- .find('strong')
222
- .should('exist')
223
- .should('have.text', 'This is Bold text input.lorem');
224
- },
225
-
226
- verifyImageAndAltTextInPreviewTab: () => {
227
- textSelectionPage.questionTextWrapperPreviewTab()
228
- .find('img')
229
- .should('have.attr', 'src', constants.foxImageLink)
230
- .and('have.attr', 'alt', constants.foxImageAltText);
231
- },
232
-
233
- verifyEquationInPreviewTab: () => {
234
- textSelectionPage.questionTextWrapperPreviewTab()
235
- .find('span[role="math"]')
236
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
237
- .contains(constants.CKEditorInputFieldEnteredEquationText);
238
- },
239
-
240
- verifyLinkInPreviewTab: () => {
241
- textSelectionPage.questionTextWrapperPreviewTab()
242
- .find('a')
243
- .should('have.text', 'lorem')
244
- .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
245
- },
246
-
247
- verifyBoldTextInPreviewTab: () => {
248
- textSelectionPage.questionTextWrapperPreviewTab()
249
- .find('strong')
250
- .should('exist')
251
- .should('have.text', 'This is Bold text input.lorem');
252
- },
253
-
254
143
  verifySpecifyPossibleOptionsFieldErrorMessage: () => {
255
144
  textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
256
145
  .next()
@@ -266,24 +155,6 @@ const steps = {
266
155
  .click();
267
156
  },
268
157
 
269
- /**
270
- * @param {string} textSelectionType Type of text selection
271
- * @description Verify text selection mode is selected
272
- */
273
- verifyTextSelectionModeIsSelected: (textSelectionType) => {
274
- textSelectionPage.textSelectionMode(textSelectionType)
275
- .should('have.attr', 'aria-pressed', 'true');
276
- },
277
-
278
- /**
279
- * @param {string} textSelectionType Type of text selection
280
- * @description Verify text selection mode is not selected
281
- */
282
- verifyTextSelectionModeIsNotSelected: (textSelectionType) => {
283
- textSelectionPage.textSelectionMode(textSelectionType)
284
- .should('have.attr', 'aria-pressed', 'false');
285
- },
286
-
287
158
  /**
288
159
  * @param {string} optionText Text of the option in specify possible options section
289
160
  * @description Click on option in specify possible options section
@@ -375,21 +246,18 @@ const steps = {
375
246
 
376
247
  /**
377
248
  * @param {string} optionText Text of the option in specify possible options section
378
- * @param {string} selectionColor type of color used for selection of option
379
249
  * @description Verify hover state of the deselected option in specify possible options section
380
- * @example verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection('Sample text', "blue")
381
250
  */
382
- verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection: (optionText, selectionColor) => {
251
+ verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection: (optionText) => {
383
252
  textSelectionPage.steps.hoverOnDeselectedOptionInSpecifyPossibleOptionsSection(optionText);
384
253
  utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextSpans()
385
254
  .contains(optionText), {
386
255
  'color': css.color.text,
387
256
  'font-size': css.fontSize.default,
388
257
  'font-weight': css.fontWeight.regular,
389
- 'background-color': colorLibrary[selectionColor].hoverBackground,
390
- 'border': `2px solid ${colorLibrary[selectionColor].hoverBorder}`
258
+ 'background-color': colorLibrary.selectionColor.hoverBackground,
259
+ 'border': `1px solid ${colorLibrary.selectionColor.hoverBorder}`
391
260
  });
392
- utilities.hoverAwayFromElement(textSelectionPage.specifyPossibleOptionsTextSpans().contains(optionText));
393
261
  },
394
262
 
395
263
  /**
@@ -467,21 +335,18 @@ const steps = {
467
335
  },
468
336
 
469
337
  /**
470
- * @param {string} optionText Text of the option in specify correct answer section
471
- * @param {string} selectionColor type of color used for selection of option
472
- * @description Verify hover state of the deselected option in specify correct answer section
473
- * @example verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection('Sample text', "blue")
338
+ * @param {string} optionText Text of the option in set correct answer section
339
+ * @description Verify hover state of the deselected option in set correct answer section
474
340
  */
475
- verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection: (optionText, selectionColor) => {
341
+ verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection: (optionText) => {
476
342
  textSelectionPage.steps.hoverOnDeselectedOptionInSpecifyCorrectAnswerSection(optionText);
477
343
  utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText), {
478
344
  'color': css.color.text,
479
345
  'font-size': css.fontSize.default,
480
346
  'font-weight': css.fontWeight.regular,
481
- 'background-color': colorLibrary[selectionColor].hoverBackground,
482
- 'border': `2px solid ${colorLibrary[selectionColor].hoverBorder}`
347
+ 'background-color': colorLibrary.selectionColor.hoverBackground,
348
+ 'border': `1px solid ${colorLibrary.selectionColor.hoverBorder}`
483
349
  });
484
- utilities.hoverAwayFromElement(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText));
485
350
  },
486
351
 
487
352
  /**
@@ -516,24 +381,11 @@ const steps = {
516
381
  });
517
382
  },
518
383
 
519
- /**
520
- * @param {string} optionText Text of the option in preview tab
521
- * @example verifyOptionIsDisplayedToStudentsInPreviewTab('Sample text')
522
- */
523
- verifyOptionIsDisplayedToStudentsInPreviewTab: (optionText) => {
524
- utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
525
- 'color': css.color.text,
526
- 'font-size': css.fontSize.default,
527
- 'font-weight': css.fontWeight.regular,
528
- 'background-color': colorLibrary["blue"].hoverBackground
529
- });
530
- },
531
-
532
384
  /**
533
385
  * @param {string} optionText Text of the option in preview tab
534
- * @example verifyStandardStateOptionInPreviewTab('Sample text')
386
+ * @example verifyDeselectedStateOptionInPreviewTab('Sample text')
535
387
  */
536
- verifyStandardStateOptionInPreviewTab: (optionText) => {
388
+ verifyDeselectedStateOptionInPreviewTab: (optionText) => {
537
389
  utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
538
390
  'color': css.color.text,
539
391
  'font-size': css.fontSize.default,
@@ -693,36 +545,6 @@ const steps = {
693
545
  textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[5]);
694
546
  },
695
547
 
696
- /**
697
- * @param {number[]} pointsArray Array of partial different points for options
698
- * @description Add points to options in set points popup
699
- */
700
- addPartialDifferentWeightsPointsInSetPointsPopup: (pointsArray) => {
701
- textSelectionPage.setPointsButton()
702
- .click();
703
- setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField(pointsArray);
704
- setPointsPopupBase.steps.saveSetPointsPopup();
705
- },
706
-
707
- /**
708
- * Verify non-optional text is not interactive in preview tab
709
- * @param {string} optionText Non-optional text in preview tab
710
- */
711
- verifyNonOptionTextIsNotInteractiveInPreviewTab: (optionText) => {
712
- utilities.hoverOverElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
713
- utilities.verifyCSS(textSelectionPage.questionTextPreviewTab().contains(optionText), {
714
- 'background-color': css.color.transparent
715
- });
716
- utilities.hoverAwayFromElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
717
- textSelectionPage.questionTextPreviewTab()
718
- .contains(optionText)
719
- .click();
720
- textSelectionPage.questionTextPreviewTab()
721
- .contains(optionText)
722
- .should('not.have.class', 'correct_answer')
723
- .and('have.attr', 'aria-checked', 'false');
724
- },
725
-
726
548
  /**
727
549
  * @param {number[]} pointsArray Array of partial different points for options
728
550
  * @description Add points to options in set points popup
@@ -753,6 +575,7 @@ const steps = {
753
575
  selectOptionInSpecifyPossibleOptionsSection: (textSelectionType, optionText) => {
754
576
  if (textSelectionType === 'Custom') {
755
577
  textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
578
+ .find('.question-text-wrapper')
756
579
  .selectText(optionText);
757
580
  textSelectionPage.steps.verifyOptionIsSelectedInSpecifyPossibleOptionsSection(optionText);
758
581
  } else {
@@ -762,6 +585,7 @@ const steps = {
762
585
  },
763
586
 
764
587
  /**
588
+ * @param {string} textSelectionType Type of text selection
765
589
  * @param {*} optionText Text of the option in specify possible options section
766
590
  * @description Deselect an option in specify possible options section
767
591
  */
@@ -783,103 +607,6 @@ const steps = {
783
607
  utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect answer: ${penaltyPoints}`);
784
608
  },
785
609
 
786
- /**
787
- * @description Verify text and options displayed in specify correct answer section
788
- * @param {string[]} textArray array of span-vise text in specify correct answer section
789
- * @param {string[]} optionsArray array of options in specify correct answer section
790
- */
791
- verifySpecifyCorrectAnswerTextAndOptions: (textArray, optionsArray) => {
792
- textArray.forEach((text, index) => {
793
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), text);
794
- utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), 'visible');
795
- });
796
- optionsArray.forEach((optionText, index) => {
797
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.optionSpecifyCorrectAnswer(), index), optionText);
798
- });
799
- utilities.verifyElementCount(textSelectionPage.optionSpecifyCorrectAnswer(), optionsArray.length);
800
- },
801
-
802
- /**
803
- *
804
- * @param {string} optionText Text of the option in preview tab
805
- * @param {string} selectionColor type of color used for selection of option
806
- * @example verifySelectedStateOptionInPreviewTab('Sample text', "blue")
807
- */
808
- verifySelectedStateOptionInSpecifyCorrectAnswerSection: (optionText, selectionColor) => {
809
- utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText), {
810
- 'color': css.color.whiteText,
811
- 'font-size': css.fontSize.default,
812
- 'font-weight': css.fontWeight.regular,
813
- 'background-color': colorLibrary[selectionColor].background
814
- });
815
- },
816
-
817
- /**
818
- *
819
- * @param {string} optionText Text of the option in preview tab
820
- * @param {string} selectionColor type of color used for selection of option
821
- * @example verifySelectedStateOptionInPreviewTab('Sample text', "blue")
822
- */
823
- verifySelectedStateOptionInSpecifyPossibleOptionSection: (optionText, selectionColor) => {
824
- utilities.verifyCSS(textSelectionPage.selectedOptionSpecifyPossibleOptions().contains(optionText), {
825
- 'color': css.color.whiteText,
826
- 'font-size': css.fontSize.default,
827
- 'font-weight': css.fontWeight.regular,
828
- 'background-color': colorLibrary[selectionColor].background
829
- });
830
- },
831
-
832
- /**
833
- * @param {number} selectedOptionCount Value of counter
834
- * @description Verify option counter text and value
835
- */
836
- verifyOptionCounterTextAndValue: (selectedOptionCount) => {
837
- utilities.verifyTextContent(textSelectionPage.selectedOptionCounterSpecifyPossibleOptions(), `Option count: ${selectedOptionCount}`);
838
- },
839
-
840
- clearSelectedOptionsInSpecifyPossibleOptionSection: () => {
841
- textSelectionPage.steps.clickOnClearOptionsButtonInSpecifyPossibleOptionSection();
842
- textSelectionPage.steps.clickOnAcceptButtonInDialogBox();
843
- },
844
-
845
- clickOnClearOptionsButtonInSpecifyPossibleOptionSection: () => {
846
- textSelectionPage.clearOptionsButton()
847
- .click();
848
- },
849
-
850
- verifyClearPopupForClearingOptionSelection: () => {
851
- utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'visible');
852
- utilities.verifyInnerText(textSelectionPage.dialogBoxTitle(), 'Clear');
853
- utilities.verifyInnerText(textSelectionPage.dialogBoxContent(), 'Are you sure you want to clear all options? This action will not delete template content but remove all options.');
854
- utilities.verifyInnerText(textSelectionPage.buttonReject(), 'Cancel');
855
- utilities.verifyInnerText(textSelectionPage.buttonAccept(), 'Confirm');
856
- },
857
-
858
- /**
859
- * @param {number} paragraphIndex Index of the paragraph in specify possible options section
860
- * @param {number} numberOfOptions Number of options inside the paragraph in specify possible options section
861
- * @description Verify number of options inside a paragraph in specify possible options section
862
- */
863
- verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection: (paragraphIndex, numberOfOptions) => {
864
- textSelectionPage.specifyPossibleOptionsTextParagraphs()
865
- .eq(paragraphIndex)
866
- .within(() => {
867
- utilities.verifyElementCount(textSelectionPage.optionSpan(), numberOfOptions)
868
- });
869
- },
870
-
871
- verifySelectAllOptionsButtonIsDisplayed: () => {
872
- utilities.verifyElementVisibilityState(textSelectionPage.selectAllOptionsButton(), 'visible');
873
- textSelectionPage.selectAllOptionsButton()
874
- .should('have.attr', 'aria-label', 'Select all options');
875
- },
876
-
877
- verifyQuestionTextOuterBorderIsDisplayedInPreviewTab: () => {
878
- utilities.verifyCSS(textSelectionPage.questionTextOuterBorderPreviewTab(), {
879
- 'border': `1px solid ${css.color.outerBorder}`
880
- });
881
- },
882
-
883
610
  /**
884
611
  * Verify non-optional text is not interactive in preview tab
885
612
  * @param {string} optionText Non-optional text in preview tab
@@ -889,126 +616,14 @@ const steps = {
889
616
  utilities.verifyCSS(textSelectionPage.questionTextPreviewTab().contains(optionText), {
890
617
  'background-color': css.color.transparent
891
618
  });
892
- },
893
-
894
- verifyQuestionTextOuterBorderIsNotDisplayedInPreviewTab: () => {
895
- utilities.verifyCSS(textSelectionPage.questionTextOuterBorderPreviewTab(), {
896
- 'border-width': '0px'
897
- });
898
- },
899
-
900
- verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked: () => {
901
- textSelectionPage.showAvailableOptionsToStudentsCheckbox()
902
- .should('not.be.checked');
903
- },
904
-
905
- verifyShowAvailableOptionsToStudentsCheckboxIsChecked: () => {
906
- textSelectionPage.showAvailableOptionsToStudentsCheckbox()
907
- .should('be.checked');
908
- },
909
-
910
- uncheckShowAvailableOptionsToStudentsCheckbox: () => {
911
- textSelectionPage.showAvailableOptionsToStudentsCheckbox()
912
- .click()
913
- .should('not.be.checked');
914
- },
915
-
916
- checkShowAvailableOptionsToStudentsCheckbox: () => {
917
- textSelectionPage.showAvailableOptionsToStudentsCheckbox()
918
- .click()
919
- .should('be.checked');
920
- },
921
-
922
- expandMaxNumberOfPossibleSelectionsDropdown: () => {
923
- textSelectionPage.maxNumberOfPossibleSelectionsDropdown()
924
- .click();
925
- },
926
-
927
- /**
928
- * Verify maximum number of possible selections dropdown options
929
- * @param {string[]} options array of dropdown options
930
- */
931
- verifyMaxNumberOfPossibleSelectionsDropdownListOptions: (options) => {
932
- options.forEach((option, count) => {
933
- utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.dropdownListOption(), count), option);
934
- });
935
- },
936
-
937
- /**
938
- * @param {string} listOption - The option to be selected from the maximum number of possible selections dropdown
939
- * @description Selects an option from the maximum number of possible selections dropdown. The dropdown options are dependent on the number of available options.
940
- */
941
- selectOptionFromMaxNumberOfPossibleSelectionsDropdown: (listOption) => {
942
- textSelectionPage.dropdownListOption()
943
- .contains(listOption)
944
- .click();
945
- },
946
-
947
- verifyShowStudentTheMaxNumberOfSelectionsCheckboxIsUnchecked: () => {
948
- textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
949
- .should('not.be.checked');
950
- },
951
-
952
- checkShowStudentTheMaxNumberOfSelectionsCheckbox: () => {
953
- textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
954
- .click()
955
- .should('be.checked');
956
- },
957
-
958
- clickOnEditColorButton: () => {
959
- textSelectionPage.editColorButton()
960
- .click();
961
- },
962
-
963
- /**
964
- * @description select a color block in style and customization layout accordion
965
- * @param {number} index index of color block
966
- */
967
- selectColorBlock: (index) => {
968
- utilities.getNthElement(textSelectionPage.colorBlock(), index)
969
- .click()
970
- .should('have.attr', 'aria-pressed', 'true');
971
- },
972
-
973
- /**
974
- * @description verify that a color block is selected in style and customization layout accordion
975
- * @param {number} index index of color block
976
- */
977
- verifyColorBlockIsSelected: (index) => {
978
- utilities.getNthElement(textSelectionPage.colorBlock(), index)
979
- .should('have.attr', 'aria-pressed', 'true');
980
- },
981
-
982
- /**
983
- * @description verify the background color of a color block in style and customization layout accordion
984
- * @param {number} index index of color block
985
- * @param {string} color background color value of the color block in rgba format
986
- */
987
- verifyColorBlockBackgroundColor: (index, color) => {
988
- utilities.verifyCSS(utilities.getNthElement(textSelectionPage.colorBlock(), index), {
989
- 'background-color': color
990
- });
991
- },
992
-
993
- verifyChangeFontColorToWhiteCheckboxIsChecked: () => {
994
- textSelectionPage.changeFontColorToWhiteCheckbox()
995
- .should('be.checked');
996
- },
997
-
998
- uncheckChangeFontColorToWhiteCheckbox: () => {
999
- textSelectionPage.changeFontColorToWhiteCheckbox()
1000
- .click()
1001
- .should('not.be.checked');
1002
- },
1003
-
1004
- /**
1005
- * @description select a color block in style and customization layout accordion
1006
- * @param {number} index index of color block
1007
- */
1008
- selectAColorBlock: (index) => {
1009
- utilities.getNthElement(textSelectionPage.colorBlock(), index)
619
+ utilities.hoverAwayFromElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
620
+ textSelectionPage.questionTextPreviewTab()
621
+ .contains(optionText)
1010
622
  .click();
1011
- textSelectionPage.steps.verifyColorBlockIsSelected(index)
623
+ textSelectionPage.questionTextPreviewTab()
624
+ .contains(optionText)
625
+ .should('not.have.class', 'correct_answer')
626
+ .and('have.attr', 'aria-checked', 'false');
1012
627
  }
1013
628
  }
1014
629
 
@@ -1017,15 +632,6 @@ const tests = {
1017
632
  ...scoringSectionBaseEditTab.tests,
1018
633
  ...autoScoredScoringSectionMultiResponseType.tests,
1019
634
  ...commonComponents.tests,
1020
- ...autoScoredSpecifyCorrectAnswerSection.tests,
1021
- ...questionInstructionsComponent.tests,
1022
- ...studentViewSettingsLabelComponent.tests,
1023
- ...enableOuterBorderComponent.tests,
1024
- ...autoScoredStudentViewSettings.tests,
1025
- ...createQuestionBasePage.tests,
1026
- ...additionalSettingsPanel.tests,
1027
- ...additionalSettingsAccessibilitySectionComponent.tests,
1028
- ...styleAndLayoutCustomizationAccordionComponent.tests,
1029
635
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
1030
636
  it('When user selects a scoring type, then in the \'Correct\' accordion all the contents should be displayed', () => {
1031
637
  textSelectionPage.specifyCorrectAnswerTextSpans()
@@ -1035,50 +641,6 @@ const tests = {
1035
641
  });
1036
642
  });
1037
643
  },
1038
-
1039
- /**
1040
- * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
1041
- * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
1042
- * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
1043
- */
1044
- verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
1045
- it('When the user selects the options as correct answer, then the selected answer should be set as correct answer', () => {
1046
- textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
1047
- textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
1048
- });
1049
-
1050
- it(`When the user deselects all the selected options in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
1051
- textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
1052
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
1053
- utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
1054
- if (accordionName == 'Correct') {
1055
- autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
1056
- .within(() => {
1057
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
1058
- });
1059
- } else {
1060
- autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
1061
- .within(() => {
1062
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
1063
- });
1064
- };
1065
- });
1066
-
1067
- autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
1068
-
1069
- it('When the user selects an option, the error message should disappear', () => {
1070
- textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
1071
- textSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
1072
- });
1073
-
1074
- autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
1075
-
1076
- //CSS covered while verifying selected and deselected state of options
1077
-
1078
- it('Accessibility of accordion contents', { tags: 'a11y' }, () => {
1079
- cy.checkAccessibility(textSelectionPage.pointsInputField().parents('.highlight-set-correct-wrapper'))
1080
- });
1081
- }
1082
644
  }
1083
645
 
1084
646
  export const textSelectionPage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.181",
3
+ "version": "1.0.182",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,4 +35,4 @@
35
35
  "node-fetch": "^3.3.2",
36
36
  "react-uuid": "^2.0.0"
37
37
  }
38
- }
38
+ }