itemengine-cypress-automation 1.0.151-28MarchRepoUpdate-4cfb82e.0 → 1.0.151

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +1 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +3 -3
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabScoring.js +1 -0
  5. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +2 -2
  6. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +25 -25
  7. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +506 -0
  8. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  9. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +155 -0
  10. package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +143 -0
  11. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +1 -1
  12. package/cypress/e2e/ILC/Matching/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  13. package/cypress/e2e/ILC/Matching/draggableOptions.js +180 -0
  14. package/cypress/e2e/ILC/Matching/editTabScoring.js +221 -0
  15. package/cypress/e2e/ILC/Matching/manuallyAndNonScoredEditTab.js +68 -0
  16. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  17. package/cypress/e2e/ILC/Matching/switchingCasesBetweenOptionsLayout.js +49 -0
  18. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -1
  19. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  20. package/cypress/fixtures/theme/ilc.json +7 -1
  21. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  22. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  23. package/cypress/pages/contentBlocksPage.js +30 -1
  24. package/cypress/pages/createItemPage.js +1 -1
  25. package/cypress/pages/essayResponsePage.js +1 -1
  26. package/cypress/pages/graphingPage.js +29 -29
  27. package/cypress/pages/gridFillPage.js +663 -15
  28. package/cypress/pages/itemPreviewSettingsPage.js +3 -3
  29. package/cypress/pages/matchingPage.js +466 -5
  30. package/cypress/pages/shortTextResponsePage.js +1 -0
  31. package/cypress/pages/textEntryMathPage.js +1 -1
  32. package/cypress/pages/textEntryMathWithImagePage.js +1 -1
  33. package/package.json +2 -2
@@ -36,26 +36,51 @@ const selectors = {
36
36
  specifyPointsForEachIncorrectCellRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
37
37
  cellShadeCountInputField: () => cy.get('.grid-fill-response-wrapper [aria-label="labeling"]'),
38
38
  matchExactPositionOfCellsCheckbox: () => cy.get('input[aria-label="Match exact position of cells"]'),
39
- gridSpecifyCorrectAnswerSection: () => cy.get('[class*="AnswerAccordionstyles__AnswerPanel"] .grid-wrapper-cls'),
39
+ gridSpecifyCorrectAnswerSection: () => cy.get('[class*="AnswerAccordionstyles__AnswerPanel"] [class*="GridFillResponsestyles__GridWrapper"]'),
40
40
  gridRow: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]'),
41
41
  cellShadeCountLabel: () => cy.get('[class*="GridFillResponsestyles__CellFillCountLabel"]'),
42
42
  cellShadeCountInputField: () => cy.get('.cell-count-cls input'),
43
+ penaltyPointsForEachIncorrectCellInputField: () => cy.get('input[aria-label="Penalty points for each incorrect cell"]'),
44
+ //student view settings
45
+ maxSelectedCellLabel: () => cy.get('[class*="MaxSelectedCellsstyles__MaxCellsLabel"]'),
46
+ maxSelectedCellInputField: () => cy.get('input[aria-label="Max selected cells"]'),
43
47
  //Customize layout accordion
44
48
  customizeLayoutAccordionButton: () => cy.get('.customize-layout-wrapper-cls .ngie-accordion-summary'),
45
49
  customizeLayoutLabel: () => cy.get('[class*="AdditionalGridFillSettingsstyles__StyledLabel"]'),
46
50
  customizeLayoutAccordionChevronButton: () => cy.get('.customize-layout-wrapper-cls [class*="MuiAccordionSummary-expandIconWrapper "]'),
51
+ shadeTheCellLabel: () => cy.get('[class*="AdditionalGridFillSettingsstyles__LabelTextWrapper"]'),
47
52
  shadeCellButton: () => cy.get('.single-select-toggle-group button').eq(0),
48
53
  hideCellButton: () => cy.get('.single-select-toggle-group button').eq(1),
54
+ shadedCellIcon: () => cy.get('[class*="GridFillResponsestyles__CellHideFillIconWrapper"] g[id*="Group"]'),
55
+ hiddenCellIcon: () => cy.get('[class*="GridFillResponsestyles__CellHideFillIconWrapper"] #Hide_cell'),
56
+ gridCustomizeLayoutSection: () => cy.get('.customize-layout-wrapper-cls [class*="GridFillResponsestyles__GridWrapper"]'),
49
57
  cellInCustomizeLayout: () => cy.get('[id*="Response-cell"]'),
50
58
  rowsWrapperCustomizeLayout: () => cy.get('.customize-layout-wrapper-cls [class*="GridFillResponsestyles__RowContainer"]'),
51
- penaltyPointsForEachIncorrectCellInputField: () => cy.get('input[aria-label="Penalty points for each incorrect cell"]'),
52
- //student view settings
53
- maxSelectedCellLabel: () => cy.get('[class*="MaxSelectedCellsstyles__MaxCellsLabel"]'),
54
- maxSelectedCellInputField: () => cy.get('input[aria-label="Max selected cells"]'),
59
+ lockShadedCellsCheckbox: () => cy.get('[data-ngie-testid="lock-shaded-cells-checkbox"] input'),
60
+ lockShadedCellsLabel: () => cy.get('[data-ngie-testid="lock-shaded-cells-checkbox"] [class*="label"]'),
61
+ outlineCellOnHoverCheckbox: () => cy.get('[data-ngie-testid="outline-cell-on-hover-checkbox"] input'),
62
+ outlineCellOnHoverLabel: () => cy.get('[data-ngie-testid="outline-cell-on-hover-checkbox"] [class*="label"]'),
63
+ canvasTitleLabel: () => cy.get('.canvas-title-wrapper .text-label'),
64
+ canvasTitleInputField: () => cy.get('.canvas-title-wrapper input'),
65
+ gridBordersTitle: () => cy.get('.single-select-toggle-group-title').eq(1),
66
+ fullGridToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(0),
67
+ onlyBorderToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(1),
68
+ noneToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(2),
69
+ gridBorderStyleTitle: () => cy.get('.single-select-toggle-group-title').eq(2),
70
+ solidToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(3),
71
+ dashedToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(4),
72
+ dottedToggleButton: () => cy.get('.single-select-toggle-group-double button').eq(5),
73
+ outerGridBorderTitle: () => cy.get('[class*="CustomizedGridstyles__SwitchLabelWrapper"]'),
74
+ outerGridBorderSwitch: () => cy.get('[class*="CustomizedGridstyles__OuterGridWrapper"] [class*="MuiSwitch-switchBase"]'),
75
+
76
+ //Fill type section
77
+ fillTypeLabel: () => cy.get('[class*="CustomizedGridstyles__LabelTextWrapper"]'),
78
+
55
79
  //Preview tab
56
- gridWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__MatrixContainer"]:visible'),
80
+ gridWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__GridWrapper"]:visible'),
57
81
  cellInPreviewTab: () => cy.get('[class*="GridFillResponsestyles__CellContainer"]:visible'),
58
82
  rowsWrapperPreviewTab: () => cy.get('[class*="GridFillResponsestyles__RowContainer"]:visible'),
83
+ canvasTitlePreviewTab: () => cy.get('[class*="GridFillResponsestyles__CanvasTitleWrapper"]'),
59
84
  warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
60
85
  warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
61
86
  }
@@ -144,6 +169,20 @@ const steps = {
144
169
  .click();
145
170
  },
146
171
 
172
+ verifyCustomizeLayoutAccordionIsCollapsed: () => {
173
+ gridFillPage.customizeLayoutAccordionButton()
174
+ .should('have.attr', 'aria-expanded', 'false');
175
+ gridFillPage.customizeLayoutAccordionChevronButton()
176
+ .should('not.have.class', 'Mui-expanded');
177
+ },
178
+
179
+ verifyCustomizeLayoutAccordionIsExpanded: () => {
180
+ gridFillPage.customizeLayoutAccordionButton()
181
+ .should('have.attr', 'aria-expanded', 'true');
182
+ gridFillPage.customizeLayoutAccordionChevronButton()
183
+ .should('have.class', 'Mui-expanded');
184
+ },
185
+
147
186
  selectShadeCellButton: () => {
148
187
  gridFillPage.shadeCellButton()
149
188
  .click()
@@ -156,6 +195,55 @@ const steps = {
156
195
  .should('have.class', 'Mui-selected');
157
196
  },
158
197
 
198
+ verifyShadeCellButtonIsSelected: () => {
199
+ gridFillPage.shadeCellButton()
200
+ .should('have.class', 'Mui-selected');
201
+ },
202
+
203
+ verifyHideCellButtonIsNotSelected: () => {
204
+ gridFillPage.hideCellButton()
205
+ .should('not.have.class', 'Mui-selected');
206
+ },
207
+
208
+ verifyHideCellButtonIsSelected: () => {
209
+ gridFillPage.hideCellButton()
210
+ .should('have.class', 'Mui-selected');
211
+ },
212
+
213
+ /**
214
+ * @description Verify cell is not selected in customize lay section
215
+ * @param {number} rowIndex Index of row in grid of customize lay section
216
+ * @param {number} columnIndex Index of column in grid of customize lay section
217
+ */
218
+ verifyCellNotShadedCustomizeLayoutSection: (rowIndex, columnIndex) => {
219
+ gridFillPage.gridCustomizeLayoutSection()
220
+ .within(() => {
221
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
222
+ .within(() => {
223
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
224
+ .invoke('attr', 'aria-label')
225
+ .should('not.include', 'fillCell');
226
+ });
227
+ });
228
+ },
229
+
230
+ /**
231
+ * @description Verify cell is selected in customize lay section
232
+ * @param {number} rowIndex Index of row in grid of customize lay section
233
+ * @param {number} columnIndex Index of column in grid of customize lay section
234
+ */
235
+ verifyCellIsShadedCustomizeLayoutSection: (rowIndex, columnIndex) => {
236
+ gridFillPage.gridCustomizeLayoutSection()
237
+ .within(() => {
238
+ utilities.getNthElement(gridFillPage.gridRow(), rowIndex)
239
+ .within(() => {
240
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
241
+ .invoke('attr', 'aria-label')
242
+ .should('include', 'fillCell');
243
+ });
244
+ });
245
+ },
246
+
159
247
  /**
160
248
  * Shades a cell in the customize layout.
161
249
  * @param {number} rowIndex - The index of the row containing the cell.
@@ -167,12 +255,12 @@ const steps = {
167
255
  utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
168
256
  .click()
169
257
  .invoke('attr', 'aria-label')
170
- .should('include', 'fillCell');
258
+ .should('include', 'Shade cell');
171
259
  });
172
260
  },
173
261
 
174
262
  /**
175
- * Unshades a cell in the customize layout.
263
+ * Un-shade a cell in the customize layout.
176
264
  * @param {number} rowIndex - The index of the row containing the cell.
177
265
  * @param {number} columnIndex - The index of the column containing the cell.
178
266
  */
@@ -182,7 +270,7 @@ const steps = {
182
270
  utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
183
271
  .click()
184
272
  .invoke('attr', 'aria-label')
185
- .should('not.include', 'fillCell');
273
+ .should('not.include', 'Shade cell');
186
274
  });
187
275
  },
188
276
 
@@ -233,7 +321,30 @@ const steps = {
233
321
  utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
234
322
  .click()
235
323
  .invoke('attr', 'aria-label')
236
- .should('include', 'hideCell');
324
+ .should('include', 'Hide cell');
325
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
326
+ .within(() => {
327
+ utilities.verifyElementVisibilityState(gridFillPage.hiddenCellIcon(), 'exist');
328
+ });
329
+ });
330
+ },
331
+
332
+ /**
333
+ * Un-hides a cell in the customize layout.
334
+ * @param {number} rowIndex - The index of the row containing the cell.
335
+ * @param {number} columnIndex - The index of the column containing the cell.
336
+ */
337
+ unHideCell: (rowIndex, columnIndex) => {
338
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
339
+ .within(() => {
340
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
341
+ .click()
342
+ .invoke('attr', 'aria-label')
343
+ .should('not.include', 'Hide cell');
344
+ utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), columnIndex)
345
+ .within(() => {
346
+ utilities.verifyElementVisibilityState(gridFillPage.shadedCellIcon(), 'notExist');
347
+ });
237
348
  });
238
349
  },
239
350
 
@@ -331,7 +442,7 @@ const steps = {
331
442
  verifyHideCustomizedCellPreviewTab: (index) => {
332
443
  utilities.getNthElement(gridFillPage.cellInPreviewTab(), index)
333
444
  .invoke('attr', 'aria-label')
334
- .should('include', 'hideCell');
445
+ .should('include', 'Hide cell');
335
446
  },
336
447
 
337
448
  /**
@@ -362,6 +473,20 @@ const steps = {
362
473
  });
363
474
  },
364
475
 
476
+ /**
477
+ * Verifies if a cell in the specify correct answer section is hidden.
478
+ * @param {number} rowIndex - The index of the row containing the cell.
479
+ * @param {number} columnIndex - The index of the column containing the cell.
480
+ */
481
+ verifyHideCustomizedCellSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
482
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
483
+ .within(() => {
484
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
485
+ .invoke('attr', 'aria-label')
486
+ .should('include', 'hideCell');
487
+ });
488
+ },
489
+
365
490
  /**
366
491
  * Verifies if a cell in the preview tab is hidden.
367
492
  * @param {number} rowIndex - The index of the row containing the cell.
@@ -372,7 +497,21 @@ const steps = {
372
497
  .within(() => {
373
498
  utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex)
374
499
  .invoke('attr', 'aria-label')
375
- .should('include', 'hideCell');
500
+ .should('include', 'Hide cell');
501
+ });
502
+ },
503
+
504
+ /**
505
+ * Verifies cell in the specify correct answer section is not hidden.
506
+ * @param {number} rowIndex - The index of the row containing the cell.
507
+ * @param {number} columnIndex - The index of the column containing the cell.
508
+ */
509
+ verifyCellNotHiddenSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
510
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
511
+ .within(() => {
512
+ utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex)
513
+ .invoke('attr', 'aria-label')
514
+ .should('not.include', 'hideCell');
376
515
  });
377
516
  },
378
517
 
@@ -435,7 +574,32 @@ const steps = {
435
574
  for (let columnIndex = 0; columnIndex < 5; columnIndex++) {
436
575
  gridFillPage.steps.verifyCellNotSelectedSpecifyCorrectAnswerSection(rowIndex, columnIndex);
437
576
  }
438
- }
577
+ };
578
+ gridFillPage.gridSpecifyCorrectAnswerSection()
579
+ .within(() => {
580
+ utilities.verifyElementCount(gridFillPage.gridRow(), 3);
581
+ utilities.getNthElement(gridFillPage.gridRow(), 0)
582
+ .within(() => {
583
+ utilities.verifyElementCount(gridFillPage.cellInEditTab(), 5);
584
+ });
585
+ });
586
+ },
587
+
588
+ verifyDefaultGridInCustomizeLayoutSection: () => {
589
+ utilities.verifyElementVisibilityState(gridFillPage.gridCustomizeLayoutSection(), 'visible');
590
+ for (let rowIndex = 0; rowIndex < 3; rowIndex++) {
591
+ for (let columnIndex = 0; columnIndex < 5; columnIndex++) {
592
+ gridFillPage.steps.verifyCellNotShadedCustomizeLayoutSection(rowIndex, columnIndex);
593
+ }
594
+ };
595
+ gridFillPage.gridCustomizeLayoutSection()
596
+ .within(() => {
597
+ utilities.verifyElementCount(gridFillPage.gridRow(), 3);
598
+ utilities.getNthElement(gridFillPage.gridRow(), 0)
599
+ .within(() => {
600
+ utilities.verifyElementCount(gridFillPage.cellInEditTab(), 5);
601
+ });
602
+ });
439
603
  },
440
604
 
441
605
  /**
@@ -572,7 +736,6 @@ const steps = {
572
736
 
573
737
  /**
574
738
  * @description Verifies the count of columns in a row in the preview tab.
575
- * @param {number} rowsIndex - The index of the row to verify.
576
739
  * @param {number} columnsLength - The expected count of cells in the row.
577
740
  */
578
741
  verifyColumnsCountPreviewTab: (lengthColumns) => {
@@ -582,6 +745,478 @@ const steps = {
582
745
  });
583
746
  },
584
747
 
748
+ verifyOutlineCellOnHoverCheckboxIsChecked: () => {
749
+ gridFillPage.outlineCellOnHoverCheckbox()
750
+ .should('be.checked');
751
+ },
752
+
753
+ verifyLockShadedCellsCheckboxIsUnchecked: () => {
754
+ gridFillPage.lockShadedCellsCheckbox()
755
+ .should('not.be.checked');
756
+ },
757
+
758
+ checkLockShadedCellsCheckbox: () => {
759
+ gridFillPage.lockShadedCellsCheckbox()
760
+ .click()
761
+ .should('be.checked');
762
+ },
763
+
764
+ uncheckLockShadedCellsCheckbox: () => {
765
+ gridFillPage.lockShadedCellsCheckbox()
766
+ .click()
767
+ .should('not.be.checked');
768
+ },
769
+
770
+ uncheckOutlineCellOnHoverCheckbox: () => {
771
+ gridFillPage.outlineCellOnHoverCheckbox()
772
+ .click()
773
+ .should('not.be.checked');
774
+ },
775
+
776
+ checkOutlineCellOnHoverCheckbox: () => {
777
+ gridFillPage.outlineCellOnHoverCheckbox()
778
+ .click()
779
+ .should('be.checked');
780
+ },
781
+
782
+ /**
783
+ * @description Verifies that cell does not show interactive state when hovered on in customize layout section
784
+ * @param {number} rowIndex - The index of the row to verify.
785
+ * @param {number} columnIndex - Index of column on the cell
786
+ */
787
+ verifyCellIsNotInteractiveForHoverInCustomizeLayoutSection: (rowIndex, columnIndex) => {
788
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
789
+ .within(() => {
790
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
791
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex), {
792
+ 'border-color': css.color.figDefaultComponentBorder,
793
+ 'background-color': css.color.gridCellDefaultStateBg
794
+ });
795
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
796
+ });
797
+ },
798
+
799
+ /**
800
+ * @description Verifies that cell does not show interactive state when hovered on in specify correct answer section
801
+ * @param {number} rowIndex - The index of the row to verify.
802
+ * @param {number} columnIndex - Index of column on the cell
803
+ */
804
+ verifyCellIsNotInteractiveForHoverInSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
805
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
806
+ .within(() => {
807
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
808
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex), {
809
+ 'border-color': css.color.figDefaultComponentBorder,
810
+ 'background-color': css.color.gridCellDefaultStateBg
811
+ });
812
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
813
+ });
814
+ },
815
+
816
+ /**
817
+ * @description Verifies that cell does not show interactive state when hovered on in preview tab
818
+ * @param {number} rowIndex - The index of the row to verify.
819
+ * @param {number} columnIndex - Index of column on the cell
820
+ */
821
+ verifyCellIsNotInteractiveForHoverInPreviewTab: (rowIndex, columnIndex) => {
822
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
823
+ .within(() => {
824
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex));
825
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex), {
826
+ 'border-color': css.color.figDefaultComponentBorder,
827
+ 'background-color': css.color.gridCellDefaultStateBg
828
+ });
829
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex));
830
+ });
831
+ },
832
+
833
+ /**
834
+ * @description Verifies that cell shows interactive state when hovered on in customize layout section
835
+ * @param {number} rowIndex - The index of the row to verify.
836
+ * @param {number} columnIndex - Index of column on the cell
837
+ */
838
+ verifyCellIsInteractiveForHoverInCustomizeLayoutSection: (rowIndex, columnIndex) => {
839
+ utilities.getNthElement(gridFillPage.rowsWrapperCustomizeLayout(), rowIndex)
840
+ .within(() => {
841
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
842
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex), {
843
+ 'border-color': css.color.activeButtons,
844
+ 'background-color': css.color.gridCellHoverStateBg
845
+ });
846
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
847
+ });
848
+ },
849
+
850
+ /**
851
+ * @description Verifies that cell shows interactive state when hovered on in specify correct answer section
852
+ * @param {number} rowIndex - The index of the row to verify.
853
+ * @param {number} columnIndex - Index of column on the cell
854
+ */
855
+ verifyCellIsInteractiveForHoverInSpecifyCorrectAnswerSection: (rowIndex, columnIndex) => {
856
+ utilities.getNthElement(gridFillPage.rowsWrapperSpecifyCorrectAnswerSection(), rowIndex)
857
+ .within(() => {
858
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
859
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex), {
860
+ 'border-color': css.color.activeButtons,
861
+ 'background-color': css.color.gridCellHoverStateBg
862
+ });
863
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInEditTab(), columnIndex));
864
+ });
865
+ },
866
+
867
+ /**
868
+ * @description Verifies that cell shows interactive state when hovered on in preview tab
869
+ * @param {number} rowIndex - The index of the row to verify.
870
+ * @param {number} columnIndex - Index of column on the cell
871
+ */
872
+ verifyCellIsInteractiveForHoverInPreviewTab: (rowIndex, columnIndex) => {
873
+ utilities.getNthElement(gridFillPage.rowsWrapperPreviewTab(), rowIndex)
874
+ .within(() => {
875
+ utilities.hoverOverElement(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex));
876
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex), {
877
+ 'border-color': css.color.activeButtons,
878
+ 'background-color': css.color.gridCellHoverStateBg
879
+ });
880
+ utilities.triggerMouseout(utilities.getNthElement(gridFillPage.cellInPreviewTab(), columnIndex));
881
+ });
882
+ },
883
+
884
+ /**
885
+ * @description Add input to canvas title input field
886
+ * @param {string} titleText Text to be given as input in canvas title input field
887
+ */
888
+ addInputToCanvasTitleInputField: (titleText) => {
889
+ gridFillPage.canvasTitleInputField()
890
+ .type(titleText);
891
+ utilities.verifyInputFieldValue(gridFillPage.canvasTitleInputField(), titleText);
892
+ },
893
+
894
+ verifyFullGridToggleButtonIsSelected: () => {
895
+ gridFillPage.fullGridToggleButton()
896
+ .should('have.class', 'single-select-toggle-button-selected');
897
+ },
898
+
899
+ verifySolidToggleButtonIsSelected: () => {
900
+ gridFillPage.solidToggleButton()
901
+ .should('have.class', 'single-select-toggle-button-selected');
902
+ },
903
+
904
+ verifyOnlyBorderToggleButtonIsSelected: () => {
905
+ gridFillPage.onlyBorderToggleButton()
906
+ .should('have.class', 'single-select-toggle-button-selected');
907
+ },
908
+
909
+ verifyDashedToggleButtonIsSelected: () => {
910
+ gridFillPage.dashedToggleButton()
911
+ .should('have.class', 'single-select-toggle-button-selected');
912
+ },
913
+
914
+ verifyOuterGridBorderSwitchIsEnabled: () => {
915
+ gridFillPage.outerGridBorderSwitch()
916
+ .should('have.class', 'Mui-checked');
917
+ },
918
+
919
+ verifyOuterGridBorderSwitchIsDisabled: () => {
920
+ gridFillPage.outerGridBorderSwitch()
921
+ .should('not.have.class', 'Mui-checked');
922
+ },
923
+
924
+ switchOffOuterGridBorderSwitch: () => {
925
+ gridFillPage.outerGridBorderSwitch()
926
+ .click()
927
+ .should('not.have.class', 'Mui-checked');
928
+ },
929
+
930
+ switchOnOuterGridBorderSwitch: () => {
931
+ gridFillPage.outerGridBorderSwitch()
932
+ .click()
933
+ .should('have.class', 'Mui-checked');
934
+ },
935
+
936
+ /**
937
+ * @description Select grid borders toggle button
938
+ * @param {string} toggleButton Name of grid borders toggle button
939
+ */
940
+ selectGridBordersToggleButton: (toggleButton) => {
941
+ switch (toggleButton) {
942
+ case 'Full grid':
943
+ gridFillPage.fullGridToggleButton()
944
+ .click()
945
+ .should('have.class', 'single-select-toggle-button-selected');
946
+ break;
947
+ case 'Only border':
948
+ gridFillPage.onlyBorderToggleButton()
949
+ .click()
950
+ .should('have.class', 'single-select-toggle-button-selected');
951
+ break;
952
+ case 'None':
953
+ gridFillPage.noneToggleButton()
954
+ .click()
955
+ .should('have.class', 'single-select-toggle-button-selected');
956
+ break;
957
+ default:
958
+ throw new Error('Invalid grid borders toggle button name');
959
+ }
960
+ },
961
+
962
+ /**
963
+ * @description Select grid border style toggle button
964
+ * @param {string} toggleButton Name of grid borders toggle button
965
+ */
966
+ selectGridBorderStyleToggleButton: (toggleButton) => {
967
+ switch (toggleButton) {
968
+ case 'Solid':
969
+ gridFillPage.solidToggleButton()
970
+ .click()
971
+ .should('have.class', 'single-select-toggle-button-selected');
972
+ break;
973
+ case 'Dashed':
974
+ gridFillPage.dashedToggleButton()
975
+ .click()
976
+ .should('have.class', 'single-select-toggle-button-selected');
977
+ break;
978
+ case 'Dotted':
979
+ gridFillPage.dottedToggleButton()
980
+ .click()
981
+ .should('have.class', 'single-select-toggle-button-selected');
982
+ break;
983
+ default:
984
+ throw new Error('Invalid grid border style toggle button name');
985
+ }
986
+ },
987
+
988
+ verifyCellBorderIsDisplayedForFullGridToggleButtonInEditTab: () => {
989
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 0), {
990
+ 'border-width': '1px'
991
+ });
992
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 4), {
993
+ 'border-width': '1px'
994
+ });
995
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 10), {
996
+ 'border-width': '1px'
997
+ });
998
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 14), {
999
+ 'border-width': '1px'
1000
+ });
1001
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 0), {
1002
+ 'border-width': '1px'
1003
+ });
1004
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 4), {
1005
+ 'border-width': '1px'
1006
+ });
1007
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 10), {
1008
+ 'border-width': '1px'
1009
+ });
1010
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 14), {
1011
+ 'border-width': '1px'
1012
+ });
1013
+ },
1014
+
1015
+ verifyCellBorderIsDisplayedForFullGridToggleButtonInPreviewTab: () => {
1016
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 0), {
1017
+ 'border-width': '1px'
1018
+ });
1019
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 4), {
1020
+ 'border-width': '1px'
1021
+ });
1022
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 10), {
1023
+ 'border-width': '1px'
1024
+ });
1025
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 14), {
1026
+ 'border-width': '1px'
1027
+ });
1028
+ },
1029
+
1030
+ verifyCellBorderIsDisplayedForOnlyBorderToggleButtonInEditTab: () => {
1031
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 0), {
1032
+ 'border-width': '1px 0px 0px 1px'
1033
+ });
1034
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 4), {
1035
+ 'border-width': '1px 1px 0px 0px'
1036
+ });
1037
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 10), {
1038
+ 'border-width': '0px 0px 1px 1px'
1039
+ });
1040
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 14), {
1041
+ 'border-width': '0px 1px 1px 0px'
1042
+ });
1043
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 0), {
1044
+ 'border-width': '1px 0px 0px 1px'
1045
+ });
1046
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 4), {
1047
+ 'border-width': '1px 1px 0px 0px'
1048
+ });
1049
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 10), {
1050
+ 'border-width': '0px 0px 1px 1px'
1051
+ });
1052
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 14), {
1053
+ 'border-width': '0px 1px 1px 0px'
1054
+ });
1055
+ },
1056
+
1057
+ verifyCellBorderIsDisplayedForOnlyBorderToggleButtonInPreviewTab: () => {
1058
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 0), {
1059
+ 'border-width': '1px 0px 0px 1px'
1060
+ });
1061
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 4), {
1062
+ 'border-width': '1px 1px 0px 0px'
1063
+ });
1064
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 10), {
1065
+ 'border-width': '0px 0px 1px 1px'
1066
+ });
1067
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 14), {
1068
+ 'border-width': '0px 1px 1px 0px'
1069
+ });
1070
+ },
1071
+
1072
+ verifyCellBorderNotDisplayedForNoneToggleButtonInEditTab: () => {
1073
+ gridFillPage.cellInCustomizeLayout()
1074
+ .each(($element) => {
1075
+ utilities.verifyCSS(cy.wrap($element), {
1076
+ 'border-width': '0px'
1077
+ });
1078
+ });
1079
+ gridFillPage.cellInSpecifyCorrectAnswerSection()
1080
+ .each(($element) => {
1081
+ utilities.verifyCSS(cy.wrap($element), {
1082
+ 'border-width': '0px'
1083
+ });
1084
+ });
1085
+ },
1086
+
1087
+ verifyCellBorderNotDisplayedForNoneToggleButtonInPreviewTab: () => {
1088
+ gridFillPage.cellInPreviewTab()
1089
+ .each(($element) => {
1090
+ utilities.verifyCSS(cy.wrap($element), {
1091
+ 'border-width': '0px'
1092
+ });
1093
+ });
1094
+ },
1095
+
1096
+ verifyGridBorderInEditTab: () => {
1097
+ gridFillPage.gridCustomizeLayoutSection()
1098
+ },
1099
+
1100
+ verifyGridBorderWhenOuterBorderSwitchIsOffInEditTab: () => {
1101
+ gridFillPage.gridCustomizeLayoutSection()
1102
+ .should('have.css', 'border-width', '0px');
1103
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 0), {
1104
+ 'border-width': '1px'
1105
+ });
1106
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 4), {
1107
+ 'border-width': '1px'
1108
+ });
1109
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 10), {
1110
+ 'border-width': '1px'
1111
+ });
1112
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInCustomizeLayout(), 14), {
1113
+ 'border-width': '1px'
1114
+ });
1115
+ gridFillPage.gridSpecifyCorrectAnswerSection()
1116
+ .should('have.css', 'border-width', '0px');
1117
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 0), {
1118
+ 'border-width': '1px'
1119
+ });
1120
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 4), {
1121
+ 'border-width': '1px'
1122
+ });
1123
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 10), {
1124
+ 'border-width': '1px'
1125
+ });
1126
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 14), {
1127
+ 'border-width': '1px'
1128
+ });
1129
+ },
1130
+
1131
+ verifyGridBorderWhenOuterBorderSwitchIsOffInPreviewTab: () => {
1132
+ gridFillPage.gridWrapperPreviewTab()
1133
+ .should('have.css', 'border-width', '0px');
1134
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 0), {
1135
+ 'border-width': '1px'
1136
+ });
1137
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 4), {
1138
+ 'border-width': '1px'
1139
+ });
1140
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 10), {
1141
+ 'border-width': '1px'
1142
+ });
1143
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInPreviewTab(), 14), {
1144
+ 'border-width': '1px'
1145
+ });
1146
+ },
1147
+
1148
+ verifySolidBorderForSolidToggleButtonInEditTab: () => {
1149
+ gridFillPage.cellInCustomizeLayout()
1150
+ .each(($element) => {
1151
+ utilities.verifyCSS(cy.wrap($element), {
1152
+ 'border-style': 'solid'
1153
+ });
1154
+ });
1155
+ gridFillPage.cellInSpecifyCorrectAnswerSection()
1156
+ .each(($element) => {
1157
+ utilities.verifyCSS(cy.wrap($element), {
1158
+ 'border-style': 'solid'
1159
+ });
1160
+ });
1161
+ },
1162
+
1163
+ verifySolidBorderForSolidToggleButtonInPreviewTab: () => {
1164
+ gridFillPage.cellInPreviewTab()
1165
+ .each(($element) => {
1166
+ utilities.verifyCSS(cy.wrap($element), {
1167
+ 'border-style': 'solid'
1168
+ });
1169
+ });
1170
+ },
1171
+
1172
+ verifyDashedBorderForDashedToggleButtonInEditTab: () => {
1173
+ gridFillPage.cellInCustomizeLayout()
1174
+ .each(($element) => {
1175
+ utilities.verifyCSS(cy.wrap($element), {
1176
+ 'border-style': 'dashed'
1177
+ });
1178
+ });
1179
+ gridFillPage.cellInSpecifyCorrectAnswerSection()
1180
+ .each(($element) => {
1181
+ utilities.verifyCSS(cy.wrap($element), {
1182
+ 'border-style': 'dashed'
1183
+ });
1184
+ });
1185
+ },
1186
+
1187
+ verifyDashedBorderForDashedToggleButtonInPreviewTab: () => {
1188
+ gridFillPage.cellInPreviewTab()
1189
+ .each(($element) => {
1190
+ utilities.verifyCSS(cy.wrap($element), {
1191
+ 'border-style': 'dashed'
1192
+ });
1193
+ });
1194
+ },
1195
+
1196
+ verifyDottedBorderForDottedToggleButtonInEditTab: () => {
1197
+ gridFillPage.cellInCustomizeLayout()
1198
+ .each(($element) => {
1199
+ utilities.verifyCSS(cy.wrap($element), {
1200
+ 'border-style': 'dotted'
1201
+ });
1202
+ });
1203
+ gridFillPage.cellInSpecifyCorrectAnswerSection()
1204
+ .each(($element) => {
1205
+ utilities.verifyCSS(cy.wrap($element), {
1206
+ 'border-style': 'dotted'
1207
+ });
1208
+ });
1209
+ },
1210
+
1211
+ verifyDottedBorderForDottedToggleButtonInPreviewTab: () => {
1212
+ gridFillPage.cellInPreviewTab()
1213
+ .each(($element) => {
1214
+ utilities.verifyCSS(cy.wrap($element), {
1215
+ 'border-style': 'dotted'
1216
+ });
1217
+ });
1218
+ },
1219
+
585
1220
  /**
586
1221
  * @description verify the displayed penalty points for each incorrect cell
587
1222
  * @param {number} penaltyPoints displayed penalty points
@@ -683,7 +1318,7 @@ const tests = {
683
1318
  utilities.verifyElementCount(gridFillPage.correctAnswerAccordion(), 1);
684
1319
  gridFillPage.steps.verifyCorrectAnswerAccordionIsExpanded();
685
1320
  utilities.verifyInnerText(gridFillPage.correctAnswerLabel(), 'Correct');
686
- utilities.verifyElementVisibilityState(gridFillPage.gridWrapper(), 'visible');
1321
+ utilities.verifyElementVisibilityState(gridFillPage.gridWrapperPreviewTab(), 'visible');
687
1322
  });
688
1323
  },
689
1324
 
@@ -828,6 +1463,19 @@ const tests = {
828
1463
  utilities.verifyCSS(gridFillPage.matchExactPositionCheckbox().parents('.ngie-checkbox').find('g').eq(1), {
829
1464
  'fill': css.color.activeButtons
830
1465
  });
1466
+ //Selected
1467
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 1), {
1468
+ 'border-color': css.color.activeHighlightBorder,
1469
+ 'background-color': css.color.gridCellSelectedStateBg
1470
+ });
1471
+ gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
1472
+ gridFillPage.steps.selectHideCellButton();
1473
+ gridFillPage.steps.hideCell(0, 2);
1474
+ //Hidden cell
1475
+ utilities.verifyCSS(utilities.getNthElement(gridFillPage.cellInSpecifyCorrectAnswerSection(), 2), {
1476
+ 'border-color': css.color.secondaryBtnDisabled,
1477
+ 'background-color': css.color.defaultBackground
1478
+ });
831
1479
  gridFillPage.steps.uncheckMatchExactPositionOfCellsCheckbox();
832
1480
  utilities.verifyCSS(gridFillPage.cellShadeCountLabel(), {
833
1481
  'color': css.color.text,