itemengine-cypress-automation 1.0.72 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/cypress/e2e/ILC/AudioResponse/{audioResponseMinimalPreviewSection.js → audioResponseMinimalPreviewSection.smoke.js} +263 -254
  2. package/cypress/e2e/ILC/AudioResponse/{audioResponseStandardPreviewSection.js → audioResponseStandardPreviewSection.smoke.js} +100 -97
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.smoke.js +121 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachCell.js → groupedOptionsPartialScoreForEachCell.smoke.js} +1 -1
  5. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachResponse.js → groupedOptionsPartialScoreForEachResponse.smoke.js} +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.smoke.js +164 -0
  7. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{standardTotalScoreDividedBetweenResponse.js → standardTotalScoreDividedBetweenResponse.smoke.js} +21 -18
  8. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +753 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.smoke.js +943 -0
  10. package/cypress/e2e/ILC/EssayResponse/{essayResponseCustomizeFormattingOptions1.js → essayResponseCustomizeFormattingOptions1.smoke.js} +113 -110
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +581 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.smoke.js +111 -0
  13. package/cypress/e2e/ILC/EssayResponse/{essayResponsePreviewContentsForAllViews.js → essayResponsePreviewContentsForAllViews.smoke.js} +6 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.smoke.js +81 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/{fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js → fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.smoke.js} +25 -22
  16. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAllOrNothingScoring.js → fillInTheGapsDropdownAllOrNothingScoring.smoke.js} +16 -14
  17. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.smoke.js} +80 -74
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.smoke.js +361 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.smoke.js +137 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.smoke.js +171 -0
  21. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.smoke.js} +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextAllOrNothingScoring.js → fillInTheGapsOverImageTextAllOrNothingScoring.smoke.js} +32 -29
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextCheckAnswerForAllViews.js → fillInTheGapsOverImageTextCheckAnswerForAllViews.smoke.js} +5 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.smoke.js +137 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.smoke.js +146 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewContentsForAllViews.js → fillInTheGapsOverImageTextPreviewContentsForAllViews.smoke.js} +5 -3
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewTab.js → fillInTheGapsOverImageTextPreviewTab.smoke.js} +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextShowCorrectAnswerForAllView.js → fillInTheGapsOverImageTextShowCorrectAnswerForAllView.smoke.js} +6 -4
  29. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextAutoScoredScoring.js → fillInTheGapsTextAutoScoredScoring.smoke.js} +12 -9
  30. package/cypress/e2e/ILC/Highlight/HighlightScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +36 -34
  31. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.smoke.js +462 -0
  32. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.smoke.js +148 -0
  33. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.smoke.js +185 -0
  34. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.smoke.js +138 -0
  35. package/cypress/e2e/ILC/HighlightImage/{highlightImagePreviewTab.js → highlightImagePreviewTab.smoke.js} +1 -1
  36. package/cypress/e2e/ILC/HighlightImage/{highlightImageToolsFunctionalityPreviewTab.js → highlightImageToolsFunctionalityPreviewTab.smoke.js} +4 -4
  37. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.smoke.js +122 -0
  38. package/cypress/e2e/ILC/ListMatching/{listMatchingAlternateAnswer.js → listMatchingAlternateAnswer.smoke.js} +47 -43
  39. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.smoke.js +211 -0
  40. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.smoke.js +254 -0
  41. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.smoke.js +191 -0
  42. package/cypress/e2e/ILC/ListOrdering/ListOrderingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +34 -32
  43. package/cypress/e2e/ILC/ListSorting/ListSortingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +41 -38
  44. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.smoke.js +269 -0
  45. package/cypress/e2e/ILC/MultipleSelectionGrid/{multipleSelectionGridAutoScoredScoring.js → multipleSelectionGridAutoScoredScoring.smoke.js} +36 -34
  46. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.smoke.js +407 -0
  47. package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoring.js → singleSelectionGridAutoScoredScoring.smoke.js} +32 -29
  48. package/cypress/e2e/ILC/UploadResponse/{uploadResponsePreview.js → uploadResponsePreview.smoke.js} +64 -59
  49. package/cypress/e2e/ILC/VideoResponse/{videoResponsePreviewTab.js → videoResponsePreviewTab.smoke.js} +290 -281
  50. package/cypress/pages/components/additionalSettingsPanel.js +0 -27
  51. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  52. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +321 -0
  53. package/cypress/pages/components/createQuestionBasePage.js +1 -7
  54. package/cypress/pages/components/essayResponseCommonComponents.js +0 -6
  55. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -13
  56. package/cypress/pages/components/index.js +2 -1
  57. package/cypress/pages/components/mcqAdditionalSettingsBase.js +0 -10
  58. package/cypress/pages/components/scoringSectionBase.js +3 -2
  59. package/cypress/pages/createItemPage.js +3 -79
  60. package/cypress/pages/dialogBoxBase.js +8 -23
  61. package/cypress/pages/index.js +1 -4
  62. package/cypress/pages/itemPreviewSettingsPage.js +446 -0
  63. package/cypress/pages/multipleSelectionPage.js +113 -64
  64. package/cypress/pages/selectQuestionResourceToolPage.js +0 -5
  65. package/cypress/pages/shortTextResponsePage.js +0 -6
  66. package/cypress/pages/singleSelectionPage.js +0 -1
  67. package/package.json +2 -2
  68. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.js +0 -116
  69. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.js +0 -160
  70. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +0 -932
  71. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -572
  72. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.js +0 -106
  73. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +0 -76
  74. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +0 -134
  75. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +0 -133
  76. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.js +0 -457
  77. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.js +0 -143
  78. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.js +0 -178
  79. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +0 -125
  80. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.js +0 -117
  81. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +0 -207
  82. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +0 -246
  83. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +0 -185
  84. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +0 -820
  85. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +0 -936
  86. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +0 -263
  87. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.js +0 -402
  88. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.js +0 -356
  89. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.js +0 -134
  90. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.js +0 -156
@@ -0,0 +1,753 @@
1
+ import { itemPreviewSettingsPage } from "../../../pages/itemPreviewSettingsPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const css = Cypress.env('css');
6
+ const spacingOptions = ['Default', 'Double', 'Triple'];
7
+ const labels = [itemPreviewSettingsPage.enableSectionsInLabel, itemPreviewSettingsPage.sectionsNavigationOrientationLabel, itemPreviewSettingsPage.sectionsNavigationStyleLabel, itemPreviewSettingsPage.sectionsNavigationAlignmentLabel];
8
+ const contentLabels = [itemPreviewSettingsPage.leftPanelLabel, itemPreviewSettingsPage.rightPanelLabel, itemPreviewSettingsPage.horizontalLabel, itemPreviewSettingsPage.underlinedLabel, itemPreviewSettingsPage.separatedUsingDividersLabel, itemPreviewSettingsPage.numberedLabel, itemPreviewSettingsPage.leftAlignedLabel, itemPreviewSettingsPage.rightAlignedLabel, itemPreviewSettingsPage.centerAlignedLabel];
9
+ const checkedCheckboxes = [itemPreviewSettingsPage.enableSectionsCheckbox, itemPreviewSettingsPage.leftPanelCheckbox];
10
+ const checkedRadioButtons = [itemPreviewSettingsPage.horizontalRadioButton, itemPreviewSettingsPage.underlinedRadioButton, itemPreviewSettingsPage.leftAlignedRadioButton];
11
+ const uncheckedCheckboxes = [itemPreviewSettingsPage.rightPanelCheckbox];
12
+ const uncheckedRadioButtons = [itemPreviewSettingsPage.separatedUsingDividersRadioButton, itemPreviewSettingsPage.centerAlignedRadioButton, itemPreviewSettingsPage.rightAlignedRadioButton, itemPreviewSettingsPage.numberedRadioButton];
13
+ const sectionsNavigationStyleSectionLabel = [itemPreviewSettingsPage.leftAlignedLabel, itemPreviewSettingsPage.rightAlignedLabel, itemPreviewSettingsPage.centerAlignedLabel];
14
+ const miscellaneousSectionLabelsText = [itemPreviewSettingsPage.disableCutCopyAndPasteLabel, itemPreviewSettingsPage.randomizeQuestionsOrderLabel, itemPreviewSettingsPage.roundNegativeScoresToZeroLabel];
15
+ const miscellaneousSectionCheckboxes = [itemPreviewSettingsPage.disableCutCopyAndPasteCheckbox, itemPreviewSettingsPage.randomizeQuestionsOrderCheckbox, itemPreviewSettingsPage.roundNegativeScoresToZeroCheckbox];
16
+
17
+ describe('Item preview: Settings tab - Contents', () => {
18
+ before(() => {
19
+ cy.loginAs('admin');
20
+ });
21
+
22
+ describe('Setting tab: Header section', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ cy.log('Navigating to Item preview settings tab');
26
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
27
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
28
+ });
29
+
30
+ it('When user navigates to the settings tab, then \'Settings\' label, \'Cancel\' and \'Apply changes\' buttons should be displayed', () => {
31
+ utilities.verifyInnerText(itemPreviewSettingsPage.settingsLabel(), 'Settings');
32
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.settingsLabel(), 'visible');
33
+ utilities.verifyInnerText(itemPreviewSettingsPage.cancelLabel(), 'Cancel');
34
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.cancelLabel(), 'visible');
35
+ utilities.verifyInnerText(itemPreviewSettingsPage.applyChangesLabel(), 'Apply changes');
36
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.applyChangesLabel(), 'visible');
37
+ });
38
+
39
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
40
+ it('CSS of the header', () => {
41
+ utilities.verifyCSS(itemPreviewSettingsPage.settingsLabel(), {
42
+ 'color': css.color.panelLabel,
43
+ 'font-size': css.fontSize.heading,
44
+ 'font-weight': css.fontWeight.bold
45
+ });
46
+ utilities.verifyCSS(itemPreviewSettingsPage.cancelLabel(), {
47
+ 'color': css.color.secondaryBtn,
48
+ 'font-size': css.fontSize.default,
49
+ 'font-weight': css.fontWeight.regular,
50
+ 'background-color': css.color.transparent
51
+ });
52
+ utilities.verifyCSS(itemPreviewSettingsPage.applyChangesLabel(), {
53
+ 'color': css.color.successBtn,
54
+ 'font-size': css.fontSize.default,
55
+ 'font-weight': css.fontWeight.regular,
56
+ 'background-color': css.color.successBtnBg
57
+ });
58
+ });
59
+
60
+ it('Accessibility of the header', { tags: 'a11y' }, () => {
61
+ cy.checkAccessibility(itemPreviewSettingsPage.headerWrapper().parents('.settings'));
62
+ });
63
+ });
64
+
65
+ describe('Setting tab: Side by side panels section', () => {
66
+ abortEarlySetup();
67
+ before(() => {
68
+ cy.log('Navigating to Item preview settings tab');
69
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
70
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
71
+ });
72
+
73
+ it('When user has navigated to the settings tab, then \'Side by side panels\' label should be displayed', () => {
74
+ utilities.verifyInnerText(itemPreviewSettingsPage.sideBySidePanelsLabel(), 'Side by side panels');
75
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.sideBySidePanelsLabel(), 'visible');
76
+ });
77
+
78
+ it('In \'Side by side panels\' section, \'Enable side by side panels\' label with checkbox should be displayed and \'Enable side by side panels\' checkbox should be unchecked by default', () => {
79
+ utilities.verifyInnerText(itemPreviewSettingsPage.enableSideBySidePanelsLabel(), 'Enable side by side panels');
80
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSideBySidePanelsLabel(), 'visible');
81
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSideBySidePanelsCheckbox(), 'exist');
82
+ itemPreviewSettingsPage.steps.verifyEnableSideBySidePanelsCheckboxUnchecked();
83
+ });
84
+
85
+ it('When user checks the \'Enable side by side panels\' checkbox then \'Vertical separator line between panels\' label and checkbox should be enabled', () => {
86
+ itemPreviewSettingsPage.steps.checkEnableSideBySidePanelsCheckbox();
87
+ itemPreviewSettingsPage.steps.verifyVerticalSeparatorIsEnabled();
88
+ });
89
+
90
+ it('When user has checked the \'Enable side by side panels\' checkbox then in \'Sections\' section, \'Left panel\' and \'Right panel\' labels and their checkboxes should be enabled', () => {
91
+ itemPreviewSettingsPage.steps.checkEnableSectionsCheckbox();
92
+ itemPreviewSettingsPage.steps.verifyLeftPanelLabelAndCheckboxIsEnabled();
93
+ itemPreviewSettingsPage.steps.verifyRightPanelLabelAndCheckboxIsEnabled();
94
+ });
95
+
96
+ it('When user has checked the \'Enable side by side panels\' checkbox then in \'Sections\' section, \'Vertical\' label and radio button should be disabled', () => {
97
+ itemPreviewSettingsPage.steps.verifyVerticalNavigationOrientationIsDisabled();
98
+ });
99
+
100
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
101
+ it('CSS of \'Side by side panels\' label, \'Enable side by side panels\' label and checked \'Enable side by side panels\' checkbox', { tags: 'css' }, () => {
102
+ utilities.verifyCSS(itemPreviewSettingsPage.sideBySidePanelsLabel(), {
103
+ 'color': css.color.panelLabel,
104
+ 'font-size': css.fontSize.default,
105
+ 'font-weight': css.fontWeight.semibold
106
+ });
107
+ utilities.verifyCSS(itemPreviewSettingsPage.enableSideBySidePanelsLabel(), {
108
+ 'color': css.color.labelText,
109
+ 'font-size': css.fontSize.normal,
110
+ 'font-weight': css.fontWeight.regular
111
+ });
112
+ utilities.verifyCSS(itemPreviewSettingsPage.enableSideBySidePanelsCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
113
+ 'fill': css.color.activeButtons
114
+ });
115
+ });
116
+
117
+ it('CSS of disabled \'Vertical\' label and its radio button', () => {
118
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalLabel().parent(), {
119
+ 'opacity': '0.4'
120
+ });
121
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalLabel(), {
122
+ 'color': css.color.labelText,
123
+ 'font-size': css.fontSize.normal,
124
+ 'font-weight': css.fontWeight.regular
125
+ });
126
+ });
127
+
128
+ it('Accessibility of the checked \'Enable side by side panels\' checkbox', { tags: 'a11y' }, () => {
129
+ cy.checkAccessibility(itemPreviewSettingsPage.enableSideBySidePanelsCheckbox());
130
+ });
131
+
132
+ it('When user unchecks the \'Enable side by side panels\' checkbox then \'Vertical separator line between panels\' label and checkbox should be disabled', () => {
133
+ itemPreviewSettingsPage.steps.uncheckEnableSideBySidePanelsCheckbox();
134
+ itemPreviewSettingsPage.steps.verifyVerticalSeparatorIsDisabled();
135
+ });
136
+
137
+ it('When user has unchecked the \'Enable side by side panels\' checkbox then in \'Sections\' section, \'Left panel\' and \Right panel\' labels with checkboxes should be disabled', () => {
138
+ itemPreviewSettingsPage.steps.verifyLeftPanelLabelAndCheckboxIsDisabled();
139
+ itemPreviewSettingsPage.steps.verifyRightPanelLabelAndCheckboxIsDisabled();
140
+ });
141
+
142
+ it('When the user hovers over the disabled \'Left panel\' and \'Right panel\' checkboxes then, \'Please enable panels\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the checkbox', () => {
143
+ itemPreviewSettingsPage.steps.verifyDisabledLeftPanelTooltip();
144
+ itemPreviewSettingsPage.steps.verifyDisabledRightPanelTooltip();
145
+ });
146
+
147
+ it('When user has unchecked the \'Enable side by side panels\' checkbox then in \'Sections\' section, \'Vertical\' label and radio button should be enabled', () => {
148
+ itemPreviewSettingsPage.steps.verifyVerticalNavigationOrientationIsEnabled();
149
+ });
150
+
151
+ it('CSS of unchecked \'Enable side by side panels\' checkbox, disabled \'Vertical separator line between panels\' label and checkbox, disabled \'Left panel\' and \Right panel\' labels and checkboxes and enabled \'Vertical\' label and radio button', { tags: 'css' }, () => {
152
+ utilities.verifyCSS(itemPreviewSettingsPage.enableSideBySidePanelsCheckbox().parent().find('svg'), {
153
+ 'fill': css.color.uncheckedCheckbox
154
+ });
155
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalSeparatorsLabel(), {
156
+ 'color': css.color.labelText,
157
+ 'font-size': css.fontSize.normal,
158
+ 'font-weight': css.fontWeight.regular
159
+ });
160
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalSeparatorsLabel().parent(), {
161
+ 'opacity': '0.4'
162
+ });
163
+ utilities.verifyCSS(itemPreviewSettingsPage.leftPanelLabel(), {
164
+ 'color': css.color.labelText,
165
+ 'font-size': css.fontSize.normal,
166
+ 'font-weight': css.fontWeight.regular
167
+ });
168
+ utilities.verifyCSS(itemPreviewSettingsPage.leftPanelLabel().parent(), {
169
+ 'opacity': '0.4'
170
+ });
171
+ utilities.verifyCSS(itemPreviewSettingsPage.rightPanelLabel(), {
172
+ 'color': css.color.labelText,
173
+ 'font-size': css.fontSize.normal,
174
+ 'font-weight': css.fontWeight.regular
175
+ });
176
+ utilities.verifyCSS(itemPreviewSettingsPage.rightPanelLabel().parent(), {
177
+ 'opacity': '0.4'
178
+ });
179
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalLabel(), {
180
+ 'color': css.color.labelText,
181
+ 'font-size': css.fontSize.normal,
182
+ 'font-weight': css.fontWeight.regular
183
+ });
184
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalRadioButton().parents('.radio-option-not-checked').find('.radio-btn-deselected'), {
185
+ 'fill': css.color.uncheckedCheckbox
186
+ });
187
+ itemPreviewSettingsPage.steps.uncheckEnableSectionsCheckbox();
188
+ });
189
+ });
190
+
191
+ describe('Setting tab: Separators section', () => {
192
+ abortEarlySetup();
193
+ before(() => {
194
+ cy.log('Navigating to Item preview settings tab');
195
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
196
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
197
+ });
198
+
199
+ it('When user has navigated to the settings tab, \'Separators\' label should be displayed', () => {
200
+ utilities.verifyInnerText(itemPreviewSettingsPage.separatorsLabel(), 'Separators');
201
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.separatorsLabel(), 'visible');
202
+ });
203
+
204
+ it('In \'Separators\' section, \'Horizontal separator line between questions\' and \'Vertical separator line between panels\' labels with checkboxes and illustrator should be displayed', () => {
205
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.horizontalSeparatorsCheckbox(), 'exist');
206
+ utilities.verifyInnerText(itemPreviewSettingsPage.horizontalSeparatorLabel(), 'Horizontal separator line between questions');
207
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.horizontalSeparatorLabel(), 'visible');
208
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.horizontalIllustrator(), 'visible');
209
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.verticalSeparatorsCheckbox(), 'exist');
210
+ utilities.verifyInnerText(itemPreviewSettingsPage.verticalSeparatorsLabel(), 'Vertical separator line between panels');
211
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.verticalSeparatorsLabel(), 'visible');
212
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.verticalSeparatorsIllustrator(), 'visible');
213
+ });
214
+
215
+ it('\'Horizontal separator line between questions\' and \'Vertical separator line between panels\' checkboxes should be unchecked by default', () => {
216
+ itemPreviewSettingsPage.steps.verifyHorizontalSeparatorCheckboxUnchecked();
217
+ itemPreviewSettingsPage.steps.verifyVerticalSeparatorCheckboxUnchecked();
218
+ });
219
+
220
+ it('When \'Enable side by side panels\' checkbox is unchecked then \'Vertical separator line between panels\' should be disabled by default', () => {
221
+ itemPreviewSettingsPage.steps.verifyVerticalSeparatorIsDisabled();
222
+ });
223
+
224
+ it('When user checks the \'Horizontal separator line between questions\' checkbox then \'Separator style\' label and three options \'Solid\', \'Dotted\' and \'Dashed\' should be displayed', () => {
225
+ itemPreviewSettingsPage.steps.checkHorizontalSeparatorCheckbox();
226
+ itemPreviewSettingsPage.steps.verifySeparatorStyleSectionContent();
227
+ });
228
+
229
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
230
+ it('CSS of \'Separators\' label, \'Horizontal separator line between questions\' label, checked \'Horizontal separator line between questions\' checkbox and \'Separator style\'', { tags: 'css' }, () => {
231
+ utilities.verifyCSS(itemPreviewSettingsPage.separatorsLabel(), {
232
+ 'color': css.color.panelLabel,
233
+ 'font-size': css.fontSize.default,
234
+ 'font-weight': css.fontWeight.semibold
235
+ });
236
+ utilities.verifyCSS(itemPreviewSettingsPage.horizontalSeparatorLabel(), {
237
+ 'color': css.color.labelText,
238
+ 'font-size': css.fontSize.normal,
239
+ 'font-weight': css.fontWeight.regular
240
+ });
241
+ utilities.verifyCSS(itemPreviewSettingsPage.horizontalSeparatorsCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
242
+ 'fill': css.color.activeButtons
243
+ });
244
+ utilities.verifyCSS(itemPreviewSettingsPage.separatorsStyleLabel(), {
245
+ 'color': css.color.labels,
246
+ 'font-size': css.fontSize.normal,
247
+ 'font-weight': css.fontWeight.semibold
248
+ });
249
+ utilities.verifyCSS(itemPreviewSettingsPage.solidSeparatorStyleOption(), {
250
+ 'border': `2px solid ${css.color.activeComponentBorder}`,
251
+ });
252
+ utilities.verifyCSS(itemPreviewSettingsPage.solidSeparatorStyleOption().find('svg line'), {
253
+ 'stroke': css.color.activeComponentBorder
254
+ });
255
+ utilities.verifyCSS(itemPreviewSettingsPage.solidSeparatorStyleOption().find('.ngie-toggle-button-label'), {
256
+ 'background-color': css.color.transparent,
257
+ 'color': css.color.activeButtons,
258
+ 'font-size': css.fontSize.default,
259
+ 'font-weight': css.fontWeight.regular
260
+ });
261
+ utilities.verifyCSS(itemPreviewSettingsPage.dashedSeparatorStyleOption().find('.ngie-toggle-button-label'), {
262
+ 'color': css.color.secondaryBtn,
263
+ 'font-size': css.fontSize.default,
264
+ 'fontWeight': css.fontWeight.regular
265
+ });
266
+ utilities.verifyCSS(itemPreviewSettingsPage.dottedSeparatorStyleOption().find('.ngie-toggle-button-label'), {
267
+ 'color': css.color.secondaryBtn,
268
+ 'font-size': css.fontSize.default,
269
+ 'font-weight': css.fontWeight.regular
270
+ });
271
+ });
272
+
273
+ it('Accessibility of checked \'Horizontal separator line between questions\' checkbox and \'Separator style\'', { tags: 'a11y' }, () => {
274
+ cy.checkAccessibility(itemPreviewSettingsPage.horizontalSeparatorsCheckbox());
275
+ cy.checkAccessibility(itemPreviewSettingsPage.separatorsStyleLabel().parent('[class*="SettingsTabstyles__SeparatorStyleWrapper"]'));
276
+ });
277
+
278
+ it('When user unchecks the \'Horizontal separator line between questions\' checkbox then \'Separator style\' should disappear', () => {
279
+ itemPreviewSettingsPage.steps.uncheckHorizontalSeparatorCheckbox();
280
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.separatorStyleWrapper(), 'notExist');
281
+ });
282
+
283
+ it('When user checks the enabled \'Vertical separator line between panels\' checkbox then \'Separator style\' label and three options \'Solid\', \'Dotted\' and \'Dashed\' should be displayed', () => {
284
+ itemPreviewSettingsPage.steps.checkEnableSideBySidePanelsCheckbox();
285
+ itemPreviewSettingsPage.steps.checkVerticalSeparatorCheckbox();
286
+ itemPreviewSettingsPage.steps.verifySeparatorStyleSectionContent();
287
+ });
288
+
289
+ it('CSS of \'Vertical separator line between panels\' label and checked \'Vertical separator line between panels\' checkbox', () => {
290
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalSeparatorsLabel(), {
291
+ 'color': css.color.labelText,
292
+ 'font-size': css.fontSize.normal,
293
+ 'font-weight': css.fontWeight.regular
294
+ });
295
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalSeparatorsCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
296
+ 'fill': css.color.activeButtons
297
+ });
298
+ });
299
+
300
+ it('When user unchecks the enabled \'Vertical separator line between panels\' checkbox then \'Separator style\' should disappear', () => {
301
+ itemPreviewSettingsPage.steps.uncheckVerticalSeparatorCheckbox();
302
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.separatorStyleWrapper(), 'notExist');
303
+ });
304
+
305
+ it('CSS of the unchecked \'Horizontal separator line between questions\' checkbox and \'Vertical separator line between panels\'', { tags: 'css' }, () => {
306
+ utilities.verifyCSS(itemPreviewSettingsPage.horizontalSeparatorsCheckbox().parent().find('svg'), {
307
+ 'fill': css.color.uncheckedCheckbox
308
+ });
309
+ utilities.verifyCSS(itemPreviewSettingsPage.verticalSeparatorsCheckbox().parent().find('svg'), {
310
+ 'fill': css.color.uncheckedCheckbox
311
+ });
312
+ });
313
+ });
314
+
315
+ describe('Setting tab: Sections section', () => {
316
+ abortEarlySetup();
317
+ before(() => {
318
+ cy.log('Navigating to Item preview settings tab')
319
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
320
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
321
+ });
322
+
323
+ it('When user has navigated to the settings tab, \'Sections\' label should be displayed', () => {
324
+ utilities.verifyInnerText(itemPreviewSettingsPage.sectionsLabel(), 'Sections');
325
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.sectionsLabel(), 'visible');
326
+ });
327
+
328
+ it('In \'Sections\' section, \'Enable sections\' label and checkbox should be displayed', () => {
329
+ utilities.verifyInnerText(itemPreviewSettingsPage.enableSectionsLabel(), 'Enable sections');
330
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSectionsLabel(), 'visible');
331
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSectionsLabel(), 'exist');
332
+ });
333
+
334
+ it('\'Enable sections\' checkbox should be unchecked by default', () => {
335
+ itemPreviewSettingsPage.steps.verifyEnableSectionsCheckboxUnchecked();
336
+ });
337
+
338
+ it('When user checks the \'Enable sections\' checkbox then four sections \'Enable sections in\', \'Sections navigation orientation\', \'Sections navigation style\' and \'Sections navigation alignment\' should be displayed', () => {
339
+ itemPreviewSettingsPage.steps.checkEnableSectionsCheckbox();
340
+ utilities.verifyInnerText(itemPreviewSettingsPage.enableSectionsInLabel(), 'Enable sections in');
341
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSectionsInLabel(), 'visible');
342
+ utilities.verifyInnerText(itemPreviewSettingsPage.sectionsNavigationOrientationLabel(), 'Sections navigation orientation');
343
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.sectionsNavigationOrientationLabel(), 'visible');
344
+ utilities.verifyInnerText(itemPreviewSettingsPage.sectionsNavigationStyleLabel(), 'Sections navigation style');
345
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.sectionsNavigationStyleLabel(), 'visible');
346
+ utilities.verifyInnerText(itemPreviewSettingsPage.sectionsNavigationAlignmentLabel(), 'Sections navigation alignment');
347
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.sectionsNavigationStyleLabel(), 'visible');
348
+ });
349
+
350
+ it('In \'Enable sections in\', two labels \'Left panel\' and \'Right panel\' should be displayed with their checkboxes and \'Left panel\' checkbox should be checked by default', () => {
351
+ itemPreviewSettingsPage.steps.checkEnableSideBySidePanelsCheckbox();
352
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.leftPanelCheckbox(), 'exist');
353
+ utilities.verifyInnerText(itemPreviewSettingsPage.leftPanelLabel(), 'Left panel');
354
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.leftPanelLabel(), 'visible');
355
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.rightPanelCheckbox(), 'exist');
356
+ utilities.verifyInnerText(itemPreviewSettingsPage.rightPanelLabel(), 'Right panel');
357
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.rightPanelLabel(), 'visible');
358
+ itemPreviewSettingsPage.steps.verifyLeftPanelCheckboxIsSelected();
359
+ });
360
+
361
+ it('In \'Section navigation orientation\', two labels \'Horizontal\' and \'Vertical\' should be displayed with their radio buttons and \'Horizontal\' radio button should be selected by default', () => {
362
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.horizontalRadioButton(), 'exist');
363
+ utilities.verifyInnerText(itemPreviewSettingsPage.horizontalLabel(), 'Horizontal');
364
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.horizontalLabel(), 'visible');
365
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.verticalRadioButton(), 'exist');
366
+ utilities.verifyInnerText(itemPreviewSettingsPage.verticalLabel(), 'Vertical');
367
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.verticalLabel(), 'visible');
368
+ itemPreviewSettingsPage.steps.verifyHorizontalRadioButtonIsSelected();
369
+ });
370
+
371
+ it('In \'Section Navigation style\', three labels \'Underlined\', \'Separated using dividers\' and \'Numbered\' should be displayed with their radio button and \'Underlined\' radio button should be selected by default', () => {
372
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.underlinedRadioButton(), 'exist');
373
+ utilities.verifyInnerText(itemPreviewSettingsPage.underlinedLabel(), 'Underlined');
374
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.underlinedLabel(), 'visible');
375
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.separatedUsingDividersRadioButton(), 'exist');
376
+ utilities.verifyInnerText(itemPreviewSettingsPage.separatedUsingDividersLabel(), 'Separated using dividers');
377
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.separatedUsingDividersLabel(), 'visible');
378
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.numberedRadioButton(), 'exist');
379
+ utilities.verifyInnerText(itemPreviewSettingsPage.numberedLabel(), 'Numbered');
380
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.numberedLabel(), 'visible');
381
+ itemPreviewSettingsPage.steps.verifyUnderlinedRadioButtonIsSelected();
382
+ });
383
+
384
+ it('In \'Sections navigation alignment\', two labels \'Left aligned\', \'Center aligned\' and \'Right aligned\' should be displayed with their radio buttons and \'Left aligned\' should be selected by default', () => {
385
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.leftAlignedRadioButton(), 'exist');
386
+ utilities.verifyInnerText(itemPreviewSettingsPage.leftAlignedLabel(), 'Left aligned');
387
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.leftAlignedLabel(), 'visible');
388
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.centerAlignedRadioButton(), 'exist');
389
+ utilities.verifyInnerText(itemPreviewSettingsPage.centerAlignedLabel(), 'Center aligned');
390
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.centerAlignedLabel(), 'visible');
391
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.rightAlignedRadioButton(), 'exist');
392
+ utilities.verifyInnerText(itemPreviewSettingsPage.rightAlignedLabel(), 'Right aligned');
393
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.rightAlignedLabel(), 'visible');
394
+ itemPreviewSettingsPage.steps.verifyLeftAlignedRadioButtonIsSelected();
395
+ });
396
+
397
+ it('When user selects \'Vertical\' orientation radio button in \'Section navigation orientation\' section, then \'Sections navigation style\' section should be displayed in disabled state', () => {
398
+ itemPreviewSettingsPage.steps.uncheckEnableSideBySidePanelsCheckbox();
399
+ itemPreviewSettingsPage.steps.selectVerticalOrientationRadioButton();
400
+ itemPreviewSettingsPage.steps.verifySectionsNavigationStyleSectionIsDisabled();
401
+ })
402
+
403
+ it('CSS of \'Sections navigation style\' section in disabled state', { tags: 'css' }, () => {
404
+ sectionsNavigationStyleSectionLabel.forEach((option) => {
405
+ utilities.verifyCSS(option().parent(), {
406
+ 'opacity': '0.4'
407
+ });
408
+ utilities.verifyCSS(option(), {
409
+ 'color': css.color.labelText,
410
+ 'font-size': css.fontSize.normal,
411
+ 'font-weight': css.fontWeight.regular
412
+ });
413
+ });
414
+ });
415
+
416
+ it('When user selects \'Horizontal\' orientation radio button in \'Section navigation orientation\' section, then \'Sections navigation style\' section should be displayed in enabled state', () => {
417
+ itemPreviewSettingsPage.steps.selectHorizontalOrientationRadioButton();
418
+ itemPreviewSettingsPage.steps.checkEnableSideBySidePanelsCheckbox();
419
+ itemPreviewSettingsPage.steps.verifySectionsNavigationStyleSectionIsEnabled();
420
+ });
421
+
422
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
423
+ it('CSS of the \'Sections\' label, \'Enable Sections\' label, checked \'Enable Sections\' checkbox, \'Enable sections in\', \'Sections navigation orientation\', \'Sections navigation style\' and \'Sections navigation alignment\'', { tags: 'css' }, () => {
424
+ utilities.verifyCSS(itemPreviewSettingsPage.sectionsLabel(), {
425
+ 'color': css.color.panelLabel,
426
+ 'font-size': css.fontSize.default,
427
+ 'font-weight': css.fontWeight.semibold
428
+ });
429
+ utilities.verifyCSS(itemPreviewSettingsPage.enableSectionsLabel(), {
430
+ 'color': css.color.labelText,
431
+ 'font-size': css.fontSize.normal,
432
+ 'font-weight': css.fontWeight.regular
433
+ });
434
+ labels.forEach((checkinglabel) => {
435
+ utilities.verifyCSS(checkinglabel(), {
436
+ 'color': css.color.sectionHeading,
437
+ 'font-size': css.fontSize.normal,
438
+ 'font-weight': css.fontWeight.semibold
439
+ });
440
+ });
441
+ contentLabels.forEach((checkingcontentlabels) => {
442
+ utilities.verifyCSS(checkingcontentlabels(), {
443
+ 'color': css.color.labelText,
444
+ 'font-size': css.fontSize.normal,
445
+ 'font-weight': css.fontWeight.regular
446
+ });
447
+ });
448
+ checkedCheckboxes.forEach((checkedCheckbox) => {
449
+ utilities.verifyCSS(checkedCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
450
+ 'fill': css.color.activeButtons
451
+ });
452
+ });
453
+ checkedRadioButtons.forEach((checkedRadio) => {
454
+ utilities.verifyCSS(checkedRadio().parents('.radio-option-checked').find('[data-name="Radio button - Selected"]'), {
455
+ 'fill': css.color.activeButtons
456
+ });
457
+ });
458
+ uncheckedCheckboxes.forEach((uncheckedCheckbox) => {
459
+ utilities.verifyCSS(uncheckedCheckbox().parent().find('svg'), {
460
+ 'fill': css.color.uncheckedCheckbox
461
+ });
462
+ });
463
+ uncheckedRadioButtons.forEach((uncheckedRadio) => {
464
+ utilities.verifyCSS(uncheckedRadio().parents('.radio-option-not-checked').find('.radio-btn-deselected'), {
465
+ 'fill': css.color.uncheckedCheckbox
466
+ });
467
+ });
468
+ });
469
+
470
+ it('Accessibility of \'Enable Sections\' checkbox, \'Enable sections in\', \'Sections navigation orientation\', \'Sections navigation style\' and \'Sections navigation alignment\'', { tags: 'a11y' }, () => {
471
+ cy.checkAccessibility(itemPreviewSettingsPage.sectionsLabel().parents('[class*="SettingsTabstyles__SectionsWrapper"]'));
472
+ });
473
+
474
+ it('When user unchecks the \'Enable sections\' checkbox then four sections \'Enable sections in\', \'Sections navigation orientation\', \'Sections navigation style\' and \'Sections navigation alignment\' should disappear', () => {
475
+ itemPreviewSettingsPage.steps.uncheckEnableSectionsCheckbox();
476
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.enableSectionsContentWrapper(), 'notExist')
477
+ });
478
+
479
+ it('CSS of unchecked the \'Enable sections\' checkbox', { tags: 'css' }, () => {
480
+ utilities.verifyCSS(itemPreviewSettingsPage.enableSectionsCheckbox().parent().find('svg'), {
481
+ 'fill': css.color.uncheckedCheckbox
482
+ });
483
+ });
484
+ });
485
+
486
+ describe('Setting tab: Space between questions section', () => {
487
+ abortEarlySetup();
488
+ before(() => {
489
+ cy.log('Navigating to Item preview settings tab');
490
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
491
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
492
+ });
493
+
494
+ it('When user has navigated to the settings tab, \'Space between questions\' label should be displayed', () => {
495
+ utilities.verifyInnerText(itemPreviewSettingsPage.spaceBetweenQuestionsLabel(), 'Space between questions');
496
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.spaceBetweenQuestionsLabel(), 'visible');
497
+ });
498
+
499
+ it('In \'Space between questions\' section, \'Spacing\' label and dropdown should be displayed and \'Default\' spacing should be selected for the dropdown by default', () => {
500
+ utilities.verifyInnerText(itemPreviewSettingsPage.spacingLabel(), 'Spacing');
501
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.spacingLabel(), 'visible');
502
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.spacingDropdown(), 'exist');
503
+ utilities.verifyInnerText(itemPreviewSettingsPage.spacingDropdown(), 'Default');
504
+ });
505
+
506
+ it('When user clicks on the \'Spacing\' dropdown then list with three options \'Default\', \'Double\' and \'Triple\' should be displayed', () => {
507
+ itemPreviewSettingsPage.steps.clickSpacingDropdownList();
508
+ itemPreviewSettingsPage.steps.verifySpacingDropdownListOptions(spacingOptions);
509
+ });
510
+
511
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
512
+ it('CSS of \'Space between questions\' label, \'Spacing\' label and \'Spacing\' dropdown in active state', { tags: 'css' }, () => {
513
+ utilities.verifyCSS(itemPreviewSettingsPage.spaceBetweenQuestionsLabel(), {
514
+ 'color': css.color.panelLabel,
515
+ 'font-size': css.fontSize.default,
516
+ 'font-weight': css.fontWeight.semibold
517
+ });
518
+ utilities.verifyCSS(itemPreviewSettingsPage.spacingLabel(), {
519
+ 'color': css.color.labels,
520
+ 'font-size': css.fontSize.normal,
521
+ 'font-weight': css.fontWeight.semibold
522
+ });
523
+ utilities.verifyCSS(itemPreviewSettingsPage.spacingDropdownListOptions().eq(0), {
524
+ 'color': css.color.liText,
525
+ 'font-size': css.fontSize.default,
526
+ 'font-weight': css.fontWeight.regular,
527
+ 'background-color': css.color.liTextSelectedBg
528
+ });
529
+ utilities.verifyCSS(itemPreviewSettingsPage.spacingDropdownListOptions().eq(1), {
530
+ 'color': css.color.liText,
531
+ 'font-size': css.fontSize.default,
532
+ 'font-weight': css.fontWeight.regular
533
+ });
534
+ });
535
+
536
+ it('Accessibility of \'Spacing\' dropdown', { tags: 'a11y' }, () => {
537
+ cy.checkAccessibility(itemPreviewSettingsPage.spacingDropdownListOptions());
538
+ });
539
+
540
+ it('When user selects an option from the dropdown list, then dropdown list should disappear and selected option should be the active selection for the dropdown', () => {
541
+ itemPreviewSettingsPage.steps.selectOptionFromSpacingDropdown('Triple');
542
+ utilities.verifyInnerText(itemPreviewSettingsPage.spacingDropdown(), 'Triple')
543
+ });
544
+
545
+ it('CSS of \'Spacing\' dropdown in collapsed state', { tags: 'css' }, () => {
546
+ itemPreviewSettingsPage.spacingDropdown()
547
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular);
548
+ utilities.verifyCSS(itemPreviewSettingsPage.spacingDropdown(), {
549
+ 'color': css.color.liText,
550
+ 'font-size': css.fontSize.default,
551
+ 'font-weight': css.fontWeight.regular
552
+ })
553
+ });
554
+ });
555
+
556
+ describe('Setting tab: Multi-language support section', () => {
557
+ abortEarlySetup();
558
+ before(() => {
559
+ cy.log('Navigating to Item preview settings tab');
560
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
561
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
562
+ });
563
+
564
+ it('When user has navigated to the settings tab, \'Multi-language support\' label should be displayed', () => {
565
+ utilities.verifyInnerText(itemPreviewSettingsPage.multiLanguageSupportLabel(), 'Multi-language support');
566
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.multiLanguageSupportLabel(), 'visible');
567
+ });
568
+
569
+ it('In \'Multi-language support\' section, \'This item is also available in other languages\' label with checkbox should be displayed and \'This item is also available in other languages\' checkbox should be unchecked by default', () => {
570
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.languagesCheckbox(), 'exist');
571
+ utilities.verifyInnerText(itemPreviewSettingsPage.languagesLabel(), 'This item is also available in other languages');
572
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.languagesLabel(), 'visible');
573
+ itemPreviewSettingsPage.steps.verifyThisItemIsAlsoAvailableInOtherLanguagesCheckboxIsUnchecked();
574
+ });
575
+
576
+ it('User should be able to check the \'This item is also available in other languages\' checkbox', () => {
577
+ itemPreviewSettingsPage.steps.checkThisItemIsAlsoAvailableInOtherLanguagesCheckbox();
578
+ });
579
+
580
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
581
+ it('CSS of \'Multi-language support\' label, \'This item is also available in other languages\' label and checked \'This item is also available in other languages\' checkbox', { tags: 'css' }, () => {
582
+ utilities.verifyCSS(itemPreviewSettingsPage.multiLanguageSupportLabel(), {
583
+ 'color': css.color.panelLabel,
584
+ 'font-size': css.fontSize.default,
585
+ 'font-weight': css.fontWeight.semibold
586
+ });
587
+ utilities.verifyCSS(itemPreviewSettingsPage.languagesLabel(), {
588
+ 'color': css.color.labelText,
589
+ 'font-size': css.fontSize.normal,
590
+ 'font-weight': css.fontWeight.regular
591
+ });
592
+ utilities.verifyCSS(itemPreviewSettingsPage.languagesCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
593
+ 'fill': css.color.activeButtons
594
+ });
595
+ });
596
+
597
+ it('Accessibility of checked \'This item is also available in other languages\' checkbox', { tags: 'a11y' }, () => {
598
+ cy.checkAccessibility(itemPreviewSettingsPage.languagesCheckbox());
599
+ });
600
+
601
+ it('User should be able to uncheck the \'This item is also available in other languages\' checkbox', () => {
602
+ itemPreviewSettingsPage.steps.uncheckThisItemIsAlsoAvailableInOtherLanguagesCheckbox();
603
+ });
604
+
605
+ it('CSS of unchecked \'This item is also available in other languages\' checkbox', { tags: 'css' }, () => {
606
+ utilities.verifyCSS(itemPreviewSettingsPage.languagesCheckbox().parent().find('svg'), {
607
+ 'fill': css.color.uncheckedCheckbox
608
+ });
609
+ });
610
+ });
611
+
612
+ describe('Setting tab: Accessibility section', () => {
613
+ abortEarlySetup();
614
+ before(() => {
615
+ cy.log('Navigating to Item preview settings tab');
616
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
617
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
618
+ });
619
+
620
+ it('When user has navigated to the settings tab, \'Accessibility\' label should be displayed', () => {
621
+ utilities.verifyInnerText(itemPreviewSettingsPage.accessibilityLabel(), 'Accessibility');
622
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.accessibilityLabel(), 'visible');
623
+ });
624
+
625
+ it('In \'Accessibility\' section, \'Flag this item as non accessible\' label with checkbox should be displayed and \'Flag this item as non accessible\' checkbox should be unchecked by default', () => {
626
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.flagNonAccessibleCheckbox(), 'exist');
627
+ utilities.verifyInnerText(itemPreviewSettingsPage.flagNonAccessibleLabel(), 'Flag this item as non accessible');
628
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.flagNonAccessibleLabel(), 'visible');
629
+ itemPreviewSettingsPage.steps.verifyFlagThisItemNonAccessibleCheckboxIsUnchecked();
630
+ });
631
+
632
+ it('When user checks \'Flag this item as non accessible\' checkbox, then \'Alternate accessible item id\' label and input field should be displayed', () => {
633
+ itemPreviewSettingsPage.steps.checkFlagThisItemNonAccessibleCheckbox();
634
+ utilities.verifyInnerText(itemPreviewSettingsPage.alternateAccessibleIdLabel(), 'Alternate accessible item ID');
635
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.alternateAccessibleIdLabel(), 'visible');
636
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.alternateAccessibleIdInputField(), 'exist');
637
+ });
638
+
639
+ it('User should be able to add text inside \'Alternate accessible item id\' input field', () => {
640
+ itemPreviewSettingsPage.steps.verifyAlternateAccessibleIdInputFieldText('This text');
641
+ });
642
+
643
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
644
+ it('CSS of \'Accessibility\' label, \'Flag this item as non accessible\' label and checked \'Flag this item as non accessible\' checkbox', { tags: 'css' }, () => {
645
+ utilities.verifyCSS(itemPreviewSettingsPage.accessibilityLabel(), {
646
+ 'color': css.color.panelLabel,
647
+ 'font-size': css.fontSize.default,
648
+ 'font-weight': css.fontWeight.semibold
649
+ });
650
+ utilities.verifyCSS(itemPreviewSettingsPage.flagNonAccessibleLabel(), {
651
+ 'color': css.color.labelText,
652
+ 'font-size': css.fontSize.normal,
653
+ 'font-weight': css.fontWeight.regular
654
+ });
655
+ utilities.verifyCSS(itemPreviewSettingsPage.flagNonAccessibleCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
656
+ 'fill': css.color.activeButtons
657
+ });
658
+ });
659
+
660
+ it('Accessibility of checked \'Flag this item as non accessible\' checkbox and \'Alternate accessible item id\' input field', { tags: 'a11y' }, () => {
661
+ cy.checkAccessibility(itemPreviewSettingsPage.flagNonAccessibleCheckbox());
662
+ });
663
+
664
+ it('When user unchecks \'Flag this item as non accessible\' then \'Alternate accessible item id\' label and input field should disappear ', () => {
665
+ itemPreviewSettingsPage.steps.uncheckFlagThisItemNonAccessibleCheckbox();
666
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.alternateAccessibleIdLabel(), 'notExist');
667
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.alternateAccessibleIdInputField(), 'notExist');
668
+ });
669
+
670
+ it('CSS of unchecked \'Flag this item as non accessible\' checkbox', { tags: 'css' }, () => {
671
+ utilities.verifyCSS(itemPreviewSettingsPage.languagesCheckbox().parent().find('svg'), {
672
+ 'fill': css.color.uncheckedCheckbox
673
+ });
674
+ });
675
+ });
676
+
677
+ describe('Setting tab: Miscellaneous section', () => {
678
+ abortEarlySetup();
679
+ before(() => {
680
+ cy.log('Navigating to Item preview settings tab');
681
+ itemPreviewSettingsPage.steps.navigateToCreateItemPage();
682
+ itemPreviewSettingsPage.steps.clickOnSettingsButton();
683
+ });
684
+
685
+ it('When user has navigated to the settings tab, \'Miscellaneous\' label should be displayed', () => {
686
+ utilities.verifyInnerText(itemPreviewSettingsPage.miscellaneousLabel(), 'Miscellaneous');
687
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.miscellaneousLabel(), 'visible');
688
+ });
689
+
690
+ it('In \'Miscellaneous\' section, \'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' labels and their checkboxes should be displayed', () => {
691
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.disableCutCopyAndPasteCheckbox(), 'exist');
692
+ utilities.verifyInnerText(itemPreviewSettingsPage.disableCutCopyAndPasteLabel(), 'Disable cut, copy and paste for all questions');
693
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.disableCutCopyAndPasteLabel(), 'visible');
694
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.randomizeQuestionsOrderCheckbox(), 'exist');
695
+ utilities.verifyInnerText(itemPreviewSettingsPage.randomizeQuestionsOrderLabel(), 'Randomize questions order');
696
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.randomizeQuestionsOrderLabel(), 'visible');
697
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.roundNegativeScoresToZeroCheckbox(), 'exist');
698
+ utilities.verifyInnerText(itemPreviewSettingsPage.roundNegativeScoresToZeroLabel(), 'Round negative scores to zero');
699
+ utilities.verifyElementVisibilityState(itemPreviewSettingsPage.roundNegativeScoresToZeroLabel(), 'visible');
700
+ });
701
+
702
+ it('\'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' checkboxes should be unchecked by default', () => {
703
+ itemPreviewSettingsPage.steps.verifyDisableCutCopyAndPasteCheckboxIsUnchecked();
704
+ itemPreviewSettingsPage.steps.verifyRandomizeQuestionsOrderCheckboxIsUnchecked();
705
+ itemPreviewSettingsPage.steps.verifyRoundNegativeScoresCheckboxIsUnchecked();
706
+ });
707
+
708
+ it('User should be able to check \'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' checkboxes', () => {
709
+ itemPreviewSettingsPage.steps.checkDisableCutCopyAndPasteCheckbox();
710
+ itemPreviewSettingsPage.steps.checkRandomizeQuestionsOrderCheckbox();
711
+ itemPreviewSettingsPage.steps.checkRoundNegativeScoresCheckbox();
712
+ });
713
+
714
+ //Failing due to https://redmine.zeuslearning.com/issues/553260?next_issue_id=553252
715
+ it('CSS of \'Miscellaneous\' section', { tags: 'css' }, () => {
716
+ utilities.verifyCSS(itemPreviewSettingsPage.miscellaneousLabel(), {
717
+ 'color': css.color.panelLabel,
718
+ 'font-size': css.fontSize.default,
719
+ 'font-weight': css.fontWeight.semibold
720
+ });
721
+ miscellaneousSectionLabelsText.forEach((labels) => {
722
+ utilities.verifyCSS(labels(), {
723
+ 'color': css.color.labelText,
724
+ 'font-size': css.fontSize.normal,
725
+ 'font-weight': css.fontWeight.regular
726
+ });
727
+ });
728
+ miscellaneousSectionCheckboxes.forEach((checkbox) => {
729
+ utilities.verifyCSS(checkbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
730
+ 'fill': css.color.activeButtons
731
+ });
732
+ });
733
+ });
734
+
735
+ it('Accessibility of checked \'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' checkboxes', { tags: 'a11y' }, () => {
736
+ cy.checkAccessibility(itemPreviewSettingsPage.disableCutCopyAndPasteCheckbox().parents('[class*="SettingsTabstyles__MiscellaneousWrapper"]'));
737
+ });
738
+
739
+ it('User should be able to uncheck \'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' checkboxes', () => {
740
+ itemPreviewSettingsPage.steps.uncheckDisableCutCopyAndPasteCheckbox();
741
+ itemPreviewSettingsPage.steps.uncheckRandomizeQuestionsOrderCheckbox();
742
+ itemPreviewSettingsPage.steps.uncheckRoundNegativeScoresCheckbox();
743
+ });
744
+
745
+ it('CSS of unchecked \'Disable cut, copy and paste for all questions\', \'Randomize questions order\' and \'Round negative scores to zero\' checkboxes', { tags: 'css' }, () => {
746
+ miscellaneousSectionCheckboxes.forEach((checkbox) => {
747
+ utilities.verifyCSS(checkbox().parent().find('svg'), {
748
+ 'fill': css.color.uncheckedCheckbox
749
+ });
750
+ });
751
+ });
752
+ });
753
+ });