itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.184

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
  2. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
  3. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
  4. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
  5. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
  6. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
  7. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  8. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  11. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
  12. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
  13. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  14. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  26. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
  27. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
  29. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  30. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  31. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  32. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  33. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  34. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  35. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
  36. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
  37. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  38. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  39. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
  40. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
  42. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
  43. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
  44. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
  45. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  46. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
  47. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
  48. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
  49. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
  50. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
  51. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
  52. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
  53. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
  54. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
  55. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
  56. package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
  57. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
  58. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
  59. package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
  60. package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
  61. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
  62. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  63. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
  64. package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
  65. package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
  66. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  67. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
  68. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  69. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
  70. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  71. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
  72. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
  73. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
  74. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  75. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  76. package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
  77. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
  78. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
  79. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
  80. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
  81. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
  82. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
  83. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
  84. package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
  85. package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
  86. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  87. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
  88. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  89. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  90. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  91. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
  92. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
  93. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
  94. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
  95. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
  96. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
  97. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
  99. package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
  100. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
  101. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
  102. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
  103. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
  104. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
  105. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
  106. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
  107. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
  108. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  109. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
  110. package/cypress/fixtures/constants.js +1 -1
  111. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  112. package/cypress/fixtures/theme/ilc.json +20 -18
  113. package/cypress/pages/audioPlayerPage.js +274 -504
  114. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  115. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  116. package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
  117. package/cypress/pages/components/commonComponents.js +1 -0
  118. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  119. package/cypress/pages/components/equationEditorFlyout.js +3 -2
  120. package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
  121. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
  122. package/cypress/pages/components/imageCanvasComponent.js +2 -1
  123. package/cypress/pages/components/index.js +3 -0
  124. package/cypress/pages/components/layoutSectionComponent.js +1191 -0
  125. package/cypress/pages/components/numberLineCommonComponent.js +36 -0
  126. package/cypress/pages/components/optionsWrapperComponent.js +13 -2
  127. package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
  128. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
  129. package/cypress/pages/components/toolSettingsComponent.js +6 -0
  130. package/cypress/pages/contentBlocksPage.js +18 -2
  131. package/cypress/pages/createItemPage.js +75 -8
  132. package/cypress/pages/dialogBoxBase.js +2 -2
  133. package/cypress/pages/drawingResponsePage.js +24 -4
  134. package/cypress/pages/feedbackScalePage.js +3 -0
  135. package/cypress/pages/graphingPage.js +19 -1
  136. package/cypress/pages/gridFillPage.js +25 -8
  137. package/cypress/pages/index.js +2 -1
  138. package/cypress/pages/itemPreviewSettingsPage.js +4 -0
  139. package/cypress/pages/listOrderingPage.js +435 -557
  140. package/cypress/pages/matchingPage.js +1 -1
  141. package/cypress/pages/multipleSelectionPage.js +23 -1
  142. package/cypress/pages/numberLineLabelPage.js +333 -0
  143. package/cypress/pages/numberLinePage.js +1370 -132
  144. package/cypress/pages/rulerPage.js +6 -2
  145. package/cypress/pages/textSelectionPage.js +461 -23
  146. package/package.json +1 -1
@@ -0,0 +1,179 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const grepTags = Cypress.env('grepTags');
6
+
7
+ describe('Create Item page - Text selection: Question Instructions and Question section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question Instructions input field - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
16
+ cy.barsPreLoaderWait();
17
+ });
18
+
19
+ textSelectionPage.tests.verifyQuestionInstructionsInputFieldEditTab();
20
+ });
21
+
22
+ describe('Question Instructions input field - Preview tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
26
+ cy.barsPreLoaderWait();
27
+ });
28
+
29
+ textSelectionPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
30
+ });
31
+
32
+ describe('Question input field - Edit tab', () => {
33
+ abortEarlySetup();
34
+ before(() => {
35
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
36
+ cy.barsPreLoaderWait();
37
+ });
38
+
39
+ it('\'Question\' label and input field should be displayed and by default in the question input field, sample \'Lorem Ipsum\' text should be present', () => {
40
+ utilities.verifyInnerText(textSelectionPage.questionLabel(), 'Question');
41
+ utilities.verifyInnerText(textSelectionPage.questionInputField(), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n\n\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n\n\n\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
42
+ });
43
+
44
+ it('The default sample \'Lorem Ipsum\' text in the question input field should also be displayed in specify possible options section and specify correct answer section in the edit tab.', () => {
45
+ utilities.verifyInnerText(textSelectionPage.specifyPossibleOptionsTextFieldWrapper(), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n \n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n \n\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
46
+ utilities.verifyInnerText(textSelectionPage.specifyCorrectAnswerTextWrapper(), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n \n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n \n\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
47
+ });
48
+
49
+ it('When the user removes all the text from the question input field and focuses out of it, an error message \'Error: Question is required.\' should be displayed', () => {
50
+ textSelectionPage.steps.clearQuestionInputField();
51
+ textSelectionPage.steps.focusOutOfQuestionInputField();
52
+ utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Question is required.');
53
+ textSelectionPage.steps.verifyErroredStateOfQuestionInputField();
54
+ });
55
+
56
+ textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
57
+
58
+ it('The user should be able to give input in the question input field, then the error message should disappear', () => {
59
+ cy.log('Add Image to Question input field')
60
+ textSelectionPage.steps.focusInQuestionInputField();
61
+ textSelectionPage.steps.selectImageOptionFromCKEditorToolbar();
62
+ textSelectionPage.steps.addImageToInputField();
63
+ textSelectionPage.steps.verifyImageAndAltTextInQuestionInputField();
64
+ textSelectionPage.steps.addInputToQuestionInputField('{enter}');
65
+ cy.log('Add equation to Question input field')
66
+ textSelectionPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
67
+ textSelectionPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
68
+ textSelectionPage.steps.verifyEquationInQuestionInputField();
69
+ textSelectionPage.steps.addInputToQuestionInputField('{rightarrow}{enter}');
70
+ cy.log('Add bold text to input field')
71
+ textSelectionPage.steps.focusInQuestionInputField();
72
+ textSelectionPage.steps.selectBoldOptionFromCKEditorToolbar();
73
+ textSelectionPage.steps.addInputToQuestionInputField('This is Bold text input.');
74
+ textSelectionPage.steps.verifyBoldTextInQuestionInputField();
75
+ textSelectionPage.steps.addInputToQuestionInputField('{enter}');
76
+ cy.log('Add link to Question input field')
77
+ textSelectionPage.steps.selectLinkOptionFromCKEditorToolbar();
78
+ textSelectionPage.steps.addLinkToInputField();
79
+ textSelectionPage.steps.verifyLinkInQuestionInputField();
80
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
81
+ textSelectionPage.steps.focusOutOfQuestionInputField();
82
+ });
83
+
84
+ it('CSS of Question label and Question input field contents', { tags: 'css' }, () => {
85
+ utilities.verifyCSS(textSelectionPage.questionLabel(), {
86
+ 'color': css.color.sectionHeading,
87
+ 'font-size': css.fontSize.normal,
88
+ 'font-weight': css.fontWeight.semibold
89
+ });
90
+ utilities.verifyCSS(textSelectionPage.questionInputField(), {
91
+ 'color': css.color.text,
92
+ 'font-size': css.fontSize.default,
93
+ 'font-weight': css.fontWeight.regular,
94
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`
95
+ });
96
+ utilities.verifyCSS(textSelectionPage.questionInputField().find('a'), {
97
+ 'color': css.color.linkText,
98
+ 'font-size': css.fontSize.default,
99
+ 'font-weight': css.fontWeight.bold
100
+ });
101
+ });
102
+
103
+ it('Image, equation, bold text and link added in Question input field should be properly displayed in specify possible options section', () => {
104
+ textSelectionPage.steps.verifyImageAndAltTextInSpecifyPossibleOptionsSection();
105
+ textSelectionPage.steps.verifyEquationInSpecifyPossibleOptionsSection();
106
+ textSelectionPage.steps.verifyBoldTextInSpecifyPossibleOptionsSection();
107
+ textSelectionPage.steps.verifyLinkInSpecifyPossibleOptionsSection();
108
+ });
109
+
110
+ it('Image, equation, bold text and link added in Question input field should be properly displayed in specify correct answer section', () => {
111
+ textSelectionPage.steps.verifyImageAndAltTextInSpecifyCorrectAnswerSection();
112
+ textSelectionPage.steps.verifyEquationInSpecifyCorrectAnswerSection();
113
+ textSelectionPage.steps.verifyBoldTextInSpecifyCorrectAnswerSection();
114
+ textSelectionPage.steps.verifyLinkInSpecifyCorrectAnswerSection();
115
+ });
116
+ });
117
+
118
+ describe('Question field - Preview tab', () => {
119
+ abortEarlySetup();
120
+ before(() => {
121
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
122
+ cy.barsPreLoaderWait();
123
+ });
124
+
125
+ it('In Preview tab, the sample \'Lorem Ipsum\' text should be displayed in the question field', () => {
126
+ textSelectionPage.steps.switchToPreviewTab()
127
+ utilities.verifyInnerText(textSelectionPage.questionTextWrapperPreviewTab(), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n \n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n \n\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
128
+ });
129
+
130
+ it('The user should be able to edit text in the question input field and the updated question should be displayed in the preview tab', () => {
131
+ cy.log('Switching to edit tab')
132
+ textSelectionPage.steps.switchToEditTab();
133
+ textSelectionPage.steps.clearQuestionInputField();
134
+ cy.log('Add Image to Question input field')
135
+ textSelectionPage.steps.focusInQuestionInputField();
136
+ textSelectionPage.steps.selectImageOptionFromCKEditorToolbar();
137
+ textSelectionPage.steps.addImageToInputField();
138
+ textSelectionPage.steps.verifyImageAndAltTextInQuestionInputField();
139
+ textSelectionPage.steps.addInputToQuestionInputField('{enter}');
140
+ cy.log('Add equation to Question input field')
141
+ textSelectionPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
142
+ textSelectionPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
143
+ textSelectionPage.steps.verifyEquationInQuestionInputField();
144
+ textSelectionPage.steps.addInputToQuestionInputField('{rightarrow}{enter}');
145
+ cy.log('Add bold text to input field')
146
+ textSelectionPage.steps.focusInQuestionInputField();
147
+ textSelectionPage.steps.selectBoldOptionFromCKEditorToolbar();
148
+ textSelectionPage.steps.addInputToQuestionInputField('This is Bold text input.');
149
+ textSelectionPage.steps.verifyBoldTextInQuestionInputField();
150
+ textSelectionPage.steps.addInputToQuestionInputField('{enter}');
151
+ cy.log('Add link to Question input field')
152
+ textSelectionPage.steps.selectLinkOptionFromCKEditorToolbar();
153
+ textSelectionPage.steps.addLinkToInputField();
154
+ textSelectionPage.steps.verifyLinkInQuestionInputField();
155
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
156
+ textSelectionPage.steps.focusOutOfQuestionInputField();
157
+ cy.log('Switching to preview tab')
158
+ textSelectionPage.steps.switchToPreviewTab();
159
+ textSelectionPage.steps.verifyImageAndAltTextInPreviewTab();
160
+ textSelectionPage.steps.verifyEquationInPreviewTab();
161
+ textSelectionPage.steps.verifyBoldTextInPreviewTab();
162
+ textSelectionPage.steps.verifyLinkInPreviewTab();
163
+ });
164
+
165
+ //Failing due to https://redmine.zeuslearning.com/issues/537907
166
+ it('CSS of \'Preview tab\' when image, equation, bold text and link are added', { tags: 'css' }, () => {
167
+ utilities.verifyCSS(textSelectionPage.questionTextWrapperPreviewTab().find('strong'), {
168
+ 'color': css.color.text,
169
+ 'font-size': css.fontSize.default,
170
+ 'font-weight': css.fontWeight.bold
171
+ });
172
+ utilities.verifyCSS(textSelectionPage.questionTextWrapperPreviewTab().find('a'), {
173
+ 'color': css.color.linkText,
174
+ 'font-size': css.fontSize.default,
175
+ 'font-weight': css.fontWeight.bold
176
+ });
177
+ });
178
+ });
179
+ });
@@ -0,0 +1,89 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ 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.'];
6
+
7
+ describe('Create Item page - Text selection: Specify correct answer, Alternative correct answer', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Specify correct answer section - \'Correct\' accordion', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
16
+ cy.barsPreLoaderWait();
17
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
18
+ textSelectionPage.steps.clearQuestionInputField();
19
+ paragraphTextArray.forEach((paragraphText) => {
20
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
21
+ });
22
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
23
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
24
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
25
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
26
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
27
+ });
28
+
29
+ textSelectionPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('text selection');
30
+
31
+ it('In the \'Correct\' accordion the question field text should be displayed and the options should be available as set in \'Specify possible options\' section', () => {
32
+ textSelectionPage.steps.verifySpecifyCorrectAnswerTextAndOptions(paragraphTextArray, [paragraphTextArray[0], paragraphTextArray[1], paragraphTextArray[2]]);
33
+ });
34
+
35
+ textSelectionPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
36
+ });
37
+
38
+ describe('Specify correct answer section - \'Alternative\' accordion', () => {
39
+ abortEarlySetup();
40
+ before(() => {
41
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
42
+ cy.barsPreLoaderWait();
43
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select text from the given paragraph');
44
+ textSelectionPage.steps.clearQuestionInputField();
45
+ paragraphTextArray.forEach((paragraphText) => {
46
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
47
+ });
48
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
49
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
50
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
51
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
52
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
53
+ });
54
+
55
+ textSelectionPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation('text selection');
56
+
57
+ it('When user has added points and set correct answers in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
58
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
59
+ textSelectionPage.steps.allotPoints(20);
60
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
61
+ });
62
+
63
+ it('In the \'Alternate\' accordion the question field text should be displayed and the options should be available as set in \'Specify possible options\' section', () => {
64
+ textSelectionPage.steps.verifySpecifyCorrectAnswerTextAndOptions(paragraphTextArray, [paragraphTextArray[0], paragraphTextArray[1], paragraphTextArray[2]]);
65
+ });
66
+
67
+ textSelectionPage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
68
+
69
+ it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
70
+ textSelectionPage.steps.addAlternativeAnswerAccordion(2);
71
+ });
72
+
73
+ textSelectionPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
74
+
75
+ it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
76
+ cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
77
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
78
+ textSelectionPage.steps.allotPoints(5);
79
+ textSelectionPage.steps.deleteAlternativeAnswerAccordion(1);
80
+ textSelectionPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
81
+ textSelectionPage.steps.verifyAlternativeAnswerAccordionLabel(0);
82
+ });
83
+
84
+ it('When the user deselects an option assigned as correct in the correct accordion then the correct accordion should be in the expanded state', () => {
85
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
86
+ textSelectionPage.steps.verifyCorrectAnswerAccordionIsExpanded();
87
+ });
88
+ });
89
+ });