itemengine-cypress-automation 1.0.151-28MarchRepoUpdate-20de036.0 → 1.0.152-28th-March-fixes-6236e0e.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabScoring.js +1 -0
  2. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +2 -2
  3. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +25 -25
  4. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +506 -0
  5. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  6. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +155 -0
  7. package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +143 -0
  8. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/Matching/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  10. package/cypress/e2e/ILC/Matching/draggableOptions.js +180 -0
  11. package/cypress/e2e/ILC/Matching/editTabScoring.js +221 -0
  12. package/cypress/e2e/ILC/Matching/manuallyAndNonScoredEditTab.js +68 -0
  13. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  14. package/cypress/e2e/ILC/Matching/switchingCasesBetweenOptionsLayout.js +49 -0
  15. package/cypress/fixtures/theme/ilc.json +7 -1
  16. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  17. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  18. package/cypress/pages/contentBlocksPage.js +30 -1
  19. package/cypress/pages/createItemPage.js +1 -1
  20. package/cypress/pages/essayResponsePage.js +1 -1
  21. package/cypress/pages/graphingPage.js +29 -29
  22. package/cypress/pages/gridFillPage.js +663 -15
  23. package/cypress/pages/itemPreviewSettingsPage.js +3 -3
  24. package/cypress/pages/matchingPage.js +466 -5
  25. package/cypress/pages/shortTextResponsePage.js +1 -0
  26. package/cypress/pages/textEntryMathPage.js +1 -1
  27. package/cypress/pages/textEntryMathWithImagePage.js +1 -1
  28. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { createItemPage } from "./createItemPage";
5
5
  import { shortTextResponsePage } from "./shortTextResponsePage";
6
6
  import { scoringSectionBase } from "./components";
7
7
  import { questionInstructionsComponent } from "./components";
8
- import { passagePage } from "./passagePage";
8
+ import { contentBlocksPage } from "./contentBlocksPage";
9
9
  import { createQuestionBasePage } from "./components";
10
10
 
11
11
  const selectors = {
@@ -13,7 +13,7 @@ const selectors = {
13
13
  ...shortTextResponsePage,
14
14
  ...scoringSectionBase,
15
15
  ...questionInstructionsComponent,
16
- ...passagePage,
16
+ ...contentBlocksPage,
17
17
  ...createQuestionBasePage,
18
18
  headerWrapper: () => cy.get('.settings-header-wrapper'),
19
19
  //HeadingSectionSelectors
@@ -101,7 +101,7 @@ const selectors = {
101
101
  const steps = {
102
102
  ...createItemPage.steps,
103
103
  ...shortTextResponsePage.steps,
104
- ...passagePage.steps,
104
+ ...contentBlocksPage.steps,
105
105
  ...scoringSectionBase.steps,
106
106
  ...questionInstructionsComponent.steps,
107
107
  ...selectQuestionResourceToolPage.steps,
@@ -2,18 +2,27 @@ import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
3
  import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType } from "./components";
4
4
  const css = Cypress.env('css');
5
+ const options = ['option 1', 'option 2', 'option 3'];
6
+ const fourOptions = ['option 1', 'option 2', 'option 3', 'option 4'];
5
7
 
6
8
  const selectors = {
7
9
  ...correctIncorrectAnswerLabelComponent,
8
10
  ...questionInstructionsComponent,
9
11
  ...commonComponents,
10
12
  ...autoScoredScoringPreviewTab,
13
+ ...draggableOptionsSectionComponent,
11
14
  ...autoScoredScoringSectionMultiResponseType,
12
15
  ...autoScoredSpecifyCorrectAnswerSection,
13
16
  ...draggableOptionContainer,
14
17
  //Edit tab
15
18
  promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
16
19
  optionInputField: () => cy.get('.edit-mcq-options-wrapper').eq(1).find('[data-rbd-draggable-id*="option-draggable"] [role="textbox"]'),
20
+ optionWrapper: () => cy.get('.response-options-wrapper [data-rbd-draggable-id*="option-draggable"]'),
21
+ optionNumeration: () => cy.get('.response-options-wrapper [class*="SingleOptionstyle__AdornmentDiv"]'),
22
+ //Specify correct answer section
23
+ dropzoneSpecifyCorrectAnswerSection: () => cy.get('.authoring-droppable-hotspot-wrapper'),
24
+ optionContainerOptionsSpecifyCorrectAnswerSection: () => cy.get('.draggable-selected-item'),
25
+ optionsLabel: () => cy.get('.cloze-with-drag-and-drop-options-label'),
17
26
  addPromptButton: () => cy.get('.add-option-wrapper-cls button').contains('Add prompt'),
18
27
  deletePromptButton: () => cy.get('.edit-mcq-stems-wrapper [type="button"]'),
19
28
 
@@ -29,7 +38,7 @@ const selectors = {
29
38
 
30
39
  //Preview tab
31
40
  promptContainerPreviewTab: () => cy.get('.stem-container'),
32
- dropzonePreviewTab: () => cy.get('[class*="MultipleDroppableHotspotstyle__DroppableHotspotWrapper"]'),
41
+ dropzonePreviewTab: () => cy.get('.cloze-with-drag-and-drop-preview [class*="MultipleDroppableHotspotstyle__DroppableHotspotWrapper"]'),
33
42
  dropzoneOptionPreviewTab: () => cy.get('[class*="MultipleDroppedItemstyles__FlexWrapper"]'),
34
43
  dropzoneNumeration: () => cy.get('[class*="NumerationDiv"]'),
35
44
  correctAnswersNumeration: () => cy.get('.answer-numeration-number-box'),
@@ -50,6 +59,8 @@ const steps = {
50
59
  ...equationEditorFlyout.steps,
51
60
  ...autoScoredStudentViewSettings.steps,
52
61
  ...autoScoredSpecifyCorrectAnswerSection.steps,
62
+ ...draggableOptionsSectionComponent.steps,
63
+ ...draggableOptionContainer.steps,
53
64
  ...autoScoredScoringSectionMultiResponseType.steps,
54
65
  //Edit tab
55
66
  addPrompt: () => {
@@ -136,11 +147,26 @@ const steps = {
136
147
  matchingPage.optionInputField()
137
148
  .eq(index)
138
149
  .clear()
139
- .type(options)
150
+ .type(options, { delay: 500 })
151
+ .blur();
152
+ matchingPage.optionInputField()
153
+ .eq(index)
140
154
  .should('have.text', options);
141
155
  });
142
156
  },
143
157
 
158
+ /**
159
+ * Verifies text in multiple option input fields.
160
+ * @param {string[]} optionsArray - Array of text to enter into the option input fields.
161
+ */
162
+ verifyTextInOptionInputField: (optionsArray) => {
163
+ optionsArray.forEach((option, index) => {
164
+ matchingPage.optionInputField()
165
+ .eq(index)
166
+ .should('have.text', option);
167
+ });
168
+ },
169
+
144
170
  /**
145
171
  * This function enters text in an option
146
172
  * @param {number} index of option
@@ -149,7 +175,23 @@ const steps = {
149
175
  enterTextInOneOptionInputField: (index, options) => {
150
176
  matchingPage.optionInputField()
151
177
  .eq(index)
152
- .type(options);
178
+ .type(options)
179
+ .blur();
180
+ matchingPage.optionInputField()
181
+ .eq(index)
182
+ .should('have.text', options);
183
+ },
184
+
185
+ /**
186
+ * @param {number} index of option input field
187
+ * @param {string} textContent to enter text in the options input field
188
+ */
189
+ editOptionInputField: (index, textContent) => {
190
+ matchingPage.optionInputField()
191
+ .eq(index)
192
+ .clear()
193
+ .type(textContent)
194
+ .blur();
153
195
  },
154
196
 
155
197
  /**
@@ -186,6 +228,32 @@ const steps = {
186
228
  .should('have.text', '​​​​​​​This is a bold option');
187
229
  },
188
230
 
231
+ /**
232
+ * @param {number} index of the option
233
+ * @description verify the enter option input field, drag handle, delete button and option numeration
234
+ */
235
+ verifyOptionsContents: (index) => {
236
+ matchingPage.optionInputField()
237
+ .eq(index)
238
+ .should('have.attr', 'data-cke-editorplaceholder', 'Enter option');
239
+ utilities.verifyElementVisibilityState(commonComponents.dragHandleButton(), 'exist');
240
+ utilities.verifyElementVisibilityState(commonComponents.deleteButton(), 'visible');
241
+ matchingPage.optionNumeration()
242
+ .eq(index)
243
+ .should('have.text', index + 1);
244
+ },
245
+
246
+ verifyDeleteOptionButtonDisabledState: () => {
247
+ matchingPage.optionWrapper()
248
+ .eq(0)
249
+ .within(() => {
250
+ optionsWrapperComponent.deleteOptionButton()
251
+ .each(($element) => {
252
+ utilities.verifyElementDisabled(cy.wrap($element))
253
+ });
254
+ });
255
+ },
256
+
189
257
  /**
190
258
  * @description Allots penalty points for each incorrect dropzone
191
259
  * @param {number} points - The penalty points to be allotted for each dropzone.
@@ -255,7 +323,7 @@ const steps = {
255
323
  /**
256
324
  * @param {string} groupTitle group title
257
325
  * @param {string[]} optionArray array of options for a particular group
258
- * @description add a group with title and options in the response options section
326
+ * @description add a group with title and options in the response options section
259
327
  */
260
328
  addGroupWithTitleAndOptionsInDraggableOptionsSection: (groupTitle, optionArray) => {
261
329
  const numOptionsToAdd = Math.max(0, optionArray.length - 2);
@@ -286,6 +354,16 @@ const steps = {
286
354
  matchingPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[3], animals[3]);
287
355
  },
288
356
 
357
+ verifyOptionContainerOptionSpecifyCorrectAnswerSection: (optionsArray) => {
358
+ optionsArray.forEach(({ index, optionText }) => {
359
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.optionContainerOptionsSpecifyCorrectAnswerSection(), index), optionText);
360
+ });
361
+ },
362
+
363
+ verifyDropzoneTextSpecifyCorrectAnswerSection: (count, text) => {
364
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.dropzoneSpecifyCorrectAnswerSection(), count), text);
365
+ },
366
+
289
367
  //Preview tab
290
368
  /**
291
369
  * Enter text in the answer input fields of the specify correct answer section.
@@ -553,13 +631,396 @@ const steps = {
553
631
  verifyGradingViewOptionDisabled: () => {
554
632
  matchingPage.correctAnswersOptionContainer()
555
633
  .should('have.css', 'pointer-events', 'none');
556
- }
634
+ },
635
+
636
+ /**
637
+ * @param {string} groupTitle group title
638
+ * @param {string[]} optionArray array of options for a particular group
639
+ * @description add a group with title and options in the response options section
640
+ */
641
+ addGroupWithTitleAndOptionsInDraggableOptionsSection: (groupTitle, optionArray) => {
642
+ const numOptionsToAdd = Math.max(0, optionArray.length - 2);
643
+ draggableOptionsSectionComponent.steps.addGroup();
644
+ draggableOptionsSectionComponent.steps.addGroupTitle(groupTitle);
645
+ for (let i = 0; i < numOptionsToAdd; i++) {
646
+ optionsWrapperComponent.steps.addOption();
647
+ }
648
+ steps.enterTextInOptionInputField(optionArray);
649
+ },
557
650
  }
558
651
 
559
652
  const tests = {
560
653
  ...autoScoredScoringPreviewTab.tests,
654
+ ...draggableOptionsSectionComponent.tests,
655
+ ...optionsWrapperComponent.tests,
656
+ ...draggableOptionContainer.tests,
561
657
  ...scoringSectionBaseEditTab.tests,
562
658
  ...autoScoredScoringSectionMultiResponseType.tests,
659
+
660
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
661
+ /**
662
+ * Verifies the contents and styling of the 'Options' section.
663
+ * @param {number} optionFieldsCount - The expected number of option input fields.
664
+ */
665
+ verifyOptionsSectionContents: ({ optionFieldsCount, optionLabel }) => {
666
+ it(`\'${optionLabel}\' label should be displayed`, () => {
667
+ utilities.verifyInnerText(matchingPage.optionsLabel(), optionLabel);
668
+ });
669
+
670
+ it(`By default ${optionFieldsCount} option input fields with placeholder text, drag handle and delete option icon buttons should be displayed`, () => {
671
+ for (let index = 0; index < optionFieldsCount; index++) {
672
+ steps.verifyOptionsContents(index);
673
+ };
674
+ });
675
+
676
+ it('\'Add Option\' button should be present', () => {
677
+ utilities.verifyInnerText(optionsWrapperComponent.addOptionButton(), 'Add option');
678
+ utilities.verifyElementVisibilityState(optionsWrapperComponent.addOptionButton(), 'visible');
679
+ });
680
+
681
+ it('CSS of Options section', { tags: 'css' }, () => {
682
+ utilities.verifyCSS(matchingPage.optionsLabel(), {
683
+ 'color': css.color.sectionHeading,
684
+ 'font-size': css.fontSize.normal,
685
+ 'font-weight': css.fontWeight.semibold
686
+ });
687
+ utilities.verifyCSS(commonComponents.dragHandleButton().find('path'), {
688
+ 'fill': css.color.secondaryBtnActive
689
+ });
690
+ commonComponents.deleteButton()
691
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
692
+ utilities.verifyCSS(optionsWrapperComponent.optionsInputField(), {
693
+ 'color': css.color.text,
694
+ 'font-size': css.fontSize.default,
695
+ 'font-weight': css.fontWeight.regular
696
+ });
697
+ utilities.verifyCSS(optionsWrapperComponent.addOptionButton(), {
698
+ 'color': css.color.secondaryBtnActive,
699
+ 'font-size': css.fontSize.default,
700
+ 'font-weight': css.fontWeight.regular
701
+ });
702
+ });
703
+ },
704
+
705
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
706
+ verifyAddOptionFunctionality: () => {
707
+ it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
708
+ let initialOptionCount;
709
+ matchingPage.steps.getOptionCount().then((count) => {
710
+ initialOptionCount = count;
711
+ optionsWrapperComponent.steps.addOption();
712
+ matchingPage.steps.getOptionCount().should('eq', initialOptionCount + 1);
713
+ matchingPage.steps.verifyOptionsContents(initialOptionCount);
714
+ });
715
+ });
716
+ },
717
+
718
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
719
+ /**
720
+ * Verify the error state of an 'Options' input field.
721
+ * @param {number} inputFieldIndex - The index of the 'Options' input field to verify.
722
+ * @throws {Error} Throws an error if the expected error message is not displayed.
723
+ */
724
+ verifyOptionInputFieldErrorState: (inputFieldIndex) => {
725
+ it('When user focus in and out of any of the \'Options\' input field without typing anything, an error message should be thrown', () => {
726
+ matchingPage.optionInputField()
727
+ .eq(inputFieldIndex)
728
+ .click()
729
+ .blur();
730
+ utilities.verifyInnerText(commonComponents.errorMessage().eq(1), 'Error: Option is required.');
731
+ });
732
+
733
+ it('User should be able to enter text in options input field and \'Error: Option is required.\' error message should disappear', () => {
734
+ matchingPage.optionInputField()
735
+ .eq(inputFieldIndex)
736
+ .type('option 1')
737
+ .blur();
738
+ matchingPage.optionWrapper()
739
+ .eq(inputFieldIndex)
740
+ .within(() => {
741
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
742
+ });
743
+ });
744
+ },
745
+
746
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
747
+ verifyDraggableOptionsForStandardLayoutInSpecifyCorrectAnswerSection: () => {
748
+ it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed in the options container of the specify correct answer section section', () => {
749
+ draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['', '', '']);
750
+ });
751
+
752
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the options container of the specify correct answer section section', () => {
753
+ matchingPage.steps.enterTextInOptionInputField(options);
754
+ draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(options);
755
+ });
756
+
757
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed along with drag handle in the options container of the \'Specify correct answer section section\' section', () => {
758
+ optionsWrapperComponent.steps.addOption();
759
+ draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['option 1', 'option 2', 'option 3', '']);
760
+ cy.log('Checking that input text to the newly added option is displayed in the options container of the \'Specify correct answer section section\' section')
761
+ matchingPage.steps.enterTextInOneOptionInputField(3, 'option 4');
762
+ draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(fourOptions);
763
+ });
764
+
765
+ it('When the user adds an identical option in the options field, then both options should be displayed in the options container of the \'Specify correct answer section section\' section', () => {
766
+ cy.log('Pre step: Editing the option 3 to option 2 to make two options identical')
767
+ steps.editOptionInputField(2, 'option 2');
768
+ draggableOptionContainer.steps.verifyCountOfDraggableOptionsInSpecifyCorrectAnswerSection(4);
769
+ draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['option 1', 'option 2', 'option 2', 'option 4']);
770
+
771
+ cy.log('Post step: Editing the the identical option back to option 3')
772
+ steps.editOptionInputField(2, 'option 3');
773
+ });
774
+ },
775
+
776
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
777
+ verifyDraggableOptionsForStandardLayoutInPreviewTab: () => {
778
+ it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed in the options container of the \'Preview tab\'', () => {
779
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(['', '', '']);
780
+ });
781
+
782
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the options container of the \'Preview tab\'', () => {
783
+ createQuestionBasePage.steps.switchToEditTab();
784
+ matchingPage.steps.enterTextInOptionInputField(options);
785
+ createQuestionBasePage.steps.switchToPreviewTab();
786
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(options);
787
+ });
788
+
789
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed in the options container of the \'Preview tab\'', () => {
790
+ cy.log('Pre-step : Switching to \'Edit\' tab')
791
+ createQuestionBasePage.steps.switchToEditTab();
792
+ optionsWrapperComponent.steps.addOption();
793
+ createQuestionBasePage.steps.switchToPreviewTab();
794
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(['option 1', 'option 2', 'option 3', '']);
795
+ cy.log('Checking that input text to the newly added option is displayed in the options container of the preview tab')
796
+ createQuestionBasePage.steps.switchToEditTab();
797
+ matchingPage.steps.enterTextInOneOptionInputField(3, 'option 4');
798
+ createQuestionBasePage.steps.switchToPreviewTab();
799
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(fourOptions);
800
+ });
801
+
802
+ it('When the user adds an identical option in the options field, then both options should be displayed in the options container of the \'Preview tab\'', () => {
803
+ cy.log('Pre-step : Switching to \'Edit\' tab and editing the option 3 to option 2 to make two options identical')
804
+ createQuestionBasePage.steps.switchToEditTab();
805
+ matchingPage.steps.editOptionInputField(2, 'option 2');
806
+ createQuestionBasePage.steps.switchToPreviewTab();
807
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(['option 1', 'option 2', 'option 2', 'option 4'])
808
+ cy.log('Post step: Editing the the identical option back to option 3')
809
+ createQuestionBasePage.steps.switchToEditTab();
810
+ matchingPage.steps.editOptionInputField(2, `option 3`);
811
+ });
812
+
813
+ it('When the user deletes an option then the deleted option should get removed from the options container of the \'Preview tab\'', () => {
814
+ const optionsAfterDeleting = fourOptions.filter((el) => el !== 'option 3')
815
+ cy.log('Pre-step : Switching to \'Edit\' tab')
816
+ createQuestionBasePage.steps.switchToEditTab();
817
+ optionsWrapperComponent.steps.deleteOption(2);
818
+ cy.log('Checking the deleted option should not exist in the Preview tab')
819
+ createQuestionBasePage.steps.switchToPreviewTab();
820
+ draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(optionsAfterDeleting);
821
+ });
822
+ },
823
+
824
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
825
+ addGroupFunctionality: () => {
826
+ it('When the user clicks on the \'Add Group\' button, a new group should get added with tab \'Group 2\'', () => {
827
+ draggableOptionsSectionComponent.steps.addGroup();
828
+ utilities.verifyElementCount(draggableOptionsSectionComponent.groupTab(), 2);
829
+ utilities.verifyInnerText(utilities.getNthElement(draggableOptionsSectionComponent.groupTab(), 1), 'Group 2');
830
+ });
831
+
832
+ it('By default, the newly added group should have a \'Close\' button next to the group tab, \'Close\' icon should not be displayed next to \'Group 1\' tab, \'Group title\' label and input field, \'Options\' label and 2 option input fields with drag handles and disabled delete buttons', () => {
833
+ draggableOptionsSectionComponent.steps.verifyGroupTabCloseIconVisible(1);
834
+ draggableOptionsSectionComponent.steps.verifyGroupedOptionsSectionTitleAndInputField();
835
+ utilities.verifyElementCount(matchingPage.optionWrapper(), 2);
836
+ matchingPage.steps.verifyOptionsContents(0);
837
+ matchingPage.steps.verifyOptionsContents(1);
838
+ });
839
+ },
840
+
841
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
842
+ verifyDraggableOptionsForGroupedLayoutInSpecifyCorrectAnswerSection: () => {
843
+ it('When the user has not entered text in the \'Group title\' input field then no group title should be displayed for the group in the options container of the specify correct answer section', () => {
844
+ utilities.verifyElementVisibilityState(draggableOptionContainer.groupedOptionsTitleSpecifyCorrectAnswerSection(), 'notExist');
845
+ });
846
+
847
+ it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the options container of the specify correct answer section', () => {
848
+ draggableOptionsSectionComponent.steps.addGroupTitle('Group title A');
849
+ utilities.verifyInnerText(draggableOptionContainer.groupedOptionsTitleSpecifyCorrectAnswerSection(), 'Group title A');
850
+ utilities.verifyElementVisibilityState(draggableOptionContainer.groupedOptionsTitleSpecifyCorrectAnswerSection(), 'visible');
851
+ });
852
+
853
+ it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed as a group in the options container of the specify correct answer section', () => {
854
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['', '', '']);
855
+ });
856
+
857
+ 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', () => {
858
+ matchingPage.steps.enterTextInOptionInputField(options);
859
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, options);
860
+ });
861
+
862
+ it('CSS of \'Grouped\' container in the specify correct answer section', { tags: 'css' }, () => {
863
+ utilities.verifyCSS(draggableOptionContainer.groupedOptionsContainerSpecifyCorrectAnswerSection(), {
864
+ 'border': `1px solid ${css.color.defaultDropdownBorder}`
865
+ });
866
+ utilities.verifyCSS(draggableOptionContainer.optionsContainerSpecifyCorrectAnswerSection(), {
867
+ 'background-color': css.color.draggableOptionsContainerBg,
868
+ 'border': `1px solid ${css.color.draggableOptionsContainerBorder}`
869
+ });
870
+ utilities.verifyCSS(draggableOptionContainer.draggableOption(), {
871
+ 'background-color': css.color.defaultBackground,
872
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
873
+ });
874
+ utilities.verifyCSS(draggableOptionContainer.draggableOption().find('.question-text-wrapper'), {
875
+ 'color': css.color.text,
876
+ 'font-size': css.fontSize.default,
877
+ 'font-weight': css.fontWeight.regular
878
+ });
879
+ });
880
+
881
+ it('Accessibility of \'Grouped\' container in the specify correct answer section', { tags: 'a11y' }, () => {
882
+ cy.checkAccessibility(draggableOptionContainer.groupedOptionsContainerSpecifyCorrectAnswerSection());
883
+ });
884
+
885
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed along with drag handle inside the group in the options container of the specify correct answer section', () => {
886
+ optionsWrapperComponent.steps.addOption();
887
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['option 1', 'option 2', 'option 3', '']);
888
+ cy.log('Checking that input text to the newly added option is displayed in the options container of the specify correct answer section')
889
+ steps.enterTextInOneOptionInputField(3, `${fourOptions[3]}`);
890
+ });
891
+
892
+ it('When the user adds an identical option in the options field, then both options should be displayed inside the group in the options container of the specify correct answer section', () => {
893
+ cy.log('Pre step: Editing the option 3 to option 2 to make two responses identical')
894
+ steps.editOptionInputField(2, `${fourOptions[1]}`);
895
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['option 1', 'option 2', 'option 3', 'option 4']);
896
+ cy.log('Post step: Editing the the identical option back to option 3')
897
+ steps.editOptionInputField(2, `${fourOptions[2]}`);
898
+ });
899
+
900
+ it('When the user deletes an option then the deleted option should get removed from the group in the options container of the specify correct answer section', () => {
901
+ optionsWrapperComponent.steps.deleteOption(3);
902
+ cy.log('verifying the text of draggable options after deleting an option')
903
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['option 1', 'option 2', 'option 3']);
904
+ });
905
+
906
+ it('When the user adds a new group, the new group should be displayed in the options container of the specify correct answer section', () => {
907
+ draggableOptionsSectionComponent.steps.addGroup();
908
+ utilities.verifyElementCount(draggableOptionContainer.groupedOptionsContainerSpecifyCorrectAnswerSection(), 2);
909
+ });
910
+
911
+ it('By default, the newly added group should have two empty draggable options along with drag handles', () => {
912
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(1, ['', '']);
913
+ });
914
+ },
915
+
916
+ //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
917
+ verifyDraggableOptionsForGroupedLayoutInPreviewTab: () => {
918
+ it('When the user has not entered text in the \'Group title\' input field then no group title should be displayed for the group in the options container of the \'Preview tab\'', () => {
919
+ utilities.verifyElementVisibilityState(draggableOptionContainer.groupedOptionsTitlePreviewTab(), 'notExist');
920
+ });
921
+
922
+ it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the options container of the \'Preview tab\'', () => {
923
+ cy.log('Pre step: Switching to edit tab')
924
+ createQuestionBasePage.steps.switchToEditTab();
925
+ draggableOptionsSectionComponent.steps.addGroupTitle('Group title A');
926
+ createQuestionBasePage.steps.switchToPreviewTab();
927
+ utilities.verifyInnerText(draggableOptionContainer.groupedOptionsTitlePreviewTab(), 'Group title A');
928
+ utilities.verifyElementVisibilityState(draggableOptionContainer.groupedOptionsTitlePreviewTab(), 'visible');
929
+ });
930
+
931
+ it('When the user has not entered text in the options input field then three empty draggable options along with drag handles should be displayed as a group in the options container of the \'Preview tab\'', () => {
932
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, ['', '', '']);
933
+ });
934
+
935
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the options container of the \'Preview tab\'', () => {
936
+ cy.log('Pre step: Switching to edit tab')
937
+ createQuestionBasePage.steps.switchToEditTab();
938
+ steps.enterTextInOptionInputField(options);
939
+ createQuestionBasePage.steps.switchToPreviewTab();
940
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, options);
941
+ });
942
+
943
+ it('CSS of \'Grouped\' container in the options container of the \'Preview tab\'', { tags: 'css' }, () => {
944
+ utilities.verifyCSS(draggableOptionContainer.groupedOptionsContainerPreviewTab(), {
945
+ 'border': `1px solid ${css.color.defaultDropdownBorder}`
946
+ });
947
+ utilities.verifyCSS(draggableOptionContainer.optionsContainerPreviewTab(), {
948
+ 'background-color': css.color.draggableOptionsContainerBg,
949
+ 'border': `1px solid ${css.color.draggableOptionsContainerBorder}`
950
+ });
951
+ utilities.verifyCSS(draggableOptionContainer.draggableOption(), {
952
+ 'background-color': css.color.defaultBackground,
953
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
954
+ });
955
+ utilities.verifyCSS(draggableOptionContainer.draggableOption().find('.question-text-wrapper'), {
956
+ 'color': css.color.text,
957
+ 'font-size': css.fontSize.default,
958
+ 'font-weight': css.fontWeight.regular
959
+ });
960
+ });
961
+
962
+ it('Accessibility of \'Grouped\' container in the options container of the \'Preview tab\'', { tags: 'a11y' }, () => {
963
+ cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
964
+ });
965
+
966
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed inside the group in the options container of the \'Preview tab\'', () => {
967
+ cy.log('Pre step: Switching to edit tab')
968
+ createQuestionBasePage.steps.switchToEditTab();
969
+ optionsWrapperComponent.steps.addOption();
970
+ createQuestionBasePage.steps.switchToPreviewTab();
971
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, ['option 1', 'option 2', 'option 3', '']);
972
+ cy.log('Checking that input text to the newly added option is displayed in the options container of the preview tab')
973
+ createQuestionBasePage.steps.switchToEditTab();
974
+ steps.enterTextInOneOptionInputField(3, `${fourOptions[3]}`);
975
+ createQuestionBasePage.steps.switchToPreviewTab();
976
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, fourOptions);
977
+ });
978
+
979
+ it('When the user adds an identical option in the options field, then both options should be displayed inside the group in the options container of the \'Preview tab\'', () => {
980
+ cy.log('Pre step: Editing the option 3 to option 2 to make two responses identical')
981
+ createQuestionBasePage.steps.switchToEditTab();
982
+ steps.editOptionInputField(2, `${fourOptions[1]}`);
983
+ createQuestionBasePage.steps.switchToPreviewTab();
984
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, ['option 1', 'option 2', 'option 2', 'option 4']);
985
+ cy.log('Post step: Editing the the identical option back to option 3')
986
+ createQuestionBasePage.steps.switchToEditTab();
987
+ steps.editOptionInputField(2, `${fourOptions[2]}`);
988
+ });
989
+
990
+ it('When the user deletes an option then the deleted option should get removed from the group in the options container of the \'Preview tab\'', () => {
991
+ optionsWrapperComponent.steps.deleteOption(3);
992
+ createQuestionBasePage.steps.switchToPreviewTab();
993
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, ['option 1', 'option 2', 'option 3']);
994
+ });
995
+
996
+ it('When the user adds a new group, the new group should be displayed in the options container of the \'Preview tab\'', () => {
997
+ createQuestionBasePage.steps.switchToEditTab();
998
+ draggableOptionsSectionComponent.steps.addGroup();
999
+ createQuestionBasePage.steps.switchToPreviewTab();
1000
+ utilities.verifyElementCount(draggableOptionContainer.groupedOptionsContainerPreviewTab(), 2);
1001
+ });
1002
+
1003
+ it('By default, the newly added group should have two empty draggable options along with drag handles', () => {
1004
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(1, ['', '']);
1005
+ });
1006
+
1007
+ //Need to update once https://redmine.zeuslearning.com/issues/557984 is resolved
1008
+ it('When the user deletes a group, it should get removed from options container of the \'Preview tab\'', () => {
1009
+ cy.log('Pre step: Switching to edit tab')
1010
+ createQuestionBasePage.steps.switchToEditTab();
1011
+ cy.log('Pre step: Entering text into the text fields of group 2 response container')
1012
+ steps.enterTextInOptionInputField(['option 3', 'option 4']);
1013
+ draggableOptionsSectionComponent.steps.addGroupTitle('Group title B');
1014
+ draggableOptionsSectionComponent.steps.switchToGroupTab(0);
1015
+ draggableOptionsSectionComponent.steps.deleteGroup(0);
1016
+ createQuestionBasePage.steps.switchToPreviewTab();
1017
+ utilities.verifyElementCount(draggableOptionContainer.groupedOptionsContainerPreviewTab(), 1);
1018
+ cy.log('verifying the contents of group 2 after deleting group 1')
1019
+ draggableOptionContainer.steps.verifyGroupedContainerContentsInPreviewTab(0, ['option 3', 'option 4']);
1020
+ utilities.verifyInnerText(draggableOptionContainer.groupedOptionsTitlePreviewTab(), 'Group title B');
1021
+ })
1022
+ },
1023
+
563
1024
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
564
1025
  it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
565
1026
  const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
@@ -14,6 +14,7 @@ const selectors = {
14
14
  ...autoScoredSpecifyCorrectAnswerSection,
15
15
  ...commonComponents,
16
16
  ...additionalSettingsPanel,
17
+ ...createQuestionBasePage,
17
18
 
18
19
  answerLabelSpecifyCorrectAnswerSection: () => cy.get('.answer-label'),
19
20
  displayCharacterCountLabel: () => cy.get('[data-ngie-testid="display-character-count-checkbox"] .MuiFormControlLabel-label'),
@@ -88,7 +88,7 @@ const selectors = {
88
88
  },
89
89
 
90
90
  //Preview tab
91
- responseFieldPreviewTab: () => cy.get('.preview-question-text-wrapper .equation-input-without-andornment'),
91
+ responseFieldPreviewTab: () => cy.get('.preview-question-text-wrapper .equation-input-without-andornment .mq-root-block'),
92
92
  responseFieldWrapperPreviewTab: () => cy.get('.cloze-response-wrapper'),
93
93
  responseFieldNumerationPreviewTab: () => cy.get('.preview-question-text-wrapper .response-input-adornment'),
94
94
  questionContainerPreviewTab: () => cy.get('[class*="ClozeWithTextPreviewstyle__QuestionPreviewWrapper"]'),
@@ -11,7 +11,7 @@ const selectors = {
11
11
  ...dialogBoxBase,
12
12
 
13
13
  addBackgroundButton: () => cy.get('[data-ngie-testid="add-background-tab"]'),
14
- responseFieldPreviewTab: () => cy.get('.cloze-math-background-preview .equation-input-without-andornment'),
14
+ responseFieldPreviewTab: () => cy.get('.cloze-math-background-preview .equation-input-without-andornment .mq-root-block'),
15
15
  canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] .image-container'),
16
16
  textAreaPreviewTab: () => cy.get('.label-image-with-text-preview [class*="TextBoxContainer"]'),
17
17
  tickIcon: () => cy.get('.add-background-tick-icon-wrapper [data-name*="Rectangle"]'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.151-28MarchRepoUpdate-20de036.0",
3
+ "version": "1.0.152-28th-March-fixes-6236e0e.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {