itemengine-cypress-automation 1.0.173 → 1.0.174

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -18
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +10 -7
  4. package/cypress/e2e/ILC/FeedbackScaleNew/additionalSettings.js +111 -0
  5. package/cypress/e2e/ILC/FeedbackScaleNew/colorPopup.js +206 -0
  6. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +262 -0
  7. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +51 -0
  8. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +17 -17
  9. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +2 -2
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +3 -3
  12. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +1 -0
  13. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +6 -7
  14. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +3 -3
  15. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -1
  16. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  17. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +0 -1
  18. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -0
  19. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -4
  20. package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +2 -2
  21. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +12 -12
  22. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +91 -90
  23. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +93 -92
  24. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +97 -95
  25. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +62 -62
  26. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +118 -117
  27. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +124 -120
  28. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -125
  29. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +97 -96
  30. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +222 -196
  31. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +34 -34
  32. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +20 -20
  33. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +29 -29
  34. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
  35. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +40 -37
  36. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +7 -4
  37. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +14 -12
  38. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +24 -23
  39. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +2 -2
  40. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -0
  42. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -0
  43. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -0
  44. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -0
  45. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -0
  46. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  47. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +8 -15
  48. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +1 -0
  49. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +1 -1
  51. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +332 -0
  52. package/cypress/e2e/ILC/TextSelection/Scoring/manuallyAndNonScored.js +149 -0
  53. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +11 -11
  56. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +3 -3
  57. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +337 -0
  58. package/cypress/e2e/ILC/TextSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +206 -0
  59. package/cypress/e2e/ILC/TextSelection/{previewContentsForAllViews.js → previewContentsForAllViews.smoke.js} +3 -3
  60. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +87 -87
  61. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +5 -5
  62. package/cypress/pages/audioResponsePage.js +1 -0
  63. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -1
  64. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  65. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -4
  66. package/cypress/pages/components/colorPopupComponent.js +11 -0
  67. package/cypress/pages/components/createCustomCategoryFlyout.js +13 -9
  68. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  69. package/cypress/pages/components/equationEditorFlyout.js +0 -1
  70. package/cypress/pages/components/essayResponseCommonComponents.js +1 -1
  71. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  72. package/cypress/pages/components/index.js +2 -1
  73. package/cypress/pages/components/optionsWrapperComponent.js +2 -1
  74. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  75. package/cypress/pages/components/questionInstructionsComponent.js +19 -7
  76. package/cypress/pages/components/setPointsPopupBase.js +17 -4
  77. package/cypress/pages/components/studentViewSettingsLabelComponent.js +2 -2
  78. package/cypress/pages/drawingResponsePage.js +2 -3
  79. package/cypress/pages/feedbackScalePage.js +143 -2
  80. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  81. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +12 -12
  82. package/cypress/pages/graphingPage.js +6 -6
  83. package/cypress/pages/gridFillPage.js +64 -7
  84. package/cypress/pages/matchingPage.js +3 -3
  85. package/cypress/pages/numberLinePage.js +342 -215
  86. package/cypress/pages/readingRulerPage.js +1 -1
  87. package/cypress/pages/textEntryMathPage.js +9 -0
  88. package/cypress/pages/textEntryMathWithImagePage.js +11 -11
  89. package/cypress/pages/textSelectionPage.js +125 -57
  90. package/package.json +1 -1
  91. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  92. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  93. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  94. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -355
  95. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  96. package/cypress/pages/feedbackScalePage copy.js +0 -716
@@ -349,8 +349,6 @@ describe('Create item page - Drawing response: Customize special characters, Cus
349
349
  utilities.verifyElementVisibilityState(colorPopupComponent.hexLabel(), 'visible');
350
350
  utilities.verifyInnerText(colorPopupComponent.hexLabel(), 'Hex');
351
351
  utilities.verifyElementVisibilityState(colorPopupComponent.hexInputField(), 'visible');
352
- utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), 'visible');
353
- utilities.verifyInnerText(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), 'Set to no color');
354
352
  utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupCancelButton(), 'visible');
355
353
  utilities.verifyInnerText(drawingResponsePage.editTabColorPickerPopupCancelButton(), 'Cancel');
356
354
  utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupOkButton(), 'visible');
@@ -469,13 +467,6 @@ describe('Create item page - Drawing response: Customize special characters, Cus
469
467
  'font-size': css.fontSize.default,
470
468
  'font-weight': css.fontWeight.regular
471
469
  });
472
- utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), {
473
- 'color': css.color.activeButtons,
474
- 'font-weight': css.fontWeight.regular
475
- });
476
- utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton().find('svg'), {
477
- 'color': css.color.activeButtons
478
- });
479
470
  utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupCancelButton().find('p'), {
480
471
  'color': css.color.secondaryBtn,
481
472
  'font-size': css.fontSize.default,
@@ -532,8 +523,6 @@ describe('Create item page - Drawing response: Customize special characters, Cus
532
523
  utilities.verifyElementVisibilityState(colorPopupComponent.hexLabel(), 'visible');
533
524
  utilities.verifyInnerText(colorPopupComponent.hexLabel(), 'Hex');
534
525
  utilities.verifyElementVisibilityState(colorPopupComponent.hexInputField(), 'visible');
535
- utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), 'visible');
536
- utilities.verifyInnerText(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), 'Set to no color');
537
526
  utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupCancelButton(), 'visible');
538
527
  utilities.verifyInnerText(drawingResponsePage.editTabColorPickerPopupCancelButton(), 'Cancel');
539
528
  utilities.verifyElementVisibilityState(drawingResponsePage.editTabColorPickerPopupOkButton(), 'visible');
@@ -650,13 +639,6 @@ describe('Create item page - Drawing response: Customize special characters, Cus
650
639
  'font-size': css.fontSize.default,
651
640
  'font-weight': css.fontWeight.regular
652
641
  });
653
- utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton(), {
654
- 'color': css.color.activeButtons,
655
- 'font-weight': css.fontWeight.regular
656
- });
657
- utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupSetToNoColorButton().find('svg'), {
658
- 'color': css.color.activeButtons
659
- });
660
642
  utilities.verifyCSS(drawingResponsePage.editTabColorPickerPopupCancelButton().find('p'), {
661
643
  'color': css.color.secondaryBtn,
662
644
  'font-size': css.fontSize.default,
@@ -26,7 +26,7 @@ describe('Create item page - Drawing response: Question instructions, Customize
26
26
  drawingResponsePage.tests.verifyQuestionInstructionsInputFieldEditTab();
27
27
  });
28
28
 
29
- //Failing due to https://redmine.zeuslearning.com/issues/555576
29
+ //Failing due to https://redmine.zeuslearning.com/issues/567593
30
30
  describe('Question instructions input field - Preview tab', () => {
31
31
  abortEarlySetup();
32
32
  before(() => {
@@ -189,13 +189,14 @@ describe('Create question page - Essay Response: Create custom category', () =>
189
189
  utilities.verifyInnerText(createCustomCategoryFlyout.selectSymbolsToDisplayLabel(), 'Select the symbols to display to the students.');
190
190
  });
191
191
 
192
- it(`${allCategories} accordions should be displayed with their respective labels and unchecked checkboxes. `, () => {
192
+ //Failing due to https://redmine.zeuslearning.com/issues/566948
193
+ it(`${allCategories} accordions expect ${equationEditorCategoriesAndSymbols['numPad'].displayName} should be displayed with their respective labels and unchecked checkboxes.`, () => {
193
194
  createCustomCategoryFlyout.steps.verifyCreateCustomCategoryAccordionLabelsAndDefaultCheckbox();
194
195
  });
195
196
 
196
- it(`By default, the ${equationEditorCategoriesAndSymbols['numPad'].displayName} category accordion should be expanded and other all accordions should be in collapsed state`, () => {
197
- for (let index = 0; index < allCategories.length; index++) {
198
- if (allCategories[index] === 'numPad') {
197
+ it(`By default, the ${equationEditorCategoriesAndSymbols['intermediate'].displayName} category accordion should be expanded and other all accordions should be in collapsed state`, () => {
198
+ for (let index = 1; index < allCategories.length; index++) {
199
+ if (allCategories[index] === 'intermediate') {
199
200
  createCustomCategoryFlyout.steps.verifyCategoryAccordionIsExpanded(`${equationEditorCategoriesAndSymbols[allCategories[index]].displayName}`);
200
201
  } else {
201
202
  createCustomCategoryFlyout.steps.verifyCategoryAccordionIsCollapsed(`${equationEditorCategoriesAndSymbols[allCategories[index]].displayName}`);
@@ -208,12 +209,14 @@ describe('Create question page - Essay Response: Create custom category', () =>
208
209
  utilities.verifyElementVisibilityState(createCustomCategoryFlyout.buttonSave(), 'visible');
209
210
  });
210
211
 
211
- allCategories.forEach((categoryName) => {
212
+ allCategories.slice(1).forEach((categoryName) => {
212
213
  it(`On clicking the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category accordion the category should be expanded`, () => {
213
- createCustomCategoryFlyout.steps.expandCategoryAccordion(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
214
+ if (categoryName != 'Intermediate') {
215
+ createCustomCategoryFlyout.steps.expandCategoryAccordion(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
216
+ }
214
217
  });
215
218
 
216
- it(`The ${equationEditorCategoriesAndSymbols[categoryName].displayName} category accordian should display all the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category Symbols. By default, all the symbols should be deselected`, () => {
219
+ it(`The ${equationEditorCategoriesAndSymbols[categoryName].displayName} category accordion should display all the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category Symbols. By default, all the symbols should be deselected`, () => {
217
220
  const symbolsArray = Object.values(equationEditorCategoriesAndSymbols[categoryName].symbols)
218
221
  createCustomCategoryFlyout.steps.verifySymbolsDisplayedInCustomCategoryFlyoutCategoryAccordion(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`, symbolsArray)
219
222
  });
@@ -0,0 +1,111 @@
1
+ import { feedbackScalePage } from "../../../pages/feedbackScalePage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
6
+
7
+ describe('Create item page: Feedback scale: Additional settings', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Additional settings accordion', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to Feedback scale question type');
16
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
17
+ });
18
+
19
+ feedbackScalePage.tests.verifyAdditionalSettingsAccordionProperties();
20
+ });
21
+
22
+ describe('Additional settings: Font size contents', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ cy.log('Navigate to Feedback scale question type');
26
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
27
+ feedbackScalePage.steps.expandAdditionalSettings();
28
+ });
29
+
30
+ feedbackScalePage.tests.verifyFontSizeSectionContents();
31
+ });
32
+
33
+ describe('Additional settings: Font size contents preview tab section', () => {
34
+ const moreInfoFontSizes = { 'Default': '14px', 'Small': '12px', 'Normal': '14px', 'Large': '17px', 'Extra large': '20px', 'Huge': '24px' };
35
+ abortEarlySetup();
36
+ before(() => {
37
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
38
+ feedbackScalePage.steps.addTextInQuestionInstructionsInputField('Reflect on your progress toward the learning target by rating your comfort level.');
39
+ feedbackScalePage.steps.expandOptionAccordion(0);
40
+ feedbackScalePage.steps.addLegendText(0, 'I am uncomfortable with the learning target.');
41
+ feedbackScalePage.steps.expandAdditionalSettings();
42
+ feedbackScalePage.steps.checkAllowStudentsToAddCommentCheckbox();
43
+ });
44
+
45
+ Object.keys(fontSizes).forEach((option, fontsIndex) => {
46
+ it(`When the user selects \'${option}\' option from the Font size dropdown, then font size of the preview contents should be changed to ${fontSizes[option]} in the preview tab`, () => {
47
+ feedbackScalePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
48
+ utilities.verifyInnerText(feedbackScalePage.fontSizeDropdown(), `${option}`);
49
+ feedbackScalePage.steps.switchToPreviewTab();
50
+ utilities.verifyCSS(feedbackScalePage.questionInstructionsText(), {
51
+ 'font-size': fontSizes[option]
52
+ });
53
+ utilities.verifyCSS(feedbackScalePage.feedbackButton(), {
54
+ 'font-size': fontSizes[option]
55
+ });
56
+ utilities.verifyCSS(feedbackScalePage.legendAccordion().find('.customize_info_label'), {
57
+ 'font-size': moreInfoFontSizes[option]
58
+ });
59
+ utilities.verifyCSS(feedbackScalePage.legendTextFeedbackButtonLabel(), {
60
+ 'font-size': moreInfoFontSizes[option]
61
+ });
62
+ utilities.verifyCSS(feedbackScalePage.legendTextPreviewTab(), {
63
+ 'font-size': moreInfoFontSizes[option]
64
+ });
65
+ utilities.verifyCSS(feedbackScalePage.commentLabel(), {
66
+ 'font-size': fontSizes[option]
67
+ });
68
+ utilities.verifyCSS(feedbackScalePage.commentInputField(), {
69
+ 'font-size': fontSizes[option]
70
+ });
71
+ feedbackScalePage.steps.switchToEditTab();
72
+ });
73
+ });
74
+ });
75
+
76
+ describe('Additional Settings: Details section', () => {
77
+ abortEarlySetup();
78
+ before(() => {
79
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
80
+ feedbackScalePage.steps.expandAdditionalSettings();
81
+ });
82
+
83
+ it('\'Details\' label should be displayed', () => {
84
+ utilities.verifyInnerText(feedbackScalePage.additionalSettingsDetailsLabel(), 'Details');
85
+ });
86
+
87
+ it('\'Acknowledgements & reference\' label and input field should be displayed and user should be able to enter \'Acknowledgements & reference\'', () => {
88
+ utilities.verifyInnerText(feedbackScalePage.additionalSettingsAcknowledgementsLabel(), 'Acknowledgements and references');
89
+ feedbackScalePage.steps.enterTextInAcknowledgementsInputField('Acknowledgements');
90
+ utilities.verifyTextContent(feedbackScalePage.additionalSettingsAcknowledgementsInputField(), 'Acknowledgements');
91
+ });
92
+
93
+ it('CSS of \'Details\' section', { tags: 'css' }, () => {
94
+ utilities.verifyCSS(additionalSettingsPanel.additionalSettingsDetailsLabel(), {
95
+ 'color': css.color.sectionHeading,
96
+ 'font-size': css.fontSize.default,
97
+ 'font-weight': css.fontWeight.semibold
98
+ });
99
+ utilities.verifyCSS(additionalSettingsPanel.additionalSettingsAcknowledgementsLabel(), {
100
+ 'color': css.color.labels,
101
+ 'font-size': css.fontSize.normal,
102
+ 'font-weight': css.fontWeight.semibold
103
+ });
104
+ utilities.verifyCSS(additionalSettingsPanel.additionalSettingsAcknowledgementsInputField(), {
105
+ 'color': css.color.text,
106
+ 'font-size': css.fontSize.default,
107
+ 'font-weight': css.fontWeight.regular
108
+ });
109
+ });
110
+ });
111
+ });
@@ -0,0 +1,206 @@
1
+ import { dialogBoxBase } from "../../../pages";
2
+ import { colorPopupComponent } from "../../../pages/components";
3
+ import { feedbackScalePage } from "../../../pages/feedbackScalePage";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ const css = Cypress.env('css');
7
+ const recommendedColors = ['rgb(255, 133, 165)', 'rgb(236, 216, 19)', 'rgb(77, 188, 147)', 'rgb(196, 56, 56)', 'rgb(184, 88, 48)', 'rgb(41, 121, 175)', 'rgb(0, 111, 111)', 'rgb(42, 183, 58)', 'rgb(107, 139, 255)', 'rgb(0, 0, 0)', 'rgb(226, 121, 0)', 'rgb(255, 56, 0)'];
8
+ describe('Create item page: Feedback scale: Color popup', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Color popup contents', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
17
+ cy.barsPreLoaderWait();
18
+ feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
19
+ });
20
+
21
+ it('When the user clicks on the color block present in an option accordion, a color popup should be displayed', () => {
22
+ feedbackScalePage.steps.editColor(0);
23
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
24
+ });
25
+
26
+ it('A title \'Select color\' should be displayed on the color popup', () => {
27
+ colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
28
+ });
29
+
30
+ 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', () => {
31
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
32
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 133, 165)');
33
+ });
34
+
35
+ 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', () => {
36
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
37
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 68)');
38
+ });
39
+
40
+ it('A \'Selected color\' label and color block displaying the selected color should be displayed', () => {
41
+ colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
42
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(255, 133, 165)');
43
+ });
44
+
45
+ it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
46
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
47
+ colorPopupComponent.steps.verifyHexValue('#FF85A5');
48
+ });
49
+
50
+ it('A \'Opacity\' label, a slider at 100% and an input field with pre-filled value - 100% should be displayed', () => {
51
+ colorPopupComponent.steps.verifyOpacityLabelSliderAndInputField();
52
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
53
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
54
+ });
55
+
56
+ it('A \'Recommended colors\' label along with recommended color blocks - Red, Yellow, Green, Black should be displayed', () => {
57
+ colorPopupComponent.steps.verifyRecommendedColorsLabel();
58
+ utilities.verifyElementCount(colorPopupComponent.recommendedColorBlock(), 12);
59
+ recommendedColors.forEach((color, blockIndex) => {
60
+ colorPopupComponent.steps.verifyRecommendedColorBlockValue(blockIndex, color);
61
+ });
62
+ });
63
+
64
+ it('When the selected color is one of the recommended color, then a \'selected\' icon should appear on the respective recommended color block', () => {
65
+ colorPopupComponent.steps.verifyRecommendedColorBlockSelectedState(0);
66
+ });
67
+
68
+ it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
69
+ colorPopupComponent.steps.verifyColorPopupCancelButton();
70
+ colorPopupComponent.steps.verifyColorPopupOkButton();
71
+ });
72
+
73
+ it('CSS of color popup contents', { tags: 'css' }, () => {
74
+ const labels = [colorPopupComponent.selectedColorLabel, colorPopupComponent.hexLabel]
75
+ labels.forEach(label => {
76
+ utilities.verifyCSS(label(), {
77
+ 'color': css.color.labels,
78
+ 'font-size': css.fontSize.normal,
79
+ 'font-weight': css.fontWeight.semibold
80
+ });
81
+ });
82
+ utilities.verifyCSS(colorPopupComponent.hexInputField(), {
83
+ 'color': css.color.text,
84
+ 'font-size': css.fontSize.default,
85
+ 'font-weight': css.fontWeight.regular
86
+ });
87
+ utilities.verifyCSS(colorPopupComponent.okButton(), {
88
+ 'color': css.color.primaryBtn,
89
+ 'font-size': css.fontSize.default,
90
+ 'font-weight': css.fontWeight.semibold,
91
+ 'background-color': css.color.primaryBtnBg
92
+ });
93
+ utilities.verifyCSS(colorPopupComponent.cancelButton(), {
94
+ 'color': css.color.secondaryBtn,
95
+ 'font-size': css.fontSize.default,
96
+ 'font-weight': css.fontWeight.semibold,
97
+ 'background-color': css.color.transparent
98
+ });
99
+ });
100
+
101
+ it('Accessibility of color popup contents', { tags: 'a11y' }, () => {
102
+ cy.checkAccessibility(dialogBoxBase.dialogBoxContent());
103
+ });
104
+ });
105
+
106
+ describe('Color popup - Updating the selected color', () => {
107
+ abortEarlySetup();
108
+ before(() => {
109
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
110
+ cy.barsPreLoaderWait();
111
+ feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
112
+ });
113
+
114
+ 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 and the opacity value should not change', () => {
115
+ feedbackScalePage.steps.editColor(0);
116
+ colorPopupComponent.steps.clickInColorSaturationPalette();
117
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(121, 61, 77)');
118
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(122, 62, 78)');
119
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 68)');
120
+ colorPopupComponent.steps.verifyHexValue('#793d4d');
121
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
122
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
123
+ });
124
+
125
+ it('When the user has set a custom color apart from the recommended colors, then the selected icon from the recommended color block should get removed', () => {
126
+ utilities.verifyElementVisibilityState(colorPopupComponent.recommendedColorBlockSelectedIcon(), 'notExist');
127
+ });
128
+
129
+ 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 and the opacity value should not change', () => {
130
+ colorPopupComponent.steps.clickInColorHuePalette();
131
+ colorPopupComponent.steps.verifySelectedColorBlock('rgb(61, 121, 121)');
132
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 255, 255)');
133
+ colorPopupComponent.steps.verifyHexValue('#3d7979');
134
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
135
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
136
+ });
137
+
138
+ it('When the user changes the color using hex code, the color in color saturation palette and color hue palette should change and the opacity value should not change', () => {
139
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
140
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
141
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
142
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
143
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
144
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
145
+ });
146
+
147
+ it('When the user changes the opacity slider value, value in the opacity input field and the opacity of the selected color should change and the color in color saturation palette and color hue palette should not change', () => {
148
+ colorPopupComponent.steps.clickOnOpacitySlider();
149
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('50');
150
+ colorPopupComponent.steps.verifyOpacitySliderValue('50');
151
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
152
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
153
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
154
+ colorPopupComponent.steps.verifySelectedColorBlock('rgba(255, 0, 0, 0.5)')
155
+ });
156
+
157
+ it('When the user changes value in the opacity input field, the slider value and the opacity of the selected color should change and the color in color saturation palette and color hue palette should not change', () => {
158
+ colorPopupComponent.steps.addInputToOpacityInputField('20');
159
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('20');
160
+ colorPopupComponent.steps.verifyOpacitySliderValue('20');
161
+ colorPopupComponent.steps.verifyHexValue('#ff0000');
162
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(255, 0, 0)');
163
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
164
+ colorPopupComponent.steps.verifySelectedColorBlock('rgba(255, 0, 0, 0.2)');
165
+ });
166
+
167
+ it('When the user selects a color block from the recommended colors, the selected color should change, the opacity values should not change and the selected icon should be displayed on the newly selected recommended color', () => {
168
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
169
+ colorPopupComponent.steps.verifyRecommendedColorBlockSelectedState(1);
170
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('20');
171
+ colorPopupComponent.steps.verifyOpacitySliderValue('20');
172
+ colorPopupComponent.steps.verifyHexValue('#ECD813');
173
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(237, 215, 18)');
174
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 230, 0)');
175
+ colorPopupComponent.steps.verifySelectedColorBlock('rgba(236, 216, 19, 0.2)')
176
+ });
177
+ });
178
+
179
+ describe('Color popup - \'Cancel\' and \'Ok\' buttons', () => {
180
+ abortEarlySetup();
181
+ before(() => {
182
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
183
+ cy.barsPreLoaderWait();
184
+ feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
185
+ });
186
+
187
+ it('When the user modifies the selected color 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', () => {
188
+ feedbackScalePage.steps.editColor(0);
189
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
190
+ colorPopupComponent.steps.addInputToOpacityInputField('20');
191
+ colorPopupComponent.steps.clickOnCancelButton();
192
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
193
+ colorPopupComponent.steps.verifyColorBlockInOptionAccordion(0, 'rgb(255, 133, 165)');
194
+ });
195
+
196
+ it('When the user modifies the selected color in the color popup and clicks on \'Ok\' button, then the popup should close, the color block should change to the new selected color and the modifications in the color popup should persist', () => {
197
+ cy.log('Pre-step: clicking on the edit color button')
198
+ feedbackScalePage.steps.editColor(0);
199
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
200
+ colorPopupComponent.steps.addInputToOpacityInputField('20');
201
+ colorPopupComponent.steps.clickOnOkButton();
202
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
203
+ colorPopupComponent.steps.verifyColorBlockInOptionAccordion(0, 'rgba(255, 0, 0, 0.2)');
204
+ });
205
+ });
206
+ });