itemengine-cypress-automation 1.0.205 → 1.0.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/gridSettings.js +3 -3
  3. package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +2 -0
  4. package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +17 -17
  5. package/cypress/e2e/ILC/ChartsBar/selectChartTypeSection.js +747 -0
  6. package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +1 -1
  7. package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +7 -7
  8. package/cypress/e2e/ILC/EssayResponse/additionalSettings.js +257 -0
  9. package/cypress/e2e/ILC/EssayResponse/toolSettings.js +73 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +1 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsBasic.js +2 -2
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsForDropdowns.js +1 -1
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +3 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +2 -2
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +3 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +2 -2
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +1 -1
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +4 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +29 -26
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +1 -1
  26. package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +1 -1
  27. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -3
  29. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +1 -1
  30. package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +707 -0
  31. package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +4 -3
  32. package/cypress/pages/chartsBarPage.js +212 -35
  33. package/cypress/pages/chartsDotPlotPage.js +10 -25
  34. package/cypress/pages/components/barAndLineChartComponent.js +54 -5
  35. package/cypress/pages/components/chartsCommonComponent.js +16 -1
  36. package/cypress/pages/components/createQuestionBasePage.js +1 -1
  37. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  38. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  39. package/cypress/pages/essayResponsePage.js +152 -2
  40. package/cypress/pages/imageHighlightPage.js +398 -15
  41. package/cypress/pages/matchingPage.js +1 -0
  42. package/package.json +1 -1
@@ -109,6 +109,7 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
109
109
  imageHighlightPage.steps.uploadFile('highlightImage.jpg');
110
110
  imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
111
111
  imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
112
+ imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
112
113
  imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
113
114
  imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
114
115
  imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
@@ -120,7 +121,7 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
120
121
  imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
121
122
  imageHighlightPage.steps.switchToPreviewTab();
122
123
  imageHighlightPage.steps.highlightARegionInPreviewTab(0);
123
- imageHighlightPage.steps.verifyFillInHighlightRegionPreviewTabSection(3);
124
+ imageHighlightPage.steps.verifyFillInHighlightRegionPreviewTabSection(0);
124
125
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(1);
125
126
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(2);
126
127
  imageHighlightPage.steps.switchToEditTab();
@@ -131,7 +132,7 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
131
132
  imageHighlightPage.steps.verifyToggleButtonSelected('Outline');
132
133
  imageHighlightPage.steps.switchToPreviewTab();
133
134
  imageHighlightPage.steps.highlightARegionInPreviewTab(0);
134
- imageHighlightPage.steps.verifyOutlineHighlightRegionPreviewTabSection(3);
135
+ imageHighlightPage.steps.verifyOutlineHighlightRegionPreviewTabSection(0);
135
136
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(1);
136
137
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(2);
137
138
  imageHighlightPage.steps.switchToEditTab();
@@ -142,7 +143,7 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
142
143
  imageHighlightPage.steps.verifyToggleButtonSelected('Pattern');
143
144
  imageHighlightPage.steps.switchToPreviewTab();
144
145
  imageHighlightPage.steps.highlightARegionInPreviewTab(0);
145
- imageHighlightPage.steps.verifyPatternHighlightRegionPreviewTabSection(3);
146
+ imageHighlightPage.steps.verifyPatternHighlightRegionPreviewTabSection(0);
146
147
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(1);
147
148
  imageHighlightPage.steps.verifyDefaultHighlightRegionSpecifyCorrectAnswer(2);
148
149
  });
@@ -14,9 +14,9 @@ const selectors = {
14
14
  ...autoScoredScoringPreviewTab,
15
15
  ...correctIncorrectAnswerLabelComponent,
16
16
  ...chartsCommonComponent,
17
- ...selectQuestionResourceToolPage,
18
17
  ...autoScoredSpecifyCorrectAnswerSection,
19
18
  ...layoutSectionComponent,
19
+ ...selectQuestionResourceToolPage,
20
20
 
21
21
  barDragHandle: () => cy.get('.bar-drag-handle'),
22
22
  bar: () => cy.get('.ngie-chart-point'),
@@ -51,6 +51,7 @@ const selectors = {
51
51
  barLabelHorizontalSelectChartType: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartGridstyle__ValueDiv"]'),
52
52
  selectChartTypeMaxXAndYLabel: () => cy.get('[class*="ChartsPreviewstyles__CustomInputFieldLabel"]'),
53
53
  selectChartTypeMaxXAndYInputField: () => cy.get('[class*="ChartsPreviewstyles__CustomInputFieldWrapper"] input'),
54
+ colorBlockBarTooltipSelectChartType: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartTooltipstyles__ColorBox"]'),
54
55
 
55
56
  //specify correct answer section
56
57
  specifyCorrectAnswerBarDragHandle: () => cy.get('.ngie-accordion .bar-drag-handle'),
@@ -68,6 +69,7 @@ const selectors = {
68
69
  previewTabBarTooltipColorBlock: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartTooltipstyles__ColorBox"]'),
69
70
  xAxisCoordinatePreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartGridstyle__HorizontalNameDiv"]'),
70
71
  barLabelHorizontalPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartGridstyle__ValueDiv"]'),
72
+ previewTabToolsAddBarButton: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button[aria-label="Add bar"]'),
71
73
  }
72
74
 
73
75
  const steps = {
@@ -84,6 +86,7 @@ const steps = {
84
86
  ...layoutSectionComponent.steps,
85
87
  ...chartsCommonComponent.steps,
86
88
  ...dialogBoxBase.steps,
89
+ ...selectQuestionResourceToolPage.steps,
87
90
  /**
88
91
  * @description set the bar height/value in the select chart type section chart
89
92
  * @param {Object} barProperties - The properties and changes to be done on the bar
@@ -120,7 +123,7 @@ const steps = {
120
123
  * @description updates height of bar once
121
124
  * @param {number} barIndex index of bar
122
125
  */
123
- keyBoardUpBarInSelectChartType: (barIndex) => {
126
+ incrementBarValueUsingUpArrowSelectChartType: (barIndex) => {
124
127
  utilities.getNthElement(chartsBarPage.selectChartTypeBarDragHandle(), barIndex)
125
128
  .focus()
126
129
  .type('{upArrow}');
@@ -139,6 +142,77 @@ const steps = {
139
142
  .should('have.attr', 'height', barHeight);
140
143
  },
141
144
 
145
+ /**
146
+ * @description verify locked bar
147
+ * @param {Object} barProperties - The properties and changes to be done on the bar
148
+ * @param {number} barProperties.barIndex index of the bar
149
+ * @param {number} barProperties.barValue value of th bar as per Y axis
150
+ * @param {number} barProperties.range Maximum value of the axis on which bar value is determined
151
+ */
152
+ verifyLockedBarInSelectChartType: ({ barIndex, barValue, range }) => {
153
+ chartsBarPage.steps.verifyBarHeightInSelectChartType({ barIndex, barValue, range });
154
+ chartsBarPage.chartContainerSelectChartType()
155
+ .within(() => {
156
+ utilities.getNthElement(chartsBarPage.bar(), barIndex)
157
+ .within(() => {
158
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'visible');
159
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'notExist');
160
+ });
161
+ });
162
+ },
163
+
164
+ /**
165
+ * @description verify unlocked bar
166
+ * @param {number} index index of the bar
167
+ */
168
+ verifyUnlockedBarInSelectChartType: (index) => {
169
+ chartsBarPage.chartContainerSelectChartType()
170
+ .within(() => {
171
+ utilities.getNthElement(chartsBarPage.bar(), index)
172
+ .within(() => {
173
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'notExist');
174
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'visible');
175
+ });
176
+ });
177
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), index));
178
+ chartsBarPage.steps.verifyLockUnlockButtonIcon('Unlocked');
179
+ utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), index));
180
+ },
181
+
182
+ /**
183
+ * Verify locked bar is uneditable
184
+ * @param {number} barIndex index of the bar
185
+ */
186
+ verifyLockedBarIsNotEditableInSelectChartType: (barIndex) => {
187
+ utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex)
188
+ .invoke('attr', 'height')
189
+ .then((barValue) => {
190
+ let originalBarValue = barValue;
191
+ utilities.verifyElementVisibilityState(chartsBarPage.dragHandleButton(), 'notExist');
192
+ utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex)
193
+ .should('have.attr', 'height', originalBarValue);
194
+ });
195
+ },
196
+
197
+ /**
198
+ * @param {number} barIndex index of the bar
199
+ */
200
+ decrementBarValueUsingDownArrowSelectChartType: (barIndex) => {
201
+ utilities.getNthElement(chartsBarPage.selectChartTypeBarDragHandle(), barIndex)
202
+ .focus()
203
+ .type('{downArrow}');
204
+ },
205
+
206
+ /**
207
+ * @description Delete bar
208
+ *@param {number} barIndex Index of the bar to be deleted
209
+ */
210
+ deleteBarInSelectChartType: (barIndex) => {
211
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex))
212
+ chartsBarPage.barAndPointTooltipDeleteButton()
213
+ .click();
214
+ },
215
+
142
216
  /**
143
217
  * @description increase the bar height/value in the specify correct answer section chart
144
218
  * @description set the bar height/value in the specify correct answer section chart
@@ -176,7 +250,7 @@ const steps = {
176
250
  * @description updates height of bar once
177
251
  * @param {number} barIndex index of bar
178
252
  */
179
- keyBoardUpBarInSpecifyCorrectAnswer: (barIndex) => {
253
+ increaseBarValueUsingUpArrowInSpecifyCorrectAnswer: (barIndex) => {
180
254
  utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarDragHandle(), barIndex)
181
255
  .focus()
182
256
  .type('{upArrow}');
@@ -212,6 +286,23 @@ const steps = {
212
286
  });
213
287
  },
214
288
 
289
+ /**
290
+ * @description Unlock the bar in select chart type section chart
291
+ * @param {number} barIndex Index of the bar to be unlocked
292
+ */
293
+ unlockBar: (barIndex) => {
294
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex))
295
+ chartsBarPage.barAndPointTooltipLockUnlockButton()
296
+ .click();
297
+ chartsBarPage.barAndPointTooltipLockUnlockButton()
298
+ .should('have.attr', 'aria-label', 'unlocked bar');
299
+ utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex));
300
+ utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex)
301
+ .within(() => {
302
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'notExist');
303
+ });
304
+ },
305
+
215
306
  /**
216
307
  * @description Edit bar label in select chart type section chart
217
308
  * @param {number} barIndex Index of the bar to be edited
@@ -264,21 +355,6 @@ const steps = {
264
355
  });
265
356
  },
266
357
 
267
- /**
268
- * Verify the bar is locked in correct answer section
269
- * @param {number} barIndex index of the bar
270
- */
271
- verifyBarIsLockedInSpecifyCorrectAnswer: (barIndex) => {
272
- chartsBarPage.chartContainerSpecifyCorrectAnswer()
273
- .within(() => {
274
- utilities.getNthElement(chartsBarPage.bar(), barIndex)
275
- .within(() => {
276
- utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'visible');
277
- utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'notExist');
278
- });
279
- });
280
- },
281
-
282
358
  /**
283
359
  * Verify the correct/incorrect icon not exists for bar
284
360
  * @param {number} barIndex index of the bar
@@ -302,15 +378,37 @@ const steps = {
302
378
  */
303
379
  verifyLockedBarInSpecifyCorrectAnswer: ({ barIndex, barValue, range }) => {
304
380
  chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex, barValue, range });
305
- chartsBarPage.steps.verifyBarIsLockedInSpecifyCorrectAnswer(barIndex);
381
+ chartsBarPage.chartContainerSpecifyCorrectAnswer()
382
+ .within(() => {
383
+ utilities.getNthElement(chartsBarPage.bar(), barIndex)
384
+ .within(() => {
385
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'visible');
386
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'notExist');
387
+ });
388
+ });
306
389
  chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInSpecifyCorrectAnswer(barIndex);
307
390
  },
308
391
 
309
392
  /**
310
- * Verify locked bar is uneditable in preview tab
393
+ * @description verify unlocked bar
394
+ * @param {number} index index of the bar
395
+ */
396
+ verifyUnlockedBarInSpecifyCorrectAnswer: (index) => {
397
+ chartsBarPage.chartContainerSpecifyCorrectAnswer()
398
+ .within(() => {
399
+ utilities.getNthElement(chartsBarPage.bar(), index)
400
+ .within(() => {
401
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'notExist');
402
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'visible');
403
+ });
404
+ });
405
+ },
406
+
407
+ /**
408
+ * Verify locked bar is uneditable
311
409
  * @param {number} barIndex index of the bar
312
410
  */
313
- verifyLockedBarIsUneditableInSpecifyCorrectAnswer: (barIndex) => {
411
+ verifyLockedBarIsNotEditableInSpecifyCorrectAnswer: (barIndex) => {
314
412
  utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex)
315
413
  .invoke('attr', 'height')
316
414
  .then((barValue) => {
@@ -415,13 +513,13 @@ const steps = {
415
513
  });
416
514
  },
417
515
 
418
- keyBoardUpBarInPreviewTab: (barIndex) => {
516
+ increaseBarValueUsingUpArrowInPreviewTab: (barIndex) => {
419
517
  utilities.getNthElement(chartsBarPage.previewTabBarDragHandle(), barIndex)
420
518
  .focus()
421
519
  .type('{upArrow}');
422
520
  },
423
521
 
424
- keyBoardDownBarInPreviewTab: (barIndex) => {
522
+ decreaseBarValueUsingDownArrowInPreviewTab: (barIndex) => {
425
523
  utilities.getNthElement(chartsBarPage.previewTabBarDragHandle(), barIndex)
426
524
  .focus()
427
525
  .type('{downArrow}');
@@ -452,16 +550,6 @@ const steps = {
452
550
  .click();
453
551
  },
454
552
 
455
- /**
456
- * @description Delete bar in specify correct answer section
457
- * @param {number} barIndex Index of the bar to be deleted
458
- */
459
- deleteBarInSpecifyCorrectAnswerSection: (barIndex) => {
460
- utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex))
461
- chartsBarPage.barAndPointTooltipDeleteButton()
462
- .click();
463
- },
464
-
465
553
  /**
466
554
  * Verify the bar height in correct answer section tab
467
555
  * @param {Object} barProperties - The properties of the bar
@@ -495,6 +583,21 @@ const steps = {
495
583
  });
496
584
  },
497
585
 
586
+ /**
587
+ * @description verify unlocked bar
588
+ * @param {number} index index of the bar
589
+ */
590
+ verifyUnlockedBarInPreviewTab: (index) => {
591
+ chartsBarPage.chartsContainerPreviewTab()
592
+ .within(() => {
593
+ utilities.getNthElement(chartsBarPage.bar(), index)
594
+ .within(() => {
595
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'notExist');
596
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'visible');
597
+ });
598
+ });
599
+ },
600
+
498
601
  /**
499
602
  * Verify the correct/incorrect icon of bar in preview tab
500
603
  * @param {number} barIndex index of the bar
@@ -665,7 +768,27 @@ const steps = {
665
768
  * @param {number} max - The expected maximum value.
666
769
  */
667
770
  verifyMaxValueOnYAxis: (max) => {
668
- chartsBarPage.selectChartTypeBarLabel()
771
+ chartsBarPage.yAxisCoordinate()
772
+ .eq(0)
773
+ .should('have.text', max);
774
+ },
775
+
776
+ /**
777
+ * Verifies the maximum value label on the y-axis
778
+ * @param {number} max - The expected maximum value.
779
+ */
780
+ verifyMaxValueOnYAxisSpecifyCorrectAnswer: (max) => {
781
+ chartsBarPage.yAxisCoordinateSpecifyCorrectAnswer()
782
+ .eq(0)
783
+ .should('have.text', max);
784
+ },
785
+
786
+ /**
787
+ * Verifies the maximum value label on the y-axis
788
+ * @param {number} max - The expected maximum value.
789
+ */
790
+ verifyMaxValueOnYAxisPreviewTab: (max) => {
791
+ chartsBarPage.previewTabYAxisCoordinate()
669
792
  .eq(0)
670
793
  .should('have.text', max);
671
794
  },
@@ -1088,9 +1211,9 @@ const tests = {
1088
1211
  ...autoScoredSpecifyCorrectAnswerSection.tests,
1089
1212
  ...autoScoredStudentViewSettings.tests,
1090
1213
  ...studentViewSettingsLabelComponent.tests,
1214
+ ...layoutSectionComponent.tests,
1091
1215
  ...createQuestionBasePage.tests,
1092
1216
  ...commonComponents.tests,
1093
- ...layoutSectionComponent.tests,
1094
1217
 
1095
1218
  /**
1096
1219
  * Verify bar tooltip contents with css and a11y in preview tab
@@ -1245,6 +1368,60 @@ const tests = {
1245
1368
  utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
1246
1369
  });
1247
1370
  },
1371
+
1372
+ /**
1373
+ * Verify bar tooltip contents with css and a11y
1374
+ * @param {number} barIndex index of the bar
1375
+ * @param {string} barBackground rgb value of the bar background
1376
+ * @param {string} barLabel label of the bar
1377
+ */
1378
+ verifyBarTooltipContentsCSSAndA11yInSelectChartType: (barIndex, barBackground, barLabel) => {
1379
+ it('When user hovers over the bar, then bar tooltip should be displayed', () => {
1380
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex));
1381
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'visible');
1382
+ });
1383
+
1384
+ it('The bar tooltip should contain lock bar button, bar background color block, bar label button, and delete button', () => {
1385
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipLockUnlockButton(), 'visible');
1386
+ utilities.verifyCSS(chartsBarPage.colorBlockBarTooltipSelectChartType(), {
1387
+ 'background-color': barBackground
1388
+ });
1389
+ utilities.verifyInnerText(barAndLineChartComponent.barAndPointTooltipLabelButton(), barLabel);
1390
+ utilities.verifyElementVisibilityState(barAndLineChartComponent.barAndPointTooltipDeleteButton(), 'visible');
1391
+ });
1392
+
1393
+ it('By default, lock bar button should be in unlocked state', () => {
1394
+ chartsBarPage.steps.verifyLockUnlockButtonIcon('Unlocked');
1395
+ });
1396
+
1397
+ it('When user hovers on the lock bar button, then \'Unlocked bar\' tooltip should be displayed', () => {
1398
+ chartsBarPage.steps.verifyTooltipInnerText(chartsBarPage.barAndPointTooltipLockUnlockButton, 'Unlocked bar');
1399
+ });
1400
+
1401
+ it('When user hovers on the delete button, then \'Delete bar\' tooltip should be displayed', () => {
1402
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex));
1403
+ chartsBarPage.barAndPointTooltipDeleteButton()
1404
+ .verifyTooltip('Delete bar');
1405
+ });
1406
+
1407
+ it('CSS of delete bar tooltip', { tags: 'css' }, () => {
1408
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex));
1409
+ utilities.triggerMouseover(chartsBarPage.barAndPointTooltipDeleteButton());
1410
+ barAndLineChartComponent.barAndPointTooltipDeleteButton()
1411
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
1412
+ });
1413
+
1414
+ it('Accessibility of delete bar tooltip', { tags: 'a11y' }, () => {
1415
+ utilities.triggerMouseover(chartsBarPage.barAndPointTooltipDeleteButton());
1416
+ cy.checkAccessibility(chartsBarPage.barAndPointTooltipWrapper());
1417
+ utilities.triggerMouseout(chartsBarPage.barAndPointTooltipDeleteButton());
1418
+ });
1419
+
1420
+ it('When user hovers away from the bar, then bar tooltip should be not be displayed', () => {
1421
+ utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex));
1422
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
1423
+ });
1424
+ },
1248
1425
  }
1249
1426
 
1250
1427
  export const chartsBarPage = {
@@ -120,21 +120,6 @@ const steps = {
120
120
  ...selectQuestionResourceToolPage.steps,
121
121
  ...dialogBoxBase.steps,
122
122
 
123
- /**
124
- * @param {string} element denotes element
125
- * @param {string} text denotes tooltip text
126
- * @description function is used to hover over element and verify inner text of its tooltip
127
- */
128
- verifyTooltipInnerText: (element, text, index = null) => {
129
- element()
130
- .eq(index)
131
- .trigger('mouseover', { force: true });
132
- utilities.verifyInnerText(commonComponents.tooltipText(), text);
133
- element()
134
- .eq(index)
135
- .trigger('mouseout', { force: true });
136
- },
137
-
138
123
  //select chart type
139
124
  selectDotPlot: () => {
140
125
  chartsDotPlotPage.dotPlotToggleButton()
@@ -539,11 +524,11 @@ const steps = {
539
524
  });
540
525
  },
541
526
 
542
- /**
543
- * Verify the bar is unlocked
544
- * @param {number} index index of the bar
545
- */
546
- verifyDotColumnIsUnlockedInSelectChartType: ({ point, min, interval }) => {
527
+ /**
528
+ * Verify the bar is unlocked
529
+ * @param {number} index index of the bar
530
+ */
531
+ verifyDotColumnIsUnlockedInSelectChartType: ({ point, min, interval }) => {
547
532
  const index = Math.round((point - min) / interval);
548
533
  utilities.getNthElement(chartsDotPlotPage.dotColumnSelectChartType(), index)
549
534
  .within(() => {
@@ -890,11 +875,11 @@ const steps = {
890
875
  .should('not.exist');
891
876
  },
892
877
 
893
- /**
894
- * Verify the bar is unlocked
895
- * @param {number} index index of the bar
896
- */
897
- verifyDotColumnIsUnlockedInSpecifyCorrectAnswer: ({ point, min, interval }) => {
878
+ /**
879
+ * Verify the bar is unlocked
880
+ * @param {number} index index of the bar
881
+ */
882
+ verifyDotColumnIsUnlockedInSpecifyCorrectAnswer: ({ point, min, interval }) => {
898
883
  const index = Math.round((point - min) / interval);
899
884
  utilities.getNthElement(chartsDotPlotPage.dotColumnSpecifyCorrectAnswer(), index)
900
885
  .within(() => {
@@ -18,7 +18,7 @@ const selectors = {
18
18
  barAndPointTooltipWrapper: () => cy.get('.charts-tooltip-wrapper'),
19
19
  controlOptionsSelectChartType: (toolOptionAriaLabel = null) => {
20
20
  if (toolOptionAriaLabel) {
21
- return cy.get(`('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button[aria-label*="${toolOptionAriaLabel}"]`)
21
+ return cy.get(`[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button[aria-label*="${toolOptionAriaLabel}"]`)
22
22
  } else {
23
23
  return cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button')
24
24
  }
@@ -50,12 +50,13 @@ const selectors = {
50
50
  return cy.get('.ngie-accordion [class*="ChartToolsstyles__ChartToolsWrapper"] button')
51
51
  }
52
52
  },
53
- barAndPointTooltipWrapperSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartTooltipstyles__ChartTooltipWrapper"]'), gridCellSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .grid-cell'),
53
+ barAndPointTooltipWrapperSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartTooltipstyles__ChartTooltipWrapper"]'),
54
+ gridCellSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .grid-cell'),
54
55
  yAxisCoordinateSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartGridstyle__ValueDiv"]'),
55
56
  yAxisLabelSpecifyCorrectAnswer: () => cy.get('.ngie-accordion-detail [class*="ChartsPreviewstyles__LeftWrapper"] .title-container'),
56
57
 
57
58
  //Preview tab
58
- previewTabToolsAddBarOrPointButton: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button').eq(0),
59
+ previewTabToolsAddBarOrPointButton: (ariaLabel) => cy.get(`[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button[aria-label*="${ariaLabel}"]`),
59
60
  previewTabToolsUndoButton: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button').eq(1),
60
61
  previewTabToolsRedoButton: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button').eq(2),
61
62
  previewTabToolsResetButton: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartToolsstyles__ChartToolsWrapper"] button').eq(3),
@@ -84,6 +85,32 @@ const steps = {
84
85
  .should('have.attr', 'data-aria-pressed', 'true');
85
86
  },
86
87
 
88
+ unselectAddBarOrPointToolbarOption: () => {
89
+ barAndLineChartComponent.addBarOrPointOptionButton()
90
+ .click()
91
+ barAndLineChartComponent.addBarOrPointOptionButton()
92
+ .should('have.attr', 'data-aria-pressed', 'false');
93
+ },
94
+
95
+ verifyAddBarOrPointToolbarOptionSelected: () => {
96
+ barAndLineChartComponent.addBarOrPointOptionButton()
97
+ .should('have.attr', 'data-aria-pressed', 'true');
98
+ },
99
+
100
+ verifyAddBarOrPointToolbarOptionUnselected: () => {
101
+ barAndLineChartComponent.addBarOrPointOptionButton()
102
+ .should('have.attr', 'data-aria-pressed', 'false');
103
+ },
104
+
105
+ verifyAddBarOrPointToolbarOptionButton: () => {
106
+ barAndLineChartComponent.addBarOrPointOptionButton()
107
+ .find('.drag-item-flex-wrapper svg')
108
+ .should('exist');
109
+ barAndLineChartComponent.addBarOrPointOptionButton()
110
+ .find('[data-testid="drag-icon-wrapper"]')
111
+ .should('exist');
112
+ },
113
+
87
114
  addBarOrPointInChartInSelectChartTypeSection: () => {
88
115
  barAndLineChartComponent.selectChartTypeChartToolsAddBarOrPointButton()
89
116
  .click();
@@ -148,8 +175,12 @@ const steps = {
148
175
  .click();
149
176
  },
150
177
 
151
- addBarOrPointInChartInPreviewTab: () => {
152
- barAndLineChartComponent.previewTabToolsAddBarOrPointButton()
178
+ /**
179
+ * @description selects add bar or add point button
180
+ * @param {("Add bar"| "Add point")} ariaLabel ariaLabel holds aria-label for the element
181
+ */
182
+ addBarOrPointInChartInPreviewTab: (ariaLabel) => {
183
+ barAndLineChartComponent.previewTabToolsAddBarOrPointButton(ariaLabel)
153
184
  .click();
154
185
  },
155
186
 
@@ -312,6 +343,24 @@ const steps = {
312
343
  barAndLineChartComponent.gridCellPreviewTab()
313
344
  .should('have.css', 'border-top-width', '0px');
314
345
  },
346
+
347
+ /**
348
+ * @description verifies ock unlock icon
349
+ * @param {('Locked'|'Unlocked')} action
350
+ */
351
+ verifyLockUnlockButtonIcon: (action) => {
352
+ if (action === 'Locked') {
353
+ barAndLineChartComponent.barAndPointTooltipLockUnlockButton()
354
+ .find('[id="Lock"]')
355
+ }
356
+ else if (action === 'Unlocked') {
357
+ barAndLineChartComponent.barAndPointTooltipLockUnlockButton()
358
+ .find('[id="Unlock"]')
359
+ .should('exist');
360
+ } else {
361
+ cy.log('Incorrect string')
362
+ }
363
+ }
315
364
  }
316
365
 
317
366
  export const barAndLineChartComponent = {
@@ -214,7 +214,22 @@ const steps = {
214
214
  .blur();
215
215
  chartsCommonComponent.toleranceThresholdInputField()
216
216
  .should('have.value', value)
217
- }
217
+ },
218
+
219
+ /**
220
+ * @param {string} element denotes element
221
+ * @param {string} text denotes tooltip text
222
+ * @description function is used to hover over element and verify inner text of its tooltip
223
+ */
224
+ verifyTooltipInnerText: (element, text, index = null) => {
225
+ element()
226
+ .eq(index)
227
+ .trigger('mouseover', { force: true });
228
+ utilities.verifyInnerText(commonComponents.tooltipText(), text);
229
+ element()
230
+ .eq(index)
231
+ .trigger('mouseout', { force: true });
232
+ },
218
233
  }
219
234
 
220
235
  const tests = {
@@ -259,7 +259,7 @@ const tests = {
259
259
  createQuestionBasePage.steps.switchToPreviewTab();
260
260
  createQuestionBasePage.editTab()
261
261
  .should('not.have.attr', 'aria-selected', 'true');
262
- utilities.verifyElementVisibilityState(createQuestionBasePage.editTabWrapper(), 'hidden');
262
+ utilities.verifyElementVisibilityState(createQuestionBasePage.editTabWrapper(), 'notExist');
263
263
  });
264
264
 
265
265
  it('User should be able to switch back to the \'Edit\' tab', () => {
@@ -9,7 +9,7 @@ const selectors = {
9
9
  borderColorLabel: () => cy.get('.sub-section-label').eq(1),
10
10
  colorBlock: () => cy.get('.color-picker-block'),
11
11
  editColorButton: () => cy.get('button[aria-label="edit color"]'),
12
- borderStyleLabel: () => cy.get('[class*="styles__LabelWrapper"].options-label'),
12
+ borderStyleLabel: () => cy.get('[class*="styles__LabelWrapper"].options-label').last(),
13
13
  dashedBorderStyleToggleButton: () => cy.get('[data-ngie-testid="dashed-toggle-button"]').eq(0),
14
14
  dottedBorderStyleToggleButton: () => cy.get('[data-ngie-testid="dotted-toggle-button"]').eq(0),
15
15
  solidBorderStyleToggleButton: () => cy.get('[data-ngie-testid="solid-toggle-button"]').eq(0),
@@ -355,9 +355,9 @@ const steps = {
355
355
  },
356
356
 
357
357
  /**
358
- * @param {"Insert dropzone"|"Insert text"|"Select dropzone"|"Insert text container"|"Select text container"} {String} button denotes selected button name
359
- *@description function selects button
360
- */
358
+ * @param {"Insert dropzone"|"Insert text"|"Select dropzone"|"Insert text container"|"Select text container"} {String} button denotes selected button name
359
+ *@description function selects button
360
+ */
361
361
  selectCanvasMenuButton: (button) => {
362
362
  if (button == 'Insert dropzone' || button == 'Insert text container' || button == 'Insert dropdown') {
363
363
  imageCanvasComponent.insertResponseAreaButton()