itemengine-cypress-automation 1.0.48 → 1.0.50
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/allOrNothingCorrectPointsEqualToAlternatePoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingAllOrNothingScoring.js → ListOrderingScoringFiles/allOrNothingScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/{listOrderingManuallyAndNonScoredScoring.js → ListOrderingScoringFiles/manuallyAndNonScoredScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialDifferentWeightsAlternatePointsGreaterThanCorrectPoints.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialDifferentWeightsCorrectPointsEqualToAlternatePoints.js +287 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialDifferentWeightsCorrectPointsGreaterThanAlternatePoints.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingPartialDifferentWeightsScoring.js → ListOrderingScoringFiles/partialDifferentWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialEqualWeightsAlternatePointsGreaterThanCorrectPoints.js +286 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialEqualWeightsCorrectPointsEqualToAlternatePoints.js +258 -0
- package/cypress/e2e/ILC/ListOrdering/ListOrderingScoringFiles/partialEqualWeightsCorrectPointsGreaterThanAlternatePoints.js +287 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingPartialEqualWeightsScoring.js → ListOrderingScoringFiles/partialEqualWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/allOrNothingCorrectPointsEqualToAlternatePoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingAllOrNothingScoring.js → ListSortingScoringFiles/allOrNothingScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/{listSortingManuallyAndNonScoredScoring.js → ListSortingScoringFiles/manuallyAndNonScoredScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialDifferentWeightsAlternatePointsGreaterThanCorrectPoints.js +338 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialDifferentWeightsCorrectPointsEqualToAlternatePoints.js +303 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialDifferentWeightsCorrectPointsGreaterThanAlternatePoints.js +337 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingPartialDifferentWeightsScoring.js → ListSortingScoringFiles/partialDifferentWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialEqualWeightsAlternatePointsGreaterThanCorrectPoints.js +307 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialEqualWeightsCorrectPointsEqualToAlternatePoints.js +272 -0
- package/cypress/e2e/ILC/ListSorting/ListSortingScoringFiles/partialEqualWeightsCorrectPointsGreaterThanAlternatePoints.js +307 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingPartialEqualWeightsScoring.js → ListSortingScoringFiles/partialEqualWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
- package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +0 -712
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +0 -895
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +0 -807
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoringWithAlternateAnswer.js +0 -759
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +0 -952
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +0 -860
@@ -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.verifyCSSAnda11yOfErrorMessage();
|
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.verifyCSSAnda11yOfErrorMessage();
|
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.verifya11yOfCreateItemWrapperContents();
|
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
|
+
});
|
@@ -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
|
+
});
|