itemengine-cypress-automation 1.0.20 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettings.js +848 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseEditTabBasicSections.js +1230 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseHeaderSection.js +80 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseMinimalPreviewSection.js +941 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseScoringSection.js +60 -0
- package/cypress/e2e/ILC/AudioResponse/audioResponseStandardPreviewSection.js +862 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -123
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -774
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories1.js +290 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories2.js +514 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
- package/package.json +1 -1
- /package/cypress/e2e/ILC/{EssayResponse → EssayResponseMath}/essayResponseMathCharacters.js +0 -0
- /package/cypress/e2e/ILC/{EssayResponse → EssayResponseMath}/essayResponseMathCreateItem.js +0 -0
@@ -0,0 +1,207 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { essayResponseBasicPage } from "../../../pages";
|
3
|
+
import { commonComponents } from "../../../pages/components";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const formattingOptions = [essayResponseBasicPage.cutCustomizeFormattingOption, essayResponseBasicPage.copyCustomizeFormattingOption, essayResponseBasicPage.pasteCustomizeFormattingOption, essayResponseBasicPage.specialCharacterCustomizeFormattingOption];
|
7
|
+
const formattingOptionLabel = ['Cut', 'Copy', 'Paste', 'Special characters'];
|
8
|
+
const stateOfFormattingOption = ['ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-not-selected'];
|
9
|
+
|
10
|
+
describe('Create question page - Essay Response - Basic: Customize formatting options (for student player) section contents, toolbar options', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Customize formatting options (for student player) section contents', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
19
|
+
});
|
20
|
+
|
21
|
+
it('\'Customize formatting options (for student player)\' label should be displayed and expand collapse icon should not be displayed beside the label. By default, following options should be in selected state - \'Cut, Copy, Paste\'. Special characters option should be in unselected state', () => {
|
22
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
23
|
+
.verifyInnerText('Customize formatting options (for student player)');
|
24
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
25
|
+
.find('.MuiExpansionPanelSummary-expandIcon')
|
26
|
+
.should('not.exist');
|
27
|
+
formattingOptions.forEach((button, count) => {
|
28
|
+
button()
|
29
|
+
.verifyInnerText(formattingOptionLabel[count])
|
30
|
+
.and('have.class', stateOfFormattingOption[count]);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
it('CSS of \'Customize formatting options (for student player)\' label and contents', { tags: 'css' }, () => {
|
35
|
+
cy.log('CSS of Customize formatting options (for student player) label');
|
36
|
+
essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
|
37
|
+
.verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.semibold);//Issue posted- https://redmine.zeuslearning.com/issues/525805
|
38
|
+
cy.log('CSS of selected toolbar formatting option')
|
39
|
+
essayResponseBasicPage.cutCustomizeFormattingOption()
|
40
|
+
.should('have.css', 'background-color', css.color.activeButtons)
|
41
|
+
.within(() => {
|
42
|
+
commonComponents.tickIconForOptionButtons()
|
43
|
+
.should('have.css', 'color', css.color.defaultBackground);
|
44
|
+
essayResponseBasicPage.customizeFormattingOptionsIcon()
|
45
|
+
.should('have.css', 'color', css.color.defaultBackground);
|
46
|
+
essayResponseBasicPage.customizeFormattingOptionsLabel()
|
47
|
+
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.regular);
|
48
|
+
});
|
49
|
+
cy.log('CSS of unselected toolbar formatting option')
|
50
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
51
|
+
.should('have.css', 'background-color', css.color.secondaryBtnBg)
|
52
|
+
.within(() => {
|
53
|
+
essayResponseBasicPage.customizeFormattingOptionsLabel()
|
54
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
it('Accessibility of \'Customize formatting options (for student player)\' label and contents', { tags: 'a11y' }, () => {
|
59
|
+
cy.checkAccessibility(essayResponseBasicPage.customizeFormattingOptionsWrapper());
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
describe('Customize formatting options (for student player) - Preview tab contents', () => {
|
64
|
+
abortEarlySetup();
|
65
|
+
before(() => {
|
66
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
67
|
+
cy.barsPreLoaderWait();
|
68
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
69
|
+
});
|
70
|
+
|
71
|
+
beforeEach(() => {
|
72
|
+
essayResponseBasicPage.steps.resetPreviewTabResponseField();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - \'Cut, Copy, Paste\'', () => {
|
76
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
77
|
+
.within(() => {
|
78
|
+
formattingOptionLabel.slice(0, 2).forEach((optionName, count) => {
|
79
|
+
cy.get('.cke_button')
|
80
|
+
.eq(count)
|
81
|
+
.should('have.attr', 'title', optionName)
|
82
|
+
.and('be.visible');
|
83
|
+
});
|
84
|
+
essayResponseBasicPage.previewTabToolbarOption('Special Characters')
|
85
|
+
.should('not.exist');
|
86
|
+
});
|
87
|
+
});
|
88
|
+
|
89
|
+
it('When the user selects all formatting options from the \'Customize formatting options (for student player)\' section, all formatting options should appear in the preview tab and all options should be in enabled sate', () => {
|
90
|
+
cy.log('Switching to edit tab')
|
91
|
+
essayResponseBasicPage.steps.switchToEditTab()
|
92
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
93
|
+
.click();
|
94
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
95
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
96
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
97
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
98
|
+
.within(() => {
|
99
|
+
formattingOptionLabel.forEach((optionName, count) => {
|
100
|
+
cy.get('.cke_button')
|
101
|
+
.eq(count)
|
102
|
+
.should('have.attr', 'title', optionName)
|
103
|
+
.and('be.visible');
|
104
|
+
});
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
|
109
|
+
essayResponseBasicPage.previewTabToolbarOption('Cut')
|
110
|
+
.find('.cke_button_icon')
|
111
|
+
.should('have.css', 'color', css.color.activeButtons);
|
112
|
+
});
|
113
|
+
|
114
|
+
it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
|
115
|
+
cy.checkAccessibility(essayResponseBasicPage.previewTabToolbarWrapper())
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user deselects an option from \'Customize formatting options (for student player)\' section, then that option should not be displayed in the preview tab toolbar.', () => {
|
119
|
+
cy.log('Switching to edit tab')
|
120
|
+
essayResponseBasicPage.steps.switchToEditTab()
|
121
|
+
essayResponseBasicPage.cutCustomizeFormattingOption()
|
122
|
+
.click()
|
123
|
+
.should('have.class', 'ngie-toggle-button-not-selected');
|
124
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
125
|
+
cy.barsPreLoaderWait();
|
126
|
+
essayResponseBasicPage.previewTabToolbarWrapper()
|
127
|
+
.within(() => {
|
128
|
+
essayResponseBasicPage.previewTabToolbarOption('Cut')
|
129
|
+
.should('not.exist');
|
130
|
+
});
|
131
|
+
});
|
132
|
+
});
|
133
|
+
|
134
|
+
describe('Cut, Copy, Paste formatting options - Preview tab', () => {
|
135
|
+
abortEarlySetup();
|
136
|
+
before(() => {
|
137
|
+
essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
|
138
|
+
cy.barsPreLoaderWait();
|
139
|
+
essayResponseBasicPage.steps.setWordLimit(5);
|
140
|
+
cy.log('Selecting \'Special Characters\' formatting option from Edit tab');
|
141
|
+
essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
|
142
|
+
.click()
|
143
|
+
essayResponseBasicPage.steps.switchToPreviewTab();
|
144
|
+
cy.barsPreLoaderWait();
|
145
|
+
});
|
146
|
+
|
147
|
+
afterEach(() => {
|
148
|
+
essayResponseBasicPage.steps.resetPreviewTabResponseField();
|
149
|
+
});
|
150
|
+
|
151
|
+
it('When the user selects the text from the response field and clicks on the \'Cut\', then the text should get removed from the field and word count should update accordingly', () => {
|
152
|
+
essayResponseBasicPage.responseField()
|
153
|
+
.type('Lorem Ipsum dolor');
|
154
|
+
essayResponseBasicPage.steps.cutTextFromResponseField();
|
155
|
+
essayResponseBasicPage.responseField()
|
156
|
+
.verifyInnerText('');
|
157
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('0/5');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When the user has cut some text from response and clicks on the \'Paste\' option, the text that was cut should get pasted in the response field and the word count should increase accordingly', () => {
|
161
|
+
essayResponseBasicPage.responseField()
|
162
|
+
.type('Lorem Ipsum dolor');
|
163
|
+
essayResponseBasicPage.steps.cutTextFromResponseField();
|
164
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
165
|
+
.click();
|
166
|
+
essayResponseBasicPage.responseField()
|
167
|
+
.verifyInnerText('Lorem Ipsum dolor');
|
168
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('3/5');
|
169
|
+
});
|
170
|
+
|
171
|
+
it('When the user enters text in the response field, selects the text and then clicks on the \'Copy\', the text should get copied and when the user clicks on the \'Paste\' toolbar option, then the copied text should get pasted in response field and the word count should increase accordingly', () => {
|
172
|
+
essayResponseBasicPage.responseField()
|
173
|
+
.type('Lorem Ipsum ');
|
174
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
175
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('2/5');
|
176
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
177
|
+
.click();
|
178
|
+
essayResponseBasicPage.responseField()
|
179
|
+
.verifyInnerText('Lorem Ipsum\u00a0Lorem Ipsum\u00a0');
|
180
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
|
181
|
+
});
|
182
|
+
|
183
|
+
it('User should not be able to paste text more than max word limit.', () => {
|
184
|
+
essayResponseBasicPage.responseField()
|
185
|
+
.type('Lorem ipsum, dolor sit.');
|
186
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
187
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
188
|
+
.click();
|
189
|
+
essayResponseBasicPage.responseField()
|
190
|
+
.verifyInnerText('Lorem ipsum, dolor sit.');
|
191
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When the user tries to paste a text and the word limit reaches after pasting, \'word limit reached\' warning message should be displayed beside word count.', () => {
|
195
|
+
essayResponseBasicPage.responseField()
|
196
|
+
.type('Lorem Ipsum dolor');
|
197
|
+
essayResponseBasicPage.steps.copyTextFromResponseField();
|
198
|
+
essayResponseBasicPage.previewTabToolbarOption('Paste')
|
199
|
+
.click();
|
200
|
+
essayResponseBasicPage.responseField()
|
201
|
+
.verifyInnerText('Lorem Ipsum dolorLorem Ipsum dolor');
|
202
|
+
essayResponseBasicPage.steps.verifyResponseFieldWordCount('5/5');
|
203
|
+
essayResponseBasicPage.wordLimitReachedWarningMessage();
|
204
|
+
});
|
205
|
+
});
|
206
|
+
//TO DO- Special characters flyout cases are pending
|
207
|
+
});
|
package/package.json
CHANGED
File without changes
|
File without changes
|