itemengine-cypress-automation 1.0.105 → 1.0.106
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
- package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
- 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/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
- package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
- package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
- package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
- package/cypress/fixtures/specialAndMathCharacters.js +2 -0
- package/cypress/fixtures/theme/ilc.json +4 -2
- package/cypress/pages/audioResponsePage.js +326 -165
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
- package/cypress/pages/components/colorPopupComponent.js +115 -26
- package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
- package/cypress/pages/components/editCategoryFlyout.js +164 -2
- package/cypress/pages/components/equationEditorFlyout.js +36 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
- package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
- package/cypress/pages/correctAnswerViewPage.js +12 -1
- package/cypress/pages/drawingResponsePage.js +26 -151
- package/cypress/pages/essayResponseMathPage.js +28 -16
- package/cypress/pages/essayResponsePage.js +187 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
- package/cypress/pages/multipleSelectionPage.js +1 -1
- package/cypress/pages/readingRulerPage.js +219 -104
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/textEntryMathPage.js +17 -6
- package/cypress/pages/videoResponsePage.js +0 -8
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,253 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
import { specialCharacters } from "../../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
|
5
|
+
const customSpecialCharacters = ['A', '1', '#'];
|
6
|
+
const css = Cypress.env('css')
|
7
|
+
|
8
|
+
describe('Essay response: Customize math characters', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Preview tab - \'Special characters\' - content', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to drawing response question type');
|
17
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
it(`When Special characters is not selected in edit tab, then in preview tab the Special characters toolbar option should not be displayed`, () => {
|
22
|
+
essayResponsePage.steps.switchToPreviewTab();
|
23
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Special characters'), 'notExist');
|
24
|
+
});
|
25
|
+
|
26
|
+
it(`When Special characters option is selected in edit tab, then in preview tab the Special characters toolbar option should be displayed`, () => {
|
27
|
+
essayResponsePage.steps.switchToEditTab();
|
28
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
29
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Special Characters']);
|
30
|
+
essayResponsePage.steps.switchToPreviewTab();
|
31
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
32
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Special characters'), 'visible');
|
33
|
+
essayResponsePage.steps.clickOnSpecialCharactersPopupCloseButton();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('By default the \'Special characters\' toolbar option should be in deselected state', () => {
|
37
|
+
//Add here once https://redmine.zeuslearning.com/issues/554508 is resolved
|
38
|
+
});
|
39
|
+
|
40
|
+
it('When user clicks on \'Special characters\' toolbar option, then the \'Special characters\' popup should be displayed with \'Special characters\' title and a \'Close\' button', () => {
|
41
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
42
|
+
utilities.verifyInnerText(essayResponsePage.specialCharactersPopupTitle(), 'Special characters');
|
43
|
+
utilities.verifyElementVisibilityState(essayResponsePage.specialCharactersPopupTitle(), 'exist');
|
44
|
+
utilities.verifyElementVisibilityState(essayResponsePage.specialCharactersPopupCloseButton(), 'exist');
|
45
|
+
});
|
46
|
+
|
47
|
+
it('All categories and accordions should be displayed in the popup', () => {
|
48
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryTitlesAndAccordions(specialCharacters);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('By default the \'Spanish\' category accordion should be in expanded state and all other accordions should be in collapsed state.', () => {
|
52
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsExpanded(0);
|
53
|
+
for (let index = 1; index < specialCharacters.length; index++) {
|
54
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsCollapsed(index);
|
55
|
+
};
|
56
|
+
});
|
57
|
+
|
58
|
+
it('The \'Spanish\' category accordion should display all its symbols', () => {
|
59
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategorySymbols(0, specialCharacters[0].symbols);
|
60
|
+
});
|
61
|
+
|
62
|
+
it('When user clicks on the expanded \'Spanish\' category accordion, then the accordion should be collapsed.', () => {
|
63
|
+
essayResponsePage.steps.clickOnSpecialCharactersCategoryAccordion(0);
|
64
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsCollapsed(0);
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When user clicks on the rest of the special character categories, then their category accordions should expand and display all the symbols', () => {
|
68
|
+
for (let index = 1; index < specialCharacters.length; index++) {
|
69
|
+
essayResponsePage.steps.clickOnSpecialCharactersCategoryAccordion(index);
|
70
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsExpanded(index);
|
71
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategorySymbols(index, specialCharacters[index].symbols);
|
72
|
+
};
|
73
|
+
});
|
74
|
+
|
75
|
+
it('User should be able to view two expanded category accordions simultaneously', () => {
|
76
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsExpanded(1);
|
77
|
+
essayResponsePage.steps.verifySpecialCharactersPopupCategoryAccordionIsExpanded(2);
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When user clicks on any category icon, then the category flyout should stay open', () => {
|
81
|
+
essayResponsePage.steps.clickOnCharacterPopupSymbol(specialCharacters[0].symbols[0]);
|
82
|
+
utilities.verifyElementVisibilityState(essayResponsePage.dialogBox(), 'exist');
|
83
|
+
});
|
84
|
+
|
85
|
+
it('CSS of \'Special characters\' popup', { tags: 'css' }, () => {
|
86
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPopupTitle(), {
|
87
|
+
'color': css.color.flyoutTitle,
|
88
|
+
'font-size': css.fontSize.heading,
|
89
|
+
'font-weight': css.fontWeight.semibold,
|
90
|
+
});
|
91
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPopupCategoryTitle(), {
|
92
|
+
'color': css.color.activeButtons,
|
93
|
+
'font-size': css.fontSize.normal,
|
94
|
+
'font-weight': css.fontWeight.semibold,
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPopupCategoryAccordionIcon(), {
|
97
|
+
'color': css.color.activeButtons
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPopupCharacterSymbol(), {
|
100
|
+
'color': css.color.activeButtons
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
it('Accessibility of \'Special characters\' popup', { tags: 'a11y' }, () => {
|
105
|
+
cy.checkAccessibility(essayResponsePage.dialogBox());
|
106
|
+
});
|
107
|
+
|
108
|
+
it('When user clicks on the \'Close\' button then the \'Special characters\' popup should be closed', () => {
|
109
|
+
essayResponsePage.steps.clickOnSpecialCharactersPopupCloseButton();
|
110
|
+
utilities.verifyElementVisibilityState(essayResponsePage.dialogBox(), 'notExist');
|
111
|
+
});
|
112
|
+
});
|
113
|
+
|
114
|
+
describe('\'Special characters\' - functionality', () => {
|
115
|
+
abortEarlySetup();
|
116
|
+
before(() => {
|
117
|
+
cy.log('Navigating to drawing response question type');
|
118
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
119
|
+
cy.barsPreLoaderWait();
|
120
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
121
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Special Characters'])
|
122
|
+
});
|
123
|
+
|
124
|
+
essayResponsePage.tests.verifyCustomSpecialCharactersEditTabContent();
|
125
|
+
|
126
|
+
it('When the user has deselected any language option and opens the special characters popup in the preview tab, then the popup contents should get updated accordingly', () => {
|
127
|
+
let newSelectedCategoryList = specialCharacters.slice(1);
|
128
|
+
essayResponsePage.steps.switchToPreviewTab();
|
129
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
130
|
+
//essayResponsePage.steps.verifySpecialCharactersPopupCategorySymbols(specialCharacters);
|
131
|
+
//Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
|
132
|
+
cy.log('Post-step: Switching to edit tab');
|
133
|
+
essayResponsePage.steps.switchToEditTab();
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When the user checks the \'Show only custom special characters\' radio button, \'Custom special characters\' label and input field should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
|
137
|
+
essayResponsePage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
|
138
|
+
utilities.verifyElementVisibilityState(essayResponsePage.customSpecialCharactersInputField(), 'visible');
|
139
|
+
utilities.verifyInnerText(essayResponsePage.customSpecialCharactersLabel(), 'Custom special characters');
|
140
|
+
utilities.verifyElementVisibilityState(essayResponsePage.customSpecialCharactersLabel(), 'visible');
|
141
|
+
utilities.verifyElementVisibilityState(essayResponsePage.customizeSpecialCharactersPreviewButton(), 'visible');
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user specifies custom special characters, then on clicking on the \'Preview\' hyperlink, only the specified custom special characters should be displayed in the popup', () => {
|
145
|
+
essayResponsePage.steps.addInputToCustomSpecialCharactersInputField(`${customSpecialCharacters.join('')}`);
|
146
|
+
essayResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
|
147
|
+
essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewPopupEditTab(customSpecialCharacters);
|
148
|
+
cy.log('Post-step: Closing preview popup')
|
149
|
+
essayResponsePage.steps.closeWarningPopup();
|
150
|
+
});
|
151
|
+
|
152
|
+
it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup', () => {
|
153
|
+
essayResponsePage.steps.switchToPreviewTab();
|
154
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
|
155
|
+
essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewTab(customSpecialCharacters);
|
156
|
+
cy.log('Post-step: Switching to edit tab');
|
157
|
+
essayResponsePage.steps.switchToEditTab();
|
158
|
+
});
|
159
|
+
|
160
|
+
it('CSS of Customize special characters', { tags: 'css' }, () => {
|
161
|
+
utilities.verifyCSS(essayResponsePage.customizeSpecialCharactersLabel(), {
|
162
|
+
'color': css.color.labels,
|
163
|
+
'font-size': css.fontSize.normal,
|
164
|
+
'font-weight': css.fontWeight.semibold
|
165
|
+
});
|
166
|
+
//checked state of customize special characters checkbox
|
167
|
+
utilities.verifyCSS(essayResponsePage.customizeSpecialCharactersCheckbox().parents('[data-ngie-testid="customize-special-characters-checkbox"]').find('rect').eq(1), {
|
168
|
+
'fill': css.color.activeButtons
|
169
|
+
});
|
170
|
+
utilities.verifyCSS(essayResponsePage.groupByLanguageLabel(), {
|
171
|
+
'color': css.color.labelText,
|
172
|
+
'font-size': css.fontSize.normal,
|
173
|
+
'font-weight': css.fontWeight.regular
|
174
|
+
});
|
175
|
+
//selected state of radio button
|
176
|
+
utilities.verifyCSS(essayResponsePage.showOnlyCustomSpecialCharactersRadioButton().parents('.radio-option-wrapper').find('svg'), {
|
177
|
+
'fill': css.color.activeButtons
|
178
|
+
});
|
179
|
+
utilities.verifyCSS(essayResponsePage.customSpecialCharactersLabel(), {
|
180
|
+
'color': css.color.labels,
|
181
|
+
'font-size': css.fontSize.normal,
|
182
|
+
'font-weight': css.fontWeight.semibold
|
183
|
+
});
|
184
|
+
utilities.verifyCSS(essayResponsePage.customSpecialCharactersInputField(), {
|
185
|
+
'color': css.color.text,
|
186
|
+
'font-size': css.fontSize.default,
|
187
|
+
'font-weight': css.fontWeight.regular
|
188
|
+
});
|
189
|
+
utilities.verifyCSS(essayResponsePage.customSpecialCharactersInputField().parents('.input-field').find('fieldset'), {
|
190
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`
|
191
|
+
});
|
192
|
+
utilities.verifyCSS(essayResponsePage.customizeSpecialCharactersPreviewButton(), {
|
193
|
+
'color': css.color.activeButtons,
|
194
|
+
'font-size': css.fontSize.normal,
|
195
|
+
'font-weight': css.fontWeight.regular
|
196
|
+
});
|
197
|
+
cy.log('Selecting group by language radio button');
|
198
|
+
essayResponsePage.steps.selectGroupByLanguageRadioButton();
|
199
|
+
utilities.verifyCSS(essayResponsePage.selectSpecialCharacterLanguagesLabel(), {
|
200
|
+
'color': css.color.labels,
|
201
|
+
'font-size': css.fontSize.normal,
|
202
|
+
'font-weight': css.fontWeight.semibold
|
203
|
+
});
|
204
|
+
//Category tiles in selected state
|
205
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(1).find('path'), {
|
206
|
+
'fill': css.color.activeButtons
|
207
|
+
});
|
208
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(1).parent(), {
|
209
|
+
'background-color': css.color.defaultBackground
|
210
|
+
});
|
211
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTileCategoryName().eq(1), {
|
212
|
+
'color': css.color.whiteText,
|
213
|
+
'font-size': css.fontSize.small,
|
214
|
+
'font-weight': css.fontWeight.regular
|
215
|
+
});
|
216
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTiles().eq(1), {
|
217
|
+
'background-color': css.color.primaryBtnBg
|
218
|
+
});
|
219
|
+
//Category tiles in de-selected state
|
220
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTileSectionCategoriesDragIcon().eq(0).find('svg path'), {
|
221
|
+
'fill': css.color.secondaryBtn
|
222
|
+
});
|
223
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTileCategoryName().eq(0), {
|
224
|
+
'color': css.color.secondaryBtn,
|
225
|
+
'font-size': css.fontSize.small,
|
226
|
+
'font-weight': css.fontWeight.regular
|
227
|
+
});
|
228
|
+
utilities.verifyCSS(essayResponsePage.specialCharacterTiles().eq(0), {
|
229
|
+
'background-color': css.color.defaultBackground
|
230
|
+
});
|
231
|
+
cy.log('Opening preview popup and expanding one category accordion');
|
232
|
+
essayResponsePage.steps.clickOnCustomizeSpecialCharactersPreviewButton();
|
233
|
+
essayResponsePage.steps.clickOnSpecialCharactersPreviewPopupCategoryAccordionExpandIcon(0);
|
234
|
+
utilities.verifyCSS(essayResponsePage.dialogBoxTitle(), {
|
235
|
+
'color': css.color.flyoutTitle,
|
236
|
+
'font-size': css.fontSize.heading,
|
237
|
+
'font-weight': css.fontWeight.semibold
|
238
|
+
});
|
239
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPreviewPopupCategoryLabel().eq(0), {
|
240
|
+
'color': css.color.activeButtons,
|
241
|
+
'font-size': css.fontSize.default,
|
242
|
+
'font-weight': css.fontWeight.bold
|
243
|
+
});
|
244
|
+
utilities.verifyCSS(essayResponsePage.specialCharactersPreviewPopupCategoryAccordionExpandIcon().last().find('svg'), {
|
245
|
+
'fill': css.color.activeButtons
|
246
|
+
});
|
247
|
+
});
|
248
|
+
|
249
|
+
it('Accessibility of Customize special characters', { tags: 'a11y' }, () => {
|
250
|
+
cy.checkAccessibility(essayResponsePage.dialogBox());
|
251
|
+
});
|
252
|
+
});
|
253
|
+
});
|
@@ -0,0 +1,266 @@
|
|
1
|
+
import { essayResponsePage } 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('Essay Response Preview: Hyperlink', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Hyperlink popup contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab.');
|
15
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
18
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Hyperlink']);
|
19
|
+
essayResponsePage.steps.switchToPreviewTab();
|
20
|
+
});
|
21
|
+
|
22
|
+
it('Hyperlink option should be displayed in the preview tab toolbar', () => {
|
23
|
+
utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Insert Hyperlink'), 'visible');
|
24
|
+
});
|
25
|
+
|
26
|
+
it('When user clicks on Hyperlink option, then the Hyperlink popup should appear and by default the cursor should be focused inside the \'Display text\' input field', () => {
|
27
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
28
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
29
|
+
//To check that focus is inside input field
|
30
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxDisplayTextInputField(), {
|
31
|
+
'border-color': css.color.activeButtons
|
32
|
+
});
|
33
|
+
});
|
34
|
+
|
35
|
+
it('Title of the popup should be \'Hyperlink\'', () => {
|
36
|
+
utilities.verifyInnerText(essayResponsePage.hyperlinkDialogBoxTitle(), 'Hyperlink');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('CSS of the \'Hyperlink\' popup', { tags: 'css' }, () => {
|
40
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogBoxTitle(), {
|
41
|
+
'color': css.color.questionHeading,
|
42
|
+
'font-size': css.fontSize.heading,
|
43
|
+
'font-weight': css.fontWeight.bold
|
44
|
+
});
|
45
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxDisplayTextInputField(), {
|
46
|
+
'color': css.color.standardTableCellText,
|
47
|
+
'font-size': css.fontSize.heading,
|
48
|
+
'font-weight': css.fontWeight.regular,
|
49
|
+
'background-color': css.color.defaultBackground
|
50
|
+
});
|
51
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxURLInputField(), {
|
52
|
+
'color': css.color.standardTableCellText,
|
53
|
+
'font-size': css.fontSize.heading,
|
54
|
+
'font-weight': css.fontWeight.regular,
|
55
|
+
'background-color': css.color.defaultBackground
|
56
|
+
});
|
57
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxDisplayTextLabel(), {
|
58
|
+
'color': css.color.labels,
|
59
|
+
'font-size': css.fontSize.normal,
|
60
|
+
'font-weight': css.fontWeight.semibold
|
61
|
+
});
|
62
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxURLLabel(), {
|
63
|
+
'color': css.color.labels,
|
64
|
+
'font-size': css.fontSize.normal,
|
65
|
+
'font-weight': css.fontWeight.semibold
|
66
|
+
});
|
67
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxButtonOk(), {
|
68
|
+
'color': css.color.primaryBtn,
|
69
|
+
'font-size': css.fontSize.default,
|
70
|
+
'font-weight': css.fontWeight.regular,
|
71
|
+
'background-color': css.color.primaryBtnBg
|
72
|
+
});
|
73
|
+
utilities.verifyCSS(essayResponsePage.hyperlinkDialogboxButtonCancel(), {
|
74
|
+
'color': css.color.secondaryBtn,
|
75
|
+
'font-size': css.fontSize.default,
|
76
|
+
'font-weight': css.fontWeight.semibold,
|
77
|
+
'background-color': css.color.secondaryBtnBg
|
78
|
+
});
|
79
|
+
});
|
80
|
+
|
81
|
+
it('Accessibility of the \'Hyperlink\' popup', { tags: 'a11y' }, () => {
|
82
|
+
cy.checkAccessibility(essayResponsePage.hyperlinkDialogBox());
|
83
|
+
});
|
84
|
+
|
85
|
+
it('\'Display text\' and \'URL\' labels and input fields should be displayed in the Hyperlink popup and the input fields should be blank by default', () => {
|
86
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxDisplayTextLabel(), 'visible');
|
87
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxDisplayTextInputField(), 'visible');
|
88
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('');
|
89
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxURLLabel(), 'visible');
|
90
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxURLInputField(), 'visible');
|
91
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue('');
|
92
|
+
});
|
93
|
+
|
94
|
+
it('\'Ok\' button should be displayed in the popup', () => {
|
95
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxButtonOk(), 'visible');
|
96
|
+
});
|
97
|
+
|
98
|
+
it('\'Cancel\' button should be displayed in the popup and when user clicks on it then the popup should close', () => {
|
99
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogboxButtonCancel(), 'visible');
|
100
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxCancelButton();
|
101
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'hidden');
|
102
|
+
});
|
103
|
+
});
|
104
|
+
|
105
|
+
describe('Add a Hyperlink to the response field', () => {
|
106
|
+
abortEarlySetup();
|
107
|
+
before(() => {
|
108
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab and opening Hyperlink popup.');
|
109
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
110
|
+
cy.barsPreLoaderWait();
|
111
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
112
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Hyperlink']);
|
113
|
+
essayResponsePage.steps.switchToPreviewTab();
|
114
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When user keeps the URL input field empty and clicks on \'Ok\' button, then a browser alert popup should be displayed with the message "Please type the link URL" and the hyperlink popup should remain open', () => {
|
118
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('lorem');
|
119
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('lorem');
|
120
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
121
|
+
cy.on('window:alert', (alert) => {
|
122
|
+
expect(alert).to.deep.eq('Please type the link URL');
|
123
|
+
});
|
124
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
125
|
+
});
|
126
|
+
|
127
|
+
it('When user gives input only to \'URL\' input field and clicks on \'Ok\' button, then the \'Hyperlink\' popup should close, hyperlink should be displayed in the response field and in the added hyperlink\'s popup, the display text input field should be prefilled with the previously added URL', () => {
|
128
|
+
cy.log('Pre-step: Clear display text input field.');
|
129
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxDisplayTextInputField();
|
130
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField(`${Cypress.config().baseUrl}`);
|
131
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
132
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), `${Cypress.config().baseUrl}`);
|
133
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
134
|
+
essayResponsePage.steps.rightClickHyperlinkText();
|
135
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'exist');
|
136
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue(`${Cypress.config().baseUrl}`);
|
137
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
138
|
+
cy.log('Post-step: Click on cancel button to close popup');
|
139
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxCancelButton();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user gives a normal text input to the URL input field in the hyper link popup and clicks on Ok button, then \'https://\' should be appended to the given input in the hyperlink text displayed in the response field', () => {
|
143
|
+
cy.log('Switching to edit tab')
|
144
|
+
essayResponsePage.steps.switchToEditTab();
|
145
|
+
essayResponsePage.steps.switchToPreviewTab();
|
146
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
147
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField('lorem');
|
148
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
149
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'https://lorem')
|
150
|
+
essayResponsePage.steps.verifyHyperlinkPreviewInputTextAttr('https://lorem');
|
151
|
+
});
|
152
|
+
|
153
|
+
it('When user shifts the cursor away from the hyperlink and clicks on \'Hyperlink\' option in the toolbar, then the Hyperlink popup should appear again in its default state', () => {
|
154
|
+
essayResponsePage.steps.enterInputInResponseField(' ');
|
155
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
156
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
157
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('');
|
158
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue('');
|
159
|
+
});
|
160
|
+
|
161
|
+
it('When user adds both \'Display text\' as well as \'URL\' in the hyperlink popup and clicks on Ok button, then the hyperlink with the added display text and URL should be displayed in the response field', () => {
|
162
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
|
163
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField(`${Cypress.config().baseUrl}`);
|
164
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
165
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link')
|
166
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
167
|
+
});
|
168
|
+
|
169
|
+
it('CSS of the hyperlink in response field', { tags: 'css' }, () => {
|
170
|
+
utilities.verifyCSS(essayResponsePage.previewInputFieldHyperlinkText(), {
|
171
|
+
'color': css.color.linkText,
|
172
|
+
'font-size': css.fontSize.default,
|
173
|
+
'font-weight': css.fontWeight.regular
|
174
|
+
});
|
175
|
+
});
|
176
|
+
|
177
|
+
it('Accessibility of the hyperlink in response field', { tags: 'a11y' }, () => {
|
178
|
+
cy.checkAccessibility(essayResponsePage.previewInputFieldHyperlinkText());
|
179
|
+
});
|
180
|
+
});
|
181
|
+
|
182
|
+
describe('Edit a previously added hyperlink', () => {
|
183
|
+
abortEarlySetup();
|
184
|
+
before(() => {
|
185
|
+
cy.log('Navigate to Essay Response question type and switching to preview tab and adding Hyperlink to response area.');
|
186
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response');
|
187
|
+
cy.barsPreLoaderWait();
|
188
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
189
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Hyperlink']);
|
190
|
+
essayResponsePage.steps.switchToPreviewTab();
|
191
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
192
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
|
193
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField(`${Cypress.config().baseUrl}`);
|
194
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
195
|
+
});
|
196
|
+
|
197
|
+
it('When the added hyperlink is in focus and user clicks on \'Hyperlink\' toolbar option then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
198
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
|
199
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
200
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('Link');
|
201
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
202
|
+
cy.log('Post-step: Click on cancel button to close hyperlink popup');
|
203
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxCancelButton();
|
204
|
+
});
|
205
|
+
|
206
|
+
it('When the user double clicks on the added hyperlink then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
207
|
+
essayResponsePage.steps.dblClickHyperlinkText();
|
208
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
209
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('Link');
|
210
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
211
|
+
cy.log('Post-step: Click on cancel button to close hyperlink popup');
|
212
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxCancelButton();
|
213
|
+
});
|
214
|
+
|
215
|
+
it('When the added hyperlink is in focus and user right clicks on it, then \'Hyperlink\' popup should appear with the details of the focused hyperlink', () => {
|
216
|
+
essayResponsePage.steps.rightClickHyperlinkText();
|
217
|
+
utilities.verifyElementVisibilityState(essayResponsePage.hyperlinkDialogBox(), 'visible');
|
218
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('Link');
|
219
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`${Cypress.config().baseUrl}`);
|
220
|
+
});
|
221
|
+
|
222
|
+
it('When user updates the details of a pre-existing hyperlink in its hyperlink popup and clicks on \'Cancel\' button, then the updated details should not be reflected in the displayed hyperlink', () => {
|
223
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxDisplayTextInputField();
|
224
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Edited');
|
225
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxURLInputField();
|
226
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField('https://www.google.com');
|
227
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxCancelButton();
|
228
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link');
|
229
|
+
essayResponsePage.steps.verifyHyperlinkPreviewInputTextAttr(`${Cypress.config().baseUrl}`)
|
230
|
+
});
|
231
|
+
|
232
|
+
it('When user updates the details of a pre-existing hyperlink in its hyperlink popup and clicks on \'Ok\' button, then the updated details should be reflected in the displayed hyperlink', () => {
|
233
|
+
cy.log('Pre-step: Right click on the hyperlink to open its hyperlink popup');
|
234
|
+
essayResponsePage.steps.rightClickHyperlinkText();
|
235
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxDisplayTextInputField();
|
236
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Edited');
|
237
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxURLInputField();
|
238
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField('https://www.google.com');
|
239
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
240
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Edited')
|
241
|
+
essayResponsePage.steps.verifyHyperlinkPreviewInputTextAttr(`https://www.google.com`)
|
242
|
+
});
|
243
|
+
|
244
|
+
it('When the user right clicks on automatically hyperlinked text then the hyperlink popup should open and the details should be correctly displayed in the popup, and the user should be able to edit the details of the automatically hyperlinked text', () => {
|
245
|
+
cy.log('Pre-step: Clearing the response area and typing a link in the response area for automatic hyperlinking');
|
246
|
+
essayResponsePage.steps.enterInputInResponseField(`{selectAll}{backspace}${Cypress.config().baseUrl} `);
|
247
|
+
essayResponsePage.steps.rightClickHyperlinkText();
|
248
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxDisplayTextInputField();
|
249
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Google');
|
250
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxDisplayTextInputValue('Google'); //Editing automatically hyperlinked text
|
251
|
+
essayResponsePage.steps.clearHyperlinkDialogBoxURLInputField();
|
252
|
+
essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField('https://www.google.com');
|
253
|
+
essayResponsePage.steps.verifyHyperlinkDialogBoxURLInputValue(`https://www.google.com`);
|
254
|
+
essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
|
255
|
+
utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Google');
|
256
|
+
essayResponsePage.steps.verifyHyperlinkPreviewInputTextAttr(`https://www.google.com`);
|
257
|
+
});
|
258
|
+
|
259
|
+
it('When the user selects the added hyperlink and clicks on any formatting option, then the formatting should be applied to the displayed hyperlink.', () => {
|
260
|
+
essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
|
261
|
+
utilities.verifyCSS(essayResponsePage.previewInputFieldHyperlinkText(), {
|
262
|
+
'font-weight': css.fontWeight.bold
|
263
|
+
});
|
264
|
+
});
|
265
|
+
});
|
266
|
+
});
|