itemengine-cypress-automation 1.0.239 → 1.0.240

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/headerSection.js +22 -5
  3. package/cypress/e2e/ILC/ChartsLine/headerSection.js +23 -5
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -4
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +3 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +4 -6
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +1 -3
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +3 -4
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +4 -5
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +3 -5
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +172 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +3 -5
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +0 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +3 -8
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +6 -6
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +2 -2
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +3 -1
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -8
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +3 -5
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +2 -2
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +16 -16
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -2
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +3 -3
  35. package/cypress/e2e/ILC/Graphing/headerSection.js +2 -3
  36. package/cypress/e2e/ILC/GridFill/headerSection.js +2 -4
  37. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +6 -3
  38. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -4
  39. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
  40. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
  41. package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -8
  42. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +2 -8
  43. package/cypress/e2e/ILC/ListOrderingNew/optionsOrientationSection.js +150 -0
  44. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/horizontalOrientationAllOrNothingForAllViews.smoke.js +218 -0
  45. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +176 -0
  46. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +170 -0
  47. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +170 -0
  48. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +230 -0
  49. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js +64 -0
  50. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/manuallyAndNonScored.js +110 -0
  51. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +249 -0
  52. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +172 -0
  53. package/cypress/e2e/ILC/Matching/clickAndDrop.js +6 -10
  54. package/cypress/e2e/ILC/Matching/headerSection.js +2 -10
  55. package/cypress/e2e/ILC/Matching/matchingConnector.js +128 -0
  56. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
  57. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
  58. package/cypress/e2e/ILC/MatchingDropdown/editTabBasicSection.js +154 -0
  59. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +4 -6
  60. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -4
  61. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -1
  62. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +3 -9
  63. package/cypress/e2e/ILC/NumberLine/headerSection.js +2 -3
  64. package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -4
  65. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
  66. package/cypress/e2e/ILC/SingleSelection/headerSection.js +2 -5
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -2
  68. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -2
  69. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +2 -9
  70. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +210 -0
  71. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +210 -0
  72. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +258 -0
  73. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +246 -0
  74. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  75. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +245 -0
  76. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +541 -0
  77. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +243 -0
  78. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  79. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +242 -0
  80. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +195 -0
  81. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
  82. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +8 -1
  83. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +12 -0
  84. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
  85. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
  86. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
  87. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +2 -0
  88. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
  89. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  90. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
  91. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
  92. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
  93. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -0
  94. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
  95. package/cypress/e2e/ILC/TextSelection/Scoring/singleSelectionPreviewScoring.js +247 -0
  96. package/cypress/e2e/ILC/TextSelection/headerSection.js +4 -5
  97. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/singleMultipleSelection.js +100 -0
  99. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionOutline.js +248 -0
  100. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionStrikethrough.js +247 -0
  101. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionUnderline.js +239 -0
  102. package/cypress/e2e/ILC/TextSelection/textSelectionStyle.js +150 -0
  103. package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +3 -2
  104. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
  105. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
  106. package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +21 -5
  107. package/cypress/pages/components/autoScoredScoringPreviewTab.js +1 -0
  108. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -11
  109. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -29
  110. package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
  111. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  112. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +2 -3
  113. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -2
  114. package/cypress/pages/components/optionsWrapperComponent.js +2 -2
  115. package/cypress/pages/components/playbackControlsBaseComponent.js +2 -2
  116. package/cypress/pages/components/questionInputFieldComponent.js +1 -0
  117. package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -2
  118. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +1 -1
  119. package/cypress/pages/createItemPage.js +1 -1
  120. package/cypress/pages/dialogBoxBase.js +21 -9
  121. package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -5
  122. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +83 -5
  123. package/cypress/pages/graphingPage.js +4 -7
  124. package/cypress/pages/gridFillPage.js +15 -16
  125. package/cypress/pages/listOrderingPage.js +373 -2
  126. package/cypress/pages/matchingPage.js +89 -33
  127. package/cypress/pages/multipleSelectionGridPage.js +11 -13
  128. package/cypress/pages/multipleSelectionPage.js +4 -5
  129. package/cypress/pages/numberLinePage.js +2 -13
  130. package/cypress/pages/shortTextResponsePage.js +2 -3
  131. package/cypress/pages/textEntryMathPage.js +28 -0
  132. package/cypress/pages/textSelectionPage.js +242 -3
  133. package/cypress/pages/videoResponsePage.js +0 -2
  134. package/package.json +1 -1
  135. /package/cypress/e2e/ILC/TextSelection/{styleAndLayoutCustomizationAccordion.js → styleAndLayoutCustomizationAccordionFilledIn.js} +0 -0
@@ -0,0 +1,248 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import { colorPopupComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ const defaultColorBlocks = ['rgb(82, 0, 255)', 'rgb(0, 112, 128)', 'rgb(128, 102, 69)', 'rgb(102, 102, 102)', 'rgb(0, 0, 0)'];
8
+ const borderBlocks = ['dashed', 'dotted', 'solid', 'none'];
9
+ const borderBlocksInnerText = ['Dashed', 'Dotted', 'Solid', 'None'];
10
+ 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']
11
+
12
+
13
+ describe('Create Item page - Text selection : Style and layout customization', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ describe('Style and layout customization accordion', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
22
+ cy.barsPreLoaderWait();
23
+ });
24
+ textSelectionPage.tests.verifyStyleAndLayoutCustomizationAccordionProperties();
25
+ });
26
+
27
+ describe('Style and layout customization accordion - Contents', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
31
+ cy.barsPreLoaderWait();
32
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
33
+ textSelectionPage.steps.switchTextSelectionStyle('outline');
34
+ });
35
+
36
+ it('When filled in text selection mode is selected, then \'Outline style\', \'Border color\' and \'Border style\' labels should be displayed in style and layout customization accordion', () => {
37
+ utilities.verifyInnerText(textSelectionPage.styleLabel(), 'Outline style');
38
+ utilities.verifyElementVisibilityState(textSelectionPage.styleLabel(), 'visible');
39
+ utilities.verifyInnerText(textSelectionPage.colorLabel(), 'Border color');
40
+ utilities.verifyElementVisibilityState(textSelectionPage.colorLabel(), 'visible');
41
+ utilities.verifyInnerText(textSelectionPage.borderStyle(), 'Border style');
42
+ utilities.verifyElementVisibilityState(textSelectionPage.borderStyle(), 'visible');
43
+ });
44
+
45
+ it('5 color blocks and \'Edit color\' button should be displayed and the first blue color block should be selected', () => {
46
+ for (let index = 0; index < 5; index++) {
47
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
48
+ }
49
+ utilities.verifyElementCount(textSelectionPage.colorBlock(), 5);
50
+ textSelectionPage.steps.verifyColorBlockIsSelected(0);
51
+ utilities.verifyInnerText(textSelectionPage.editColorButton(), 'Edit color');
52
+ utilities.verifyElementVisibilityState(textSelectionPage.editColorButton(), 'visible');
53
+ });
54
+
55
+ it('4 border style blocks button should be displayed and solid border block should be selected', () => {
56
+ utilities.verifyElementCount(textSelectionPage.borderBlock(), 4);
57
+ for (let index = 0; index < 4; index++) {
58
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.borderBlockInnerText(), index), borderBlocksInnerText[index]);
59
+ }
60
+ textSelectionPage.steps.verifyBorderBlockIsSelected(2);
61
+ });
62
+
63
+ it('CSS of style and layout customization accordion contents', { tags: 'css' }, () => {
64
+ utilities.verifyCSS(textSelectionPage.styleLabel(), {
65
+ 'color': css.color.labels,
66
+ 'font-size': css.fontSize.default,
67
+ 'font-weight': css.fontWeight.bold
68
+ });
69
+ utilities.verifyCSS(textSelectionPage.colorLabel(), {
70
+ 'color': css.color.labels,
71
+ 'font-size': css.fontSize.normal,
72
+ 'font-weight': css.fontWeight.semibold
73
+ });
74
+ utilities.verifyCSS(textSelectionPage.borderStyle(), {
75
+ 'color': css.color.labels,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.semibold
78
+ });
79
+ utilities.verifyCSS(textSelectionPage.editColorButton(), {
80
+ 'color': css.color.activeButtons,
81
+ 'font-size': css.fontSize.default,
82
+ 'font-weight': css.fontWeight.regular
83
+ });
84
+ });
85
+
86
+ it('Accessibility of style and layout customization accordion contents', { tags: 'a11y' }, () => {
87
+ cy.checkAccessibility(textSelectionPage.styleLabel().parents('.ngie-accordion-detail'));
88
+ });
89
+
90
+ it('When the user clicks on the edit color button in the accordion, a color popup should be displayed for the selected color block', () => {
91
+ textSelectionPage.steps.clickOnEditColorButton();
92
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
93
+ });
94
+
95
+ it('A title \'Select color\' should be displayed on the color popup', () => {
96
+ colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
97
+ });
98
+
99
+ it('A \'Color saturation palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
100
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
101
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 255, 255)');
102
+ });
103
+
104
+ it('A \'Color hue palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
105
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
106
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
107
+ });
108
+
109
+ it('A \'Selected color\' label and color block displaying the selected color should be displayed', () => {
110
+ colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
111
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(255, 255, 255)');
112
+ });
113
+
114
+ it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
115
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
116
+ colorPopupComponent.steps.verifyHexValue('#ffffff');
117
+ });
118
+
119
+ it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
120
+ colorPopupComponent.steps.verifyColorPopupCancelButton();
121
+ colorPopupComponent.steps.verifyColorPopupOkButton();
122
+ });
123
+ });
124
+
125
+ describe('Color popup - Updating the selected color', () => {
126
+ abortEarlySetup();
127
+ before(() => {
128
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
129
+ cy.barsPreLoaderWait();
130
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
131
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
132
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
133
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
134
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
135
+ textSelectionPage.steps.switchTextSelectionStyle('outline');
136
+ });
137
+
138
+ it('When the user moves the color picker in the color saturation palette, color in the selected color block and the hex code should change, color in the hue color palette', () => {
139
+ textSelectionPage.steps.clickOnEditColorButton();
140
+ colorPopupComponent.steps.clickInColorSaturationPalette();
141
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(121, 60, 60)');
142
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(119, 60, 60)');
143
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
144
+ colorPopupComponent.steps.verifyHexValue('#793c3c');
145
+ });
146
+
147
+ it('When the user moves the color picker in the color hue palette, color in the selected color block, the hex code and the saturation color palette should change', () => {
148
+ colorPopupComponent.steps.clickInColorHuePalette();
149
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(60, 121, 121)');
150
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 255, 255)');
151
+ colorPopupComponent.steps.verifyHexValue('#3c7979');
152
+ });
153
+
154
+ it('When the user changes the color using hex code, the color in color saturation palette and color hue palette should change', () => {
155
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
156
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
157
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
158
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
159
+ });
160
+
161
+ it('When the user modifies the selected color block in the color popup and clicks on \'Cancel\' button, then the popup should close, the color block should not change and the modifications in the color popup should not persist', () => {
162
+ colorPopupComponent.steps.clickOnCancelButton();
163
+ utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'notExist');
164
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(0, defaultColorBlocks[0]);
165
+ });
166
+
167
+ it('When the user modifies the selected color block in the color popup and clicks on \'Ok\' button, then the updated color should be applied to the previously selected color block and the rest of the color blocks should remain unchanged', () => {
168
+ textSelectionPage.steps.clickOnEditColorButton();
169
+ colorPopupComponent.steps.addInputToHexInputField('#558632');
170
+ colorPopupComponent.steps.clickOnOkButton();
171
+ utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'notExist');
172
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(0, 'rgb(85, 134, 50)');
173
+ for (let index = 1; index < 5; index++) {
174
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
175
+ }
176
+ textSelectionPage.steps.verifyStyleInSpecifyPossibleOptions('outline', 0, 'rgb(85, 134, 50)');
177
+ textSelectionPage.steps.verifyStyleInSpecifyCorrectAnswer('outline', 0, 'rgb(85, 134, 50)');
178
+ })
179
+ });
180
+
181
+ describe('Selecting a different color block and border style block for outline style - edit tab functionality', () => {
182
+ abortEarlySetup();
183
+ before(() => {
184
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
185
+ cy.barsPreLoaderWait();
186
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
187
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
188
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
189
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
190
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
191
+ textSelectionPage.steps.switchTextSelectionStyle('outline');
192
+ });
193
+
194
+ it('User should be able to select a different color block and the newly selected color block\'s color should be applied to selected state of text selection in edit tab', () => {
195
+ for (let index = 0; index < 5; index++) {
196
+ textSelectionPage.steps.selectColorBlock(index);
197
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
198
+ textSelectionPage.steps.verifyStyleInSpecifyPossibleOptions('outline', 0, defaultColorBlocks[index]);
199
+ textSelectionPage.steps.verifyStyleInSpecifyCorrectAnswer('outline', 0, defaultColorBlocks[index]);
200
+ }
201
+ });
202
+
203
+ it('User should be able to select a different border style block and the newly selected border block\'s style should be applied to selected state of text selection in edit tab', () => {
204
+ for (let index = 0; index < 4; index++) {
205
+ textSelectionPage.steps.selectBorderBlock(index);
206
+ textSelectionPage.steps.verifyBorderBlockIsSelected(index);
207
+ textSelectionPage.steps.verifyBorderStyleInSpecifyPossibleOptions('outline', 0, borderBlocks[index]);
208
+ textSelectionPage.steps.verifyBorderStyleInSpecifyCorrectAnswer('outline', 0, borderBlocks[index]);
209
+ }
210
+ });
211
+ });
212
+
213
+ describe('Selecting a different color block and border style block for outline style - preview tab functionality', () => {
214
+ abortEarlySetup();
215
+ before(() => {
216
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
217
+ cy.barsPreLoaderWait();
218
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
219
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
220
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
221
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
222
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
223
+ textSelectionPage.steps.switchTextSelectionStyle('outline');
224
+ });
225
+
226
+ it('The newly selected color block\'s color should be applied to selected state of text selection in preview tab', () => {
227
+ for (let index = 0; index < 5; index++) {
228
+ textSelectionPage.steps.selectColorBlock(index);
229
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
230
+ textSelectionPage.steps.switchToPreviewTab();
231
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
232
+ textSelectionPage.steps.verifyStyleInPreview('outline', 0, defaultColorBlocks[index]);
233
+ textSelectionPage.steps.switchToEditTab();
234
+ }
235
+ });
236
+
237
+ it('The newly selected border block\'s style should be applied to selected state of text selection in preview tab', () => {
238
+ for (let index = 0; index < 4; index++) {
239
+ textSelectionPage.steps.selectBorderBlock(index);
240
+ textSelectionPage.steps.verifyBorderBlockIsSelected(index);
241
+ textSelectionPage.steps.switchToPreviewTab();
242
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
243
+ textSelectionPage.steps.verifyBorderStyleInPreview('outline', 0, borderBlocks[index]);
244
+ textSelectionPage.steps.switchToEditTab();
245
+ }
246
+ });
247
+ });
248
+ });
@@ -0,0 +1,247 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import { colorPopupComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ const defaultColorBlocks = ['rgb(82, 0, 255)', 'rgb(0, 112, 128)', 'rgb(128, 102, 69)', 'rgb(102, 102, 102)', 'rgb(0, 0, 0)'];
8
+ const borderBlocks = ['dashed', 'dotted', 'solid'];
9
+ const borderBlocksInnerText = ['Dashed', 'Dotted', 'Solid'];
10
+ 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']
11
+
12
+
13
+ describe('Create Item page - Text selection : Style and layout customization', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ describe('Style and layout customization accordion', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
22
+ cy.barsPreLoaderWait();
23
+ });
24
+ textSelectionPage.tests.verifyStyleAndLayoutCustomizationAccordionProperties();
25
+ });
26
+
27
+ describe('Style and layout customization accordion - Contents', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
31
+ cy.barsPreLoaderWait();
32
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
33
+ textSelectionPage.steps.switchTextSelectionStyle('strikethrough');
34
+ });
35
+
36
+ it('When filled in text selection mode is selected, then \'Strikethrough style\', \'Border color\' and \'Border style\' labels should be displayed in style and layout customization accordion', () => {
37
+ utilities.verifyInnerText(textSelectionPage.styleLabel(), 'Strikethrough style');
38
+ utilities.verifyElementVisibilityState(textSelectionPage.styleLabel(), 'visible');
39
+ utilities.verifyInnerText(textSelectionPage.colorLabel(), 'Color');
40
+ utilities.verifyElementVisibilityState(textSelectionPage.colorLabel(), 'visible');
41
+ utilities.verifyInnerText(textSelectionPage.borderStyle(), 'Border style');
42
+ utilities.verifyElementVisibilityState(textSelectionPage.borderStyle(), 'visible');
43
+ });
44
+
45
+ it('5 color blocks and \'Edit color\' button should be displayed and the first blue color block should be selected', () => {
46
+ for (let index = 0; index < 5; index++) {
47
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
48
+ }
49
+ utilities.verifyElementCount(textSelectionPage.colorBlock(), 5);
50
+ textSelectionPage.steps.verifyColorBlockIsSelected(0);
51
+ utilities.verifyInnerText(textSelectionPage.editColorButton(), 'Edit color');
52
+ utilities.verifyElementVisibilityState(textSelectionPage.editColorButton(), 'visible');
53
+ });
54
+
55
+ it('3 border style blocks button should be displayed and solid border block should be selected', () => {
56
+ utilities.verifyElementCount(textSelectionPage.borderBlock(), 3);
57
+ for (let index = 0; index < 3; index++) {
58
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.borderBlockInnerText(), index), borderBlocksInnerText[index]);
59
+ }
60
+ textSelectionPage.steps.verifyBorderBlockIsSelected(2);
61
+ });
62
+
63
+ it('CSS of style and layout customization accordion contents', { tags: 'css' }, () => {
64
+ utilities.verifyCSS(textSelectionPage.styleLabel(), {
65
+ 'color': css.color.labels,
66
+ 'font-size': css.fontSize.default,
67
+ 'font-weight': css.fontWeight.bold
68
+ });
69
+ utilities.verifyCSS(textSelectionPage.colorLabel(), {
70
+ 'color': css.color.labels,
71
+ 'font-size': css.fontSize.normal,
72
+ 'font-weight': css.fontWeight.semibold
73
+ });
74
+ utilities.verifyCSS(textSelectionPage.borderStyle(), {
75
+ 'color': css.color.labels,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.semibold
78
+ });
79
+ utilities.verifyCSS(textSelectionPage.editColorButton(), {
80
+ 'color': css.color.activeButtons,
81
+ 'font-size': css.fontSize.default,
82
+ 'font-weight': css.fontWeight.regular
83
+ });
84
+ });
85
+ it('Accessibility of style and layout customization accordion contents', { tags: 'a11y' }, () => {
86
+ cy.checkAccessibility(textSelectionPage.styleLabel().parents('.ngie-accordion-detail'));
87
+ });
88
+
89
+ it('When the user clicks on the edit color button in the accordion, a color popup should be displayed for the selected color block', () => {
90
+ textSelectionPage.steps.clickOnEditColorButton();
91
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
92
+ });
93
+
94
+ it('A title \'Select color\' should be displayed on the color popup', () => {
95
+ colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
96
+ });
97
+
98
+ it('A \'Color saturation palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
99
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
100
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 255, 255)');
101
+ });
102
+
103
+ it('A \'Color hue palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
104
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
105
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
106
+ });
107
+
108
+ it('A \'Selected color\' label and color block displaying the selected color should be displayed', () => {
109
+ colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
110
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(255, 255, 255)');
111
+ });
112
+
113
+ it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
114
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
115
+ colorPopupComponent.steps.verifyHexValue('#ffffff');
116
+ });
117
+
118
+ it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
119
+ colorPopupComponent.steps.verifyColorPopupCancelButton();
120
+ colorPopupComponent.steps.verifyColorPopupOkButton();
121
+ });
122
+ });
123
+
124
+ describe('Color popup - Updating the selected color', () => {
125
+ abortEarlySetup();
126
+ before(() => {
127
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
128
+ cy.barsPreLoaderWait();
129
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
130
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
131
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
132
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
133
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
134
+ textSelectionPage.steps.switchTextSelectionStyle('strikethrough');
135
+ });
136
+
137
+ it('When the user moves the color picker in the color saturation palette, color in the selected color block and the hex code should change, color in the hue color palette', () => {
138
+ textSelectionPage.steps.clickOnEditColorButton();
139
+ colorPopupComponent.steps.clickInColorSaturationPalette();
140
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(121, 60, 60)');
141
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(119, 60, 60)');
142
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
143
+ colorPopupComponent.steps.verifyHexValue('#793c3c');
144
+ });
145
+
146
+ it('When the user moves the color picker in the color hue palette, color in the selected color block, the hex code and the saturation color palette should change', () => {
147
+ colorPopupComponent.steps.clickInColorHuePalette();
148
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(60, 121, 121)');
149
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 255, 255)');
150
+ colorPopupComponent.steps.verifyHexValue('#3c7979');
151
+ });
152
+
153
+ it('When the user changes the color using hex code, the color in color saturation palette and color hue palette should change', () => {
154
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
155
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
156
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
157
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
158
+ });
159
+
160
+ it('When the user modifies the selected color block in the color popup and clicks on \'Cancel\' button, then the popup should close, the color block should not change and the modifications in the color popup should not persist', () => {
161
+ colorPopupComponent.steps.clickOnCancelButton();
162
+ utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'notExist');
163
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(0, defaultColorBlocks[0]);
164
+ });
165
+
166
+ it('When the user modifies the selected color block in the color popup and clicks on \'Ok\' button, then the updated color should be applied to the previously selected color block and the rest of the color blocks should remain unchanged', () => {
167
+ textSelectionPage.steps.clickOnEditColorButton();
168
+ colorPopupComponent.steps.addInputToHexInputField('#558632');
169
+ colorPopupComponent.steps.clickOnOkButton();
170
+ utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'notExist');
171
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(0, 'rgb(85, 134, 50)');
172
+ for (let index = 1; index < 5; index++) {
173
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
174
+ }
175
+ textSelectionPage.steps.verifyStyleInSpecifyPossibleOptions('strikethrough', 0, 'rgb(85, 134, 50)');
176
+ textSelectionPage.steps.verifyStyleInSpecifyCorrectAnswer('strikethrough', 0, 'rgb(85, 134, 50)');
177
+ })
178
+ });
179
+
180
+ describe('Selecting a different color block and border style block for strikethrough style - edit tab functionality', () => {
181
+ abortEarlySetup();
182
+ before(() => {
183
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
184
+ cy.barsPreLoaderWait();
185
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
186
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
187
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
188
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
189
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
190
+ textSelectionPage.steps.switchTextSelectionStyle('strikethrough');
191
+ });
192
+
193
+ it('User should be able to select a different color block and the newly selected color block\'s color should be applied to selected state of text selection in edit tab', () => {
194
+ for (let index = 0; index < 5; index++) {
195
+ textSelectionPage.steps.selectColorBlock(index);
196
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
197
+ textSelectionPage.steps.verifyStyleInSpecifyPossibleOptions('strikethrough', 0, defaultColorBlocks[index]);
198
+ textSelectionPage.steps.verifyStyleInSpecifyCorrectAnswer('strikethrough', 0, defaultColorBlocks[index]);
199
+ }
200
+ });
201
+
202
+ it('User should be able to select a different border style block and the newly selected border block\'s style should be applied to selected state of text selection in edit tab', () => {
203
+ for (let index = 0; index < 3; index++) {
204
+ textSelectionPage.steps.selectBorderBlock(index);
205
+ textSelectionPage.steps.verifyBorderBlockIsSelected(index);
206
+ textSelectionPage.steps.verifyBorderStyleInSpecifyPossibleOptions('strikethrough', 0, borderBlocks[index]);
207
+ textSelectionPage.steps.verifyBorderStyleInSpecifyCorrectAnswer('strikethrough', 0, borderBlocks[index]);
208
+ }
209
+ });
210
+ });
211
+
212
+ describe('Selecting a different color block and border style block for strikethrough style - preview tab functionality', () => {
213
+ abortEarlySetup();
214
+ before(() => {
215
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
216
+ cy.barsPreLoaderWait();
217
+ textSelectionPage.steps.expandStyleAndLayoutCustomizationAccordion();
218
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
219
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
220
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
221
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
222
+ textSelectionPage.steps.switchTextSelectionStyle('strikethrough');
223
+ });
224
+
225
+ it('The newly selected color block\'s color should be applied to selected state of text selection in preview tab', () => {
226
+ for (let index = 0; index < 5; index++) {
227
+ textSelectionPage.steps.selectColorBlock(index);
228
+ textSelectionPage.steps.verifyColorBlockBackgroundColor(index, defaultColorBlocks[index]);
229
+ textSelectionPage.steps.switchToPreviewTab();
230
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
231
+ textSelectionPage.steps.verifyStyleInPreview('strikethrough', 0, defaultColorBlocks[index]);
232
+ textSelectionPage.steps.switchToEditTab();
233
+ }
234
+ });
235
+
236
+ it('The newly selected border block\'s style should be applied to selected state of text selection in preview tab', () => {
237
+ for (let index = 0; index < 3; index++) {
238
+ textSelectionPage.steps.selectBorderBlock(index);
239
+ textSelectionPage.steps.verifyBorderBlockIsSelected(index);
240
+ textSelectionPage.steps.switchToPreviewTab();
241
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
242
+ textSelectionPage.steps.verifyBorderStyleInPreview('strikethrough', 0, borderBlocks[index]);
243
+ textSelectionPage.steps.switchToEditTab();
244
+ }
245
+ });
246
+ });
247
+ });