itemengine-cypress-automation 1.0.72 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/cypress/e2e/ILC/AudioResponse/{audioResponseMinimalPreviewSection.js → audioResponseMinimalPreviewSection.smoke.js} +263 -254
  2. package/cypress/e2e/ILC/AudioResponse/{audioResponseStandardPreviewSection.js → audioResponseStandardPreviewSection.smoke.js} +100 -97
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.smoke.js +121 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachCell.js → groupedOptionsPartialScoreForEachCell.smoke.js} +1 -1
  5. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachResponse.js → groupedOptionsPartialScoreForEachResponse.smoke.js} +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.smoke.js +164 -0
  7. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{standardTotalScoreDividedBetweenResponse.js → standardTotalScoreDividedBetweenResponse.smoke.js} +21 -18
  8. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +753 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.smoke.js +943 -0
  10. package/cypress/e2e/ILC/EssayResponse/{essayResponseCustomizeFormattingOptions1.js → essayResponseCustomizeFormattingOptions1.smoke.js} +113 -110
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +581 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.smoke.js +111 -0
  13. package/cypress/e2e/ILC/EssayResponse/{essayResponsePreviewContentsForAllViews.js → essayResponsePreviewContentsForAllViews.smoke.js} +6 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.smoke.js +81 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/{fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js → fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.smoke.js} +25 -22
  16. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAllOrNothingScoring.js → fillInTheGapsDropdownAllOrNothingScoring.smoke.js} +16 -14
  17. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.smoke.js} +80 -74
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.smoke.js +361 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.smoke.js +137 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.smoke.js +171 -0
  21. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.smoke.js} +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextAllOrNothingScoring.js → fillInTheGapsOverImageTextAllOrNothingScoring.smoke.js} +32 -29
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextCheckAnswerForAllViews.js → fillInTheGapsOverImageTextCheckAnswerForAllViews.smoke.js} +5 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.smoke.js +137 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.smoke.js +146 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewContentsForAllViews.js → fillInTheGapsOverImageTextPreviewContentsForAllViews.smoke.js} +5 -3
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewTab.js → fillInTheGapsOverImageTextPreviewTab.smoke.js} +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextShowCorrectAnswerForAllView.js → fillInTheGapsOverImageTextShowCorrectAnswerForAllView.smoke.js} +6 -4
  29. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextAutoScoredScoring.js → fillInTheGapsTextAutoScoredScoring.smoke.js} +12 -9
  30. package/cypress/e2e/ILC/Highlight/HighlightScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +36 -34
  31. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.smoke.js +462 -0
  32. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.smoke.js +148 -0
  33. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.smoke.js +185 -0
  34. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.smoke.js +138 -0
  35. package/cypress/e2e/ILC/HighlightImage/{highlightImagePreviewTab.js → highlightImagePreviewTab.smoke.js} +1 -1
  36. package/cypress/e2e/ILC/HighlightImage/{highlightImageToolsFunctionalityPreviewTab.js → highlightImageToolsFunctionalityPreviewTab.smoke.js} +4 -4
  37. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.smoke.js +122 -0
  38. package/cypress/e2e/ILC/ListMatching/{listMatchingAlternateAnswer.js → listMatchingAlternateAnswer.smoke.js} +47 -43
  39. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.smoke.js +211 -0
  40. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.smoke.js +254 -0
  41. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.smoke.js +191 -0
  42. package/cypress/e2e/ILC/ListOrdering/ListOrderingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +34 -32
  43. package/cypress/e2e/ILC/ListSorting/ListSortingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +41 -38
  44. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.smoke.js +269 -0
  45. package/cypress/e2e/ILC/MultipleSelectionGrid/{multipleSelectionGridAutoScoredScoring.js → multipleSelectionGridAutoScoredScoring.smoke.js} +36 -34
  46. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.smoke.js +407 -0
  47. package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoring.js → singleSelectionGridAutoScoredScoring.smoke.js} +32 -29
  48. package/cypress/e2e/ILC/UploadResponse/{uploadResponsePreview.js → uploadResponsePreview.smoke.js} +64 -59
  49. package/cypress/e2e/ILC/VideoResponse/{videoResponsePreviewTab.js → videoResponsePreviewTab.smoke.js} +290 -281
  50. package/cypress/pages/components/additionalSettingsPanel.js +0 -27
  51. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  52. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +321 -0
  53. package/cypress/pages/components/createQuestionBasePage.js +1 -7
  54. package/cypress/pages/components/essayResponseCommonComponents.js +0 -6
  55. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -13
  56. package/cypress/pages/components/index.js +2 -1
  57. package/cypress/pages/components/mcqAdditionalSettingsBase.js +0 -10
  58. package/cypress/pages/components/scoringSectionBase.js +3 -2
  59. package/cypress/pages/createItemPage.js +3 -79
  60. package/cypress/pages/dialogBoxBase.js +8 -23
  61. package/cypress/pages/index.js +1 -4
  62. package/cypress/pages/itemPreviewSettingsPage.js +446 -0
  63. package/cypress/pages/multipleSelectionPage.js +113 -64
  64. package/cypress/pages/selectQuestionResourceToolPage.js +0 -5
  65. package/cypress/pages/shortTextResponsePage.js +0 -6
  66. package/cypress/pages/singleSelectionPage.js +0 -1
  67. package/package.json +2 -2
  68. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.js +0 -116
  69. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.js +0 -160
  70. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +0 -932
  71. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -572
  72. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.js +0 -106
  73. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +0 -76
  74. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +0 -134
  75. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +0 -133
  76. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.js +0 -457
  77. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.js +0 -143
  78. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.js +0 -178
  79. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +0 -125
  80. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.js +0 -117
  81. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +0 -207
  82. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +0 -246
  83. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +0 -185
  84. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +0 -820
  85. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +0 -936
  86. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +0 -263
  87. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.js +0 -402
  88. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.js +0 -356
  89. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.js +0 -134
  90. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.js +0 -156
@@ -1,7 +1,7 @@
1
1
  import { listMatchingPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  const css = Cypress.env('css');
4
-
4
+ const grepTags = Cypress.env('grepTags');
5
5
  let optionsForThreeResponses = ['Correct answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3'];
6
6
 
7
7
  describe('Create Item Page: List matching: Edit tab scoring types and set correct answer section for Alternate answer tab', () => {
@@ -9,7 +9,7 @@ describe('Create Item Page: List matching: Edit tab scoring types and set correc
9
9
  cy.loginAs('admin');
10
10
  });
11
11
 
12
- describe('Alternate answer tab', () => {
12
+ describe('Alternate answer tab', { tags: 'smoke' }, () => {
13
13
  abortEarlySetup();
14
14
  before(() => {
15
15
  listMatchingPage.steps.navigateToCreateQuestion('list matching');
@@ -91,57 +91,61 @@ describe('Create Item Page: List matching: Edit tab scoring types and set correc
91
91
  });
92
92
  });
93
93
 
94
- describe('Edit tab \'Set correct answer\' section for Alternate answer tab and \'Scoring\' for Auto-scored: All or Nothing scoring type', () => {
95
- abortEarlySetup();
96
- before(() => {
97
- cy.log('Navigate to list matching question type');
98
- listMatchingPage.steps.navigateToCreateQuestion('list matching');
99
- cy.barsPreLoaderWait();
100
- cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
101
- listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
102
- listMatchingPage.steps.allotPoints(10);
103
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
104
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
105
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
106
- cy.log('adding alternate tab')
107
- listMatchingPage.steps.addAlternateTab(1);
108
- });
109
-
110
- listMatchingPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
94
+ if (!grepTags || !grepTags.includes('smoke')) {
95
+ describe('Edit tab \'Set correct answer\' section for Alternate answer tab and \'Scoring\' for Auto-scored: All or Nothing scoring type', () => {
96
+ abortEarlySetup();
97
+ before(() => {
98
+ cy.log('Navigate to list matching question type');
99
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
100
+ cy.barsPreLoaderWait();
101
+ cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
102
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
103
+ listMatchingPage.steps.allotPoints(10);
104
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
105
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
106
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
107
+ cy.log('adding alternate tab')
108
+ listMatchingPage.steps.addAlternateTab(1);
109
+ });
111
110
 
112
- listMatchingPage.tests.verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection();
111
+ listMatchingPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
113
112
 
114
- listMatchingPage.tests.verifyOptionsInAlternateTab();
113
+ listMatchingPage.tests.verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection();
115
114
 
116
- listMatchingPage.tests.verifyPointsFieldErrorState(10);
115
+ listMatchingPage.tests.verifyOptionsInAlternateTab();
117
116
 
118
- listMatchingPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
119
- });
117
+ listMatchingPage.tests.verifyPointsFieldErrorState(10);
120
118
 
121
- describe('Edit tab \'Set correct answer\' section for Alternate answer tab and \'Scoring\' for Auto-scored: Partial equal weights scoring type', () => {
122
- abortEarlySetup();
123
- before(() => {
124
- cy.log('Navigate to list matching question type');
125
- listMatchingPage.steps.navigateToCreateQuestion('list matching');
126
- cy.barsPreLoaderWait();
127
- cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
128
- listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
129
- listMatchingPage.steps.allotPoints(10);
130
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
131
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
132
- listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
133
- cy.log('adding alternate tab')
134
- listMatchingPage.steps.addAlternateTab(1);
119
+ listMatchingPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
135
120
  });
121
+ }
122
+
123
+ if (!grepTags || !grepTags.includes('smoke')) {
124
+ describe('Edit tab \'Set correct answer\' section for Alternate answer tab and \'Scoring\' for Auto-scored: Partial equal weights scoring type', () => {
125
+ abortEarlySetup();
126
+ before(() => {
127
+ cy.log('Navigate to list matching question type');
128
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
129
+ cy.barsPreLoaderWait();
130
+ cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
131
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
132
+ listMatchingPage.steps.allotPoints(10);
133
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
134
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
135
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
136
+ cy.log('adding alternate tab')
137
+ listMatchingPage.steps.addAlternateTab(1);
138
+ });
136
139
 
137
- listMatchingPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabContents();
140
+ listMatchingPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabContents();
138
141
 
139
- listMatchingPage.tests.verifyOptionsInAlternateTab();
142
+ listMatchingPage.tests.verifyOptionsInAlternateTab();
140
143
 
141
- listMatchingPage.tests.verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection();
144
+ listMatchingPage.tests.verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection();
142
145
 
143
- listMatchingPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality();
144
- });
146
+ listMatchingPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality();
147
+ });
148
+ }
145
149
 
146
150
  describe('Edit tab \'Set correct answer\' section for Alternate answer tab and \'Scoring\' for Auto-scored: Partial different weights scoring type', () => {
147
151
  abortEarlySetup();
@@ -0,0 +1,211 @@
1
+ import { listMatchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+ const grepTags = Cypress.env('grepTags');
5
+ const optionsForGroup2 = ['Response 5', 'Response 6'];
6
+ let optionsForThreeResponses = ['Response 1', 'Response 2', 'Response 3'];
7
+ let optionsForFourResponses = ['Response 1', 'Response 2', 'Response 3', 'Response 4'];
8
+
9
+ describe('Create Item Page: List matching: Grouped response layout - Edit tab', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ if (!grepTags || !grepTags.includes('smoke')) {
15
+ describe('\'Grouped\' response options layout - Edit tab section contents', () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ cy.log('Navigating to List Matching question type');
19
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
20
+ cy.barsPreLoaderWait();
21
+ });
22
+
23
+ listMatchingPage.tests.verifyGroupedOptionsContentAndFunctionality();
24
+ });
25
+ }
26
+
27
+ if (!grepTags || !grepTags.includes('smoke')) {
28
+ describe('\'Grouped\' response options layout - Set correct answer section contents', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ cy.log('Navigating to List Matching question type');
32
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
33
+ cy.barsPreLoaderWait();
34
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
35
+ });
36
+
37
+ 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 response options container of the \'Set Correct Answer\' section', () => {
38
+ listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
39
+ .should('not.exist');
40
+ });
41
+
42
+ it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the response options container of the \'Set Correct Answer\' section', () => {
43
+ listMatchingPage.steps.addGroupTitle(0, 'Group title A');
44
+ listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
45
+ .should('have.text', 'Group title A');
46
+ });
47
+
48
+ 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 response options container of the \'Set Correct Answer\' section', () => {
49
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['', '', '']);
50
+ listMatchingPage.steps.verifyDragIconVisibleInOptionsInSetCorrectAnswerSection();
51
+ });
52
+
53
+ 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 response options container of the \'Set Correct Answer\' section', () => {
54
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
55
+ cy.wait(500);
56
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForThreeResponses);
57
+ });
58
+
59
+ //Failing due to https://redmine.zeuslearning.com/issues/541421
60
+ it('CSS of \'Grouped\' container in the \'Set Correct Answer\' section', { tags: 'css' }, () => {
61
+ listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer()
62
+ .should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`);
63
+ listMatchingPage.draggableOption()
64
+ .should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
65
+ .find('.question-text-wrapper')
66
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
67
+ listMatchingPage.draggableOption()
68
+ .find('.drag-indicator-icon')
69
+ .should('have.css', 'fill', `${css.color.activeButtons}`);
70
+ });
71
+
72
+ it('Accessibility of \'Grouped\' container in the \'Set Correct Answer\' section', { tags: 'a11y' }, () => {
73
+ cy.checkAccessibility(listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer());
74
+ });
75
+
76
+ 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 response options container of the \'Set Correct Answer\' section', () => {
77
+ listMatchingPage.steps.addOption();
78
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInSetCorrectAnswerSection('List matching', 4);
79
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInSetCorrectAnswerSection('List matching', 3);
80
+ cy.log('Checking that input text to the newly added option is displayed in the response options container of the \'Set Correct Answer\' section')
81
+ listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
82
+ cy.wait(500);
83
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForFourResponses);
84
+ });
85
+
86
+ it('When the user deletes an option then the deleted option should get removed from the group in the response options container of the \'Set Correct Answer\' section', () => {
87
+ listMatchingPage.steps.deleteResponseOptionInputField(3);
88
+ cy.log('verifying the text of draggable options after deleting an option')
89
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForThreeResponses);
90
+ });
91
+
92
+ it('When the user adds a new group, the new group should be displayed in the response options container of the \'Set Correct Answer\' section', () => {
93
+ listMatchingPage.steps.addGroup();
94
+ listMatchingPage.steps.verifyCountOfGroupsInSetCorrectAnswerSection(2);
95
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['', '']);
96
+ });
97
+
98
+ it('When the user deletes a group, then the deleted group should get removed from the response options container as well as from the response areas (if any) of the \'Set Correct Answer\' section', () => {
99
+ cy.log('Pre step: Entering text into the text fields of group 2 response container')
100
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, optionsForGroup2);
101
+ listMatchingPage.steps.addGroupTitle(1, 'Group title B');
102
+ cy.log('Setting a correct answer option')
103
+ listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Response 2', 0);
104
+ cy.log('Deleting the 1st group')
105
+ listMatchingPage.steps.deleteGroup(0);
106
+ listMatchingPage.steps.verifyCountOfGroupsInSetCorrectAnswerSection(1);
107
+ listMatchingPage.steps.verifyErroredStateOfEmptyResponseFieldInSetCorrectAnswerSection(0);
108
+ cy.log('verifying the contents of group 2 after deleting group 1')
109
+ listMatchingPage.steps.verifyGroupedResponseOptionsInSetCorrectAnswerSection(0, 'Group title B', optionsForGroup2);
110
+ });
111
+ });
112
+ }
113
+
114
+ describe('\'Grouped\' response options layout - Preview tab contents', { tags: 'smoke' }, () => {
115
+ abortEarlySetup();
116
+ before(() => {
117
+ cy.log('Navigating to List Matching question type');
118
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
119
+ cy.barsPreLoaderWait();
120
+ listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
121
+ listMatchingPage.steps.switchToPreviewTab();
122
+ });
123
+
124
+ 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 response options container of the \'Preview tab\'', () => {
125
+ listMatchingPage.previewTabGroupedResponseTitle()
126
+ .should('not.exist');
127
+ });
128
+
129
+ it('When the user enters text in the \'Group title\' input field, a group title should be displayed for the group in the response options container of the \'Preview tab\'', () => {
130
+ cy.log('Pre step: Switching to edit tab')
131
+ listMatchingPage.steps.switchToEditTab();
132
+ listMatchingPage.steps.addGroupTitle(0, 'Group title A');
133
+ listMatchingPage.steps.switchToPreviewTab();
134
+ listMatchingPage.previewTabGroupedResponseTitle()
135
+ .should('have.text', 'Group title A');
136
+ });
137
+
138
+ 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 response options container of the \'Preview tab\'', () => {
139
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['', '', '']);
140
+ });
141
+
142
+ it('When the user enters text in options input fields then the entered text should be displayed in the respective draggable options in the response options container of the \'Preview tab\'', () => {
143
+ cy.log('Pre step: Switching to edit tab')
144
+ listMatchingPage.steps.switchToEditTab();
145
+ listMatchingPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
146
+ listMatchingPage.steps.switchToPreviewTab();
147
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForThreeResponses);
148
+ });
149
+
150
+ it('CSS of \'Grouped\' container in the response options container of the \'Preview tab\'', { tags: 'css' }, () => {
151
+ listMatchingPage.previewTabGroupedResponseContainer()
152
+ .should('have.css', 'border', `1px solid ${css.color.defaultDropdownBorder}`)
153
+ .within(() => {
154
+ listMatchingPage.draggableOption()
155
+ .should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
156
+ .find('.drag-indicator-icon')
157
+ .should('have.css', 'fill', `${css.color.activeButtons}`);
158
+ });
159
+ });
160
+
161
+ it('Accessibility of \'Grouped\' container in the response options container of the \'Preview tab\'', { tags: 'a11y' }, () => {
162
+ cy.checkAccessibility(listMatchingPage.previewTabGroupedResponseContainer());
163
+ });
164
+
165
+ it('When the user adds an option using \'Add Option\' button then the added option should be displayed inside the group in the response options container of the \'Preview tab\'', () => {
166
+ cy.log('Pre step: Switching to edit tab')
167
+ listMatchingPage.steps.switchToEditTab();
168
+ listMatchingPage.steps.addOption();
169
+ listMatchingPage.steps.switchToPreviewTab();
170
+ listMatchingPage.steps.verifyCountOfDraggableOptionsInPreviewTab('List matching', 4);
171
+ listMatchingPage.steps.verifyDefaultStateOfDraggableOptionsInPreviewTab('List matching', 3);
172
+ cy.log('Checking that input text to the newly added option is displayed in the option in Preview tab section')
173
+ listMatchingPage.steps.switchToEditTab();
174
+ listMatchingPage.steps.addInputToOptionForDragAndDropInputField(optionsForFourResponses[3], 3);
175
+ listMatchingPage.steps.switchToPreviewTab();
176
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForFourResponses);
177
+ });
178
+
179
+ it('When the user deletes an option then the deleted option should get removed from the group in the response options container of the \'Preview tab\'', () => {
180
+ cy.log('Pre step: Switching to edit tab')
181
+ listMatchingPage.steps.switchToEditTab();
182
+ listMatchingPage.steps.deleteResponseOptionInputField(3);
183
+ cy.log('Checking the deleted option should not exist in the Preview tab')
184
+ listMatchingPage.steps.switchToPreviewTab();
185
+ cy.log('verifying the text of draggable options after deleting an option')
186
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForThreeResponses);
187
+ });
188
+
189
+ it('When the user adds a new group, the new group should be displayed in the response options container of the \'Preview tab\'', () => {
190
+ cy.log('Pre step: Switching to edit tab')
191
+ listMatchingPage.steps.switchToEditTab();
192
+ listMatchingPage.steps.addGroup();
193
+ listMatchingPage.steps.switchToPreviewTab();
194
+ listMatchingPage.steps.verifyCountOfGroupsInPreviewTab(2);
195
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['', '']);
196
+ });
197
+
198
+ it('When the user deletes a group, it should get removed from response options container of the \'Preview tab\'', () => {
199
+ cy.log('Pre step: Switching to edit tab')
200
+ listMatchingPage.steps.switchToEditTab();
201
+ cy.log('Pre step: Entering text into the text fields of group 2 response container')
202
+ listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, optionsForGroup2)
203
+ listMatchingPage.steps.addGroupTitle(1, 'Group title B');
204
+ listMatchingPage.steps.deleteGroup(0);
205
+ listMatchingPage.steps.switchToPreviewTab();
206
+ listMatchingPage.steps.verifyCountOfGroupsInPreviewTab(1);
207
+ listMatchingPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForGroup2);
208
+ listMatchingPage.steps.verifyGroupTitleInPreviewTab(0, 'Group title B');
209
+ });
210
+ });
211
+ })
@@ -0,0 +1,254 @@
1
+ import { listMatchingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+ const grepTags = Cypress.env('grepTags');
5
+ const stems = ['Land pollution', 'Water pollution', 'Air pollution'];
6
+
7
+ describe('Create Item page - List Matching: Question Instructions and Stems section', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ if (!grepTags || !grepTags.includes('smoke')) {
13
+ describe('Question Instructions input field - Edit tab', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to List Matching question type');
17
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
18
+ cy.barsPreLoaderWait();
19
+ });
20
+
21
+ listMatchingPage.tests.verifyQuestionInstructionsInputFieldEditTab();
22
+ });
23
+ }
24
+
25
+ if (!grepTags || !grepTags.includes('smoke')) {
26
+ describe('Question Instructions input field - Preview tab', () => {
27
+ abortEarlySetup();
28
+ before(() => {
29
+ cy.log('Navigating to List Matching question type');
30
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
31
+ cy.barsPreLoaderWait();
32
+ });
33
+
34
+ listMatchingPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
35
+ });
36
+ }
37
+
38
+ if (!grepTags || !grepTags.includes('smoke')) {
39
+ describe('Stems - Edit tab stems section contents', () => {
40
+ abortEarlySetup();
41
+ before(() => {
42
+ cy.log('Navigating to List Matching question type');
43
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
44
+ cy.barsPreLoaderWait();
45
+ });
46
+
47
+ it('\'Stems\' label should be displayed', () => {
48
+ listMatchingPage.stemsLabel()
49
+ .verifyInnerText('Stems');
50
+ });
51
+
52
+ it('By default, 3 \'Stem\' input fields should be displayed with placeholder text and numeration, Drag handle and Delete option icon buttons should be displayed besides each input field', () => {
53
+ for (let index = 0; index < 3; index++) {
54
+ listMatchingPage.steps.verifyStemContents(index)
55
+ }
56
+ listMatchingPage.stemWrapper()
57
+ .eq(3)
58
+ .should('not.exist');
59
+ });
60
+
61
+ it('CSS of Stems section', { tags: 'css' }, () => {
62
+ listMatchingPage.stemsLabel()
63
+ .verifyCSS(css.color.sectionHeading, css.fontSize.normal, css.fontWeight.semibold);
64
+ listMatchingPage.stemWrapper()
65
+ .eq(0)
66
+ .within(() => {
67
+ listMatchingPage.dragHandleButton()
68
+ .verifyCSS(css.color.secondaryBtnActive, css.fontSize.normal, css.fontWeight.regular);
69
+ listMatchingPage.buttonDeleteStem()
70
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
71
+ listMatchingPage.stemInputField()
72
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
73
+ listMatchingPage.optionNumeration()
74
+ .verifyCSS(css.color.labels, css.fontSize.default, css.fontWeight.semibold);
75
+ });
76
+ listMatchingPage.addStemButton()
77
+ .verifyCSS(css.color.secondaryBtnActive, css.fontSize.default, css.fontWeight.medium);
78
+ });
79
+
80
+ it('On hovering over the drag handle of the stem, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
81
+ listMatchingPage.steps.verifyDragHandleTooltipForStem();
82
+ });
83
+
84
+ it('When the user hovers over the enabled \'Delete\' icon buttons then, \'Delete stem\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
85
+ listMatchingPage.steps.verifyDeleteButtonTooltipForStem();
86
+ });
87
+
88
+ it('When user clicks on the \'Delete\' question stem button then the respective options input field should get deleted, option numeration should change accordingly', () => {
89
+ listMatchingPage.steps.deleteStem(0);
90
+ for (let index = 0; index < 2; index++) {
91
+ listMatchingPage.steps.verifyStemContents(index)
92
+ }
93
+ listMatchingPage.stemWrapper()
94
+ .eq(2)
95
+ .should('not.exist');
96
+ });
97
+
98
+ it('When number of stem is equal to 1, then the Delete option icon buttons should be displayed in disabled state', () => {
99
+ listMatchingPage.steps.deleteStem(0);
100
+ listMatchingPage.steps.verifyDisabledDeleteStemButton(0);
101
+ });
102
+
103
+ it('When the user hovers over the disabled \'Delete\' icon buttons then, \'Minimum one stem is required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
104
+ listMatchingPage.steps.verifyDisabledDeleteStemButtonTooltip();
105
+ });
106
+
107
+ it('\'Add stem\' button should be present', () => {
108
+ listMatchingPage.addStemButton()
109
+ .verifyInnerText('Add stem')
110
+ .should('be.visible');
111
+ });
112
+
113
+ it('When user adds a question stem using the \'Add stem\' button then added stem should be displayed with drag handle, placeholder text, option numeration and delete button', () => {
114
+ listMatchingPage.steps.addStem()
115
+ listMatchingPage.steps.verifyStemContents(1)
116
+ });
117
+
118
+ it('When user focus in and out of any of the \'Stem\' input field without typing anything, an error message should be thrown', () => {
119
+ listMatchingPage.steps.focusInAndFocusOutOfStemInputField(1);
120
+ listMatchingPage.steps.verifyStemErrorMessageIsDisplayed(1);
121
+ });
122
+
123
+ it('CSS of error message', { tags: 'css' }, () => {
124
+ listMatchingPage.stemWrapper()
125
+ .eq(1)
126
+ .within(() => {
127
+ listMatchingPage.errorMessage()
128
+ .verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
129
+ });
130
+ });
131
+
132
+ it('Accessibility of error message', { tags: 'a11y' }, () => {
133
+ cy.checkAccessibility(listMatchingPage.errorMessage());
134
+ });
135
+
136
+ it('When user enters text in question stem input field the \'Error: Question stem is required.\' error message should disappear', () => {
137
+ listMatchingPage.steps.addInputToStemField(1, stems[1]);
138
+ listMatchingPage.steps.verifyStemErrorMessageIsNotDisplayed(1);
139
+ });
140
+ });
141
+ }
142
+
143
+ if (!grepTags || !grepTags.includes('smoke')) {
144
+ describe('Stems - set correct answer section', () => {
145
+ abortEarlySetup();
146
+ before(() => {
147
+ cy.log('Navigating to List Matching question type');
148
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
149
+ cy.barsPreLoaderWait();
150
+ });
151
+
152
+ it('When user clicks on the \'Delete\' question stem button then deleted stem should not be displayed in the \'Set Correct Answer\' section table', () => {
153
+ listMatchingPage.steps.deleteStem(0);
154
+ listMatchingPage.setCorrectAnswerStemRow()
155
+ .eq(2)
156
+ .should('not.exist');
157
+ });
158
+
159
+ it('When user adds a question stem using the \'Add stem\' button then added stem should be displayed in the \'Set Correct Answer\' section table', () => {
160
+ listMatchingPage.steps.addStem();
161
+ listMatchingPage.setCorrectAnswerStemRow()
162
+ .eq(2)
163
+ .should('exist');
164
+ });
165
+
166
+ it('When user adds text to all the stem input field, the added text should be displayed in the set correct answer section section in the stem fields', () => {
167
+ listMatchingPage.steps.addInputToAllStemFields(stems);
168
+ listMatchingPage.steps.verifyAllStemTextInSetCorrectAnswerSection(stems);
169
+ });
170
+
171
+ it('When user removes text from a stem input field, the text should also be removed from the stem field in the set correct answer section', () => {
172
+ listMatchingPage.steps.clearStemInputField(0);
173
+ listMatchingPage.steps.verifyAllStemTextInSetCorrectAnswerSection(['', 'Water pollution', 'Air pollution']);
174
+ });
175
+
176
+ it('CSS of \'Set Correct Answer\' section stems', { tags: 'css' }, () => {
177
+ listMatchingPage.setCorrectAnswerStemLabel()
178
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
179
+ listMatchingPage.setCorrectAnswerStemField()
180
+ .should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`);
181
+ listMatchingPage.setCorrectAnswerStemResponseArea()
182
+ .should('have.css', 'border', `2px dashed ${css.color.figDefaultComponentBorder}`);
183
+ });
184
+ });
185
+ }
186
+
187
+ describe('Stem - Preview tab section', { tags: 'smoke' }, () => {
188
+ abortEarlySetup();
189
+ before(() => {
190
+ cy.log('Navigating to List Matching question type');
191
+ listMatchingPage.steps.navigateToCreateQuestion('list matching');
192
+ cy.barsPreLoaderWait();
193
+ cy.log('Switching to Preview tab')
194
+ listMatchingPage.steps.switchToPreviewTab();
195
+ });
196
+
197
+ it('When user deletes a question stem then the deleted stem should not be displayed in the \'Preview\' tab table', () => {
198
+ cy.log('Switching to Edit tab')
199
+ listMatchingPage.steps.switchToEditTab();
200
+ listMatchingPage.steps.deleteStem(0);
201
+ cy.log('Switching to Preview tab')
202
+ listMatchingPage.steps.switchToPreviewTab();
203
+ listMatchingPage.previewTabStemRow()
204
+ .eq(2)
205
+ .should('not.exist');
206
+ });
207
+
208
+ it('When user adds a question stem using the \'Add stem\' button then added stem should be displayed in the \'Preview\' tab table', () => {
209
+ cy.log('Switching to Edit tab')
210
+ listMatchingPage.steps.switchToEditTab();
211
+ listMatchingPage.steps.addStem();
212
+ cy.log('Switching to Preview tab')
213
+ listMatchingPage.steps.switchToPreviewTab();
214
+ listMatchingPage.previewTabStemRow()
215
+ .eq(2)
216
+ .should('exist');
217
+ });
218
+
219
+ it('When user adds text to all the question stem input field, the added text should be displayed in the Preview tab table under the Question stem column', () => {
220
+ cy.log('Switching to Edit tab')
221
+ listMatchingPage.steps.switchToEditTab();
222
+ listMatchingPage.steps.addInputToAllStemFields(stems);
223
+ cy.log('Switching to Preview tab')
224
+ listMatchingPage.steps.switchToPreviewTab();
225
+ listMatchingPage.steps.verifyAllStemTextInPreviewTab(stems);
226
+ });
227
+
228
+ it('When user removes text from a stem input field, the text should also be removed from the stem field in the preview tab', () => {
229
+ cy.log('Switching to Edit tab')
230
+ listMatchingPage.steps.switchToEditTab();
231
+ listMatchingPage.stemInputField()
232
+ .eq(0)
233
+ .clear();
234
+ cy.log('Switching to Preview tab')
235
+ listMatchingPage.steps.switchToPreviewTab();
236
+ listMatchingPage.previewTabStemLabel()
237
+ .eq(0)
238
+ .verifyInnerText('');
239
+ });
240
+
241
+ it('CSS of added stems in \'Preview\' tab table', { tags: 'css' }, () => {
242
+ listMatchingPage.previewTabStemLabel()
243
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
244
+ listMatchingPage.previewTabStemField()
245
+ .should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`);
246
+ listMatchingPage.previewTabStemResponseArea()
247
+ .should('have.css', 'border', `2px dashed ${css.color.figDefaultComponentBorder}`);
248
+ });
249
+
250
+ it('Accessibility of \'Preview\' tab stem fields', { tags: 'a11y' }, () => {
251
+ cy.checkAccessibility(listMatchingPage.previewTabStemLabel().parents('[class*="ClozeWithDragAndDropstyles__QuestionItemContainer"]'));
252
+ });
253
+ });
254
+ });