itemengine-cypress-automation 1.0.181-figDropdown-5a8309d.0 → 1.0.181

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  3. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +4 -5
  4. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +64 -3
  5. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  6. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  9. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  18. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
  19. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  20. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
  21. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  24. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  25. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  26. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  28. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  29. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
  30. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
  31. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
  32. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  33. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
  34. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
  35. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
  36. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  37. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  39. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +530 -0
  40. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  41. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +119 -0
  42. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +263 -0
  43. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  44. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  45. package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
  46. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  47. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
  48. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  49. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  50. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  51. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
  52. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
  53. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
  56. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
  57. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  58. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
  59. package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
  60. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +2 -2
  61. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.smoke.js +179 -0
  62. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
  63. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
  64. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
  65. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
  66. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
  67. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
  68. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  69. package/cypress/fixtures/constants.js +1 -1
  70. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  71. package/cypress/fixtures/theme/ilc.json +16 -16
  72. package/cypress/pages/audioPlayerPage.js +55 -543
  73. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  74. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  75. package/cypress/pages/components/autoScoredStudentViewSettings.js +4 -4
  76. package/cypress/pages/components/commonComponents.js +1 -0
  77. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  78. package/cypress/pages/components/equationEditorFlyout.js +3 -2
  79. package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
  80. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
  81. package/cypress/pages/components/imageCanvasComponent.js +2 -1
  82. package/cypress/pages/components/index.js +1 -0
  83. package/cypress/pages/components/optionsWrapperComponent.js +11 -0
  84. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
  85. package/cypress/pages/components/toolSettingsComponent.js +6 -0
  86. package/cypress/pages/contentBlocksPage.js +2 -2
  87. package/cypress/pages/createItemPage.js +29 -0
  88. package/cypress/pages/dialogBoxBase.js +2 -2
  89. package/cypress/pages/drawingResponsePage.js +23 -4
  90. package/cypress/pages/feedbackScalePage.js +3 -0
  91. package/cypress/pages/graphingPage.js +18 -0
  92. package/cypress/pages/gridFillPage.js +18 -2
  93. package/cypress/pages/index.js +1 -1
  94. package/cypress/pages/itemPreviewSettingsPage.js +4 -0
  95. package/cypress/pages/listOrderingPage.js +122 -647
  96. package/cypress/pages/matchingPage.js +1 -1
  97. package/cypress/pages/multipleSelectionPage.js +23 -1
  98. package/cypress/pages/numberLinePage.js +1196 -59
  99. package/cypress/pages/rulerPage.js +6 -2
  100. package/cypress/pages/textSelectionPage.js +460 -22
  101. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +3 -107
  102. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -2
  103. package/cypress/support/migrationHelpers/migrationScript.js +0 -13
  104. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +6 -106
  105. package/package.json +2 -2
  106. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  107. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -183,8 +183,8 @@ const tests = {
183
183
  case 'list sorting':
184
184
  helpText = 'You can set the correct answer by sorting the correct answer(s) in the response area(s).';
185
185
  break;
186
- case 'highlight':
187
- helpText = 'You can set the correct answer by highlighting the correct answer(s) in the response area(s).';
186
+ case 'text selection':
187
+ helpText = 'You can set the correct answer by selecting the correct answer selection(s).';
188
188
  break;
189
189
  case 'highlight image':
190
190
  helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
@@ -205,7 +205,7 @@ const tests = {
205
205
  helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s)';
206
206
  break;
207
207
  case 'grid fill':
208
- helpText = 'You can set the correct answer by selecting the correct cell(s) in the grid.';
208
+ helpText = 'You can set the correct answer by selecting the correct answer cell(s).';
209
209
  break;
210
210
  case 'number line':
211
211
  helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s)';
@@ -9,11 +9,11 @@ const selectors = {
9
9
  allowStudentToCheckAnswerCheckbox: () => cy.get('[data-ngie-testid="allow-students-to-check-answer-checkbox"] input'),
10
10
  maximumCheckAnswerAttemptsDropdownLabel: () => cy.get('#Maximum-check-answer-attempts-dropdown-label'),
11
11
  maximumCheckAnswerAttemptsDropdown: () => cy.get('#Maximum-check-answer-attempts-select'),
12
- maximumCheckAnswerAttemptsDropdownListOptions: (ariaLabel = null) => {
13
- if (ariaLabel) {
14
- return cy.get(`[aria-labelledby*="Maximum-check-answer-attempts-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
12
+ maximumCheckAnswerAttemptsDropdownListOptions: (dataValue = null) => {
13
+ if (dataValue) {
14
+ return cy.get(`[aria-labelledby*="Maximum-check-answer-attempts-dropdown-label"] [role="option"][data-value="${dataValue}"]`)
15
15
  } else {
16
- return cy.get('[aria-labelledby*="Maximum-check-answer-attempts-dropdown-label"] [role="option"]')
16
+ return cy.get('[aria-labelledby*="Maximum-check-answer-attempts-dropdown-label"] [role="option"]').eq(0)
17
17
  }
18
18
  },
19
19
  disablePreviousIncorrectOptionLabel: () => cy.get('[data-ngie-testid="disable-previous-incorrect-options-checkbox"] .MuiFormControlLabel-label'),
@@ -11,6 +11,7 @@ const selectors = {
11
11
  errorMessage: () => cy.get('.error-text-message:visible'),
12
12
  nextGenCreateItemWrapper: () => cy.get('#nextgen-assess-create-item'),
13
13
  dropdownList: () => cy.get('.dropdown-list'),
14
+ dropdownListOption: () => cy.get('.dropdown-menu-item'),
14
15
  dragHandleButton: () => cy.get('.dragicon-button'),
15
16
  deleteButton: () => cy.get('button[aria-label*="Delete option"]'),
16
17
  tickIconForOptionButtons: () => cy.get('.ngie-toggle-button-tick-icon'),
@@ -470,6 +470,7 @@ const tests = {
470
470
 
471
471
  it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in a group in the options container of the specify correct answer section', () => {
472
472
  optionsWrapperComponent.steps.addInputToOptionsInputField(options);
473
+ cy.wait(200) //Added wait as this is failing due to page updating
473
474
  draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, options);
474
475
  });
475
476
 
@@ -244,7 +244,7 @@ const steps = {
244
244
  equationEditorFlyout.categoryCharacters('Comma')
245
245
  .click();
246
246
  equationEditorFlyout.previewInputField()
247
- .type('What is the value of x?');
247
+ .type('What is the value of x');
248
248
  equationEditorFlyout.categoryCharacters('QuestionMark')
249
249
  .click();
250
250
  equationEditorFlyout.previewInputField()
@@ -383,9 +383,10 @@ const tests = {
383
383
 
384
384
  verifyEquationEditorFlyoutSymbolCategoriesTabs: (categoryName) => {
385
385
  it(`On clicking the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category in the Equation Editor flyout, then the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category tab should get selected`, () => {
386
- equationEditorFlyout.categoryTab()
386
+ equationEditorFlyout.categoryTabTitle()
387
387
  .contains(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`, { matchCase: false })
388
388
  .click()
389
+ .parents('.tool-wrapper')
389
390
  .within(() => {
390
391
  equationEditorFlyout.categoryTabTitle()
391
392
  .verifyInnerText(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
@@ -369,8 +369,14 @@ const steps = {
369
369
  essayResponseCommonComponents.customizeFormattingOptionsTiles()
370
370
  .each(($button, count) => {
371
371
  cy.wrap($button)
372
- .should('have.attr', 'title', customizeOptions[count])
373
- .and('have.attr', 'data-aria-pressed', stateOfFormattingOption[count])
372
+ .invoke('attr', 'aria-label')
373
+ .then((ariaLabel) => {
374
+ const normalizedAriaLabel = ariaLabel.trim();
375
+ const isOptionIncluded = customizeOptions.some(option => normalizedAriaLabel.includes(option));
376
+ expect(isOptionIncluded).to.be.true;
377
+ cy.wrap($button)
378
+ .and('have.attr', 'data-aria-pressed', stateOfFormattingOption[count])
379
+ });
374
380
  });
375
381
  },
376
382
 
@@ -683,6 +683,7 @@ const tests = {
683
683
  utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), 1), 'Dropdown 2');
684
684
  });
685
685
 
686
+ //Note: Need to find a solution for this, not working
686
687
  it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should be displayed', () => {
687
688
  fillInTheGapsDropdownCommonComponent.steps.expandAndCollapseDropdownInSpecifyCorrectAnswerSection(0);
688
689
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
@@ -568,7 +568,8 @@ const steps = {
568
568
  imageCanvasComponent.responseAreaStyle()
569
569
  .eq(index)
570
570
  .trigger('mouseover', { force: true });
571
- utilities.verifyInnerText(commonComponents.tooltipText(), dropzonePointer);
571
+ commonComponents.tooltipText()
572
+ .should('have.text', dropzonePointer, { matchCase: true });
572
573
  imageCanvasComponent.responseAreaStyle()
573
574
  .eq(index)
574
575
  .trigger('mouseout', { force: true });
@@ -63,4 +63,5 @@ export * from './specifyRowsAndColumnsComponent'
63
63
  export * from './toolsAndControlsComponent';
64
64
  export * from './resetPopupComponent';
65
65
  export * from './setPointsPopupBase';
66
+ export * from './styleAndLayoutCustomizationAccordionComponent';
66
67
  export * from './defaultToolDropdown';
@@ -140,6 +140,17 @@ const steps = {
140
140
  .should('have.text', '​​​​​​​This is a bold option');
141
141
  },
142
142
 
143
+ /**
144
+ * @param {number} index of the option input field
145
+ * @description this function add input to options input field which contains an image
146
+ */
147
+ addTextInputToOptionsInputFieldWithImage: (index) => {
148
+ optionsWrapperComponent.optionsInputField()
149
+ .eq(index)
150
+ .type('Petals')
151
+ .should('have.text', '​​​​​​​Petals');
152
+ },
153
+
143
154
  /**
144
155
  * @param {number} index of option
145
156
  * @description this function verifies bold text in options input fields
@@ -0,0 +1,46 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ styleAndLayoutCustomizationAccordion: () => cy.get('.style-and-layout-customization-wrapper .MuiAccordionSummary-root'),
7
+ }
8
+
9
+ const steps = {
10
+ expandStyleAndLayoutCustomizationAccordion: () => {
11
+ styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion()
12
+ .click()
13
+ .should('have.attr', 'aria-expanded', 'true');
14
+ },
15
+ }
16
+
17
+ const tests = {
18
+ verifyStyleAndLayoutCustomizationAccordionProperties: () => {
19
+ it('By default \'Style and layout customization\' accordion should be collapsed and by clicking on the \'Style and layout customization\' accordion, user should be able to expand the accordion', () => {
20
+ styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion()
21
+ .should('have.attr', 'aria-expanded', 'false');
22
+ styleAndLayoutCustomizationAccordionComponent.steps.expandStyleAndLayoutCustomizationAccordion();
23
+ });
24
+
25
+ it('CSS of \'Style and layout customization\' accordion', { tags: 'css' }, () => {
26
+ utilities.verifyCSS(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().find('.accordion_label'), {
27
+ 'color': css.color.accordionLabel,
28
+ 'font-size': css.fontSize.default,
29
+ 'font-weight': css.fontWeight.bold
30
+ });
31
+ utilities.verifyCSS(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().find('svg'), {
32
+ 'fill': css.color.activeButtons
33
+ });
34
+ });
35
+
36
+ it('Accessibility of \'Style and layout customization\' accordion', { tags: 'a11y' }, () => {
37
+ cy.checkAccessibility(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().parents('.style-and-layout-customization-wrapper'));
38
+ });
39
+ }
40
+ }
41
+
42
+ export const styleAndLayoutCustomizationAccordionComponent = {
43
+ ...selectors,
44
+ steps,
45
+ tests
46
+ }
@@ -13,6 +13,7 @@ const selectors = {
13
13
  toolLabel: () => cy.get('.tool-settings-customization-wrapper [class*="DragItemstyles__ButtonLabel"]'),
14
14
  toolDragHandleButton: () => cy.get('.tool-settings-customization-wrapper [class*="DragItemstyles__DragIconWrapper"]'),
15
15
  toolEditIcon: () => cy.get('.tool-settings-customization-wrapper [class*="DragItemstyles__ItemContainer"] .icon-pencil'),
16
+ okButton: () => cy.get('.action-button').eq(1)
16
17
  }
17
18
 
18
19
  const steps = {
@@ -87,6 +88,11 @@ const steps = {
87
88
  clickOnToolEditIcon: (toolIndex) => {
88
89
  utilities.getNthElement(toolSettingsComponent.toolEditIcon(), toolIndex)
89
90
  .click();
91
+ },
92
+
93
+ clickOnOkButton: () => {
94
+ toolSettingsComponent.okButton()
95
+ .click();
90
96
  }
91
97
  }
92
98
 
@@ -591,8 +591,8 @@ const steps = {
591
591
  .within(() => {
592
592
  utilities.verifyInnerText(createItemPage.questionTitle().eq(questionIndex), questionTitle);
593
593
  utilities.verifyElementVisibilityState(createItemPage.questionTitle().eq(questionIndex), 'visible');
594
- utilities.verifyInnerText(contentBlocksPage.contentWrapperPreviewTab().eq(questionIndex), questionInstructions);
595
- utilities.verifyElementVisibilityState(contentBlocksPage.contentWrapperPreviewTab().eq(questionIndex), 'visible');
594
+ utilities.verifyInnerText(contentBlocksPage.contentWrapperPreviewTab(), questionInstructions);
595
+ utilities.verifyElementVisibilityState(contentBlocksPage.contentWrapperPreviewTab(), 'visible');
596
596
  });
597
597
  },
598
598
  }
@@ -21,6 +21,7 @@ const selectors = {
21
21
  rowQuestionWrapper: () => cy.get('[class*="Widgetstyles__RowWrapper"]'),
22
22
  columnQuestionWrapper: () => cy.get('[class*="ColumnComponentstyles__WidgetsWrapper"]'),
23
23
  panelWrapper: () => cy.get('.column-tab-without-scroll'),
24
+ itemContainer: () => cy.get('.item-layout-columns-wrapper-without-scroll'),
24
25
  questionTitle: () => cy.get('.question-type-text'),
25
26
  sectionsTitleWrapper: () => cy.get('[class*="TabsComponentstyles__TabListWrapper"]'),
26
27
  sectionsTitleBoxWrapper: () => cy.get('[class*="TabsComponentstyles__TabListWrapper"] .ngie-tablist-box-wrapper'),
@@ -504,7 +505,35 @@ const steps = {
504
505
  });
505
506
  },
506
507
 
508
+ /**
509
+ * This function verifies the Panel width is half of the item width
510
+ * @param {number} panelIndex index of the panel
511
+ */
512
+ verifyPanelWidthIsHalfOfItemWidth: (panelIndex) => {
513
+ createItemPage.itemContainer()
514
+ .then(($el) => {
515
+ const itemWidth = $el[0].clientWidth;
516
+ const expectedPanelWidth = itemWidth / 2
517
+ createItemPage.panelWrapper()
518
+ .eq(panelIndex)
519
+ .then(($el) => {
520
+ const panelWidth = $el[0].clientWidth;
521
+ expect(expectedPanelWidth).to.be.closeTo(Math.floor(panelWidth), 1);
522
+ });
523
+ });
524
+ },
507
525
 
526
+ verifyPanelWidthEqualToItemWidth: () => {
527
+ createItemPage.itemContainer()
528
+ .then(($el) => {
529
+ const itemWidth = $el[0].clientWidth;
530
+ createItemPage.panelWrapper()
531
+ .then(($el) => {
532
+ const panelWidth = $el[0].clientWidth;
533
+ expect(itemWidth).to.be.eq(panelWidth);
534
+ });
535
+ });
536
+ }
508
537
  }
509
538
 
510
539
  export const createItemPage = {
@@ -6,8 +6,8 @@ const selectors = {
6
6
  dialogBox: () => cy.get('[aria-labelledby="alert-dialog-title"]'),
7
7
  dialogBoxTitle: () => cy.get('.dialog-title'),
8
8
  dialogBoxContent: () => cy.get('[class*="dialog-content"]'),
9
- buttonReject: () => cy.get('.save-action-btn-wrapper button').eq(0),
10
- buttonAccept: () => cy.get('.save-action-btn-wrapper button').eq(1),
9
+ buttonReject: () => cy.get('[data-testid="reject-button"]'),
10
+ buttonAccept: () => cy.get('[data-testid="accept-button"]'),
11
11
  buttonClose: () => cy.get('[aria-label="CLOSE"]')
12
12
  }
13
13
 
@@ -59,8 +59,8 @@ const selectors = {
59
59
  }
60
60
  },
61
61
  previewTabToolbarOptionTooltip: () => cy.get('.edit-question-preview-wrapper [role="tooltip"][class*="Tooltipstyles__TooltipContent"]'),
62
- previewTabLowerCanvas: () => cy.get('.edit-question-preview-wrapper .lower-canvas'),
63
- previewTabUpperCanvas: () => cy.get('.edit-question-preview-wrapper .upper-canvas'),
62
+ previewTabLowerCanvas: () => cy.get('.question-preview-wrapper .lower-canvas'),
63
+ previewTabUpperCanvas: () => cy.get('.question-preview-wrapper .upper-canvas'),
64
64
  previewTabSecondaryToolbarOptionLabel: () => cy.get('.edit-question-preview-wrapper .drawing-tool__secondary-toolbar__tool-name'),
65
65
  previewTabSecondaryToolbarOption: (ariaLabel = null) => {
66
66
  if (ariaLabel) {
@@ -198,7 +198,7 @@ const selectors = {
198
198
  editTabColorPickerPopupOpacityPalette: () => cy.get('.react-colorful__last-control .react-colorful__interactive'),
199
199
  editTabColorPickerPopupOpacityPicker: () => cy.get('.react-colorful__last-control .react-colorful__pointer'),
200
200
  editTabColorPickerPopupCancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
201
- editTabColorPickerPopupOkButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(2),
201
+ editTabColorPickerPopupOkButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
202
202
 
203
203
  //TODO: Student view: Need to remove once https://redmine.zeuslearning.com/issues/556302 is fixed
204
204
  studentAndGradingViewDrawingToolbarOption: (drawingOption = null) => {
@@ -208,7 +208,8 @@ const selectors = {
208
208
  return cy.get('.drawing-tool__button')
209
209
  }
210
210
  },
211
- studentViewUpperCanvas: () => cy.get('.upper-canvas').eq(0)
211
+ studentViewUpperCanvas: () => cy.get('.upper-canvas').eq(0),
212
+ gradingViewPlayFeatureButton: () => cy.get('[class*="DrawingResponsePreviewstyles__PlayBtnWrapper"] button')
212
213
  }
213
214
 
214
215
  const steps = {
@@ -1225,6 +1226,24 @@ const steps = {
1225
1226
  });
1226
1227
  });
1227
1228
  },
1229
+
1230
+ /**
1231
+ * This function sets basic question and saves it
1232
+ * @param {string} inputQuestion input for the question instruction
1233
+ * @param {number} points for the question
1234
+ */
1235
+ createBasicDrawingResponseQuestion: (inputQuestion, points) => {
1236
+ drawingResponsePage.questionInstructionsInputField()
1237
+ .type(inputQuestion);
1238
+ drawingResponsePage.pointsInputField()
1239
+ .type(points);
1240
+ drawingResponsePage.saveQuestionButton()
1241
+ },
1242
+
1243
+ clickOnPlayButtonInGradingView: () => {
1244
+ drawingResponsePage.gradingViewPlayFeatureButton()
1245
+ .click();
1246
+ }
1228
1247
  }
1229
1248
 
1230
1249
  const tests = {
@@ -1,11 +1,13 @@
1
1
  import { additionalSettingsPanel, commonComponents, createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, studentViewSettingsLabelComponent } from "./components"
2
2
  import utilities from "../support/helpers/utilities";
3
+ import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
3
4
  const css = Cypress.env('css');
4
5
 
5
6
  const selectors = {
6
7
  ...questionInstructionsComponent,
7
8
  ...commonComponents,
8
9
  ...additionalSettingsPanel,
10
+ ...selectQuestionResourceToolPage,
9
11
  specifyFeedbackScaleOptionsLabel: () => cy.get('[class*="FeedbackScalestyles__SpecifyFeedbackLabel"]'),
10
12
  feedbackScaleStyleDropdownLabel: () => cy.get('#feedback-scale-style-dropdown-label'),
11
13
  feedbackScaleStyleDropdown: () => cy.get('#feedback-scale-style-select'),
@@ -103,6 +105,7 @@ const steps = {
103
105
  ...additionalSettingsPanel.steps,
104
106
  ...questionInstructionsComponent.steps,
105
107
  ...autoScoredScoringPreviewTab.steps,
108
+ ...selectQuestionResourceToolPage.steps,
106
109
  /**
107
110
  * Adds legend text to a specific option in the Legend Text accordion.
108
111
  * @param {number} optionIndex - The index of the option in the Legend Text accordion.
@@ -1664,6 +1664,24 @@ const steps = {
1664
1664
 
1665
1665
  verifyCorrectAnswerSectionNotExist: () => {
1666
1666
  utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.graphCorrectAnswerSection(), 1), 'notExist');
1667
+ },
1668
+
1669
+ /**
1670
+ * This function sets basic question and saves it
1671
+ * @param {string} inputQuestion input for the question instruction
1672
+ * @param {number} points for the question
1673
+ */
1674
+ createBasicGraphingResponseQuestion: (inputQuestion, points) => {
1675
+ graphingPage.questionInstructionsInputField()
1676
+ .type(inputQuestion);
1677
+ graphingPage.pointsInputField()
1678
+ .type(points);
1679
+ graphingPage.steps.selectGraphToolOptionEditTab('Line');
1680
+ graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
1681
+ graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Line');
1682
+ graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: -4, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 4, yRange: 20 }]);
1683
+ graphingPage.saveQuestionButton()
1684
+ .click();
1667
1685
  }
1668
1686
  }
1669
1687
 
@@ -787,7 +787,7 @@ const steps = {
787
787
  const element = $element[0];
788
788
  const pseudoStyle = win.getComputedStyle(element, '::after');
789
789
  const pseudoBackgroundColor = pseudoStyle.getPropertyValue('background-color');
790
- expect(pseudoBackgroundColor).to.equal(css.color.gridCellSelectedStateBg);
790
+ expect(pseudoBackgroundColor).to.equal(css.color.titleContainerBorder);
791
791
  });
792
792
  });
793
793
  });
@@ -954,7 +954,11 @@ const steps = {
954
954
  * @param {number} lengthRows - The expected count of rows.
955
955
  */
956
956
  verifyRowsCountPreviewTab: (lengthRows) => {
957
- utilities.verifyElementCount(gridFillPage.rowsWrapperPreviewTab(), lengthRows);
957
+ gridFillPage.gridWrapperPreviewTab()
958
+ .eq(0)
959
+ .within(() => {
960
+ utilities.verifyElementCount(gridFillPage.rowsWrapperPreviewTab(), lengthRows);
961
+ });
958
962
  },
959
963
 
960
964
  /**
@@ -968,6 +972,18 @@ const steps = {
968
972
  });
969
973
  },
970
974
 
975
+ /**
976
+ * @description Verifies the count of cells in a grid in the preview tab.
977
+ * @param {number} expectedCount - The expected count of cells in the grid.
978
+ */
979
+ getCellCountInGridPreviewTab:(expectedCount)=>{
980
+ gridFillPage.gridWrapperPreviewTab()
981
+ .eq(0)
982
+ .within(() => {
983
+ utilities.verifyElementCount(gridFillPage.cellInPreviewTab(), expectedCount);
984
+ });
985
+ },
986
+
971
987
  expandOpenTheGridSelectorDropdown: () => {
972
988
  gridFillPage.openTheGridSelectorDropdownButton()
973
989
  .click()
@@ -47,4 +47,4 @@ export * from './geoGebraToolsPage';
47
47
  export * from './matchingPage';
48
48
  export * from './brainingCampManipulativePage';
49
49
  export * from './numberLinePage';
50
- export * from './textSelectionPage';
50
+ export * from './textSelectionPage';
@@ -7,6 +7,8 @@ import { scoringSectionBase } from "./components";
7
7
  import { questionInstructionsComponent } from "./components";
8
8
  import { contentBlocksPage } from "./contentBlocksPage";
9
9
  import { createQuestionBasePage } from "./components";
10
+ import { graphingPage } from "./graphingPage";
11
+ import { drawingResponsePage } from "./drawingResponsePage";
10
12
 
11
13
  const selectors = {
12
14
  ...createItemPage,
@@ -105,6 +107,8 @@ const steps = {
105
107
  ...scoringSectionBase.steps,
106
108
  ...questionInstructionsComponent.steps,
107
109
  ...selectQuestionResourceToolPage.steps,
110
+ ...graphingPage.steps,
111
+ ...drawingResponsePage.steps,
108
112
 
109
113
  verifyEnableSideBySidePanelsCheckboxUnchecked: () => {
110
114
  itemPreviewSettingsPage.enableSideBySidePanelsCheckbox()