itemengine-cypress-automation 1.0.252 → 1.0.253

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddFeatureRadioButton.js +231 -0
  2. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddTranscriptRadioButton .js +213 -0
  3. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAudioPlayerStyle.js +148 -0
  4. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabStudentViewSettings.js +249 -0
  5. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +164 -0
  6. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +444 -0
  7. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +102 -0
  8. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +134 -0
  9. package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +46 -0
  10. package/cypress/e2e/ILC/CkEditorInsertTable/insertTableEditorBasicFile.js +98 -0
  11. package/cypress/e2e/ILC/CkEditorInsertTable/tableDimension&FooterProperties.js +147 -0
  12. package/cypress/e2e/ILC/CkEditorInsertTable/tableHeaders.js +127 -0
  13. package/cypress/e2e/ILC/CkEditorInsertTable/tableRowAndColumn.js +71 -0
  14. package/cypress/e2e/ILC/CkEditorInsertTable/tableStyle.js +154 -0
  15. package/cypress/e2e/ILC/Compass/compassPreviewContent.smoke.js +1 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +41 -17
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +24 -12
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +47 -20
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +43 -16
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +5 -5
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +52 -21
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionBasic.js +23 -11
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +55 -21
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +53 -21
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +48 -19
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneBasic.js +23 -11
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +47 -17
  28. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +50 -19
  29. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -2
  30. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -0
  31. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -3
  32. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -1
  33. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -4
  34. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +261 -0
  35. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  36. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +4 -2
  37. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +1 -1
  38. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +2 -2
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +5 -3
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -2
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAlternateAnswerPopup.js +1 -0
  43. package/cypress/e2e/ILC/GridFill/customizeLayoutFillColor.js +3 -0
  44. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +15 -0
  45. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +10 -0
  46. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +2 -1
  47. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +3 -2
  48. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +56 -8
  49. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  50. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  51. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  52. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  53. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  54. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  55. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -3
  56. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +2 -2
  57. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +16 -16
  58. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +4 -5
  59. package/cypress/e2e/ILC/TextEntryMath/customSettings.js +8 -22
  60. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +19 -19
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +5 -5
  63. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +1 -4
  64. package/cypress/e2e/ILC/ToolAudioPlayerNew/studentViewSettings.js +8 -2
  65. package/cypress/fixtures/theme/ilc.json +9 -5
  66. package/cypress/pages/components/ckEditorAudioPlayerComponent.js +615 -0
  67. package/cypress/pages/components/ckEditorEquationEditorComponent.js +41 -0
  68. package/cypress/pages/components/ckEditorInsertTableComponent.js +741 -0
  69. package/cypress/pages/components/essayResponseCommonComponents.js +145 -7
  70. package/cypress/pages/components/imageCanvasComponent.js +2 -2
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/layoutSectionComponent.js +25 -4
  73. package/cypress/pages/components/numberLineCommonComponent.js +39 -0
  74. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  75. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -0
  76. package/cypress/pages/dragAndDropIntoCategoriesPage.js +28 -0
  77. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  78. package/cypress/pages/graphingPage.js +8 -8
  79. package/cypress/pages/gridFillPage.js +11 -11
  80. package/cypress/pages/multipleSelectionPage.js +12 -0
  81. package/cypress/pages/singleSelectionPage.js +1 -1
  82. package/cypress/pages/textEntryMathPage.js +18 -0
  83. package/cypress/pages/textEntryMathWithImagePage.js +15 -2
  84. package/cypress/pages/textSelectionPage.js +7 -1
  85. package/package.json +1 -1
@@ -0,0 +1,741 @@
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
+ tablePropertyWrapper: () => cy.get('.custom-link-wrapper'),
11
+ buttonTableIcon: () => cy.get('.cke_button__table_icon'),
12
+ tablePropertyLabel: () => cy.get('.dialog-header-label'),
13
+ buttonOk: () => cy.get('.cke_dialog_ui_button_ok'),
14
+ buttonCancel: () => cy.get('.cke_dialog_ui_button_cancel'),
15
+ tableInQuestionInstructionSection: () => cy.get('.custom_author_table'),
16
+
17
+ //Row Column
18
+ rowLabel: () => cy.get('.dialog-input-label').eq(0),
19
+ rowInputField: () => cy.get('.cke_dialog_ui_input_text').eq(1),
20
+ rowIncrement: () => cy.get('.increment').eq(0),
21
+ rowDecrement: () => cy.get('.decrement').eq(0),
22
+ columnLabel: () => cy.get('.dialog-input-label').eq(1),
23
+ columnInputField: () => cy.get('.cke_dialog_ui_input_text').eq(3),
24
+ columnIncrement: () => cy.get('.increment').eq(1),
25
+ columnDecrement: () => cy.get('.decrement').eq(1),
26
+
27
+ //Table Style
28
+ tableStyleLabel: () => cy.get('.table_styles_header .cke_dialog_ui_html'),
29
+ borderLabel: () => cy.get('.cke_dialog_ui_vbox_child').eq(26),
30
+ clearAllTableStyle: () => cy.get('.clear_all_table_styles'),
31
+
32
+ //Borders
33
+ allBorders: () => cy.get('[title="All borders"]'),
34
+ innerBorders: () => cy.get('[title="Inner borders"]'),
35
+ outerAndHorizontalBorders: () => cy.get('[title="Outer and horizontal borders"]'),
36
+ horizontalBorders: () => cy.get('[title="Horizontal borders "]'),
37
+ outerAndVerticalBorders: () => cy.get('[title="Outer and vertical borders"]'),
38
+ verticalBorders: () => cy.get('[title="Vertical borders"]'),
39
+ outerBorders: () => cy.get('[title="Outer borders"]'),
40
+ clearBorders: () => cy.get('[title="Clear borders"]'),
41
+ firstRowOfTable: () => cy.get('tbody tr').eq(0),
42
+ firstContainerOfTable: () => cy.get('tbody tr td').eq(0),
43
+ containerOfTable: () => cy.get('tbody tr td'),
44
+ headerContainerOfTable: () => cy.get('.custom_author_table th'),
45
+ borderSizeLabel: () => cy.get('.dialog-input-label').eq(7),
46
+ borderSizeInputField: () => cy.get('.cke_dialog_ui_input_text').eq(13),
47
+ stripedLabel: () => cy.get('.cke_dialog_ui_html').eq(3),
48
+ clearStripes: () => cy.get('[title="Clear stripes"]'),
49
+ horizontalStripes: () => cy.get('[title="Horizontal stripes"]'),
50
+ verticalStripes: () => cy.get('[title="Vertical stripes"]'),
51
+ addHoverStateLabel: () => cy.get('.dialog-input-label').eq(8),
52
+ addHoverStateDropDown: () => cy.get('.dialog-input-area').eq(8),
53
+ hoverOptionsSelect: (value = null) => {
54
+ if (value) {
55
+ return cy.get(`[class*="cke_dialog_ui_input_select"] option[value="${value}"]`)
56
+ } else {
57
+ return cy.get('[class*="cke_dialog_ui_input_select"] option[value]').eq(0)
58
+ }
59
+ },
60
+
61
+ //Headers
62
+ headerLabel: () => cy.get('.cke_dialog_ui_html').eq(0),
63
+ rowHeaderLabel: () => cy.get('.dialog-input-label').eq(5),
64
+ rowHeaderInput: () => cy.get('[aria-label="Header Rows"]'),
65
+ columnHeaderLabel: () => cy.get('.dialog-input-label').eq(6),
66
+ columnHeaderInput: () => cy.get('[aria-label="Header Columns"]'),
67
+ rowHeaderIncrementButton: () => cy.get('[aria-label="increment header row button"]'),
68
+ rowHeaderDecrementButton: () => cy.get('[aria-label="decrement header row button"]'),
69
+ columnHeaderIncrementButton: () => cy.get('[aria-label="increment header column button"]'),
70
+ columnHeaderDecrementButton: () => cy.get('[aria-label="decrement header column button"]'),
71
+ firstRowHeaderLabel: () => cy.get('.chk_box_make_first_row_title_header').eq(0),
72
+ firstRowHeaderCheckBox: () => cy.get('.chk_box_make_first_row_title_header').eq(1),
73
+ firstRowHeaderInTable: () => cy.get('[class*="InstructionComponentstyles__DivBody"] .custom_author_table [colspan="2"]'),
74
+
75
+ //Error Message
76
+ rowErrorMessage: () => cy.get('.inlvalid_value_error').eq(1),
77
+ rowHeaderErrorMessage: () => cy.get('.inlvalid_value_error').eq(5),
78
+ columnErrorMessage: () => cy.get('.inlvalid_value_error').eq(3),
79
+ columnHeaderErrorMessage: () => cy.get('.inlvalid_value_error').eq(8),
80
+
81
+ //Dimension
82
+ tableDimensionsLabel: () => cy.get('.dialog-input-label').eq(2),
83
+ fullWidthLabel: () => cy.get('.table-width-auto').eq(2),
84
+ fullWidthRadioButton: () => cy.get('.table-width-auto').eq(1),
85
+ autoAdjustLabel: () => cy.get('.table-width-auto').eq(4),
86
+ autoAdjustRadioButton: () => cy.get('.table-width-auto').eq(3),
87
+ widthPxLabel: () => cy.get('.dialog-input-label').eq(3),
88
+ widthPxInput: () => cy.get('.cke_dialog_ui_input_text').eq(5),
89
+ heightPxLabel: () => cy.get('.dialog-input-label').eq(4),
90
+ heightPxInput: () => cy.get('.cke_dialog_ui_input_text').eq(7),
91
+
92
+ //Alignment, Caption and Summary
93
+ alignmentLabel: () => cy.get('.dialog-input-label').eq(9),
94
+ alignmentDropDown: () => cy.get('.cke_dialog_ui_input_select').eq(2),
95
+ captionLabel: () => cy.get('.dialog-input-label').eq(10),
96
+ captionInputField: () => cy.get('.cke_dialog_ui_input_text').eq(15),
97
+ summaryLabel: () => cy.get('.dialog-input-label').eq(11),
98
+ summaryInputField: () => cy.get('.cke_dialog_ui_input_text').eq(17),
99
+ captionOfTheTable: () => cy.get('[class*="InstructionComponentstyles__DivBody"] .custom_author_table caption'),
100
+ alignmentOptions: (alignment = null) => {
101
+ if (alignment) {
102
+ return cy.get(`[class*="cke_dialog_ui_input_select"] option[value="${alignment}"]`)
103
+ } else {
104
+ return cy.get('[class*="cke_dialog_ui_input_select"] option[value]').eq(3)
105
+ }
106
+ },
107
+ }
108
+
109
+ const steps = {
110
+
111
+ incrementRowCount: () => {
112
+ ckEditorInsertTableComponent.rowIncrement()
113
+ .click();
114
+ },
115
+
116
+ decrementRowCount: () => {
117
+ ckEditorInsertTableComponent.rowDecrement()
118
+ .click();
119
+ },
120
+
121
+ /**
122
+ * @param {string} value value of row
123
+ * @description this function is used to type value in row input field
124
+ */
125
+ typeRowValue: (value) => {
126
+ ckEditorInsertTableComponent.rowInputField()
127
+ .click()
128
+ .clear()
129
+ .type(value);
130
+ },
131
+
132
+ emptyRowAndCheckErrorMessage: () => {
133
+ ckEditorInsertTableComponent.rowInputField()
134
+ .click()
135
+ .clear();
136
+ utilities.verifyInnerText(ckEditorInsertTableComponent.rowErrorMessage(), 'Value must be greater than zero.');
137
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.rowErrorMessage(), 'visible');
138
+ },
139
+
140
+ incrementColumnCount: () => {
141
+ ckEditorInsertTableComponent.columnIncrement()
142
+ .click();
143
+ },
144
+
145
+ decrementColumnCount: () => {
146
+ ckEditorInsertTableComponent.columnDecrement()
147
+ .click();
148
+ },
149
+
150
+ /**
151
+ * @param {string} value value of column
152
+ * @description this function is used to type value in column input field
153
+ */
154
+ typeColumnValue: (value) => {
155
+ ckEditorInsertTableComponent.columnInputField()
156
+ .click()
157
+ .clear()
158
+ .type(value);
159
+ },
160
+
161
+ emptyColumnAndCheckErrorMessage: () => {
162
+ ckEditorInsertTableComponent.columnInputField()
163
+ .click()
164
+ .clear();
165
+ utilities.verifyInnerText(ckEditorInsertTableComponent.columnErrorMessage(), 'Value must be greater than zero.');
166
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.columnErrorMessage(), 'visible');
167
+ },
168
+
169
+ incrementRowHeaderCount: () => {
170
+ ckEditorInsertTableComponent.rowHeaderIncrementButton()
171
+ .click();
172
+ },
173
+
174
+ /**
175
+ * @param {string} value value of row header
176
+ * @description this function is used to type value in row header input field
177
+ */
178
+ typeRowHeaderValue: (value) => {
179
+ ckEditorInsertTableComponent.rowHeaderInput()
180
+ .click()
181
+ .clear()
182
+ .type(value);
183
+ },
184
+
185
+ decrementRowHeaderCount: () => {
186
+ ckEditorInsertTableComponent.rowHeaderDecrementButton()
187
+ .click();
188
+ },
189
+
190
+ incrementColumnHeaderCount: () => {
191
+ ckEditorInsertTableComponent.columnHeaderIncrementButton()
192
+ .click();
193
+ },
194
+
195
+ /**
196
+ * @param {string} value value of column header
197
+ * @description this function is used to type value in column header input field
198
+ */
199
+ typeColumnHeaderValue: (value) => {
200
+ ckEditorInsertTableComponent.columnHeaderInput()
201
+ .click()
202
+ .clear()
203
+ .type(value);
204
+ },
205
+
206
+ clickOnAutoAdjustRadioButton: () => {
207
+ ckEditorInsertTableComponent.autoAdjustRadioButton()
208
+ .click();
209
+ },
210
+
211
+ verifyFullWidthRadioButtonChecked: () => {
212
+ ckEditorInsertTableComponent.fullWidthRadioButton()
213
+ .should('be.checked');
214
+ },
215
+
216
+ verifyFullWidthRadioButtonUnchecked: () => {
217
+ ckEditorInsertTableComponent.fullWidthRadioButton()
218
+ .should('not.be.checked');
219
+ },
220
+
221
+ verifyAutoAdjustRadioButtonChecked: () => {
222
+ ckEditorInsertTableComponent.autoAdjustRadioButton()
223
+ .should('be.checked');
224
+ },
225
+
226
+ verifyAutoAdjustRadioButtonUnchecked: () => {
227
+ ckEditorInsertTableComponent.autoAdjustRadioButton()
228
+ .should('not.be.checked');
229
+ },
230
+
231
+ /**
232
+ * @param {string} value value of width in px
233
+ * @description this function is used to type value in widthPx input field
234
+ */
235
+ enterWidthPx: (value) => {
236
+ ckEditorInsertTableComponent.widthPxInput()
237
+ .click()
238
+ .clear()
239
+ .type(value);
240
+ },
241
+
242
+ /**
243
+ * @param {string} value value of height in px
244
+ * @description this function is used to type value in heightPx input field
245
+ */
246
+ enterHeightPx: (value) => {
247
+ ckEditorInsertTableComponent.heightPxInput()
248
+ .click()
249
+ .clear()
250
+ .type(value);
251
+ },
252
+
253
+ /**
254
+ * @param {string} width width value in px
255
+ * @description this function is used to verify width of the table
256
+ */
257
+ verifyWidthOfTheTable: (width) => {
258
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
259
+ 'width': `${width}px`,
260
+ });
261
+ },
262
+
263
+ /**
264
+ * @param {string} height height value in px
265
+ * @description this function is used to verify height of the table
266
+ */
267
+ verifyHeightOfTheTable: (height) => {
268
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
269
+ 'height': `${height}px`,
270
+ });
271
+ },
272
+
273
+ decrementColumnHeaderCount: () => {
274
+ ckEditorInsertTableComponent.columnHeaderDecrementButton()
275
+ .click();
276
+ },
277
+
278
+ clickOnFirstRowHeaderCheckBox: () => {
279
+ ckEditorInsertTableComponent.firstRowHeaderCheckBox()
280
+ .click();
281
+ },
282
+
283
+ selectTableButtonOptionFromCKEditorToolbar: () => {
284
+ ckEditorInsertTableComponent.buttonTableIcon()
285
+ .eq(0)
286
+ .click();
287
+ },
288
+
289
+ selectCancelButtonFromCKEditorToolbar: () => {
290
+ ckEditorInsertTableComponent.buttonCancel()
291
+ .click();
292
+ },
293
+
294
+ selectOkButtonFromCKEditorToolbar: () => {
295
+ ckEditorInsertTableComponent.buttonOk()
296
+ .click();
297
+ },
298
+
299
+ /**
300
+ * @param {number} expectedRowCount The expected number of rows in the table.
301
+ * @param {number} expectedColumnCount The expected number of columns in the first row of the table.
302
+ * @description This function is used to verify the number of rows and columns present in the table.
303
+ */
304
+ checkNumberOfRowsAndColumnsPresentInTable: (expectedRowCount, expectedColumnCount) => {
305
+ ckEditorInsertTableComponent.tableInQuestionInstructionSection()
306
+ .should('exist')
307
+ .within(() => {
308
+ cy.get('tbody tr').should('have.length', expectedRowCount);
309
+ cy.get('tbody tr').first().find('td').should('have.length', expectedColumnCount);
310
+ });
311
+ },
312
+
313
+ /**
314
+ * @param {number} containerNumber The index of the container whose header needs to be checked.
315
+ * @description This function verifies the background color of the header for the specified container number.
316
+ */
317
+ checkHeaderForContainerNumber: (containerNumber) => {
318
+ utilities.verifyCSS(ckEditorInsertTableComponent.headerContainerOfTable().eq(containerNumber), {
319
+ 'background-color': 'rgb(29, 29, 156)',
320
+ });
321
+ },
322
+
323
+ /**
324
+ * @param {number} size The expected border size (in pixels) of the table.
325
+ * @description This function verifies the top border width of the table.
326
+ */
327
+ checkBorderSizeOfTable: (size) => {
328
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
329
+ 'border-top-width': `${size}px`,
330
+ });
331
+
332
+ },
333
+
334
+ /**
335
+ * @param { string } value The value to be input as the border size for the table.
336
+ * @description This function inputs the specified border size value into the border size input field of the table and verifies that the value has been set correctly.
337
+ */
338
+ inputBorderSizeForTable: (value) => {
339
+ ckEditorInsertTableComponent.borderSizeInputField()
340
+ .clear()
341
+ .type(value)
342
+ .should('have.value', value)
343
+ },
344
+
345
+ expandHoverStateDropdown: () => {
346
+ ckEditorInsertTableComponent.addHoverStateDropDown()
347
+ .click();
348
+ },
349
+
350
+ scrollingDownInInsertTablePopUp: () => {
351
+ ckEditorInsertTableComponent.borderSizeLabel()
352
+ .scrollIntoView()
353
+ },
354
+
355
+ scrollingDownToAlignmentLabel: () => {
356
+ ckEditorInsertTableComponent.alignmentLabel()
357
+ .scrollIntoView()
358
+ },
359
+
360
+ /**
361
+ * @param {string} value The caption text to be entered for the table.
362
+ * @description This function enters the specified caption into the caption input field of the table.
363
+ */
364
+ enterCaption: (value) => {
365
+ ckEditorInsertTableComponent.captionInputField()
366
+ .click()
367
+ .clear()
368
+ .type(value);
369
+ },
370
+
371
+ /**
372
+ * @param {string} value The summary text to be entered for the table.
373
+ * @description This function enters the specified summary into the summary input field of the table.
374
+ */
375
+ enterSummary: (value) => {
376
+ ckEditorInsertTableComponent.summaryInputField()
377
+ .click()
378
+ .clear()
379
+ .type(value);
380
+ },
381
+
382
+ /**
383
+ * @param {string} value The expected summary value of the table.
384
+ * @description This function verifies that the table has the specified summary attribute value.
385
+ */
386
+ verifySummaryOfTheTable: (value) => {
387
+ ckEditorInsertTableComponent.tableInQuestionInstructionSection()
388
+ .should('have.attr', 'summary', value);
389
+ },
390
+
391
+ expandAlignmentDropDown: () => {
392
+ ckEditorInsertTableComponent.alignmentDropDown()
393
+ .click();
394
+ },
395
+
396
+ /**
397
+ * @param {string} alignment The alignment option to be selected (e.g., 'left', 'center', 'right').
398
+ * @description This function selects the specified alignment option from the alignment dropdown.
399
+ */
400
+ selectAlignmentOptionDropdown: (alignment) => {
401
+ ckEditorInsertTableComponent.alignmentOptions(alignment)
402
+ .click();
403
+ },
404
+
405
+ /**
406
+ * @param {string} value The expected alignment value of the table (e.g., 'left', 'center', 'right').
407
+ * @description This function verifies that the table has the specified alignment attribute value.
408
+ */
409
+ verifyAlignmentOnTable: (value) => {
410
+ ckEditorInsertTableComponent.tableInQuestionInstructionSection()
411
+ .should('have.attr', 'align', value);
412
+ },
413
+
414
+ /**
415
+ * @param {string} effectOn The hover effect option to be selected ('Row' or 'Cell').
416
+ * @description This function selects the specified hover effect style (row or cell) from the hover state dropdown.
417
+ * @throws Will throw an error if an unsupported hover effect option is provided.
418
+ */
419
+ selectHoverEffectStyle: (effectOn) => {
420
+ switch (effectOn) {
421
+ case 'Row':
422
+ ckEditorInsertTableComponent.steps.expandHoverStateDropdown();
423
+ ckEditorInsertTableComponent.hoverOptionsSelect("row")
424
+ .click();
425
+ break;
426
+ case 'Cell':
427
+ ckEditorInsertTableComponent.steps.expandHoverStateDropdown();
428
+ ckEditorInsertTableComponent.hoverOptionsSelect("cell")
429
+ .click();
430
+ break;
431
+ default:
432
+ throw new Error(`Unknown Border Strip: ${effectOn}`);
433
+ }
434
+ },
435
+
436
+ /**
437
+ * @param {string} effectOn The hover effect style to verify ('Row' or 'Cell').
438
+ * @description This function verifies the hover effect style applied to the table based on the specified option.
439
+ * @throws Will throw an error if an unsupported hover effect option is provided.
440
+ */
441
+ verifyHoverEffectStyleOnTable: (effectOn) => {
442
+ switch (effectOn) {
443
+ case 'Row':
444
+ ckEditorInsertTableComponent.firstRowOfTable()
445
+ .realHover();
446
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstRowOfTable(), {
447
+ 'box-shadow': '0 2px 8px rgba(82,0,255,.32)',
448
+ 'border': '1px solid #bac9ff'
449
+ });
450
+ break;
451
+ case 'Cell':
452
+ ckEditorInsertTableComponent.firstContainerOfTable()
453
+ .realHover();
454
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
455
+ 'background-color': 'fbf5ff',
456
+ 'color': '#7e00cc'
457
+ });
458
+ break;
459
+ default:
460
+ throw new Error(`Unknown Border Strip: ${effectOn}`);
461
+ }
462
+ },
463
+
464
+ /**
465
+ * @param {string} borderStrip The table strip style to be selected ('Clear', 'Horizontal', or 'Vertical').
466
+ * @description This function selects the specified table strip style from the available options.
467
+ * @throws Will throw an error if an unsupported border strip option is provided.
468
+ */
469
+ selectTableStripStyle: (borderStrip) => {
470
+ switch (borderStrip) {
471
+ case 'Clear':
472
+ ckEditorInsertTableComponent.clearStripes()
473
+ .click();
474
+ break;
475
+ case 'Horizontal':
476
+ ckEditorInsertTableComponent.horizontalStripes()
477
+ .click();
478
+ break;
479
+ case 'Vertical':
480
+ ckEditorInsertTableComponent.verticalStripes()
481
+ .click();
482
+ break;
483
+ default:
484
+ throw new Error(`Unknown Border Strip: ${borderStrip}`);
485
+ }
486
+ },
487
+
488
+ /**
489
+ * @param {string} borderStrip The border strip style to verify ('Clear', 'Horizontal', or 'Vertical').
490
+ * @description This function checks the background color of the table containers based on the specified border strip style.
491
+ * @throws Will throw an error if an unsupported border strip option is provided.
492
+ */
493
+ checkBorderStripOfTable: (borderStrip) => {
494
+ switch (borderStrip) {
495
+ case 'Clear':
496
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(0), {
497
+ 'background-color': 'rgba(0, 0, 0, 0)',
498
+ });
499
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(1), {
500
+ 'background-color': 'rgba(0, 0, 0, 0)',
501
+ });
502
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(2), {
503
+ 'background-color': 'rgba(0, 0, 0, 0)',
504
+ });
505
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(3), {
506
+ 'background-color': 'rgba(0, 0, 0, 0)',
507
+ });
508
+ break;
509
+ case 'Horizontal':
510
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(0), {
511
+ 'background-color': 'rgb(245, 248, 255)',
512
+ });
513
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(1), {
514
+ 'background-color': 'rgb(245, 248, 255)',
515
+ });
516
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(2), {
517
+ 'background-color': 'rgba(0, 0, 0, 0)',
518
+ });
519
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(3), {
520
+ 'background-color': 'rgba(0, 0, 0, 0)',
521
+ });
522
+ break;
523
+ case 'Vertical':
524
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(0), {
525
+ 'background-color': 'rgb(245, 248, 255)',
526
+ });
527
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(1), {
528
+ 'background-color': 'rgba(0, 0, 0, 0)',
529
+ });
530
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(2), {
531
+ 'background-color': 'rgb(245, 248, 255)',
532
+ });
533
+ utilities.verifyCSS(ckEditorInsertTableComponent.containerOfTable().eq(3), {
534
+ 'background-color': 'rgba(0, 0, 0, 0)',
535
+ });
536
+ break;
537
+ default:
538
+ throw new Error(`Unknown Border Strip: ${borderStrip}`);
539
+ }
540
+ },
541
+
542
+ /**
543
+ * @param {string} borderType The type of border button to check for visibility ('All borders', 'Inner borders', 'Outer and horizontal borders', 'Horizontal borders', 'Outer and vertical borders', 'Vertical borders', 'Outer borders', or 'Clear borders').
544
+ * @description This function checks if the specified border button is visible in the table component.
545
+ * @throws Will throw an error if an unsupported border type is provided.
546
+ */
547
+ checkBorderButtonVisible: (borderType) => {
548
+ switch (borderType) {
549
+ case 'All borders':
550
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.allBorders(), 'visible');
551
+ break;
552
+ case 'Inner borders':
553
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.innerBorders(), 'visible');
554
+ break;
555
+ case 'Outer and horizontal borders':
556
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.outerAndHorizontalBorders(), 'visible');
557
+ break;
558
+ case 'Horizontal borders':
559
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.horizontalBorders(), 'visible');
560
+ break;
561
+ case 'Outer and vertical borders':
562
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.outerAndVerticalBorders(), 'visible');
563
+ break;
564
+ case 'Vertical borders':
565
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.verticalBorders(), 'visible');
566
+ break;
567
+ case 'Outer borders':
568
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.outerBorders(), 'visible');
569
+ break;
570
+ case 'Clear borders':
571
+ utilities.verifyElementVisibilityState(ckEditorInsertTableComponent.clearBorders(), 'visible');
572
+ break;
573
+ default:
574
+ throw new Error(`Unknown Border Type: ${borderType}`);
575
+ }
576
+ },
577
+
578
+ /**
579
+ * @param {string} borderType The border type to check for visibility ('All borders', 'Inner borders', 'Outer and horizontal borders', 'Horizontal borders', 'Outer and vertical borders', 'Vertical borders', 'Outer borders', or 'Clear borders').
580
+ * @description This function verifies the CSS styles of the borders in the question instruction section and the first container of the table based on the specified border type.
581
+ * @throws Will throw an error if an unsupported border type is provided.
582
+ */
583
+ checkBorderVisibleInQuestionInstruction: (borderType) => {
584
+ switch (borderType) {
585
+ case 'All borders':
586
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
587
+ 'border-bottom-style': 'solid',
588
+ 'border-left-style': 'solid',
589
+ 'border-right-style': 'solid',
590
+ 'border-top-style': 'solid',
591
+ });
592
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
593
+ 'border-bottom-style': 'solid',
594
+ 'border-left-style': 'solid',
595
+ 'border-right-style': 'solid',
596
+ 'border-top-style': 'solid',
597
+ });
598
+ break;
599
+ case 'Inner borders':
600
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
601
+ 'border-bottom-style': 'hidden',
602
+ 'border-left-style': 'hidden',
603
+ 'border-right-style': 'hidden',
604
+ 'border-top-style': 'hidden',
605
+ });
606
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
607
+ 'border-bottom-style': 'solid',
608
+ 'border-left-style': 'hidden',
609
+ 'border-right-style': 'solid',
610
+ 'border-top-style': 'hidden',
611
+ });
612
+ break;
613
+ case 'Outer and horizontal borders':
614
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
615
+ 'border-bottom-style': 'solid',
616
+ 'border-left-style': 'solid',
617
+ 'border-right-style': 'solid',
618
+ 'border-top-style': 'solid',
619
+ });
620
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
621
+ 'border-bottom-style': 'solid',
622
+ 'border-left-style': 'solid',
623
+ 'border-right-style': 'hidden',
624
+ 'border-top-style': 'solid',
625
+ });
626
+ break;
627
+ case 'Horizontal borders':
628
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
629
+ 'border-bottom-style': 'hidden',
630
+ 'border-left-style': 'hidden',
631
+ 'border-right-style': 'hidden',
632
+ 'border-top-style': 'hidden',
633
+ });
634
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
635
+ 'border-bottom-style': 'solid',
636
+ 'border-left-style': 'hidden',
637
+ 'border-right-style': 'hidden',
638
+ 'border-top-style': 'hidden',
639
+ });
640
+ break;
641
+ case 'Outer and vertical borders':
642
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
643
+ 'border-bottom-style': 'solid',
644
+ 'border-left-style': 'solid',
645
+ 'border-right-style': 'solid',
646
+ 'border-top-style': 'solid',
647
+ });
648
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
649
+ 'border-bottom-style': 'hidden',
650
+ 'border-left-style': 'solid',
651
+ 'border-right-style': 'solid',
652
+ 'border-top-style': 'solid',
653
+ });
654
+ break;
655
+ case 'Vertical borders':
656
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
657
+ 'border-bottom-style': 'hidden',
658
+ 'border-left-style': 'hidden',
659
+ 'border-right-style': 'hidden',
660
+ 'border-top-style': 'hidden',
661
+ });
662
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
663
+ 'border-bottom-style': 'hidden',
664
+ 'border-left-style': 'hidden',
665
+ 'border-right-style': 'solid',
666
+ 'border-top-style': 'hidden',
667
+ });
668
+ break;
669
+ case 'Outer borders':
670
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
671
+ 'border-bottom-style': 'solid',
672
+ 'border-left-style': 'solid',
673
+ 'border-right-style': 'solid',
674
+ 'border-top-style': 'solid',
675
+ });
676
+ utilities.verifyCSS(ckEditorInsertTableComponent.firstContainerOfTable(), {
677
+ 'border-bottom-style': 'hidden',
678
+ 'border-left-style': 'solid',
679
+ 'border-right-style': 'hidden',
680
+ 'border-top-style': 'solid',
681
+ });
682
+ break;
683
+ case 'Clear borders':
684
+ utilities.verifyCSS(ckEditorInsertTableComponent.tableInQuestionInstructionSection(), {
685
+ 'border-color': 'rgba(0, 0, 0, 0)',
686
+ });
687
+ break;
688
+ default:
689
+ throw new Error(`Unknown Border Type: ${borderType}`);
690
+ }
691
+ },
692
+
693
+ /**
694
+ * @param {string} borderType The border type to select ('All borders', 'Inner borders', 'Outer and horizontal borders', 'Horizontal borders', 'Outer and vertical borders', 'Vertical borders', 'Outer borders', or 'Clear borders').
695
+ * @description This function selects the specified border style for the table component based on the provided border type.
696
+ * @throws Will throw an error if an unsupported border type is provided.
697
+ */
698
+ selectTableBorderStyle: (borderType) => {
699
+ switch (borderType) {
700
+ case 'All borders':
701
+ ckEditorInsertTableComponent.allBorders()
702
+ .click();
703
+ break;
704
+ case 'Inner borders':
705
+ ckEditorInsertTableComponent.innerBorders()
706
+ .click();
707
+ break;
708
+ case 'Outer and horizontal borders':
709
+ ckEditorInsertTableComponent.outerAndHorizontalBorders()
710
+ .click();
711
+ break;
712
+ case 'Horizontal borders':
713
+ ckEditorInsertTableComponent.horizontalBorders()
714
+ .click();
715
+ break;
716
+ case 'Outer and vertical borders':
717
+ ckEditorInsertTableComponent.outerAndVerticalBorders()
718
+ .click();
719
+ break;
720
+ case 'Vertical borders':
721
+ ckEditorInsertTableComponent.verticalBorders()
722
+ .click();
723
+ break;
724
+ case 'Outer borders':
725
+ ckEditorInsertTableComponent.outerBorders()
726
+ .click();
727
+ break;
728
+ case 'Clear borders':
729
+ ckEditorInsertTableComponent.clearBorders()
730
+ .click();
731
+ break;
732
+ default:
733
+ throw new Error(`Unknown Border Type: ${borderType}`);
734
+ }
735
+ },
736
+ }
737
+
738
+ export const ckEditorInsertTableComponent = {
739
+ ...selectors,
740
+ steps
741
+ }