itemengine-cypress-automation 1.0.105 → 1.0.107

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) 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/responseEvaluationMethodsAndCustomSettings.js +3 -3
  57. package/cypress/fixtures/specialAndMathCharacters.js +2 -0
  58. package/cypress/fixtures/theme/ilc.json +4 -2
  59. package/cypress/pages/audioResponsePage.js +326 -165
  60. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  61. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  62. package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
  63. package/cypress/pages/components/colorPopupComponent.js +115 -26
  64. package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
  65. package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
  66. package/cypress/pages/components/editCategoryFlyout.js +164 -2
  67. package/cypress/pages/components/equationEditorFlyout.js +36 -1
  68. package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
  69. package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
  70. package/cypress/pages/components/index.js +2 -1
  71. package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
  72. package/cypress/pages/correctAnswerViewPage.js +12 -1
  73. package/cypress/pages/drawingResponsePage.js +26 -151
  74. package/cypress/pages/essayResponseMathPage.js +28 -16
  75. package/cypress/pages/essayResponsePage.js +187 -7
  76. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
  77. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
  78. package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
  79. package/cypress/pages/multipleSelectionPage.js +1 -1
  80. package/cypress/pages/readingRulerPage.js +219 -104
  81. package/cypress/pages/singleSelectionPage.js +1 -0
  82. package/cypress/pages/textEntryMathPage.js +17 -6
  83. package/cypress/pages/videoResponsePage.js +0 -8
  84. package/package.json +1 -1
  85. package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,242 @@
1
+ import { passagePage } from "../../../pages";
2
+ import { commonComponents } 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: Heading Section, Content section, Body section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Enable multi-page content-Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to passage resource type');
16
+ passagePage.steps.navigateToCreateResource('passage');
17
+ });
18
+
19
+ it('\'Content\' label should be displayed', () => {
20
+ utilities.verifyTextContent(passagePage.contentLabel(), 'Content');
21
+ utilities.verifyElementVisibilityState(passagePage.contentLabel(), 'visible');
22
+ });
23
+
24
+ it('\'Enable multi-page content\' label and checkbox should be displayed and by default the checkbox should be unchecked', () => {
25
+ utilities.verifyTextContent(passagePage.enableMultipageContentLabel(), 'Enable multi-page content');
26
+ utilities.verifyElementVisibilityState(passagePage.enableMultipageContentLabel(), 'visible');
27
+ passagePage.steps.verifyEnableMultiPageContentCheckboxUnchecked();
28
+ });
29
+
30
+ it('When the user checks the \'Enable multi-page content\' checkbox then 1 \'Body\' input fields should be displayed with placeholder text and numeration, Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
31
+ passagePage.steps.checkMultipageContentCheckbox();
32
+ utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
33
+ passagePage.steps.verifyBodyContents(0)
34
+ utilities.verifyElementCount(passagePage.bodyInputField(), 1);
35
+ });
36
+
37
+ it('CSS of Checked Multi-page checkbox', { tags: 'css' }, () => {
38
+ utilities.verifyCSS(passagePage.enableMultipageContentLabelCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
39
+ 'fill': css.color.activeButtons
40
+ });
41
+ });
42
+
43
+ it('Accessbility of checked Multi-page checkbox', { tags: 'a11y' }, () => {
44
+ cy.checkAccessibility(passagePage.enableMultipageContentLabelCheckbox().parents('[data-ngie-testid="enable-multi-page-content-checkbox"]'));
45
+ });
46
+
47
+ it('When body input fields are less than 2 then drag handle and Delete page button should be in disabled state', () => {
48
+ passagePage.steps.verifyDeletePageButtonDisabled();
49
+ passagePage.steps.verifyDragHandleButtonDisabled();
50
+ });
51
+
52
+ it('CSS of disabled delete and Drag handle button', { tags: 'css' }, () => {
53
+ passagePage.deletePageButton()
54
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
55
+ utilities.verifyCSS(passagePage.deletePageButton(), {
56
+ 'opacity': '0.5'
57
+ })
58
+ utilities.verifyCSS(passagePage.dragHandleButton(), {
59
+ 'opacity': '0.5'
60
+ });
61
+ });
62
+
63
+ it('Accessbility of disabled delete and Drag handle button', { tags: 'a11y' }, () => {
64
+ cy.checkAccessibility(passagePage.deletePageButton());
65
+ cy.checkAccessibility(passagePage.dragHandleButton());
66
+ });
67
+
68
+ it('When the user hovers over the disabled \'Delete\' icon buttons then, \'Minimum one page is required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
69
+ passagePage.steps.verifyDisabledDeletePageButtonTooltip();
70
+ });
71
+
72
+ it('\'Add page\' button should be present', () => {
73
+ utilities.verifyTextContent(passagePage.addPageButton(), 'Add page');
74
+ utilities.verifyElementVisibilityState(passagePage.addPageButton(), 'visible');
75
+ });
76
+
77
+ it('When user adds a page using the \'Add page\' button then added page should be displayed with drag handle, placeholder text, body numeration and delete button', () => {
78
+ passagePage.steps.addPage();
79
+ for (let index = 0; index < 2; index++) {
80
+ passagePage.steps.verifyBodyContents(index)
81
+ }
82
+ utilities.verifyElementCount(passagePage.bodyInputField(), 2);
83
+ });
84
+
85
+ it('When body input fields are more than one then drag handle and Delete page button should be in displayed in enabled state', () => {
86
+ passagePage.steps.verifyDeletePageButtonEnabled();
87
+ passagePage.steps.verifyDragHandleButtonEnabled();
88
+ });
89
+
90
+ it('CSS of Body input field', { tags: 'css' }, () => {
91
+ utilities.verifyCSS(passagePage.dragHandleButton().eq(0), {
92
+ 'color': css.color.secondaryBtnActive,
93
+ 'font-size': css.fontSize.normal,
94
+ 'font-weight': css.fontWeight.regular
95
+ });
96
+ utilities.verifyCSS(passagePage.deletePageButton().eq(0), {
97
+ 'opacity': '1'
98
+ });
99
+ utilities.verifyCSS(passagePage.bodyInputField(), {
100
+ 'color': css.color.text,
101
+ 'font-size': css.fontSize.default,
102
+ 'font-weight': css.fontWeight.regular
103
+ });
104
+ utilities.verifyCSS(passagePage.bodyNumeration().eq(0), {
105
+ 'color': css.color.labels,
106
+ 'font-size': css.fontSize.default,
107
+ 'font-weight': css.fontWeight.semibold
108
+ });
109
+ utilities.verifyCSS(passagePage.addPageButton(), {
110
+ 'color': css.color.secondaryBtnActive,
111
+ 'font-size': css.fontSize.default,
112
+ 'font-weight': css.fontWeight.medium
113
+ });
114
+ });
115
+
116
+ it('When the user hovers over the drag handle of the body field, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
117
+ passagePage.steps.verifyDragHandleButtonTooltip();
118
+ });
119
+
120
+ it('When the user hovers over the enabled \'Delete\' icon buttons then, \'Delete page\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
121
+ passagePage.steps.verifyDeletePageButtonTooltip();
122
+ });
123
+
124
+ it('When user clicks on the \'Delete\' page button then the respective body input field should get deleted, body numeration should change accordingly', () => {
125
+ passagePage.steps.deletePage(0);
126
+ passagePage.steps.verifyDeletePageButtonDisabled();
127
+ passagePage.steps.verifyBodyContents(0)
128
+ utilities.verifyElementCount(passagePage.bodyInputField(), 1);
129
+ });
130
+
131
+ it('When user focus in and out of any of the \'Body\' input field without typing anything, an error message \'Error: Body is required.\' should be displayed', () => {
132
+ passagePage.steps.focusInBodyInputField(0);
133
+ passagePage.steps.focusOutOfBodyInputField(0);
134
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Body is required.');
135
+ });
136
+
137
+ it('When user enters text in body input field the error message should disappear', () => {
138
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
139
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
140
+ });
141
+
142
+ it('When user enters text in Body input field, the placeholder text should disappear ', () => {
143
+ passagePage.steps.verifyBodyPlaceholderTextNotExist();
144
+ });
145
+
146
+ it('When user adds an image to the body input field then it should be displayed in the body input field', () => {
147
+ cy.log('Clear Body field')
148
+ passagePage.steps.clearBodyInputField();
149
+ passagePage.steps.focusInBodyInputField(0);
150
+ passagePage.steps.selectImageOptionFromCKEditorToolbar();
151
+ passagePage.steps.addImageToInputField();
152
+ passagePage.steps.verifyImageAndAltTextInBodyInputField(0);
153
+ });
154
+
155
+ it('When user adds an equation to the body input field then it should be displayed in the body input field', () => {
156
+ cy.log('Add page');
157
+ passagePage.steps.addPage();
158
+ passagePage.steps.focusInBodyInputField(1);
159
+ passagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
160
+ passagePage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
161
+ passagePage.steps.verifyEquationInBodyInputField(1);
162
+ });
163
+
164
+ it('When user adds a link to the body input field then it should be displayed in the body input field', () => {
165
+ cy.log('Add page');
166
+ passagePage.steps.addPage();
167
+ passagePage.steps.focusInBodyInputField(2);
168
+ passagePage.steps.selectLinkOptionFromCKEditorToolbar();
169
+ passagePage.steps.addLinkToInputField();
170
+ passagePage.steps.verifyLinkInBodyInputField(2);
171
+ });
172
+
173
+ it('When user adds bold text to the body input field then it should be displayed in the body input field', () => {
174
+ cy.log('Add page');
175
+ passagePage.steps.addPage();
176
+ passagePage.steps.focusInBodyInputField(3);
177
+ passagePage.steps.selectBoldOptionFromCKEditorToolbar();
178
+ passagePage.steps.addBoldTextInputToBodyInputField(3);
179
+ passagePage.steps.verifyBoldTextInBodyInputField(3);
180
+ });
181
+
182
+ it('CSS of \'Body\' input field when image, equation, text and link are added', { tags: 'css' }, () => {
183
+ utilities.verifyCSS(passagePage.bodyInputField().eq(0).find('img'), {
184
+ 'color': css.color.text,
185
+ 'font-size': css.fontSize.default,
186
+ 'font-weight': css.fontWeight.regular
187
+ });
188
+ utilities.verifyCSS(passagePage.bodyInputField().eq(1), {
189
+ 'color': css.color.text,
190
+ 'font-size': css.fontSize.default,
191
+ 'font-weight': css.fontWeight.regular
192
+ });
193
+ utilities.verifyCSS(passagePage.bodyInputField().eq(2).find('a'), {
194
+ 'color': css.color.linkText,
195
+ 'font-size': css.fontSize.default,
196
+ 'font-weight': css.fontWeight.regular
197
+ });
198
+ utilities.verifyCSS(passagePage.bodyInputField().eq(3), {
199
+ 'color': css.color.text,
200
+ 'font-size': css.fontSize.default,
201
+ 'font-weight': css.fontWeight.regular
202
+ });
203
+ });
204
+
205
+ it('Accessbility of\' Body input\' field when image, equation, text and link are added', { tags: 'a11y' }, () => {
206
+ cy.checkAccessibility(passagePage.bodyWrapper().parents('[data-rbd-droppable-id="assessment-option-item-options"]'));
207
+ });
208
+ });
209
+
210
+ describe('Enable multi-page content: Check & Uncheck functionality-Edit tab', () => {
211
+ abortEarlySetup();
212
+ before(() => {
213
+ cy.log('Navigating to passage resource type');
214
+ passagePage.steps.navigateToCreateResource('passage');
215
+ cy.log('check the \'Enable multi-page content\' checkbox');
216
+ passagePage.steps.checkMultipageContentCheckbox();
217
+ utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
218
+ cy.log('Add 1 page to body input field');
219
+ passagePage.steps.addPage();
220
+ });
221
+
222
+ it('When user adds text input to all the \'Body \' input fields then the added text should be displayed in input fields', () => {
223
+ passagePage.steps.focusInBodyInputField(0);
224
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized', 'Globalization is a serious issue']);
225
+ });
226
+
227
+ it('When user unchecks the \'Enable multi-page content\' checkbox then all the input fields should be combined and displayed in a single \'Body\' input field', () => {
228
+ passagePage.steps.uncheckMultipageContentCheckbox();
229
+ passagePage.steps.verifyTextInBodyInputField(0, 'It simply means the act of being globalizedGlobalization is a serious issue');
230
+ });
231
+
232
+ it('\'Body\' input field should be displayed without numeration, Drag handle and Delete option icon ', () => {
233
+ utilities.verifyElementVisibilityState(passagePage.bodyWrapper(), 'notExist');
234
+ });
235
+
236
+ it('When user checks the \'Enable multi-page content\' checkbox again then the added content should be displayed in a single body field', () => {
237
+ passagePage.steps.checkMultipageContentCheckbox();
238
+ passagePage.steps.verifyTextInBodyInputField(0, 'It simply means the act of being globalizedGlobalization is a serious issue');
239
+ });
240
+ });
241
+ });
242
+
@@ -0,0 +1,99 @@
1
+ import { passagePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create Item page - Passage: Additional settings', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Additional settings accordion', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigating to passage resource type');
15
+ passagePage.steps.navigateToCreateResource('passage');
16
+ });
17
+
18
+ passagePage.tests.verifyAdditonalSettingsAccordionProperties();
19
+
20
+ });
21
+
22
+ describe('Additional settings details section-Edit tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ cy.log('Navigating to passage resource type');
26
+ passagePage.steps.navigateToCreateResource('passage');
27
+ cy.log('Expanding additional settings accordion');
28
+ passagePage.steps.expandAdditonalSettings();
29
+ });
30
+
31
+ it('\'Details\' label should be displayed', () => {
32
+ utilities.verifyInnerText(passagePage.additionalSettingsDetailsLabel(), 'Details');
33
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsDetailsLabel(), 'visible');
34
+ });
35
+
36
+ it('\'Flesch-Kincaid\' label and input field should be displayed and user should be able to enter text in input field', () => {
37
+ utilities.verifyInnerText(passagePage.additionalSettingsFleschKincaidLabel(), 'Flesch-Kincaid');
38
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsFleschKincaidLabel(), 'visible');
39
+ passagePage.steps.addAndVerifyTextInFleschKincaidInputField('Average');
40
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsFleschKincaidInputField(), 'visible');
41
+ });
42
+
43
+ it('\'Lexile\' label and input field should be displayed and user should be able to enter text in input field', () => {
44
+ utilities.verifyInnerText(passagePage.additionalSettingsLexileLabel(), 'Lexile');
45
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsLexileLabel(), 'visible');
46
+ passagePage.steps.addAndVerifyTextInLexileInputField('Grade Band');
47
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsLexileInputField(), 'visible');
48
+ });
49
+
50
+ it('\'Teacher scoring guidelines\' label and input field should be displayed and user should be able to enter \'Teacher scoring guidelines\'', () => {
51
+ utilities.verifyInnerText(passagePage.additionalSettingsTeacherGuidelinesLabel(), 'Teacher scoring guidelines');
52
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsTeacherGuidelinesLabel(), 'visible');
53
+ passagePage.steps.addTextToTeacherGuidelinesInputField();
54
+ utilities.verifyElementVisibilityState(passagePage.additionalSettingsTeacherGuidelinesInputField(), 'visible');
55
+ utilities.verifyInnerText(passagePage.additionalSettingsTeacherGuidelinesInputField(), 'Teacher scoring guidelines');
56
+ });
57
+
58
+ it('CSS of \'Details\' section', { tags: 'css' }, () => {
59
+ utilities.verifyCSS(passagePage.additionalSettingsDetailsLabel(), {
60
+ 'color': css.color.sectionHeading,
61
+ 'font-size': css.fontSize.default,
62
+ 'font-weight': css.fontWeight.semibold
63
+ });
64
+ utilities.verifyCSS(passagePage.additionalSettingsFleschKincaidLabel(), {
65
+ 'color': css.color.labels,
66
+ 'font-size': css.fontSize.normal,
67
+ 'font-weight': css.fontWeight.semibold
68
+ });
69
+ utilities.verifyCSS(passagePage.additionalSettingsLexileLabel(), {
70
+ 'color': css.color.labels,
71
+ 'font-size': css.fontSize.normal,
72
+ 'font-weight': css.fontWeight.semibold
73
+ });
74
+ utilities.verifyCSS(passagePage.additionalSettingsTeacherGuidelinesLabel(), {
75
+ 'color': css.color.labels,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.semibold
78
+ });
79
+ });
80
+
81
+ it('CSS of added text in input field of the Details Section', { tags: 'css' }, () => {
82
+ utilities.verifyCSS(passagePage.additionalSettingsFleschKincaidInputField(), {
83
+ 'color': css.color.text,
84
+ 'font-size': css.fontSize.default,
85
+ 'font-weight': css.fontWeight.regular
86
+ });
87
+ utilities.verifyCSS(passagePage.additionalSettingsLexileInputField(), {
88
+ 'color': css.color.text,
89
+ 'font-size': css.fontSize.default,
90
+ 'font-weight': css.fontWeight.regular
91
+ });
92
+ utilities.verifyCSS(passagePage.additionalSettingsTeacherGuidelinesInputField(), {
93
+ 'color': css.color.text,
94
+ 'font-size': css.fontSize.default,
95
+ 'font-weight': css.fontWeight.regular
96
+ });
97
+ });
98
+ });
99
+ });
@@ -0,0 +1,241 @@
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: Heading Section, Content section, Body section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Heading section - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to passage resource type');
16
+ passagePage.steps.navigateToCreateResource('passage');
17
+ });
18
+
19
+ it('\'Heading\' label should be displayed', () => {
20
+ utilities.verifyInnerText(passagePage.headingLabel(), 'Heading');
21
+ utilities.verifyElementVisibilityState(passagePage.headingLabel(), 'visible');
22
+ });
23
+
24
+ it('\'Heading\' input fields should be displayed with placeholder text by default', () => {
25
+ passagePage.steps.verifyHeadingPlaceholder();
26
+ });
27
+
28
+ it('CSS of Heading Section in Edit tab', { tags: 'css' }, () => {
29
+ utilities.verifyCSS(passagePage.headingLabel(), {
30
+ 'color': css.color.sectionHeading,
31
+ 'font-size': css.fontSize.normal,
32
+ 'font-weight': css.fontWeight.semibold
33
+ });
34
+ });
35
+
36
+ it('Accessbility of default passage edit page', { tags: 'a11y' }, () => {
37
+ cy.checkAccessibility(passagePage.headingLabel().parents('.resource-and-tool-tablist-wrapper'))
38
+ });
39
+
40
+ it('When user focus in and out of any of the \'Heading\' input field without typing anything, an error message should be thrown', () => {
41
+ passagePage.steps.focusInHeadingInputField();
42
+ passagePage.steps.focusOutOfHeadingInputField();
43
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Heading is required.')
44
+ });
45
+
46
+ passagePage.tests.verifyErrorMessageCSSAndA11y();
47
+
48
+ it('When user enters text in Heading input field the \'Error: Heading is required.\' error message should disappear.', () => {
49
+ passagePage.steps.addHeadingText();
50
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist')
51
+ });
52
+
53
+ // Failing due to https://redmine.zeuslearning.com/issues/539634
54
+ it('When user enters text in Heading input field, the placeholder text should disappear ', () => {
55
+ passagePage.steps.verifyHeadingPlaceholderTextDisappear();
56
+ });
57
+ });
58
+
59
+ describe('Content section - Edit tab', () => {
60
+ abortEarlySetup();
61
+ before(() => {
62
+ cy.log('Navigating to passage resource type');
63
+ passagePage.steps.navigateToCreateResource('passage');
64
+ });
65
+
66
+ it('\'Content\' label should be displayed', () => {
67
+ utilities.verifyInnerText(passagePage.contentLabel(), 'Content');
68
+ utilities.verifyElementVisibilityState(passagePage.contentLabel(), 'visible');
69
+ });
70
+
71
+ it('CSS of Content Section in Edit tab', { tags: 'css' }, () => {
72
+ utilities.verifyCSS(passagePage.contentLabel(), {
73
+ 'color': css.color.sectionHeading,
74
+ 'font-size': css.fontSize.default,
75
+ 'font-weight': css.fontWeight.semibold
76
+ });
77
+ utilities.verifyCSS(passagePage.enableMultipageContentLabelCheckbox().parents('[data-ngie-testid="enable-multi-page-content-checkbox"]').find('svg path'), {
78
+ 'fill': css.color.uncheckedCheckbox
79
+ });
80
+ });
81
+
82
+ it('\'Enable multi-page content\' label and checkbox should be displayed and by default the checkbox should be unchecked', () => {
83
+ utilities.verifyInnerText(passagePage.enableMultipageContentLabel(), 'Enable multi-page content');
84
+ utilities.verifyElementVisibilityState(passagePage.enableMultipageContentLabel(), 'visible');
85
+ passagePage.steps.verifyEnableMultiPageContentCheckboxUnchecked();
86
+ });
87
+ });
88
+
89
+ describe('Body section - Edit tab', () => {
90
+ abortEarlySetup();
91
+ before(() => {
92
+ cy.log('Navigating to passage resource type');
93
+ passagePage.steps.navigateToCreateResource('passage');
94
+ });
95
+
96
+ it('\'Body\' label should be displayed', () => {
97
+ utilities.verifyInnerText(passagePage.bodyLabel(), 'Body');
98
+ utilities.verifyElementVisibilityState(passagePage.bodyLabel(), 'visible');
99
+ });
100
+
101
+ it('By default, \'Body\' input fields should be displayed with placeholder text', () => {
102
+ passagePage.steps.verifyBodyPlaceholder();
103
+ });
104
+
105
+ it('CSS of Body Section in Edit tab', { tags: 'css' }, () => {
106
+ utilities.verifyCSS(passagePage.bodyLabel(), {
107
+ 'color': css.color.sectionHeading,
108
+ 'font-size': css.fontSize.normal,
109
+ 'font-weight': css.fontWeight.semibold
110
+ });
111
+ utilities.verifyCSS(passagePage.bodyInputField(), {
112
+ 'color': css.color.text,
113
+ 'font-size': css.fontSize.default,
114
+ 'font-weight': css.fontWeight.regular
115
+ });
116
+ });
117
+
118
+ it('When user focus in and out of any of the \'Body\' input field without typing anything, an error message \'Error: Body is required.\' should be displayed', () => {
119
+ passagePage.steps.focusInBodyInputField(0);
120
+ passagePage.steps.focusOutOfBodyInputField(0);
121
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Body is required.');
122
+ });
123
+
124
+ passagePage.tests.verifyErrorMessageCSSAndA11y();
125
+
126
+ it('When user enters text in body input field the error message should disappear', () => {
127
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
128
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
129
+ });
130
+
131
+ it('When user enters text in Body input field, the placeholder text should disappear', () => {
132
+ passagePage.steps.verifyBodyPlaceholderTextNotExist();
133
+ });
134
+
135
+ it('When user adds an image to the body input field then it should be displayed in the body input field', () => {
136
+ passagePage.steps.clearBodyInputField();
137
+ passagePage.steps.focusInBodyInputField(0);
138
+ passagePage.steps.selectImageOptionFromCKEditorToolbar();
139
+ passagePage.steps.addImageToInputField();
140
+ passagePage.steps.verifyImageAndAltTextInBodyInputField(0);
141
+ });
142
+
143
+ it('When user adds an equation to the body input field then it should be displayed in the body input field', () => {
144
+ passagePage.steps.clearBodyInputField();
145
+ passagePage.steps.focusInBodyInputField(0);
146
+ passagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
147
+ passagePage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
148
+ passagePage.steps.verifyEquationInBodyInputField(0);
149
+ });
150
+
151
+ it('When user adds a link to the body input field then it should be displayed in the body input field', () => {
152
+ passagePage.steps.clearBodyInputField();
153
+ passagePage.steps.focusInBodyInputField(0);
154
+ passagePage.steps.selectLinkOptionFromCKEditorToolbar();
155
+ passagePage.steps.addLinkToInputField();
156
+ passagePage.steps.verifyLinkInBodyInputField(0);
157
+ });
158
+
159
+ it('When user adds bold text to the body input field then it should be displayed in the body input field', () => {
160
+ passagePage.steps.clearBodyInputField();
161
+ passagePage.steps.focusInBodyInputField(0);
162
+ passagePage.steps.selectBoldOptionFromCKEditorToolbar();
163
+ passagePage.steps.addBoldTextInputToBodyInputField(0);
164
+ passagePage.steps.verifyBoldTextInBodyInputField(0);
165
+ });
166
+ });
167
+
168
+ describe('Heading section - Preview tab', () => {
169
+ abortEarlySetup();
170
+ before(() => {
171
+ cy.log('Navigating to passage resource type');
172
+ passagePage.steps.navigateToCreateResource('passage');
173
+ });
174
+
175
+ it('When user has not entered any text in \'Heading\' and \'Body\' field then \'Preview not available\' text should display in Preview Tab', () => {
176
+ cy.log('Switching to Preview Tab')
177
+ createQuestionBasePage.steps.switchToPreviewTab();
178
+ utilities.verifyInnerText(passagePage.noPreviewText(), 'Preview not available')
179
+ });
180
+
181
+ it('When user adds text to the Heading input field then the added text should be displayed in the \'Preview tab\' section', () => {
182
+ cy.log('Switching to Edit Tab')
183
+ createQuestionBasePage.steps.switchToEditTab();
184
+ passagePage.steps.addHeadingText()
185
+ cy.log('Switching to Preview Tab')
186
+ createQuestionBasePage.steps.switchToPreviewTab();
187
+ utilities.verifyInnerText(passagePage.previewHeadingText(), 'Globalization')
188
+ });
189
+ });
190
+
191
+ describe('Body section - Preview tab', () => {
192
+ abortEarlySetup();
193
+ before(() => {
194
+ cy.log('Navigating to passage resource type');
195
+ passagePage.steps.navigateToCreateResource('passage');
196
+ });
197
+
198
+ it('When user adds an image to the body input it should be displayed in the \'Preview tab\'', () => {
199
+ cy.log('Switching to Edit Tab')
200
+ createQuestionBasePage.steps.switchToEditTab();
201
+ passagePage.steps.focusInBodyInputField(0);
202
+ passagePage.steps.selectImageOptionFromCKEditorToolbar();
203
+ passagePage.steps.addImageToInputField();
204
+ createQuestionBasePage.steps.switchToPreviewTab();
205
+ passagePage.steps.verifyImageAddedToBodyInPreviewTab(0);
206
+ });
207
+
208
+ it('When user adds an equation to the body input it should be displayed in the \'Preview tab\'', () => {
209
+ cy.log('Switching to Edit Tab')
210
+ createQuestionBasePage.steps.switchToEditTab();
211
+ passagePage.steps.clearBodyInputField();
212
+ passagePage.steps.focusInBodyInputField(0);
213
+ passagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
214
+ passagePage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
215
+ createQuestionBasePage.steps.switchToPreviewTab();
216
+ passagePage.steps.verifyEquationAddedToBodyInPreviewTab(0);
217
+ });
218
+
219
+ it('When user adds a Bold text to the body input it should be displayed in the \'Preview tab\'', () => {
220
+ cy.log('Switching to Edit Tab')
221
+ createQuestionBasePage.steps.switchToEditTab();
222
+ passagePage.steps.clearBodyInputField();
223
+ passagePage.steps.focusInBodyInputField(0);
224
+ passagePage.steps.selectBoldOptionFromCKEditorToolbar();
225
+ passagePage.steps.addBoldTextInputToBodyInputField(0);
226
+ createQuestionBasePage.steps.switchToPreviewTab();
227
+ passagePage.steps.verifyBoldTextAddedToBodyInPreviewTab(0);
228
+ });
229
+
230
+ it('When user adds a link to the body input it should be displayed in the \'Preview tab\'', () => {
231
+ cy.log('Switching to Edit Tab')
232
+ createQuestionBasePage.steps.switchToEditTab();
233
+ passagePage.steps.clearBodyInputField();
234
+ passagePage.steps.focusInBodyInputField(0);
235
+ passagePage.steps.selectLinkOptionFromCKEditorToolbar();
236
+ passagePage.steps.addLinkToInputField();
237
+ createQuestionBasePage.steps.switchToPreviewTab();
238
+ passagePage.steps.verifyLinkAddedToBodyInPreviewTab(0);
239
+ });
240
+ });
241
+ });
@@ -0,0 +1,73 @@
1
+ import { dialogBoxBase, passagePage } from "../../../pages";
2
+ import { commonComponents } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+
6
+ describe('Create question page - Passage: Header section and saving resource tool', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Header section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigating to passage resource type');
15
+ passagePage.steps.navigateToCreateResource('passage');
16
+ });
17
+
18
+ passagePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Passage');
19
+ });
20
+
21
+ describe('Tabs section', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ cy.log('Navigating to passage resource type');
25
+ passagePage.steps.navigateToCreateResource('passage');
26
+ });
27
+
28
+ passagePage.tests.verifyTabsSection();
29
+ });
30
+
31
+ describe('Cancel button', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ cy.log('Navigating to passage resource type');
35
+ passagePage.steps.navigateToCreateResource('passage');
36
+ });
37
+
38
+ passagePage.tests.verifyCancelButton();
39
+ });
40
+
41
+ describe('Save button', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ cy.log('Navigating to passage resource type');
45
+ passagePage.steps.navigateToCreateResource('passage');
46
+ });
47
+
48
+ describe('Validation error messages', () => {
49
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
50
+
51
+ it('Validation error messages should be displayed below required input fields', () => {
52
+ passagePage.steps.verifyHeadingInputFieldErrorMessage();
53
+ passagePage.steps.verifyBodyInputFieldErrorMessage();
54
+ });
55
+
56
+ it('Validation error messages should disappear when required input fields are filled', () => {
57
+ passagePage.steps.addHeadingText();
58
+ passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
59
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
60
+ });
61
+
62
+ passagePage.tests.verifyCreateItemWrapperContentsA11y();
63
+ });
64
+
65
+ describe('Saving a resource tool', () => {
66
+ 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', () => {
67
+ passagePage.steps.saveAQuestionAndVerifySnackbar();
68
+ });
69
+
70
+ passagePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
71
+ });
72
+ });
73
+ });