itemengine-cypress-automation 1.0.104 → 1.0.106

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
  6. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
  7. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
  9. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
  10. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
  15. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
  16. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
  17. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
  37. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
  39. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
  40. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
  41. package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
  42. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
  43. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
  44. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
  45. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
  46. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
  47. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
  48. package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
  49. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
  51. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
  53. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
  54. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
  55. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
  56. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
  57. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  58. package/cypress/fixtures/specialAndMathCharacters.js +2 -0
  59. package/cypress/fixtures/theme/ilc.json +4 -2
  60. package/cypress/pages/audioResponsePage.js +326 -165
  61. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  62. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  63. package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
  64. package/cypress/pages/components/colorPopupComponent.js +115 -26
  65. package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
  66. package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
  67. package/cypress/pages/components/editCategoryFlyout.js +164 -2
  68. package/cypress/pages/components/equationEditorFlyout.js +36 -1
  69. package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
  70. package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
  73. package/cypress/pages/correctAnswerViewPage.js +12 -1
  74. package/cypress/pages/drawingResponsePage.js +26 -151
  75. package/cypress/pages/essayResponseMathPage.js +28 -16
  76. package/cypress/pages/essayResponsePage.js +187 -7
  77. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
  78. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
  79. package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
  80. package/cypress/pages/multipleSelectionPage.js +1 -1
  81. package/cypress/pages/readingRulerPage.js +219 -104
  82. package/cypress/pages/singleSelectionPage.js +1 -0
  83. package/cypress/pages/textEntryMathPage.js +17 -6
  84. package/cypress/pages/videoResponsePage.js +0 -8
  85. package/deploy/smoke/run.sh +1 -1
  86. package/package.json +1 -1
  87. package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,246 @@
1
+ import { passagePage } from "../../../pages";
2
+ import { commonComponents, createQuestionBasePage } 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
+ describe('Create Item page - Passage - Preview tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Passage content - Preview tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to passage resource type');
16
+ passagePage.steps.navigateToCreateResource('passage');
17
+ passagePage.steps.addHeadingText();
18
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
19
+ cy.log('Switching to Preview Tab')
20
+ createQuestionBasePage.steps.switchToPreviewTab();
21
+ });
22
+
23
+ it('When user adds text to the Heading and Body input field then the added text should be displayed in the \'Preview tab\' section', () => {
24
+ utilities.verifyInnerText(passagePage.previewHeadingText(), 'Globalization');
25
+ utilities.verifyInnerText(passagePage.previewTabBody(), 'It simply means the act of being globalized');
26
+ });
27
+
28
+ // Failing due to https://redmine.zeuslearning.com/issues/540708
29
+ it('CSS of Heading and Body text in \'Preview\' tab', { tags: 'css' }, () => {
30
+ utilities.verifyCSS(passagePage.previewHeadingText(), {
31
+ 'color': css.color.questionHeading,
32
+ 'font-size': css.fontSize.huge,
33
+ 'font-weight': css.fontWeight.regular
34
+ });
35
+ utilities.verifyCSS(passagePage.previewTabBody(), {
36
+ 'color': css.color.text,
37
+ 'font-size': css.fontSize.default,
38
+ 'font-weight': css.fontWeight.regular
39
+ });
40
+ });
41
+
42
+ it('Accessbility of default passage Preview Tab', { tags: 'a11y' }, () => {
43
+ cy.checkAccessibility(passagePage.previewWrapper());
44
+ });
45
+ });
46
+
47
+ describe('Multi-page content with single page - Preview tab', () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ cy.log('Navigating to passage resource type');
51
+ passagePage.steps.navigateToCreateResource('passage');
52
+ passagePage.steps.addHeadingText();
53
+ cy.log('Checking Multipage content checkbox')
54
+ passagePage.steps.checkMultipageContentCheckbox();
55
+ utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
56
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
57
+ cy.log('Switching to Preview Tab')
58
+ createQuestionBasePage.steps.switchToPreviewTab();
59
+ });
60
+
61
+ it('When user adds text to the Heading and Body input field then the added text should be displayed in the \'Preview tab\' section', () => {
62
+ utilities.verifyInnerText(passagePage.previewHeadingText(), 'Globalization');
63
+ utilities.verifyInnerText(passagePage.previewTabBody(), 'It simply means the act of being globalized');
64
+ });
65
+
66
+ it('Two chevron icons \'Previous\' and \'Next\' should be displayed in disabled state', () => {
67
+ passagePage.steps.verifyPreviousPageButtonDisabled();
68
+ passagePage.steps.verifyNextPageButtonDisabled();
69
+ });
70
+
71
+ it('\'Pagination\' text should be displayed', () => {
72
+ passagePage.steps.verifyPaginationText(1, 1);
73
+ });
74
+
75
+ it('CSS of disabled Previous and Next button', { tags: 'css' }, () => {
76
+ utilities.verifyCSS(passagePage.previousPageButton(), {
77
+ 'opacity': '0.5'
78
+ });
79
+ utilities.verifyCSS(passagePage.previousPageButton().find('svg path'), {
80
+ 'fill': css.color.secondaryBtnDisabled
81
+ });
82
+ utilities.verifyCSS(passagePage.nextPageButton(), {
83
+ 'opacity': '0.5'
84
+ });
85
+ utilities.verifyCSS(passagePage.nextPageButton().find('svg path'), {
86
+ 'fill': css.color.secondaryBtnDisabled
87
+ });
88
+ });
89
+
90
+ it('Accessbility of disabled \'Previous\' and \'Next\' button', { tags: 'a11y' }, () => {
91
+ cy.checkAccessibility(passagePage.previousPageButton());
92
+ cy.checkAccessibility(passagePage.nextPageButton());
93
+ });
94
+ });
95
+
96
+ describe('Multi-page content with multiple pages - Preview tab', () => {
97
+ abortEarlySetup();
98
+ before(() => {
99
+ cy.log('Navigating to passage resource type');
100
+ passagePage.steps.navigateToCreateResource('passage');
101
+ passagePage.steps.addHeadingText();
102
+ cy.log('Checking Multipage content checkbox')
103
+ passagePage.steps.checkMultipageContentCheckbox();
104
+ utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
105
+ cy.log('Add Image to Body input field')
106
+ passagePage.steps.focusInBodyInputField(0);
107
+ passagePage.steps.selectImageOptionFromCKEditorToolbar();
108
+ passagePage.steps.addImageToInputField();
109
+ cy.log('Add Equation to Body input field')
110
+ passagePage.steps.addPage();
111
+ passagePage.steps.focusInBodyInputField(1);
112
+ passagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
113
+ passagePage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
114
+ cy.log('Add Link to Body input field')
115
+ passagePage.steps.addPage();
116
+ passagePage.steps.focusInBodyInputField(2);
117
+ passagePage.steps.selectLinkOptionFromCKEditorToolbar();
118
+ passagePage.steps.addLinkToInputField();
119
+ cy.log('Add Bold text to Body input field')
120
+ passagePage.steps.addPage();
121
+ passagePage.steps.focusInBodyInputField(3);
122
+ passagePage.steps.selectBoldOptionFromCKEditorToolbar();
123
+ passagePage.steps.addBoldTextInputToBodyInputField(3);
124
+ createQuestionBasePage.steps.switchToPreviewTab();
125
+ });
126
+
127
+ it('When the user is on the first page, the next button should be enabled and the previous button should be disabled', () => {
128
+ passagePage.steps.verifyNextPageButtonEnabled();
129
+ passagePage.steps.verifyPreviousPageButtonDisabled();
130
+ });
131
+
132
+ it('When user adds an image, equation, text and link to the Body input they should be displayed in the \'Preview tab\' and when user navigates through the pages the Pagination text should change accordingly', () => {
133
+ passagePage.steps.verifyImageAddedToBodyInPreviewTab();
134
+ passagePage.steps.verifyPaginationText(1, 4);
135
+ cy.log('Switching to second page')
136
+ passagePage.steps.navigateToNextPage();
137
+ passagePage.steps.verifyEquationAddedToBodyInPreviewTab();
138
+ passagePage.steps.verifyPaginationText(2, 4);
139
+ cy.log('Switching to third page')
140
+ passagePage.steps.navigateToNextPage();
141
+ passagePage.steps.verifyLinkAddedToBodyInPreviewTab();
142
+ passagePage.steps.verifyPaginationText(3, 4);
143
+ cy.log('Switching to fourth page')
144
+ passagePage.steps.navigateToNextPage();
145
+ passagePage.steps.verifyBoldTextAddedToBodyInPreviewTab();
146
+ passagePage.steps.verifyPaginationText(4, 4);
147
+ });
148
+
149
+ it('When the user is on the last page, the previous button should be enabled and the next button should be disabled', () => {
150
+ passagePage.steps.verifyPreviousPageButtonEnabled();
151
+ passagePage.steps.verifyNextPageButtonDisabled();
152
+ });
153
+
154
+ it('When the user is on the intermediate page then the \'Previous\' and \'Next\' button should be in enabled state', () => {
155
+ cy.log('Switching to third page')
156
+ passagePage.steps.navigateToPreviousPage();
157
+ passagePage.steps.verifyPreviousPageButtonEnabled();
158
+ passagePage.steps.verifyNextPageButtonEnabled();
159
+ });
160
+
161
+ it('When the user hovers over the enabled \'Previous\' icon button then, \'Previous page\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Previous\' icon button', () => {
162
+ passagePage.previousPageButton()
163
+ .verifyTooltip('Previous Page');
164
+ });
165
+
166
+ it('When the user hovers over the enabled \'Next\' icon button then, \'Next page\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Next\' icon button', () => {
167
+ passagePage.nextPageButton()
168
+ .verifyTooltip('Next Page');
169
+ });
170
+
171
+ it('CSS of default and active state of next and previous buttons in Preview tab', { tags: 'css' }, () => {
172
+ passagePage.steps.hoverOnNextPageButton()
173
+ utilities.verifyCSS(passagePage.nextPageButton(), {
174
+ 'border': `1px solid ${css.color.activeButtons}`,
175
+ });
176
+ utilities.verifyCSS(passagePage.nextPageButton().find('svg path'), {
177
+ 'fill': css.color.nextPreviousButtonFill,
178
+ });
179
+ passagePage.steps.hoverAwayFromNextPageButton()
180
+ utilities.verifyCSS(passagePage.nextPageButton(), {
181
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
182
+ });
183
+ passagePage.steps.hoverOnPreviousPageButton()
184
+ utilities.verifyCSS(passagePage.previousPageButton(), {
185
+ 'border': `1px solid ${css.color.activeButtons}`,
186
+ });
187
+ utilities.verifyCSS(passagePage.previousPageButton().find('svg path'), {
188
+ 'fill': css.color.nextPreviousButtonFill,
189
+ });
190
+ passagePage.steps.hoverAwayFromPreviousPageButton();
191
+ utilities.verifyCSS(passagePage.previousPageButton(), {
192
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
193
+ });
194
+ });
195
+
196
+ //Failing due to https://redmine.zeuslearning.com/issues/537907
197
+ it('CSS of \'Preview Tab\' when image, equation, text and link are added', { tags: 'css' }, () => {
198
+ cy.log('Switching to first page')
199
+ passagePage.steps.navigateToPreviousPage();
200
+ passagePage.steps.navigateToPreviousPage();
201
+ utilities.verifyCSS(passagePage.previewTabBody().find('img'), {
202
+ 'color': css.color.text,
203
+ 'font-size': css.fontSize.default,
204
+ 'font-weight': css.fontWeight.regular
205
+ });
206
+ cy.log('Switching to second page')
207
+ passagePage.steps.navigateToNextPage();
208
+ utilities.verifyCSS(passagePage.previewTabBody(), {
209
+ 'color': css.color.text,
210
+ 'font-size': css.fontSize.default,
211
+ 'font-weight': css.fontWeight.regular
212
+ });
213
+ cy.log('Switching to third page')
214
+ passagePage.steps.navigateToNextPage();
215
+ utilities.verifyCSS(passagePage.previewTabBody().find('a'), {
216
+ 'color': css.color.linkText,
217
+ 'font-size': css.fontSize.default,
218
+ 'font-weight': css.fontWeight.regular
219
+ });
220
+ cy.log('Switching to fourth page')
221
+ passagePage.steps.navigateToNextPage();
222
+ utilities.verifyCSS(passagePage.previewTabBody(), {
223
+ 'color': css.color.text,
224
+ 'font-size': css.fontSize.default,
225
+ 'font-weight': css.fontWeight.regular
226
+ });
227
+ cy.log('Switching back to third page')
228
+ passagePage.steps.navigateToPreviousPage();
229
+ });
230
+
231
+ it('Accessibility of \'Preview tab\' when image, equation and link are added', { tags: 'a11y' }, () => {
232
+ cy.log('Switching to fourth page')
233
+ passagePage.steps.navigateToNextPage();
234
+ cy.checkAccessibility(passagePage.previewWrapper());
235
+ cy.log('Switching to third page')
236
+ passagePage.steps.navigateToPreviousPage();
237
+ cy.checkAccessibility(passagePage.previewWrapper());
238
+ cy.log('Switching to second page')
239
+ passagePage.steps.navigateToPreviousPage();
240
+ cy.checkAccessibility(passagePage.previewWrapper());
241
+ cy.log('Switching to first page')
242
+ passagePage.steps.navigateToPreviousPage();
243
+ cy.checkAccessibility(passagePage.previewWrapper());
244
+ });
245
+ });
246
+ });
@@ -3,12 +3,77 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
+ const rulerStyles = ['Line focus', 'Overlay mask', 'Drag handle'];
7
+ const colors = ['Grey', 'Black', 'Blue', 'Green', 'Red'];
8
+ const colorValues = ['rgb(112, 112, 112)', 'rgb(26, 26, 26)', 'rgb(0, 134, 153)', 'rgb(0, 159, 106)', 'rgb(153, 29, 0)'];
9
+ const labels = [readingRulerPage.displayButtonToStudentLabel, readingRulerPage.allowStudentToResizeLabel, readingRulerPage.visibleOnLandingLabel];
10
+
6
11
  describe('Create Item page - Reading ruler: Edit Tab', () => {
7
12
  before(() => {
8
13
  cy.loginAs('admin');
9
14
  });
15
+
16
+ describe('Ruler style - Edit tab', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ cy.log('Navigating to \'Reading ruler\' resource tool');
20
+ readingRulerPage.steps.navigateToCreateResource('reading ruler');
21
+ });
22
+
23
+ it('\'Ruler style\' label should be displayed', () => {
24
+ utilities.verifyInnerText(readingRulerPage.rulerStyleLabel(), 'Ruler style');
25
+ utilities.verifyElementVisibilityState(readingRulerPage.rulerStyleLabel(), 'visible');
26
+ });
27
+
28
+ it(`Three ruler styles ${rulerStyles} should be displayed with their labels and icons`, () => {
29
+ rulerStyles.forEach((styleName, styleIndex) => {
30
+ readingRulerPage.steps.verifyRulerStyleButton(styleName, styleIndex);
31
+ });
32
+ });
33
+
34
+ it('\'Line focus\' should be selected ruler style by default', () => {
35
+ readingRulerPage.steps.verifyRulerStyleSelectedState('Line focus');
36
+ });
37
+
38
+ it('CSS of Ruler style section', { tags: 'css' }, () => {
39
+ utilities.verifyCSS(readingRulerPage.rulerStyleLabel(), {
40
+ 'color': css.color.labels,
41
+ 'font-size': css.fontSize.normal,
42
+ 'font-weight': css.fontWeight.semibold
43
+ });
44
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), 0), {
45
+ 'color': css.color.whiteText,
46
+ 'font-size': css.fontSize.default,
47
+ 'font-weight': css.fontWeight.regular
48
+ });
49
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.rulerStyleButton(), 0), {
50
+ 'border': `1px solid ${css.color.activeButtons}`
51
+ });
52
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.rulerStyleButton().find('[class*="RulerStyleIconLabelWrapper"]'), 0), {
53
+ 'background-color': css.color.activeButtons
54
+ });
55
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), 1), {
56
+ 'color': css.color.secondaryBtn,
57
+ 'font-size': css.fontSize.default,
58
+ 'font-weight': css.fontWeight.regular
59
+ });
60
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.rulerStyleButton().find('[class*="RulerStyleIconLabelWrapper"]'), 1), {
61
+ 'background-color': css.color.transparent
62
+ });
63
+ });
64
+
65
+ it('Accessibility of Ruler style section', { tags: 'a11y' }, () => {
66
+ cy.checkAccessibility(readingRulerPage.rulerStyleLabel().parents('[class*="RulerStyle"]'));
67
+ });
68
+
69
+ it('When the user selects any other \'Ruler style\' option then it should be displayed in selected state', () => {
70
+ readingRulerPage.steps.selectRulerStyle('Overlay mask');
71
+ readingRulerPage.steps.verifyRulerStyleSelectedState('Overlay mask');
72
+ });
73
+ });
74
+
10
75
  //TODO: update below to lower case after https://redmine.zeuslearning.com/issues/542832 gets resolved
11
- describe('\'Conditional checkboxes\', \'Color\', \'Default number of lines\' section -Edit Tab', () => {
76
+ describe('\'Conditional checkboxes\', \'Default number of lines\' section -Edit Tab', () => {
12
77
  abortEarlySetup();
13
78
  before(() => {
14
79
  cy.log('Navigating to \'Reading ruler\' resource tool');
@@ -35,7 +100,6 @@ describe('Create Item page - Reading ruler: Edit Tab', () => {
35
100
 
36
101
  //Failing due to https://redmine.zeuslearning.com/issues/541620
37
102
  it('CSS of \'Conditional checkboxes\' label in Edit tab', { tags: 'css' }, () => {
38
- const labels = [readingRulerPage.displayButtonToStudentLabel, readingRulerPage.allowStudentToResizeLabel, readingRulerPage.visibleOnLandingLabel]
39
103
  labels.forEach(label => {
40
104
  utilities.verifyCSS(label(), {
41
105
  'color': css.color.labelText,
@@ -45,18 +109,57 @@ describe('Create Item page - Reading ruler: Edit Tab', () => {
45
109
  });
46
110
  });
47
111
 
112
+ it('\'Default number of lines\' label and input field should be displayed and by default the input field should be prefilled with value 4', () => {
113
+ utilities.verifyInnerText(readingRulerPage.defaultNumberOfLinesLabel(), 'Default number of lines'
114
+ );
115
+ utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesLabel(), 'visible');
116
+ readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('4');
117
+ utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesInputField(), 'visible');
118
+ });
119
+
120
+ it('User should able to update value in \'Default number of lines\' input field', () => {
121
+ readingRulerPage.steps.addInputToDefaultNumberOfLinesInputField('2')
122
+ readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('2');
123
+ });
124
+
125
+ it('CSS of \'Default number of lines\' Section in Edit tab', { tags: 'css' }, () => {
126
+ utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesLabel(), {
127
+ 'color': css.color.labels,
128
+ 'font-size': css.fontSize.normal,
129
+ 'font-weight': css.fontWeight.semibold
130
+ });
131
+ utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesInputField(), {
132
+ 'color': css.color.text,
133
+ 'font-size': css.fontSize.default,
134
+ 'font-weight': css.fontWeight.regular
135
+ });
136
+ });
137
+
138
+ it('Accessibility of \'Default number of lines\' input field', { tags: 'a11y' }, () => {
139
+ cy.checkAccessibility(readingRulerPage.defaultNumberOfLinesInputField());
140
+ });
141
+ });
142
+
143
+ describe('Color - Edit tab', () => {
144
+ abortEarlySetup();
145
+ before(() => {
146
+ cy.log('Navigating to \'Reading ruler\' resource tool');
147
+ readingRulerPage.steps.navigateToCreateResource('reading ruler');
148
+ });
149
+
48
150
  it('\'Color\' label should be displayed', () => {
49
151
  utilities.verifyInnerText(readingRulerPage.colorLabel(), 'Color');
50
152
  utilities.verifyElementVisibilityState(readingRulerPage.colorLabel(), 'visible');
51
153
  });
52
154
 
53
- it('Five solid colors with the label \'Grey\', \'Black\', \'Blue\',\'Green\' and \'Red\' respectively should be displayed ', () => {
54
- const colors = ['Gray', 'Black', 'Blue', 'Green', 'Red'];
55
- const colorValues = ['rgb(112, 112, 112)', 'rgb(26, 26, 26)', 'rgb(0, 134, 153)', 'rgb(0, 159, 106)', 'rgb(153, 29, 0)'];
155
+ it('Five solid colors with the label \'Grey\', \'Black\', \'Blue\',\'Green\' and \'Red\' respectively and custom color block should be displayed ', () => {
56
156
  utilities.verifyElementCount(readingRulerPage.colorBlock(), 5);
57
157
  colors.forEach((color, blockIndex) => {
58
158
  readingRulerPage.steps.verifyColorBlock(blockIndex, color, colorValues[blockIndex]);
59
159
  });
160
+ utilities.verifyElementVisibilityState(readingRulerPage.customColorWrapper(), 'visible');
161
+ utilities.verifyInnerText(readingRulerPage.customLabel(), 'Custom');
162
+ utilities.verifyElementVisibilityState(readingRulerPage.customLabel(), 'visible');
60
163
  });
61
164
 
62
165
  it('\'Grey\' color radio button should be preselected by default.', () => {
@@ -70,16 +173,12 @@ describe('Create Item page - Reading ruler: Edit Tab', () => {
70
173
  'font-weight': css.fontWeight.semibold
71
174
  });
72
175
  utilities.verifyCSS(readingRulerPage.colorBlockLabel(), {
73
- 'color': css.color.labelText,
176
+ 'color': css.color.codeBlockText,
74
177
  'font-size': css.fontSize.normal,
75
178
  'font-weight': css.fontWeight.regular
76
179
  });
77
180
  });
78
181
 
79
- it('Accessibility of edit tab when \'Display button to student\' and \'Allow student to resize\' checkbox are checked', { tags: 'a11y' }, () => {
80
- cy.checkAccessibility(readingRulerPage.displayButtonToStudentCheckbox().parents('.ngie-checkbox-form-group'));
81
- });
82
-
83
182
  it('When the user selects a color block from the \'Color\' section then the selected color should change and the selected icon should be displayed on the newly selected color', () => {
84
183
  readingRulerPage.steps.selectColorBlock(2);
85
184
  readingRulerPage.steps.verifyColorBlockSelectedState(2);
@@ -87,37 +186,43 @@ describe('Create Item page - Reading ruler: Edit Tab', () => {
87
186
  });
88
187
 
89
188
  it('Accessibility of newly selected color', { tags: 'a11y' }, () => {
90
- cy.checkAccessibility(readingRulerPage.colorBlock().parents('[aria-label="color"]'));
189
+ cy.checkAccessibility(readingRulerPage.colorBlock().parents('[class*="ColorPalleteWrapper"]'));
91
190
  });
92
191
 
93
- it('\'Default number of lines\' label and input field should be displayed and by default the input field should be prefilled with value 4', () => {
94
- utilities.verifyInnerText(readingRulerPage.defaultNumberOfLinesLabel(), 'Default number of lines'
95
- );
96
- utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesLabel(), 'visible');
97
- readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('4');
98
- utilities.verifyElementVisibilityState(readingRulerPage.defaultNumberOfLinesInputField(), 'visible');
192
+ it('When user clicks on custom color block then select color popup should appear', () => {
193
+ readingRulerPage.steps.clickOnCustomColorBlock();
194
+ readingRulerPage.steps.verifyColorPopupIsDisplayed();
99
195
  });
100
196
 
101
- it('User should able to update value in \'Default number of lines\' input field', () => {
102
- readingRulerPage.steps.addInputToDefaultNumberOfLinesInputField('2')
103
- readingRulerPage.steps.verifyDefaultNumberOfLinesInputFieldValue('2');
197
+ readingRulerPage.tests.verifyColorPopupSelectColorTitle();
198
+
199
+ readingRulerPage.tests.verifySaturationAndOpacityGradientPalette('rgb(255, 255, 255)');
200
+
201
+ readingRulerPage.tests.verifyColorHuePaletteAndHexInputField('rgb(255, 0, 0)', '#ffffff');
202
+
203
+ it('When the user has modified the selected color in the color popup and clicks on \'Ok\' button, then the popup should close and the modifications in the color popup should persist. Color block should change to the new selected color and it should be in unselected state', () => {
204
+ readingRulerPage.steps.addInputToHexInputField('#ff0000');
205
+ readingRulerPage.steps.clickOnOpacityGradientHuePalette();
206
+ readingRulerPage.steps.verifyOpacityGradientPaletteColor('rgba(255, 0, 0, 0.5)');
207
+ readingRulerPage.steps.clickOnOkButton();
208
+ utilities.verifyElementVisibilityState(readingRulerPage.dialogBoxContent(), 'notExist');
209
+ readingRulerPage.steps.verifyCustomColor('#ff0000', 'rgba(255, 0, 0, 0.5)');
210
+ readingRulerPage.steps.verifyColorBlockUnSelectedState(5);
104
211
  });
105
212
 
106
- it('CSS of \'Default number of lines\' Section in Edit tab', { tags: 'css' }, () => {
107
- utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesLabel(), {
108
- 'color': css.color.labels,
109
- 'font-size': css.fontSize.normal,
110
- 'font-weight': css.fontWeight.semibold
111
- });
112
- utilities.verifyCSS(readingRulerPage.defaultNumberOfLinesInputField(), {
113
- 'color': css.color.text,
114
- 'font-size': css.fontSize.default,
115
- 'font-weight': css.fontWeight.regular
116
- });
213
+ it('When the user modifies the selected color in the color popup and clicks on \'Cancel\' button, then the popup should close and it should be in unselected state and the modifications in the color popup should not persist. Color block should not change and it should be in unselected state', () => {
214
+ readingRulerPage.steps.clickOnCustomBlockEditIcon();
215
+ readingRulerPage.steps.addInputToHexInputField('#00002E');
216
+ readingRulerPage.steps.clickOnCancelButton();
217
+ utilities.verifyElementVisibilityState(readingRulerPage.dialogBoxContent(), 'notExist');
218
+ readingRulerPage.steps.verifyCustomColor('#ff0000', 'rgba(255, 0, 0, 0.5)');
219
+ readingRulerPage.steps.verifyColorBlockUnSelectedState(5);
117
220
  });
118
221
 
119
- it('Accessibility of \'Default number of lines\' input field', { tags: 'a11y' }, () => {
120
- cy.checkAccessibility(readingRulerPage.defaultNumberOfLinesInputField());
222
+ it('When user has modified custom color in color popup and selects it then custom color should be in selected state', () => {
223
+ utilities.verifyElementVisibilityState(utilities.getNthElement(readingRulerPage.colorBlock(), 5), 'visible');
224
+ readingRulerPage.steps.selectColorBlock(5);
225
+ readingRulerPage.steps.verifyColorBlockSelectedState(5);
121
226
  });
122
227
  });
123
228
 
@@ -1,5 +1,6 @@
1
1
  import { readingRulerPage } from "../../../pages";
2
2
  import { commonComponents } from "../../../pages/components";
3
+ import utilities from "../../../support/helpers/utilities";
3
4
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
5
 
5
6
  describe('Create question page - Reading ruler: Header section and saving resource tool', () => {
@@ -34,22 +35,45 @@ describe('Create question page - Reading ruler: Header section and saving resour
34
35
  readingRulerPage.steps.navigateToCreateResource('reading ruler');
35
36
  });
36
37
 
37
- readingRulerPage.tests.verifyCancelButton();
38
+ it('When user has made no edits and clicks on Cancel button, the user should be directed back to the \'Select a Question\' page', () => {
39
+ readingRulerPage.steps.clickOnCancelButton();
40
+ utilities.verifyElementVisibilityState(readingRulerPage.selectAQuestionHeaderText(), 'visible');
41
+ utilities.verifyElementVisibilityState(readingRulerPage.questionTypeOptionTitle(), 'visible');
42
+ });
43
+
44
+ it('When user has made some edits/changes and clicks on Cancel button, a popup should be displayed', () => {
45
+ readingRulerPage.steps.selectResourceType('reading ruler');
46
+ readingRulerPage.steps.addInputToOpacityInputField(30);
47
+ readingRulerPage.steps.clickOnCancelButton();
48
+ utilities.verifyElementVisibilityState(readingRulerPage.dialogBox(), 'visible');
49
+ });
50
+
51
+ readingRulerPage.tests.verifyContentsOfLeavePagePopupWithCSSAnda11y();
52
+
53
+ it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
54
+ readingRulerPage.steps.clickOnRejectButtonInDialogBox();
55
+ readingRulerPage.steps.verifyEditTabSelectedState();
56
+ readingRulerPage.steps.verifyOpacityInputFieldValue(30);
57
+ });
58
+
59
+ it(`Clicking on \'Yes, I want to leave this page\' button should discard all changes and direct the user to the \'Select a question\' page.`, () => {
60
+ readingRulerPage.steps.clickOnCancelButton();
61
+ readingRulerPage.steps.clickOnAcceptButtonInDialogBox();
62
+ utilities.verifyElementVisibilityState(readingRulerPage.selectAQuestionHeaderText(), 'visible');
63
+ utilities.verifyElementVisibilityState(readingRulerPage.questionTypeOptionTitle(), 'visible');
64
+ });
38
65
  });
39
66
 
40
- //TODO: Need to update cases after https://redmine.zeuslearning.com/issues/542818
41
67
  describe('Save button', () => {
42
68
  abortEarlySetup();
43
69
  before(() => {
44
70
  cy.log('Navigating to Reading ruler resource tool');
45
71
  readingRulerPage.steps.navigateToCreateResource('reading ruler');
46
72
  });
47
- commonComponents.tests.verifyCreateItemWrapperContentsA11y();
48
-
49
- it('When user has filled all the mandatory fields then on clicking on Save button the resource tool should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
73
+ it('When user clicks on Save button, then the resource tool should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
50
74
  readingRulerPage.steps.saveAQuestionAndVerifySnackbar();
51
75
  });
52
76
 
53
77
  readingRulerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
54
- });
78
+ });
55
79
  });