itemengine-cypress-automation 1.0.248-23rdSeptUpdates-8103a8f.0 → 1.0.248

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +5 -5
  4. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +8 -0
  5. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +2 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneAlternateAnswerPopup.js +1 -1
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +1 -2
  8. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationDropDown.js +166 -0
  9. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSameList.js +1 -0
  10. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSeperateList.js +344 -0
  11. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -2
  12. package/cypress/e2e/ILC/UploadResponse/thumbNail.smoke.js +121 -0
  13. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +6 -3
  14. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  15. package/cypress/pages/components/imageCanvasComponent.js +2 -3
  16. package/cypress/pages/components/listOrderingCommonStyleAndLayoutComponent.js +287 -53
  17. package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -1
  18. package/cypress/pages/listOrderingPage.js +1 -1
  19. package/cypress/pages/matchingPage.js +1 -1
  20. package/cypress/pages/uploadResponsePage.js +49 -4
  21. package/deploy/e2e/deploy.yaml +2 -2
  22. package/deploy/smoke/deploy.yaml +2 -2
  23. package/package.json +1 -1
@@ -1,17 +1,15 @@
1
1
  import utilities from "../../support/helpers/utilities"
2
- import { listOrderingPage } from "../listOrderingPage";
3
2
  import { colorPopupComponent } from "./colorPopupComponent";
4
3
  import { commonComponents } from "./commonComponents";
5
4
  import { createQuestionBasePage } from "./createQuestionBasePage";
6
5
  const css = Cypress.env('css');
7
6
 
8
7
  const selectors = {
9
- ...listOrderingPage,
10
8
  fillColorLabel: () => cy.get('.sub-section-label').eq(0),
11
- fillColorLabelListContainer: () => cy.get('.sub-section-label').eq(2),
9
+ fillColorLabelListContainerAndDropDown: () => cy.get('.sub-section-label').eq(2),
12
10
  colorBlock: () => cy.get('.color-grid-wrapper .color-picker-block'),
13
11
  borderColorLabel: () => cy.get('.sub-section-label').eq(1),
14
- borderColorLabelListContainer: () => cy.get('.sub-section-label').eq(3),
12
+ borderColorLabelListContainerAndDropDown: () => cy.get('.sub-section-label').eq(3),
15
13
  editColorButton: () => cy.get('button[aria-label="edit color"]'),
16
14
  colorBlockSelectedIcon: () => cy.get('[class*="BtnSelectionWrapper"] svg'),
17
15
  optionStyleLabel: () => cy.get('.options-border-style .options-label').eq(0),
@@ -20,12 +18,23 @@ const selectors = {
20
18
  connectorSettingLabel: () => cy.get('.options-border-style .options-label').eq(2),
21
19
  dottedBorderStyleToggleButton: () => cy.get('[data-ngie-testid="dotted-toggle-button"]').eq(0),
22
20
  solidBorderStyleToggleButton: () => cy.get('[data-ngie-testid="solid-toggle-button"]').eq(0),
23
- dottedBorderStyleToggleButtonListContainer: () => cy.get('[data-ngie-testid="dotted-toggle-button"]').eq(1),
24
- solidBorderStyleToggleButtonListContainer: () => cy.get('[data-ngie-testid="solid-toggle-button"]').eq(1),
21
+ dottedBorderStyleToggleButtonListContainerAndDropDown: () => cy.get('[data-ngie-testid="dotted-toggle-button"]').eq(1),
22
+ solidBorderStyleToggleButtonListContainerAndDropDown: () => cy.get('[data-ngie-testid="solid-toggle-button"]').eq(1),
25
23
  noneBorderStyleToggleButton: () => cy.get('[data-ngie-testid="none-toggle-button"]').eq(0),
26
24
  specifyCorrectanswerSectionOption: () => cy.get('[class*="ListOrderingResponsestyles__ItemWrapper"]'),
27
25
  specifyCorrectanswerSectionOptionSeperateList: () => cy.get('[class*="DraggableItemstyle__ItemWrapper"]'),
28
26
  dropzoneSeperateList: () => cy.get('[class*="MultipleDroppableHotspotstyle__DroppableHotspotWrapper"]'),
27
+ specifyCorrectanswerSectionOptionDropDown: () => cy.get('[class*="DropdownLayoutstyles__OptionsWrapper"]'),
28
+ specifyCorrectanswerSectionResponseDropDown: () => cy.get('[class*="ResponseDropdownComponentstyles__ResponseDropdownWrapper"] .drop-down-parent'),
29
+ positionDropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-dropdown-wrapper [role="combobox"]'),
30
+ positionDropdownListOption: (ariaLabel = null) => {
31
+ if (ariaLabel) {
32
+ return cy.get(`[aria-labelledby*="-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`).eq(0)
33
+ } else {
34
+ return cy.get('[aria-labelledby*="-dropdown-label"] [role="option"]')
35
+ }
36
+ },
37
+
29
38
  }
30
39
 
31
40
  const steps = {
@@ -91,12 +100,12 @@ const steps = {
91
100
  selectBorderStyleToggleButtonOfListContainer: (button) => {
92
101
  switch (button) {
93
102
  case 'Dotted':
94
- listOrderingCommonStyleAndLayoutComponent.dottedBorderStyleToggleButtonListContainer()
103
+ listOrderingCommonStyleAndLayoutComponent.dottedBorderStyleToggleButtonListContainerAndDropDown()
95
104
  .click()
96
105
  .should('have.class', 'ngie-toggle-button-selected');
97
106
  break;
98
107
  case 'Solid':
99
- listOrderingCommonStyleAndLayoutComponent.solidBorderStyleToggleButtonListContainer()
108
+ listOrderingCommonStyleAndLayoutComponent.solidBorderStyleToggleButtonListContainerAndDropDown()
100
109
  .click()
101
110
  .should('have.class', 'ngie-toggle-button-selected');
102
111
  break;
@@ -118,11 +127,11 @@ const steps = {
118
127
  verifyBorderStyleToggleButtonSelectedStateListContainer: (button) => {
119
128
  switch (button) {
120
129
  case 'Dotted':
121
- listOrderingCommonStyleAndLayoutComponent.dottedBorderStyleToggleButtonListContainer()
130
+ listOrderingCommonStyleAndLayoutComponent.dottedBorderStyleToggleButtonListContainerAndDropDown()
122
131
  .should('have.class', 'ngie-toggle-button-selected');
123
132
  break;
124
133
  case 'Solid':
125
- listOrderingCommonStyleAndLayoutComponent.solidBorderStyleToggleButtonListContainer()
134
+ listOrderingCommonStyleAndLayoutComponent.solidBorderStyleToggleButtonListContainerAndDropDown()
126
135
  .should('have.class', 'ngie-toggle-button-selected');
127
136
  break;
128
137
  case 'None':
@@ -148,17 +157,30 @@ const steps = {
148
157
  utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionOptionSeperateList(), responseAreaIndex), {
149
158
  'background-color': colorValue
150
159
  });
160
+ } else if (listType === "DropDown") {
161
+ utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionOptionDropDown(), responseAreaIndex), {
162
+ 'background-color': colorValue
163
+ });
164
+ utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionResponseDropDown(), responseAreaIndex), {
165
+ 'background-color': colorValue
166
+ });
151
167
  }
152
168
  },
153
169
 
154
170
  /**
155
- * Verifies the background color of list container.
171
+ * Verifies the background color of list container or drop down.
156
172
  * @param {string} colorValue - The expected background color value.
157
173
  */
158
- verifyFillColorOfListContainer: (colorValue) => {
159
- utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
160
- 'background-color': colorValue
161
- });
174
+ verifyFillColorOfListContainerOrDropDown: (colorValue, containerType) => {
175
+ if(containerType === "ListContainer") {
176
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
177
+ 'background-color': colorValue
178
+ });
179
+ } else if (containerType === "DropDown") {
180
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionResponseDropDown(), {
181
+ 'background-color': colorValue
182
+ });
183
+ }
162
184
  },
163
185
 
164
186
  /**
@@ -193,17 +215,30 @@ const steps = {
193
215
  utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent. specifyCorrectanswerSectionOptionSeperateList(), responseAreaIndex), {
194
216
  'border': colorValue
195
217
  });
218
+ } else if (listType === "DropDown") {
219
+ utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionOptionDropDown(), responseAreaIndex), {
220
+ 'border': colorValue
221
+ });
222
+ utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionResponseDropDown(), responseAreaIndex), {
223
+ 'border': colorValue
224
+ });
196
225
  }
197
226
  },
198
227
 
199
228
  /**
200
- * Verifies the border color of list container.
229
+ * Verifies the border color of list container or Dropdown.
201
230
  * @param {string} colorValue - The expected border color value.
202
231
  */
203
- verifyBorderColorOfListContainer: (colorValue) => {
204
- utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
205
- 'border': colorValue
206
- });
232
+ verifyBorderColorOfListContainerOrDropDown: (colorValue, containerType) => {
233
+ if(containerType === "ListContainer") {
234
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
235
+ 'border': colorValue
236
+ });
237
+ } else if (containerType === "DropDown") {
238
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionResponseDropDown(), {
239
+ 'border': colorValue
240
+ });
241
+ }
207
242
  },
208
243
 
209
244
  /**
@@ -221,19 +256,28 @@ const steps = {
221
256
  utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionOptionSeperateList(), responseAreaIndex), {
222
257
  'border-style': styleName
223
258
  });
259
+ } else if (listType === "DropDown") {
260
+ utilities.verifyCSS(utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionOptionDropDown(), responseAreaIndex), {
261
+ 'border-style': styleName
262
+ });
224
263
  }
225
264
  },
226
265
 
227
266
  /**
228
267
  * Verifies the border style of element.
229
- * @param {number} responseAreaIndex - The index of the options to verify.
230
268
  * @param {string} borderStyle - The expected border style value.
231
269
  */
232
- verifyBorderStyleOfListContainer: (borderStyle) => {
270
+ verifyBorderStyleOfListContainerOrDropDown: (borderStyle, containerType) => {
233
271
  const styleName = borderStyle.toLowerCase();
234
- utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
235
- 'border-style': styleName
236
- });
272
+ if(containerType === "ListContainer") {
273
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.dropzoneSeperateList(), {
274
+ 'border-style': styleName
275
+ });
276
+ } else if (containerType === "DropDown") {
277
+ utilities.verifyCSS(listOrderingCommonStyleAndLayoutComponent.specifyCorrectanswerSectionResponseDropDown(), {
278
+ 'border-style': styleName
279
+ });
280
+ }
237
281
  },
238
282
 
239
283
  /**
@@ -290,6 +334,38 @@ const steps = {
290
334
  .click()
291
335
  .should('have.attr', 'aria-selected', 'true');
292
336
  },
337
+
338
+ /**
339
+ * Selects positions for all options in the specify correct answer section according to the provided position object.
340
+ * @param {Object[]} positionObject - An array of objects where each object contains optionIndex and position properties.
341
+ * @param {number} positionObject[].optionIndex - The index of the option.
342
+ * @param {string} positionObject[].position - The position to select.
343
+ */
344
+ selectPositionForAllOptionsPreviewTab: (positionObject) => {
345
+ positionObject.forEach(({ optionIndex, position }) => {
346
+ steps.selectOptionPositionPreviewTab(optionIndex, position)
347
+ });
348
+ },
349
+
350
+ /**
351
+ * Selects the specified option from the position dropdown in the specify correct answer section.
352
+ * @param {number} optionIndex - The index of the option in the dropdown.
353
+ * @param {string} position - The position to select.
354
+ */
355
+ selectOptionPositionPreviewTab: (optionIndex, position) => {
356
+ steps.expandPositionDropdownPreviewTab(optionIndex);
357
+ listOrderingCommonStyleAndLayoutComponent.positionDropdownListOption(position)
358
+ .click();
359
+ },
360
+
361
+ /**
362
+ * Expands the position dropdown in the specify correct answer section and selects the specified dropdown index.
363
+ * @param {number} dropdownIndex - The index of the dropdown to expand and select.
364
+ */
365
+ expandPositionDropdownPreviewTab: (dropdownIndex) => {
366
+ utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.positionDropdownPreviewTab(), dropdownIndex)
367
+ .click();
368
+ },
293
369
  }
294
370
 
295
371
  const tests = {
@@ -333,6 +409,9 @@ const tests = {
333
409
  });
334
410
  },
335
411
 
412
+ /**
413
+ * Verifies the correct hex code getting displayed when hover on fill color blocks
414
+ */
336
415
  verifyFillColorTooltips: () => {
337
416
  it('When the user hovers over the color blocks in the "Fill color" section, hex code of the selected color should be displayed in a tooltip', () => {
338
417
  utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.colorBlock(), 0).verifyTooltip('#FFFFFF');
@@ -340,6 +419,9 @@ const tests = {
340
419
  });
341
420
  },
342
421
 
422
+ /**
423
+ * Verifies the correct hex code getting displayed when hover on border color blocks
424
+ */
343
425
  verifyBorderColorTooltips: () => {
344
426
  it('When the user hovers over the color blocks in the "Border color" section, hex code of the selected color should be displayed in a tooltip', () => {
345
427
  utilities.getNthElement(listOrderingCommonStyleAndLayoutComponent.colorBlock(), 2).verifyTooltip('#6B8BFF');
@@ -347,6 +429,10 @@ const tests = {
347
429
  });
348
430
  },
349
431
 
432
+ /**
433
+ * Verifies whether correct color is getting displayed inside the options
434
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
435
+ */
350
436
  verifyFillColorFunctionalityEditTab: (listType) => {
351
437
  const modifiedColor = 'rgb(121, 60, 60)'
352
438
 
@@ -367,27 +453,35 @@ const tests = {
367
453
  });
368
454
  },
369
455
 
370
- verifyFillColorFunctionalityOfListContainerEditTab: () => {
456
+ /**
457
+ * Verifies whether correct color is getting displayed inside drag and drop container or drop down options
458
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
459
+ */
460
+ verifyFillColorFunctionalityOfListContainerOrDropDownEditTab: (containerType) => {
371
461
  const modifiedColor = 'rgb(121, 60, 60)'
372
462
 
373
- it('When the default color block is in selected state in the \'Fill color\' section of \'List Container\', then the background color of the container in the specify correct answer section should be the default selected color', () => {
374
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer('rgb(245, 248, 255)');
463
+ it('When the default color block is in selected state in the \'Fill color\' section of \'List Container\' or \'DropDown\', then the background color of the container/dropdown in the specify correct answer section should be the default selected color', () => {
464
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(245, 248, 255)', containerType);
375
465
  });
376
466
 
377
- it('When the user selects the "None" color block of \'List Container\', it should get in selected state and the no background color should be present for the container in the specify correct answer section', () => {
467
+ it('When the user selects the "None" color block of \'List Container\' or \'DropDown\', it should get in selected state and the no background color should be present for the container/dropdown in the specify correct answer section', () => {
378
468
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(5);
379
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer('rgb(255, 255, 255)');
469
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(255, 255, 255)', containerType);
380
470
  });
381
471
 
382
- it('When the user clicks on the "Edit color" button of \'List Container\', modifies color for the selected color block, then the background color of the container in the specify correct answer section should be the modified selected color', () => {
472
+ it('When the user clicks on the "Edit color" button of \'List Container\' or \'DropDown\', modifies color for the selected color block, then the background color of the container/dropdown in the specify correct answer section should be the modified selected color', () => {
383
473
  listOrderingCommonStyleAndLayoutComponent.steps.editColor(2);
384
474
  listOrderingCommonStyleAndLayoutComponent.steps.clickInColorSaturationPalette();
385
475
  listOrderingCommonStyleAndLayoutComponent.steps.clickOnOkButton();
386
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer(modifiedColor);
476
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown(modifiedColor, containerType);
387
477
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(4);
388
478
  });
389
479
  },
390
480
 
481
+ /**
482
+ * Verifies whether correct border color is getting displayed for the options
483
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
484
+ */
391
485
  verifyBorderColorFunctionalityEditTab: (listType) => {
392
486
  const modifiedColor = 'rgb(121, 60, 60)'
393
487
 
@@ -409,28 +503,42 @@ const tests = {
409
503
  });
410
504
  },
411
505
 
412
- verifyBorderColorFunctionalityOfListContainerEditTab: () => {
506
+ /**
507
+ * Verifies whether correct border color is getting displayed for drag and drop container or drop down options
508
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
509
+ */
510
+ verifyBorderColorFunctionalityOfListOrDropDownContainerEditTab: (containerType) => {
413
511
  const modifiedColor = 'rgb(121, 60, 60)'
512
+ let borderStyles = '2px dotted'
414
513
 
415
- it('When the default color block is in selected state in the \'Border color\' section of \'List Container\', then the background color of the container in the specify correct answer section should be the default selected color', () => {
514
+ if (containerType === "DropDown")
515
+ {
516
+ borderStyles = '1px solid'
517
+ }
518
+ it('When the default color block is in selected state in the \'Border color\' section of \'List Container\' or \'DropDown\', then the background color of the container/dropdown in the specify correct answer section should be the default selected color', () => {
416
519
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(6);
417
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer('2px dotted rgb(82, 0, 255)');
520
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown(`${borderStyles} rgb(82, 0, 255)`, containerType);
418
521
  });
419
522
 
420
- it('When the user selects the "None" color block of \'List Container\', it should get in selected state and the no background color should be present for the container in the specify correct answer section', () => {
523
+ it('When the user selects the "None" color block of \'List Container\' or \'DropDown\', it should get in selected state and the no background color should be present for the container/dropdown in the specify correct answer section', () => {
421
524
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(7);
422
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer('2px dotted rgb(255, 255, 255)');
525
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown(`${borderStyles} rgb(255, 255, 255)`, containerType);
423
526
  });
424
527
 
425
- it('When the user clicks on the "Edit color" button of \'List Container\', modifies color for the selected color block, then the background color of the container in the specify correct answer section should be the modified selected color', () => {
528
+ it('When the user clicks on the "Edit color" button of \'List Container\' or \'DropDown\', modifies color for the selected color block, then the background color of the container/dropdown in the specify correct answer section should be the modified selected color', () => {
426
529
  listOrderingCommonStyleAndLayoutComponent.steps.editColor(3);
427
530
  colorPopupComponent.steps.clickInColorSaturationPalette();
428
531
  colorPopupComponent.steps.clickOnOkButton();
429
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer(`2px dotted ${modifiedColor}`);
532
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown(`${borderStyles} ${modifiedColor}`, containerType);
430
533
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(6);
431
534
  });
432
535
  },
433
536
 
537
+ /**
538
+ * Verifies whether correct border style is getting displayed for the options
539
+ * By default solid will be the border style
540
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
541
+ */
434
542
  verifyBorderStyleFunctionalityEditTab: (listType) => {
435
543
  const borderStyles = ["Dotted", "Solid"]
436
544
  it('When the \'Solid\' border style is in selected state, then the border style of the container in the specify correct answer section should be "Solid"', () => {
@@ -445,20 +553,35 @@ const tests = {
445
553
  })
446
554
  },
447
555
 
448
- verifyBorderStyleFunctionalityOfListContainerEditTab: () => {
556
+ /**
557
+ * Verifies whether correct border style is getting displayed for drag and drop container or drop down options
558
+ * By default solid will be the border style for drop-down and dotted will be the border style for drag and drop container
559
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
560
+ */
561
+ verifyBorderStyleFunctionalityOfListContainerOrDropDownContainerEditTab: (containerType) => {
449
562
  const borderStyles = ["Dotted", "Solid", "None"]
450
- it('When the \'Dotted\' border style of \'List Container\' is in selected state, then the border style of the options in the specify correct answer section should be "Solid"', () => {
451
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainer('dotted');
563
+ let borderStyle = 'dotted'
564
+
565
+ if (containerType === "DropDown")
566
+ {
567
+ borderStyle = borderStyles[1]
568
+ }
569
+ it('When the \'Dotted\' border style of \'List Container\' or the \'Solid\' border style of \'DropDown\' is in selected state, then the border style of the container/dropdown in the specify correct answer section should be "Solid"', () => {
570
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown(`${borderStyle}`);
452
571
  });
453
572
 
454
573
  borderStyles.forEach((style) => {
455
- it(`When the user selects ${style} of \'List Container\', then the border style of the options in the specify correct answer section should update to ${style}`, () => {
574
+ it(`When the user selects ${style} of \'List Container\' or \'DropDown\', then the border style of the container/dropdown in the specify correct answer section should update to ${style}`, () => {
456
575
  listOrderingCommonStyleAndLayoutComponent.steps.selectBorderStyleToggleButtonOfListContainer(style);
457
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainer(style);
576
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown(style);
458
577
  });
459
578
  })
460
579
  },
461
580
 
581
+ /**
582
+ * Verifies whether correct color is getting displayed inside the options in preview tab
583
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
584
+ */
462
585
  verifyFillColorFunctionalityPreviewTab: (listType) => {
463
586
  const modifiedColor = 'rgb(121, 60, 60)'
464
587
 
@@ -484,19 +607,23 @@ const tests = {
484
607
  });
485
608
  },
486
609
 
487
- verifyFillColorFunctionalityOfListContainerPreviewTab: () => {
610
+ /**
611
+ * Verifies whether correct color is getting displayed inside drag and drop container in preview tab
612
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
613
+ */
614
+ verifyFillColorFunctionalityOfListContainerPreviewTab: (containerType) => {
488
615
  const modifiedColor = 'rgb(121, 60, 60)'
489
616
 
490
617
  it('When the default color block is in selected state in the \'Fill color\' section of \'List Container\', then the background color of the container in the preview tab should be the default selected color', () => {
491
618
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
492
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer('rgb(245, 248, 255)');
619
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(245, 248, 255)', containerType);
493
620
  });
494
621
 
495
622
  it('When the user selects the \'None\' color block of \'List Container\', it should get in selected state and the no background color should be present for the container in the preview tab', () => {
496
623
  listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
497
624
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(5);
498
625
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
499
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer('rgb(255, 255, 255)');
626
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(255, 255, 255)', containerType);
500
627
  });
501
628
 
502
629
  it('When the user clicks on the \'Edit color\' button of \'List Container\', modifies color for the selected color block, then the color block should get updated accordingly', () => {
@@ -505,10 +632,46 @@ const tests = {
505
632
  colorPopupComponent.steps.clickInColorSaturationPalette();
506
633
  colorPopupComponent.steps.clickOnOkButton();
507
634
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
508
- listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainer(modifiedColor);
635
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown(modifiedColor, containerType);
636
+ });
637
+ },
638
+
639
+ /**
640
+ * Verifies whether correct color is getting displayed inside drop down options in preview tab
641
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
642
+ */
643
+ verifyFillColorFunctionalityOfDropDownContainerPreviewTab: (containerType) => {
644
+ const modifiedColor = 'rgb(121, 60, 60)'
645
+
646
+ it('When the default color block is in selected state in the \'Fill color\' section of \'DropDown\', then the background color of the drop down in the preview tab should be the default selected color', () => {
647
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
648
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
649
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(245, 248, 255)', containerType);
650
+ });
651
+
652
+ it('When the user selects the \'None\' color block of \'DropDown\', it should get in selected state and the no background color should be present for the drop down in the preview tab', () => {
653
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
654
+ listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(5);
655
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
656
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
657
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown('rgb(255, 255, 255)', containerType);
658
+ });
659
+
660
+ it('When the user clicks on the \'Edit color\' button of \'DropDown\', modifies color for the selected color block, then the color block should get updated accordingly', () => {
661
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
662
+ listOrderingCommonStyleAndLayoutComponent.steps.editColor(2);
663
+ colorPopupComponent.steps.clickInColorSaturationPalette();
664
+ colorPopupComponent.steps.clickOnOkButton();
665
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
666
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
667
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyFillColorOfListContainerOrDropDown(modifiedColor, containerType);
509
668
  });
510
669
  },
511
670
 
671
+ /**
672
+ * Verifies whether correct border color is getting displayed for the options in preview tab
673
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
674
+ */
512
675
  verifyBorderColorFunctionalityPreviewTab: (listType) => {
513
676
  const modifiedColor = 'rgb(121, 60, 60)'
514
677
 
@@ -536,6 +699,10 @@ const tests = {
536
699
  });
537
700
  },
538
701
 
702
+ /**
703
+ * Verifies whether correct border color is getting displayed for drag and drop container in preview tab
704
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
705
+ */
539
706
  verifyBorderColorFunctionalityOfListConatinerPreviewTab: () => {
540
707
  const modifiedColor = 'rgb(121, 60, 60)'
541
708
 
@@ -544,14 +711,14 @@ const tests = {
544
711
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(4);
545
712
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(6);
546
713
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
547
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer('2px dotted rgb(82, 0, 255)');
714
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown('2px dotted rgb(82, 0, 255)');
548
715
  });
549
716
 
550
717
  it('When the user selects the \'None\' color block of \'List Container\', it should get in selected state and the no background color should be present for the container in the preview tab', () => {
551
718
  listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
552
719
  listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(7);
553
720
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
554
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer('2px dotted rgb(255, 255, 255)');
721
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown('2px dotted rgb(255, 255, 255)');
555
722
  });
556
723
 
557
724
  it('When the user clicks on the \'Edit color\' button of \'List Container\', modifies color for the selected color block, then the color block should get updated accordingly', () => {
@@ -560,10 +727,50 @@ const tests = {
560
727
  colorPopupComponent.steps.clickInColorSaturationPalette();
561
728
  colorPopupComponent.steps.clickOnOkButton();
562
729
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
563
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainer(`2px dotted ${modifiedColor}`);
730
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown(`2px dotted ${modifiedColor}`);
564
731
  });
565
732
  },
566
733
 
734
+ /**
735
+ * Verifies whether correct border color is getting displayed for drop down options in preview tab
736
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
737
+ */
738
+ verifyBorderColorFunctionalityOfDropDownContainerPreviewTab: (containerType) => {
739
+ const modifiedColor = 'rgb(121, 60, 60)'
740
+
741
+ it('When the default color block is in selected state in the \'Border color\' section of \'DropDown\', then the background color of the container in the preview tab should be the default selected color', () => {
742
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
743
+ listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(4);
744
+ listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(6);
745
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
746
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
747
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown('1px solid rgb(82, 0, 255)', containerType);
748
+ });
749
+
750
+ it('When the user selects the \'None\' color block of \'DropDown\', it should get in selected state and the no background color should be present for the container in the preview tab', () => {
751
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
752
+ listOrderingCommonStyleAndLayoutComponent.steps.selectColorBlock(7);
753
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
754
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
755
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown('1px solid rgb(255, 255, 255)', containerType);
756
+ });
757
+
758
+ it('When the user clicks on the \'Edit color\' button of \'DropDown\', modifies color for the selected color block, then the color block should get updated accordingly', () => {
759
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
760
+ listOrderingCommonStyleAndLayoutComponent.steps.editColor(3);
761
+ colorPopupComponent.steps.clickInColorSaturationPalette();
762
+ colorPopupComponent.steps.clickOnOkButton();
763
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
764
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
765
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderColorOfListContainerOrDropDown(`1px solid ${modifiedColor}`, containerType);
766
+ });
767
+ },
768
+
769
+ /**
770
+ * Verifies whether correct border style is getting displayed for the options in preview tab
771
+ * By default solid will be the border style
772
+ * @param {string} listType - Three list type :- 'SameList', 'SeperateList' and 'DropDown'
773
+ */
567
774
  verifyBorderStyleFunctionalityPreviewTab: (listType) => {
568
775
  const borderStyles = ["Dotted", "Solid"]
569
776
  it('When the "Solid" border style is in selected state, then the border style of the text options in the preview tab should be "solid"', () => {
@@ -580,10 +787,15 @@ const tests = {
580
787
  })
581
788
  },
582
789
 
790
+ /**
791
+ * Verifies whether correct border style is getting displayed for drag and drop container in preview tab
792
+ * By default solid will be the border style for drop-down and dotted will be the border style for drag and drop container
793
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
794
+ */
583
795
  verifyBorderStyleFunctionalityOfListContainerPreviewTab: () => {
584
796
  const borderStyles = ["Dotted", "Solid", "None"]
585
797
  it('When the \'Dotted\' border style of \'List Container\' is in selected state, then the border style of the text containers in the preview tab should be "solid"', () => {
586
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainer('dotted');
798
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown('dotted');
587
799
  });
588
800
 
589
801
  borderStyles.forEach((style) => {
@@ -591,7 +803,29 @@ const tests = {
591
803
  listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
592
804
  listOrderingCommonStyleAndLayoutComponent.steps.selectBorderStyleToggleButtonOfListContainer(style);
593
805
  listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
594
- listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainer(style);
806
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown(style);
807
+ });
808
+ })
809
+ },
810
+
811
+ /**
812
+ * Verifies whether correct border style is getting displayed for drop down options in preview tab
813
+ * By default solid will be the border style for drop-down and dotted will be the border style for drag and drop container
814
+ * @param {string} containerType - Two container type :- 'ListContainer'and 'DropDown'
815
+ */
816
+ verifyBorderStyleFunctionalityOfDropDownPreviewTab: () => {
817
+ const borderStyles = ["Dotted", "Solid", "None"]
818
+ it('When the \'Dotted\' border style of \'DropDown\' is in selected state, then the border style of the text containers in the preview tab should be "solid"', () => {
819
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown('solid');
820
+ });
821
+
822
+ borderStyles.forEach((style) => {
823
+ it(`When the user selects ${style} of \'DropDown\', then the border style of the text containers in the preview tab should update to ${style}`, () => {
824
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToEditTab();
825
+ listOrderingCommonStyleAndLayoutComponent.steps.selectBorderStyleToggleButtonOfListContainer(style);
826
+ listOrderingCommonStyleAndLayoutComponent.steps.switchToPreviewTab();
827
+ listOrderingCommonStyleAndLayoutComponent.steps.selectPositionForAllOptionsPreviewTab([{ optionIndex: 0, position: '2' }, { optionIndex: 1, position: '1' }, { optionIndex: 2, position: '3' }, { optionIndex: 3, position: '4' }]);
828
+ listOrderingCommonStyleAndLayoutComponent.steps.verifyBorderStyleOfListContainerOrDropDown(style);
595
829
  });
596
830
  })
597
831
  },
@@ -33,7 +33,8 @@ const selectors = {
33
33
  //Specify correct answer section
34
34
  dropzoneSpecifyCorrectAnswerSection: () => cy.get('[class="droppable-area"] [role="button"]'),
35
35
  optionContainerOptionsSpecifyCorrectAnswerSection: () => cy.get('.draggable-selected-item'),
36
- optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.draggable-wrapper'), addAlternateButtonSpecifyCorrectAnswer: () => cy.get('.alternate-option-btn-wrapper button'),
36
+ optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.draggable-wrapper'),
37
+ addAlternateButtonSpecifyCorrectAnswer: () => cy.get('.alternate-option-btn-wrapper button'),
37
38
  selectedAlternateAnswerCountSpecifyCorrectAnswer: () => cy.get('.selected-option-wrapper'),
38
39
  alternateAnswerPopup: () => cy.get('.alternate-option-popup-wrapper'),
39
40
  alternateAnswerPopupTitle: () => cy.get('.alternate-option-title-wrapper div').eq(0),
@@ -118,7 +118,7 @@ const selectors = {
118
118
  connectorIcon: () => cy.get('[class*="ListOrderingResponsestyles__ShowIconWrapper"]'),
119
119
  connectorType: () => cy.get('[class*="StyleAndLayoutCustomizationstyles__DropzoneConnectorOptionsWrapper"] [type="button"]'),
120
120
  fillAndBorderColorWrapper: () => cy.get('[class*="DraggableOptionsstyles__ColorOptionWrapper"]'),
121
- listContainerLabel: () => cy.get('.dropzone-label'),
121
+ listContainerAndDropDownLabel: () => cy.get('.dropzone-label'),
122
122
  specifyCorrectanswerSectionOptionSeperateList: () => cy.get('[class*="DraggableItemstyle__ItemWrapper"]'),
123
123
  draggableOptionPanelLabel: () => cy.get('.draggable-option-panel-label'),
124
124
  panelPlacementLabel: () => cy.get('.panel-placement-style .options-label'),
@@ -54,7 +54,7 @@ const selectors = {
54
54
  noConnectorButton: () => cy.get('button[aria-label*="Matching layout No connectors"]'),
55
55
  connectorLabel: () => cy.get('button[aria-label*="Matching layout Connectors"] .ngie-toggle-button-label'),
56
56
  noConnectorLabel: () => cy.get('button[aria-label*="Matching layout No connectors"] .ngie-toggle-button-label'),
57
- optionInnnerFieldInputFieldDropdown: () => cy.get(' .edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] .MuiOutlinedInput-inputAdornedStart'),
57
+ optionInnerFieldInputFieldDropdown: () => cy.get(' .edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] .MuiOutlinedInput-inputAdornedStart'),
58
58
  //Specify correct answer section
59
59
  connectorIcon: () => cy.get('.correct-answer-accordion [class*="ClozeWithDragAndDropstyles__ShowIconWrapper"]'),
60
60
  dropzoneSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-wrapper .authoring-droppable-hotspot-wrapper'),