itemengine-cypress-automation 1.0.255 → 1.0.256-updatedRepo18thNov-3c7b396.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +21 -21
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +6 -6
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +4 -4
- package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +86 -5
- package/cypress/e2e/ILC/CkEditorEquationEditor/selectModeEditorBasic.js +114 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/imageInfo.js +160 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/insertImageBasicFile.js +83 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/upload.js +53 -0
- package/cypress/e2e/ILC/CkEditorLink/linkBasic.js +85 -0
- package/cypress/e2e/ILC/CkEditorLink/linkInfoSection.js +94 -0
- package/cypress/e2e/ILC/CkEditorLink/linkPreview.js +38 -0
- package/cypress/e2e/ILC/CkEditorLink/uploadSection.js +59 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +14 -279
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +2 -2
- package/cypress/e2e/ILC/Graphing/acceptRepeatedPoints.js +75 -0
- package/cypress/e2e/ILC/TextEntryMath/additionalSettingsBasic.js +84 -0
- package/cypress/e2e/ILC/TextEntryMath/additionalSettingsForAnswerInputFields.js +286 -0
- package/cypress/e2e/ILC/TextEntryMath/customSettingsSeparators.ts +107 -0
- package/cypress/e2e/ILC/TextEntryMath/equationEditor.smoke.js +99 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +336 -0
- package/cypress/pages/components/ariaLabelSectionComponent.js +1 -1
- package/cypress/pages/components/ckEditorAudioPlayerComponent.js +0 -11
- package/cypress/pages/components/ckEditorEquationEditorComponent.js +175 -7
- package/cypress/pages/components/ckEditorInsertImageComponent.js +272 -0
- package/cypress/pages/components/ckEditorLinkComponent.js +142 -0
- package/cypress/pages/components/customSettingsSeparatorsComponent.ts +97 -0
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +528 -0
- package/cypress/pages/components/gradingViewEnumerationComponent.js +11 -6
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/questionInstructionsComponent.js +10 -0
- package/cypress/pages/essayResponsePage.js +4 -121
- package/cypress/pages/graphingPage.js +24 -2
- package/cypress/pages/multipleSelectionPage.js +8 -0
- package/cypress/pages/textEntryMathPage.js +125 -18
- package/cypress/support/index.d.ts +7 -0
- package/cypress/tsconfig.json +11 -0
- package/package.json +1 -1
@@ -0,0 +1,272 @@
|
|
1
|
+
import { dialogBoxBase } from "../dialogBoxBase";
|
2
|
+
import { createQuestionBasePage } from "../components/createQuestionBasePage.js";
|
3
|
+
import utilities from "../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const selectors = {
|
7
|
+
...createQuestionBasePage,
|
8
|
+
...dialogBoxBase,
|
9
|
+
//Basic
|
10
|
+
imageInsertIcon: () => cy.get('.cke_button__image_icon'),
|
11
|
+
imagePropertiesLabel: () => cy.get('.dialog-header-label'),
|
12
|
+
imagePropertyWrapper: () => cy.get('.custom-link-wrapper'),
|
13
|
+
imageInQuestionInstruction: () => cy.get('[data-cke-saved-src*="https"]'),
|
14
|
+
foxImageLinkUrlValueCheck: () => cy.get('[data-cke-saved-src*="https://cdn.pixabay.com/photo/2016/11/29/03/28/fox-1867062_960_720.jpg"]'),
|
15
|
+
imageInfoButton: () => cy.get('[title="Image Info"]'),
|
16
|
+
uploadButton: () => cy.get('[title="Upload"]'),
|
17
|
+
//Image Info
|
18
|
+
urlLabel: () => cy.get('.dialog-input-label').eq(0),
|
19
|
+
urlInputField: () => cy.get('.cke_dialog_ui_input_text').eq(1),
|
20
|
+
alternateTextLabel: () => cy.get('.dialog-input-label').eq(1),
|
21
|
+
alternateTextInputField: () => cy.get('.cke_dialog_ui_input_text').eq(3),
|
22
|
+
widthLabel: () => cy.get('.dialog-input-label').eq(2),
|
23
|
+
widthInputField: () => cy.get('.cke_dialog_ui_input_text').eq(5),
|
24
|
+
heightLabel: () => cy.get('.dialog-input-label').eq(3),
|
25
|
+
heightInputField: () => cy.get('.cke_dialog_ui_input_text').eq(7),
|
26
|
+
borderLabel: () => cy.get('.dialog-input-label').eq(4),
|
27
|
+
borderInputField: () => cy.get('.cke_dialog_ui_input_text').eq(9),
|
28
|
+
hSpaceLabel: () => cy.get('.dialog-input-label').eq(5),
|
29
|
+
hSpaceInputField: () => cy.get('.cke_dialog_ui_input_text').eq(11),
|
30
|
+
vSpaceLabel: () => cy.get('.dialog-input-label').eq(6),
|
31
|
+
vSpaceInputField: () => cy.get('.cke_dialog_ui_input_text').eq(13),
|
32
|
+
//Image Responsive
|
33
|
+
imageResponsivenessLabel: () => cy.get('.dialog-input-label').eq(8),
|
34
|
+
responsiveRadioButton: () => cy.get('[class*="image-responsiveness-radio-wrapper"]').eq(1),
|
35
|
+
responsiveRadioLabel: () => cy.get('[class*="image-responsiveness-radio-wrapper"]').eq(2),
|
36
|
+
fixedRadioButton: () => cy.get('[class*="image-responsiveness-radio-wrapper"]').eq(3),
|
37
|
+
fixedRadioLabel: () => cy.get('[class*="image-responsiveness-radio-wrapper"]').eq(4),
|
38
|
+
//Alignment
|
39
|
+
alignmentLabel: () => cy.get('.dialog-input-label').eq(7),
|
40
|
+
alignmentDropDown: () => cy.get('.cke_dialog_ui_input_select').eq(1),
|
41
|
+
alignmentOptions: (alignment = null) => {
|
42
|
+
if (alignment) {
|
43
|
+
return cy.get(`[class*="cke_dialog_ui_input_select"] option[value="${alignment}"]`)
|
44
|
+
} else {
|
45
|
+
return cy.get('[class*="cke_dialog_ui_input_select"] option[value]').eq(3)
|
46
|
+
}
|
47
|
+
},
|
48
|
+
//Special Button
|
49
|
+
lockRatioButton: () => cy.get('[title="Lock Ratio"]'),
|
50
|
+
resetSizeButton: () => cy.get('[title="Reset Size"]'),
|
51
|
+
//Preview box
|
52
|
+
imageInPreviewBox: () => cy.get('[src*="https://cdn.pixabay.com/photo/2016/11/29/03/28/fox-1867062_960_720.jpg"]'),
|
53
|
+
//Upload
|
54
|
+
sendItToTheServerLabel: () => cy.get('.dialog-input-label').eq(9),
|
55
|
+
chooseFileButton: () => cy.get('.dialog-input-area').eq(9),
|
56
|
+
sendItToTheServerButton: () => cy.get('[title="Send it to the Server"] .cke_dialog_ui_button'),
|
57
|
+
}
|
58
|
+
|
59
|
+
const steps = {
|
60
|
+
clickChooseFileButton: () => {
|
61
|
+
ckEditorInsertImageComponent.chooseFileButton()
|
62
|
+
.click();
|
63
|
+
},
|
64
|
+
|
65
|
+
selectImageInsertOptionFromCKEditorToolbar: () => {
|
66
|
+
ckEditorInsertImageComponent.imageInsertIcon()
|
67
|
+
.eq(0)
|
68
|
+
.click();
|
69
|
+
},
|
70
|
+
|
71
|
+
selectLockRatioButton: () => {
|
72
|
+
ckEditorInsertImageComponent.lockRatioButton()
|
73
|
+
.click();
|
74
|
+
},
|
75
|
+
|
76
|
+
selectResetSizeButton: () => {
|
77
|
+
ckEditorInsertImageComponent.resetSizeButton()
|
78
|
+
.click();
|
79
|
+
},
|
80
|
+
|
81
|
+
/**
|
82
|
+
* This function adds URL in the image popup
|
83
|
+
* @param {string} text to be added in the url input field
|
84
|
+
*/
|
85
|
+
addURLInImagePopUp: (text) => {
|
86
|
+
ckEditorInsertImageComponent.urlInputField()
|
87
|
+
.type(text, { delay: 0 })
|
88
|
+
.blur();
|
89
|
+
},
|
90
|
+
|
91
|
+
/**
|
92
|
+
* This function adds text in the alternate text
|
93
|
+
* @param {string} text to be added in the alternate text input field
|
94
|
+
*/
|
95
|
+
addTextInAlternateText: (text) => {
|
96
|
+
ckEditorInsertImageComponent.alternateTextInputField()
|
97
|
+
.type(text, { delay: 0 })
|
98
|
+
.blur();
|
99
|
+
},
|
100
|
+
|
101
|
+
/**
|
102
|
+
* This function adds text in the width input field
|
103
|
+
* @param {string} text to be added in the width input field
|
104
|
+
*/
|
105
|
+
insertWidth: (text) => {
|
106
|
+
ckEditorInsertImageComponent.widthInputField()
|
107
|
+
.clear()
|
108
|
+
.type(text, { delay: 0 })
|
109
|
+
.blur();
|
110
|
+
},
|
111
|
+
|
112
|
+
/**
|
113
|
+
* This function adds text in the height input field
|
114
|
+
* @param {string} text to be added in the height input field
|
115
|
+
*/
|
116
|
+
insertHeight: (text) => {
|
117
|
+
ckEditorInsertImageComponent.heightInputField()
|
118
|
+
.clear()
|
119
|
+
.type(text, { delay: 0 })
|
120
|
+
.blur();
|
121
|
+
},
|
122
|
+
|
123
|
+
/**
|
124
|
+
* This function adds text in the border input field
|
125
|
+
* @param {string} text to be added in the border input field
|
126
|
+
*/
|
127
|
+
insertBorder: (text) => {
|
128
|
+
ckEditorInsertImageComponent.borderInputField()
|
129
|
+
.clear()
|
130
|
+
.type(text, { delay: 0 })
|
131
|
+
.blur();
|
132
|
+
},
|
133
|
+
|
134
|
+
/**
|
135
|
+
* This function adds text in the vSpace input field
|
136
|
+
* @param {string} text to be added in the vSpace input field
|
137
|
+
*/
|
138
|
+
insertVSpace: (text) => {
|
139
|
+
ckEditorInsertImageComponent.vSpaceInputField()
|
140
|
+
.clear()
|
141
|
+
.type(text, { delay: 0 })
|
142
|
+
.blur();
|
143
|
+
},
|
144
|
+
|
145
|
+
/**
|
146
|
+
* This function adds text in the hSpace input field
|
147
|
+
* @param {string} text to be added in the hSpace input field
|
148
|
+
*/
|
149
|
+
insertHSpace: (text) => {
|
150
|
+
ckEditorInsertImageComponent.hSpaceInputField()
|
151
|
+
.clear()
|
152
|
+
.type(text, { delay: 0 })
|
153
|
+
.blur();
|
154
|
+
},
|
155
|
+
|
156
|
+
verifyImageInfoButtonSelected: () => {
|
157
|
+
ckEditorInsertImageComponent.imageInfoButton()
|
158
|
+
.should('have.attr', 'aria-selected', 'true');
|
159
|
+
},
|
160
|
+
|
161
|
+
selectUploadButton: () => {
|
162
|
+
ckEditorInsertImageComponent.uploadButton()
|
163
|
+
.click();
|
164
|
+
},
|
165
|
+
|
166
|
+
verifyUploadButtonSelected: () => {
|
167
|
+
ckEditorInsertImageComponent.uploadButton()
|
168
|
+
.should('have.attr', 'aria-selected', 'true');
|
169
|
+
},
|
170
|
+
|
171
|
+
verifyResponsiveRadioButtonChecked: () => {
|
172
|
+
ckEditorInsertImageComponent.responsiveRadioButton()
|
173
|
+
.should('be.checked');
|
174
|
+
},
|
175
|
+
|
176
|
+
verifyFixedRadioButtonChecked: () => {
|
177
|
+
ckEditorInsertImageComponent.fixedRadioButton()
|
178
|
+
.should('be.checked');
|
179
|
+
},
|
180
|
+
|
181
|
+
verifyLockRatioButtonChecked: () => {
|
182
|
+
ckEditorInsertImageComponent.lockRatioButton()
|
183
|
+
.should('have.attr', 'aria-checked', 'true');
|
184
|
+
},
|
185
|
+
|
186
|
+
/**
|
187
|
+
* This function verifies the width and height of the input field
|
188
|
+
* @param {number} width expected width of the input field
|
189
|
+
* @param {number} height expected height of the input field
|
190
|
+
*/
|
191
|
+
verifyWidthAndHeightInInputField: (width, height) => {
|
192
|
+
ckEditorInsertImageComponent.widthInputField()
|
193
|
+
.should('have.value', width);
|
194
|
+
ckEditorInsertImageComponent.heightInputField()
|
195
|
+
.should('have.value', height);
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* This function verifies the border of the input field
|
200
|
+
* @param {number} width
|
201
|
+
* @param {number} height
|
202
|
+
* @param {number} border
|
203
|
+
* @param {number} hSpace
|
204
|
+
* @param {number} vSpace
|
205
|
+
* @param {number} view
|
206
|
+
*/
|
207
|
+
verifyCssOfImageInDifferentViews: (width, height, border, hSpace, vSpace, view) => {
|
208
|
+
switch (view) {
|
209
|
+
case 'Preview Box':
|
210
|
+
utilities.verifyCSS(ckEditorInsertImageComponent.imageInPreviewBox(), {
|
211
|
+
'width': `${width}px`,
|
212
|
+
'height': `${height}px`,
|
213
|
+
'border': `${border}px solid rgb(0, 0, 0)`,
|
214
|
+
//It not working cause of a bug https://redmine.zeuslearning.com/issues/586076
|
215
|
+
//HSpace
|
216
|
+
// 'margin-left': `${hSpace}px`,
|
217
|
+
// 'margin-right': `${hSpace}px`,
|
218
|
+
//VSpace
|
219
|
+
'margin-top': `${vSpace}px`,
|
220
|
+
'margin-bottom': `${vSpace}px`,
|
221
|
+
});
|
222
|
+
break;
|
223
|
+
case 'Question Instruction':
|
224
|
+
utilities.verifyCSS(ckEditorInsertImageComponent.foxImageLinkUrlValueCheck(), {
|
225
|
+
'width': `${width}px`,
|
226
|
+
'height': `${height}px`,
|
227
|
+
'border': `${border}px solid rgb(0, 0, 46)`,
|
228
|
+
//It not working cause of a bug https://redmine.zeuslearning.com/issues/586076
|
229
|
+
//HSpace
|
230
|
+
// 'margin-left': `${hSpace}px`,
|
231
|
+
// 'margin-right': `${hSpace}px`,
|
232
|
+
//VSpace
|
233
|
+
'margin-top': `${vSpace}px`,
|
234
|
+
'margin-bottom': `${vSpace}px`,
|
235
|
+
});
|
236
|
+
break;
|
237
|
+
case 'Preview Tab':
|
238
|
+
utilities.verifyCSS(ckEditorInsertImageComponent.imageInPreviewBox(), {
|
239
|
+
'width': `${width}px`,
|
240
|
+
// It is not Working cause of a bug https://redmine.zeuslearning.com/issues/586086
|
241
|
+
// 'height': `${height}px`,
|
242
|
+
'border': `${border}px solid rgb(0, 0, 46)`,
|
243
|
+
//It not working cause of a bug https://redmine.zeuslearning.com/issues/586076
|
244
|
+
//HSpace
|
245
|
+
// 'margin-left': `${hSpace}px`,
|
246
|
+
// 'margin-right': `${hSpace}px`,
|
247
|
+
//VSpace
|
248
|
+
'margin-top': `${vSpace}px`,
|
249
|
+
'margin-bottom': `${vSpace}px`,
|
250
|
+
});
|
251
|
+
break;
|
252
|
+
default:
|
253
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
254
|
+
}
|
255
|
+
},
|
256
|
+
|
257
|
+
/**
|
258
|
+
* This function selects the alignment option from the dropdown
|
259
|
+
* @param {string} alignment option from the dropdown
|
260
|
+
*/
|
261
|
+
selectAlignmentOptionDropdown: (alignment) => {
|
262
|
+
ckEditorInsertImageComponent.alignmentDropDown()
|
263
|
+
.click();
|
264
|
+
ckEditorInsertImageComponent.alignmentOptions(alignment)
|
265
|
+
.click();
|
266
|
+
}
|
267
|
+
}
|
268
|
+
|
269
|
+
export const ckEditorInsertImageComponent = {
|
270
|
+
...selectors,
|
271
|
+
steps
|
272
|
+
}
|
@@ -0,0 +1,142 @@
|
|
1
|
+
import { dialogBoxBase } from "../dialogBoxBase";
|
2
|
+
import { createQuestionBasePage } from "../components/createQuestionBasePage.js";
|
3
|
+
import utilities from "../../support/helpers/utilities";
|
4
|
+
import constants from "../../fixtures/constants.js";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
const selectors = {
|
8
|
+
...createQuestionBasePage,
|
9
|
+
...dialogBoxBase,
|
10
|
+
//Basic
|
11
|
+
buttonLinkIcon: () => cy.get('.cke_button__link_icon'),
|
12
|
+
linkLabel: () => cy.get('.dialog-header-label'),
|
13
|
+
linkPopUpWrapper: () => cy.get('.custom-link-wrapper'),
|
14
|
+
urlInQuestionInstruction: () => cy.get('[data-cke-saved-href*="https"]'),
|
15
|
+
foxImageLinkUrlValueCheck: () => cy.get('[data-cke-saved-href*="https://cdn.pixabay.com/photo/2016/11/29/03/28/fox-1867062_960_720.jpg"]'),
|
16
|
+
urlInputField: () => cy.get('input[class*="cke_dialog_ui_input_text"]').eq(1),
|
17
|
+
OkButton: () => cy.get('[title="OK"]'),
|
18
|
+
//Link Info
|
19
|
+
displayTextInputField: () => cy.get('input[class*="cke_dialog_ui_input_text"]').eq(0),
|
20
|
+
linkInfo: () => cy.get('[title="Link Info"]'),
|
21
|
+
displayTextLabel: () => cy.get('.dialog-input-label').eq(0),
|
22
|
+
displayTextInputField: () => cy.get('.cke_dialog_ui_input_text').eq(1),
|
23
|
+
linkTypeLabel: () => cy.get('.dialog-input-label').eq(1),
|
24
|
+
linkTypeDropDown: () => cy.get('.cke_dialog_ui_input_select').eq(0),
|
25
|
+
protocolLabel: () => cy.get('.dialog-input-label').eq(2),
|
26
|
+
protocolDropDown: () => cy.get('.cke_dialog_ui_input_select').eq(1),
|
27
|
+
urlLabel: () => cy.get('.dialog-input-label').eq(3),
|
28
|
+
urlInputField: () => cy.get('.cke_dialog_ui_input_text').eq(3),
|
29
|
+
//Protocol
|
30
|
+
protocolDropDown: () => cy.get('.dialog-input-area').eq(2),
|
31
|
+
selectProtocolOptionDropdown: (protocolType = null) => {
|
32
|
+
if (protocolType) {
|
33
|
+
return cy.get(`[class*="cke_dialog_ui_input_select"] option[value="${protocolType}"]`)
|
34
|
+
} else {
|
35
|
+
return cy.get('[class*="cke_dialog_ui_input_select"] option[value]').eq(8)
|
36
|
+
}
|
37
|
+
},
|
38
|
+
//Upload
|
39
|
+
uploadSectionTitle: () => cy.get('[title="Upload"]').eq(0),
|
40
|
+
uploadTitle: () => cy.get('.dialog-input-label').eq(12),
|
41
|
+
chooseFileButton: () => cy.get('.cke_dialog_ui_input_file').eq(0),
|
42
|
+
chooseFileButtonClick: () => cy.get('.cke_dialog_ui_input_file').eq(1),
|
43
|
+
sendItToServerButton: () => cy.get('[title="Send it to the Server"]'),
|
44
|
+
//Preview Tab
|
45
|
+
urlInQuestionInstructionPreviewTab: () => cy.get('[data-testid="question-instruction-element"] [href*="https"]'),
|
46
|
+
foxImageLinkUrlValueCheckPreviewTab: () => cy.get('[data-testid="question-instruction-element"] [href*="https://cdn.pixabay.com/photo/2016/11/29/03/28/fox-1867062_960_720.jpg"]'),
|
47
|
+
}
|
48
|
+
|
49
|
+
const steps = {
|
50
|
+
selectLinkButtonOptionFromCKEditorToolbar: () => {
|
51
|
+
ckEditorLinkComponent.buttonLinkIcon()
|
52
|
+
.eq(0)
|
53
|
+
.click();
|
54
|
+
},
|
55
|
+
|
56
|
+
addURLInLinkPopUp: (text) => {
|
57
|
+
ckEditorLinkComponent.urlInputField()
|
58
|
+
.type(text, { delay: 0 })
|
59
|
+
.blur();
|
60
|
+
},
|
61
|
+
|
62
|
+
addTextInDisplayText: (text) => {
|
63
|
+
ckEditorLinkComponent.displayTextInputField()
|
64
|
+
.type(text, { delay: 0 })
|
65
|
+
.blur();
|
66
|
+
},
|
67
|
+
|
68
|
+
selectOkButtonFromCKEditorToolbarForLinkPopUp: () => {
|
69
|
+
ckEditorLinkComponent.OkButton()
|
70
|
+
.click();
|
71
|
+
},
|
72
|
+
|
73
|
+
expandProtocolDropDown: () => {
|
74
|
+
ckEditorLinkComponent.protocolDropDown()
|
75
|
+
.click({force: true});
|
76
|
+
},
|
77
|
+
|
78
|
+
selectProtocolType: (protocolType) => {
|
79
|
+
switch (protocolType) {
|
80
|
+
case 'http://':
|
81
|
+
ckEditorLinkComponent.steps.expandProtocolDropDown();
|
82
|
+
ckEditorLinkComponent.selectProtocolOptionDropdown('http://')
|
83
|
+
.click();
|
84
|
+
break;
|
85
|
+
case 'https://':
|
86
|
+
ckEditorLinkComponent.steps.expandProtocolDropDown();
|
87
|
+
ckEditorLinkComponent.selectProtocolOptionDropdown('https://')
|
88
|
+
.click();
|
89
|
+
break;
|
90
|
+
case 'ftp://':
|
91
|
+
ckEditorLinkComponent.steps.expandProtocolDropDown();
|
92
|
+
ckEditorLinkComponent.selectProtocolOptionDropdown('ftp://')
|
93
|
+
.click();
|
94
|
+
break;
|
95
|
+
case 'news://':
|
96
|
+
ckEditorLinkComponent.steps.expandProtocolDropDown();
|
97
|
+
ckEditorLinkComponent.selectProtocolOptionDropdown('news://')
|
98
|
+
.click();
|
99
|
+
break;
|
100
|
+
default:
|
101
|
+
throw new Error(`Unknown protocol: ${protocolType}`);
|
102
|
+
}
|
103
|
+
},
|
104
|
+
|
105
|
+
clickUploadButton: () => {
|
106
|
+
ckEditorLinkComponent.uploadSectionTitle()
|
107
|
+
.click();
|
108
|
+
},
|
109
|
+
|
110
|
+
clickOnChooseFileButton: () => {
|
111
|
+
ckEditorLinkComponent.chooseFileButton()
|
112
|
+
.click();
|
113
|
+
},
|
114
|
+
|
115
|
+
clickingOnTheLinkPreviewTab: () => {
|
116
|
+
ckEditorLinkComponent.urlInQuestionInstructionPreviewTab()
|
117
|
+
.click();
|
118
|
+
},
|
119
|
+
|
120
|
+
verifyWindowOpenMethodAfterClickingOnLink: (fileName) => {
|
121
|
+
cy.window().document().then(function (doc) {
|
122
|
+
doc.addEventListener('click', () => {
|
123
|
+
setTimeout(function () { doc.location.reload() }, 5000);
|
124
|
+
});
|
125
|
+
ckEditorLinkComponent.foxImageLinkUrlValueCheckPreviewTab()
|
126
|
+
.click();
|
127
|
+
cy.verifyDownload(fileName);
|
128
|
+
});
|
129
|
+
},
|
130
|
+
|
131
|
+
|
132
|
+
clickSendItToServerButton: () => {
|
133
|
+
ckEditorLinkComponent.sendItToServerButton()
|
134
|
+
.click();
|
135
|
+
cy.wait(1000);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
export const ckEditorLinkComponent = {
|
140
|
+
...selectors,
|
141
|
+
steps
|
142
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
const selectors = {
|
2
|
+
decimalSeparatorLabel: () => cy.get('.single-select-toggle-group-title').eq(0),
|
3
|
+
thousandSeparatorLabel: () => cy.get('.single-select-toggle-group-title').eq(1),
|
4
|
+
decimalSeparatorToggleOptions: (ariaLabel: string | null = null) => {
|
5
|
+
if (ariaLabel) {
|
6
|
+
return cy.get(`.single-select-toggle-group button[aria-label*="${ariaLabel}"]`);
|
7
|
+
} else {
|
8
|
+
return cy.get('.single-select-toggle-group button');
|
9
|
+
}
|
10
|
+
},
|
11
|
+
thousandSeparatorToggleOptions: (ariaLabel: string | null = null) => {
|
12
|
+
if (ariaLabel) {
|
13
|
+
return cy.get(`.single-select-toggle-group-double button[aria-label*="${ariaLabel}"]`);
|
14
|
+
} else {
|
15
|
+
return cy.get('.single-select-toggle-group-double button');
|
16
|
+
}
|
17
|
+
},
|
18
|
+
decimalPlacesToBeComparedLabel: () => cy.get('[for*="dec-places-label"]'),
|
19
|
+
decimalPlacesToBeComparedInputField: () => cy.get('input[id*="dec-places-label"]'),
|
20
|
+
toleranceLabel: () => cy.get('[for*="tolerance-label"]'),
|
21
|
+
toleranceInputField: () => cy.get('input[id*="tolerance-label"]'),
|
22
|
+
decimalAndThousandSeparatorWrapper: () => cy.get('[class*="CustomSettingsstyles__ToggleWrapper"]'),
|
23
|
+
decimalPlacesAndToleranceWrapper: () => cy.get('.custom-settings-text-box-wrapper')
|
24
|
+
}
|
25
|
+
|
26
|
+
const steps = {
|
27
|
+
/**
|
28
|
+
* This function selects decimal separator options
|
29
|
+
* @param option aria-label of the option to be selected
|
30
|
+
*/
|
31
|
+
selectDecimalSeparatorOption: (option: string) => {
|
32
|
+
selectors.decimalSeparatorToggleOptions(option)
|
33
|
+
.click();
|
34
|
+
},
|
35
|
+
|
36
|
+
/**
|
37
|
+
* This function verifies the label of decimal separator
|
38
|
+
* @param label of the decimal separator
|
39
|
+
*/
|
40
|
+
verifyLabelDecimalSeparatorLabel: (label: string) => {
|
41
|
+
customSettingsSeparatorComponent.decimalSeparatorLabel()
|
42
|
+
.should('have.text', label);
|
43
|
+
},
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Verifies the existence of the decimal separator toggle options.
|
47
|
+
* @param {string} option - The aria-label of the option to be verified.
|
48
|
+
*/
|
49
|
+
verifyDecimalSeparatorOptions: (option: string) => {
|
50
|
+
customSettingsSeparatorComponent.decimalSeparatorToggleOptions(option)
|
51
|
+
.should('exist');
|
52
|
+
},
|
53
|
+
|
54
|
+
verifyDecimalAndThousandSeparatorDoesNotExist: () => {
|
55
|
+
customSettingsSeparatorComponent.decimalPlacesAndToleranceWrapper()
|
56
|
+
.should('not.exist');
|
57
|
+
customSettingsSeparatorComponent.decimalAndThousandSeparatorWrapper()
|
58
|
+
.should('not.exist');
|
59
|
+
},
|
60
|
+
|
61
|
+
/**
|
62
|
+
* This function verifies the label of thousand separator
|
63
|
+
* @param label of the thousand separator
|
64
|
+
*/
|
65
|
+
verifyLabelThousandSeparatorLabel: (label: string) => {
|
66
|
+
customSettingsSeparatorComponent.thousandSeparatorLabel()
|
67
|
+
.should('have.text', label);
|
68
|
+
},
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Verifies the existence of the thousand separator toggle options.
|
72
|
+
* @param {string} option - The aria-label of the option to be verified.
|
73
|
+
*/
|
74
|
+
verifyThousandSeparatorOptions: (option: string) => {
|
75
|
+
customSettingsSeparatorComponent.thousandSeparatorToggleOptions(option)
|
76
|
+
.should('exist');
|
77
|
+
},
|
78
|
+
|
79
|
+
verifyVisibilityOfDecimalPlacesToBeComparedSection: () => {
|
80
|
+
customSettingsSeparatorComponent.decimalPlacesToBeComparedLabel()
|
81
|
+
.should('have.text', 'Decimal places to be compared');
|
82
|
+
customSettingsSeparatorComponent.decimalPlacesToBeComparedInputField()
|
83
|
+
.should('be.visible');
|
84
|
+
},
|
85
|
+
|
86
|
+
verifyVisibilityOfToleranceSection: () => {
|
87
|
+
customSettingsSeparatorComponent.toleranceLabel()
|
88
|
+
.should('have.text', 'Tolerance');
|
89
|
+
customSettingsSeparatorComponent.toleranceInputField()
|
90
|
+
.should('be.visible');
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
export const customSettingsSeparatorComponent = {
|
95
|
+
...selectors,
|
96
|
+
steps
|
97
|
+
}
|