itemengine-cypress-automation 1.0.240-textentrychangesreverted-28d08d1.0 → 1.0.241-28thAugustRepoUpdate-dc7df0c.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/headerSection.js +22 -5
  3. package/cypress/e2e/ILC/ChartsLine/headerSection.js +23 -5
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -4
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +3 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +4 -6
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +1 -3
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +3 -4
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +4 -5
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
  16. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +3 -5
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +172 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +3 -5
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +0 -1
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +3 -8
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +6 -6
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +2 -2
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +3 -1
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -8
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +3 -5
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +2 -2
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +16 -16
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -2
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +3 -3
  35. package/cypress/e2e/ILC/Graphing/headerSection.js +2 -3
  36. package/cypress/e2e/ILC/GridFill/headerSection.js +2 -4
  37. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +6 -3
  38. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -4
  39. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
  40. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
  41. package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -8
  42. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +2 -8
  43. package/cypress/e2e/ILC/ListOrderingNew/optionsOrientationSection.js +150 -0
  44. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/horizontalOrientationAllOrNothingForAllViews.smoke.js +218 -0
  45. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +176 -0
  46. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +170 -0
  47. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +170 -0
  48. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +230 -0
  49. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js +64 -0
  50. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/manuallyAndNonScored.js +110 -0
  51. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +249 -0
  52. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +172 -0
  53. package/cypress/e2e/ILC/Matching/clickAndDrop.js +6 -10
  54. package/cypress/e2e/ILC/Matching/headerSection.js +2 -10
  55. package/cypress/e2e/ILC/Matching/matchingConnector.js +128 -0
  56. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
  57. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
  58. package/cypress/e2e/ILC/MatchingDropdown/editTabBasicSection.js +154 -0
  59. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +4 -6
  60. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -4
  61. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -1
  62. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +3 -9
  63. package/cypress/e2e/ILC/NumberLine/headerSection.js +2 -3
  64. package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -4
  65. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
  66. package/cypress/e2e/ILC/SingleSelection/headerSection.js +2 -5
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -2
  68. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -2
  69. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +2 -9
  70. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +210 -0
  71. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +210 -0
  72. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +258 -0
  73. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +246 -0
  74. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  75. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +245 -0
  76. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +541 -0
  77. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +243 -0
  78. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
  79. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +242 -0
  80. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +195 -0
  81. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
  82. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +8 -1
  83. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +12 -0
  84. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
  85. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
  86. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
  87. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +2 -0
  88. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
  89. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  90. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
  91. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
  92. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
  93. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -0
  94. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
  95. package/cypress/e2e/ILC/TextSelection/Scoring/singleSelectionPreviewScoring.js +247 -0
  96. package/cypress/e2e/ILC/TextSelection/headerSection.js +4 -5
  97. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
  98. package/cypress/e2e/ILC/TextSelection/singleMultipleSelection.js +100 -0
  99. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionOutline.js +248 -0
  100. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionStrikethrough.js +247 -0
  101. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionUnderline.js +239 -0
  102. package/cypress/e2e/ILC/TextSelection/textSelectionStyle.js +150 -0
  103. package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +3 -2
  104. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
  105. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
  106. package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +21 -5
  107. package/cypress/pages/components/autoScoredScoringPreviewTab.js +1 -0
  108. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -11
  109. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -29
  110. package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
  111. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  112. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +2 -3
  113. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -2
  114. package/cypress/pages/components/optionsWrapperComponent.js +2 -2
  115. package/cypress/pages/components/playbackControlsBaseComponent.js +2 -2
  116. package/cypress/pages/components/questionInputFieldComponent.js +1 -0
  117. package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -2
  118. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +1 -1
  119. package/cypress/pages/createItemPage.js +1 -1
  120. package/cypress/pages/dialogBoxBase.js +21 -9
  121. package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -5
  122. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +83 -5
  123. package/cypress/pages/graphingPage.js +4 -7
  124. package/cypress/pages/gridFillPage.js +15 -16
  125. package/cypress/pages/listOrderingPage.js +373 -2
  126. package/cypress/pages/matchingPage.js +89 -33
  127. package/cypress/pages/multipleSelectionGridPage.js +11 -13
  128. package/cypress/pages/multipleSelectionPage.js +4 -5
  129. package/cypress/pages/numberLinePage.js +2 -13
  130. package/cypress/pages/shortTextResponsePage.js +2 -3
  131. package/cypress/pages/textEntryMathPage.js +28 -0
  132. package/cypress/pages/textSelectionPage.js +242 -3
  133. package/cypress/pages/videoResponsePage.js +0 -2
  134. package/package.json +1 -1
  135. /package/cypress/e2e/ILC/TextSelection/{styleAndLayoutCustomizationAccordion.js → styleAndLayoutCustomizationAccordionFilledIn.js} +0 -0
@@ -0,0 +1,150 @@
1
+ import { listOrderingPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const options = ['sprout', 'plant', 'flower', 'seed'];
5
+
6
+ describe('Create item page - List ordering: Options orientation Section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Options orientation section: Edit tab contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ it('The \"Option orientation\" label should be displayed', () => {
19
+ utilities.verifyInnerText(listOrderingPage.optionOrientationSectionLabel(), 'Option orientation');
20
+ });
21
+
22
+ it('The \'Vertical\' toggle button and \'Horizontal\' toggle should be displayed, by default vertical toggle button should be selected', () => {
23
+ utilities.verifyInnerText(listOrderingPage.verticalButton(), 'Vertical');
24
+ utilities.verifyInnerText(listOrderingPage.horizontalButton(), 'Horizontal');
25
+ listOrderingPage.steps.verifySelectedStateOfOptionOrientationToggle('Vertical');
26
+ });
27
+
28
+ it('User should be able to select horizontal orientation button', () => {
29
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
30
+ listOrderingPage.steps.verifySelectedStateOfOptionOrientationToggle('Horizontal');
31
+ });
32
+
33
+ it('When user selects horizontal orientation, then \"Enable wrapping\" label should be displayed', () => {
34
+ listOrderingPage.steps.verifyEnableWrappingCheckboxChecked();
35
+ utilities.verifyInnerText(listOrderingPage.enableWrappingLabel(), 'Enable wrapping');
36
+ });
37
+
38
+ it('When horizontal orientation is selected, then \"Enable wrapping\" checkbox should be selected by default ', () => {
39
+ listOrderingPage.steps.verifyEnableWrappingCheckboxChecked();
40
+ });
41
+
42
+ it('User should be able to uncheck the \"Enable wrapping\" checkbox', () => {
43
+ listOrderingPage.steps.uncheckEnableWrappingCheckbox();
44
+ listOrderingPage.steps.verifyEnableWrappingCheckboxUnchecked();
45
+ });
46
+
47
+ it('User should be able to re-select vertical orientation button', () => {
48
+ listOrderingPage.steps.selectOptionOrientation('Vertical');
49
+ listOrderingPage.steps.verifySelectedStateOfOptionOrientationToggle('Vertical');
50
+ });
51
+ });
52
+
53
+ describe('Functionality - Specify correct answer section', () => {
54
+ abortEarlySetup();
55
+ before(() => {
56
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
57
+ cy.barsPreLoaderWait();
58
+ listOrderingPage.steps.addInputToOptionsInputField(options);
59
+ });
60
+
61
+ it('When vertical orientation is selected, then the options should be displayed vertically', () => {
62
+ listOrderingPage.steps.verifyOptionOrientation('Vertical');
63
+ });
64
+
65
+ it('User should be able to reorder the options when vertical orientation is selected', () => {
66
+ listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection(options[0], '1');
67
+ listOrderingPage.steps.verifyOptionsOrderInSpecifyCorrectAnswerSection(['plant', 'sprout', 'flower', 'seed']);
68
+ });
69
+
70
+ it('When user selects horizontal orientation, then the options should be displayed horizontally', () => {
71
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
72
+ listOrderingPage.steps.verifyOptionOrientation('Horizontal');
73
+ });
74
+
75
+ it('User should be able to reorder the options when horizontal orientation is selected', () => {
76
+ listOrderingPage.steps.clickAndReorderOptionInHorizontalSpecifyCorrectAnswerSection(options[0], '1');
77
+ listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(['plant', 'sprout', 'flower', 'seed']);
78
+ });
79
+
80
+
81
+ it('When the horizontal orientation is selected and \"Enable wrapping\" is enabled, then the text within the options should be wrapped', () => {
82
+ listOrderingPage.steps.verifyHorizontalWrapping('enabled');
83
+ });
84
+
85
+ it('When user unchecks the \'Enable wrapping\' checkbox then the text within the options should not be wrapped', () => {
86
+ listOrderingPage.steps.uncheckEnableWrappingCheckbox();
87
+ listOrderingPage.steps.verifyEnableWrappingCheckboxUnchecked();
88
+ listOrderingPage.steps.verifyHorizontalWrapping('disabled');
89
+ });
90
+
91
+ it('When user re-selects the vertical orientation option then, then the changes should be reflected in the \"Specify correct answer\" section', () => {
92
+ listOrderingPage.steps.selectOptionOrientation('Vertical');
93
+ listOrderingPage.steps.verifyOptionOrientation('Vertical');
94
+ listOrderingPage.steps.verifyOptionOrientation('Vertical');
95
+ });
96
+ });
97
+
98
+ describe('Functionality - Preview tab', () => {
99
+ abortEarlySetup();
100
+ before(() => {
101
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
102
+ cy.barsPreLoaderWait();
103
+ listOrderingPage.steps.addInputToOptionsInputField(options);
104
+ });
105
+
106
+ it('When user selects vertical orientation, then the options should be displayed vertically', () => {
107
+ listOrderingPage.steps.switchToPreviewTab();
108
+ listOrderingPage.steps.verifyOptionOrientationInPreviewTab('Vertical');
109
+ });
110
+
111
+ it('User should be able to reorder the options when vertical orientation is selected', () => {
112
+ listOrderingPage.steps.clickAndReorderOptionInPreviewTab(options[0], '1');
113
+ listOrderingPage.steps.verifyOptionsOrderInPreviewTab(['plant', 'sprout', 'flower', 'seed']);
114
+ });
115
+
116
+ it('When user selects horizontal orientation, then the options should be displayed horizontally', () => {
117
+ listOrderingPage.steps.switchToEditTab();
118
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
119
+ listOrderingPage.steps.verifyOptionOrientation('Horizontal');
120
+ listOrderingPage.steps.switchToPreviewTab();
121
+ listOrderingPage.steps.verifyOptionOrientation('Horizontal');
122
+ });
123
+
124
+ it('User should be able to reorder the options when horizontal orientation is selected', () => {
125
+ listOrderingPage.steps.clickAndReorderOptionInHorizontalPreviewTab(options[0], '1');
126
+ listOrderingPage.steps.verifyHorizontalOptionsOrderInPreviewTab(['plant', 'sprout', 'flower', 'seed']);
127
+ });
128
+
129
+
130
+ it('When the horizontal orientation is selected and \"Enable wrapping\" is enabled, then the text within the options should be wrapped', () => {
131
+ listOrderingPage.steps.verifyHorizontalWrapping('enabled');
132
+ });
133
+
134
+ it('When user unchecks the \'Enable wrapping\' checkbox then the text within the options should not be wrapped', () => {
135
+ listOrderingPage.steps.switchToEditTab();
136
+ listOrderingPage.steps.uncheckEnableWrappingCheckbox();
137
+ listOrderingPage.steps.verifyEnableWrappingCheckboxUnchecked();
138
+ listOrderingPage.steps.switchToPreviewTab();
139
+ listOrderingPage.steps.verifyHorizontalWrapping('disabled');
140
+ });
141
+
142
+ it('When user re-selects the vertical orientation option then, then the changes should be reflected in the \"Preview Tab\" section', () => {
143
+ listOrderingPage.steps.switchToEditTab();
144
+ listOrderingPage.steps.selectOptionOrientation('Vertical');
145
+ listOrderingPage.steps.verifyOptionOrientation('Vertical');
146
+ listOrderingPage.steps.switchToPreviewTab();
147
+ listOrderingPage.steps.verifyOptionOrientation('Vertical');
148
+ });
149
+ });
150
+ });
@@ -0,0 +1,218 @@
1
+ import { dialogBoxBase, listOrderingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const grepTags = Cypress.env('grepTags');
6
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
+ const views = utilities.getViews(correctAnswerViews);
8
+ var itemReferenceID = "";
9
+ const options = ['sprout', 'plant', 'flower', 'seed'];
10
+ const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
11
+
12
+ describe('Create item page - List ordering: All or nothing for "Horizontal" option orientation', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ views.forEach((view) => {
18
+ describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ switch (view) {
22
+ case 'Question preview':
23
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
24
+ cy.barsPreLoaderWait();
25
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
26
+ listOrderingPage.steps.addInputToOptionsInputField(options);
27
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
28
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
29
+ listOrderingPage.steps.allotPoints(20);
30
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
31
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
32
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
33
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
34
+ listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
35
+ listOrderingPage.steps.switchToPreviewTab();
36
+ break;
37
+ case 'Item preview':
38
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
39
+ itemPreviewPage.steps.switchToPreviewTab();
40
+ break;
41
+ case 'Grading view':
42
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
43
+ break;
44
+ };
45
+ });
46
+
47
+ beforeEach(() => {
48
+ switch (view) {
49
+ case 'Question preview':
50
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
51
+ listOrderingPage.steps.resetQuestionPreview();
52
+ break;
53
+ case 'Item preview':
54
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
55
+ itemPreviewPage.steps.resetQuestionPreview();
56
+ break;
57
+ case 'Grading view':
58
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ cy.wait(3000);
60
+ break;
61
+ }
62
+ });
63
+
64
+ if (view === 'Question preview') {
65
+ after(() => {
66
+ listOrderingPage.steps.clickOnSaveQuestionButton();
67
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
68
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
69
+ });
70
+ };
71
+ if (view === 'Question preview' || view === 'Item preview') {
72
+ it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons and correct incorrect status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
73
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
74
+ listOrderingPage.steps.switchToGradingView();
75
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
76
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
77
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
78
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
79
+ });
80
+ }
81
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
82
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
83
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
84
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
85
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
86
+ if (view === 'Grading view') {
87
+ studentViewPage.steps.submitResponse();
88
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
89
+ studentViewPage.steps.clickOnGoToGradingViewButton();
90
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
91
+ };
92
+ if (view === 'Question preview' || view === 'Item preview') {
93
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
94
+ listOrderingPage.steps.switchToGradingView();
95
+ };
96
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
97
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
98
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
99
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
100
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
101
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
102
+ });
103
+
104
+ it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
105
+ if (view === 'Grading view') {
106
+ studentViewPage.steps.clearResponses();
107
+ };
108
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
109
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
110
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
111
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
112
+ if (view === 'Grading view') {
113
+ studentViewPage.steps.submitResponse();
114
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
115
+ studentViewPage.steps.clickOnGoToGradingViewButton();
116
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
117
+ };
118
+ if (view === 'Question preview' || view === 'Item preview') {
119
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
120
+ listOrderingPage.steps.switchToGradingView();
121
+ };
122
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
123
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
124
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
125
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
126
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
127
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
128
+ });
129
+
130
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
131
+ if (view === 'Grading view') {
132
+ studentViewPage.steps.clearResponses();
133
+ };
134
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
135
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
136
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
137
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
138
+ if (view === 'Grading view') {
139
+ studentViewPage.steps.submitResponse();
140
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
141
+ studentViewPage.steps.clickOnGoToGradingViewButton();
142
+ gradingViewPage.steps.verifyGradingViewScore(20, 20);
143
+ };
144
+ if (view === 'Question preview' || view === 'Item preview') {
145
+ listOrderingPage.steps.verifyPreviewScore(20, 20);
146
+ listOrderingPage.steps.switchToGradingView();
147
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
148
+ };
149
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
150
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
151
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
152
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
153
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
154
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
155
+ });
156
+ });
157
+ });
158
+
159
+ if (!grepTags || !grepTags.includes('smoke')) {
160
+ describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
164
+ cy.barsPreLoaderWait();
165
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
166
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
167
+ listOrderingPage.steps.allotPoints(20);
168
+ listOrderingPage.steps.addInputToOptionsInputField(options);
169
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
170
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
171
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
172
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
173
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
174
+ listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
175
+ });
176
+
177
+ it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
178
+ listOrderingPage.steps.expandMinimumScoringDropdown();
179
+ listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
180
+ listOrderingPage.steps.allotMinimumPoints(2);
181
+ listOrderingPage.steps.switchToPreviewTab();
182
+ listOrderingPage.steps.switchToGradingView();
183
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
184
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
185
+ });
186
+
187
+ it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
188
+ listOrderingPage.steps.resetQuestionPreview();
189
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
190
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
191
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
192
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
193
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
194
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
195
+ });
196
+
197
+ it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then considering the default list order incorrect, the user should be awarded with minimum points', () => {
198
+ listOrderingPage.steps.switchToEditTab();
199
+ listOrderingPage.steps.expandMinimumScoringDropdown();
200
+ listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
201
+ listOrderingPage.steps.allotMinimumPoints(2);
202
+ listOrderingPage.steps.switchToPreviewTab();
203
+ listOrderingPage.steps.switchToGradingView();
204
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
205
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
206
+ });
207
+
208
+ it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
209
+ listOrderingPage.steps.resetQuestionPreview();
210
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
211
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
212
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
213
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
214
+ listOrderingPage.steps.verifyPreviewScore(2, 20);
215
+ });
216
+ });
217
+ };
218
+ });
@@ -0,0 +1,176 @@
1
+ import { itemPreviewPage, listOrderingPage, studentViewPage } from "../../../../pages";
2
+ import { ckEditorToolbar, equationEditorFlyout } from "../../../../pages/components";
3
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
+ import utilities from "../../../../support/helpers/utilities";
5
+
6
+ const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
7
+ const array = ['This is a bold option', 'Fox', 'Solve the following', 'alpha'];
8
+ const views = utilities.getViews(previewContentViews);
9
+ var itemReferenceID = "";
10
+ const css = Cypress.env('css');
11
+
12
+ describe('Create item page - List ordering - Preview contents in all views', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ views.forEach((view) => {
18
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ switch (view) {
22
+ case 'Question preview':
23
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
24
+ cy.barsPreLoaderWait();
25
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
26
+ listOrderingPage.steps.selectOptionOrientation('Horizontal');
27
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
28
+ listOrderingPage.steps.allotPoints(10);
29
+ cy.log('Add image to option input field')
30
+ listOrderingPage.steps.focusInOptionsInputField(0);
31
+ ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar();
32
+ ckEditorToolbar.steps.addImageToInputField();
33
+ listOrderingPage.steps.enterTextInOptionInputField(0, 'Fox');
34
+ cy.log('Add bold text to option input field')
35
+ listOrderingPage.steps.focusInOptionsInputField(1);
36
+ ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
37
+ listOrderingPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
38
+ cy.log('Add equation to option input field')
39
+ listOrderingPage.steps.enterTextInOptionInputField(2, 'Solve the following');
40
+ listOrderingPage.steps.focusInOptionsInputField(2);
41
+ ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
42
+ equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
43
+ listOrderingPage.steps.enterTextInOptionInputField(3, 'alpha');
44
+ listOrderingPage.steps.clickAndDropOptionSeperateList('This is a bold option');
45
+ listOrderingPage.steps.clickAndDropOptionSeperateList('Fox');
46
+ listOrderingPage.steps.clickAndDropOptionSeperateList('Solve the following');
47
+ listOrderingPage.steps.clickAndDropOptionSeperateList('alpha');
48
+ listOrderingPage.steps.switchToPreviewTab();
49
+ break;
50
+ case 'Item view':
51
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
52
+ break;
53
+ case 'Item preview':
54
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
55
+ listOrderingPage.steps.switchToPreviewTab();
56
+ break;
57
+ case 'Student view':
58
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ break;
60
+ case 'Grading view':
61
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
62
+ break;
63
+ case 'Correct answer view':
64
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
65
+ break;
66
+ default:
67
+ throw new Error('Invalid view');
68
+ }
69
+ });
70
+
71
+ after(() => {
72
+ if (view === 'Question preview') {
73
+ listOrderingPage.steps.clickOnSaveQuestionButton();
74
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
75
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
76
+ }
77
+ if (view === 'Student view') {
78
+ studentViewPage.steps.submitResponse();
79
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
80
+ }
81
+ });
82
+
83
+ it('Question instructions should be visible', () => {
84
+ utilities.verifyInnerText(listOrderingPage.questionInstructionsText(), 'Arrange options in correct order.');
85
+ utilities.verifyElementVisibilityState(listOrderingPage.questionInstructionsText(), 'visible');
86
+ });
87
+
88
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
89
+ it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
90
+ listOrderingPage.steps.verifyOptionWithImageInOptionsContainerPreviewTabSeperateList(0);
91
+ listOrderingPage.steps.verifyOptionWithBoldTextInOptionsContainerPreviewTabSeperateList(1);
92
+ listOrderingPage.steps.verifyOptionWithEquationTextInOptionsContainerPreviewTabSeperateList(2);
93
+ listOrderingPage.steps.verifyTextContentOfOptionInPreviewTabSeperateList('alpha', 3);
94
+ });
95
+
96
+ it('User should be able to drop the options in the dropzone containing image, bold text and equation options in the list', () => {
97
+ listOrderingPage.steps.clickAndDropOptionSeperateList('This is a bold option');
98
+ listOrderingPage.steps.clickAndDropOptionSeperateList('Fox');
99
+ listOrderingPage.steps.clickAndDropOptionSeperateList('Solve the following');
100
+ listOrderingPage.steps.clickAndDropOptionSeperateList('alpha');
101
+ listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
102
+ listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
103
+ listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
104
+ listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
105
+ });
106
+
107
+ } else if (view === 'Grading view') {
108
+ it(`The order of the responses should be as per the submitted response`, () => {
109
+ listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
110
+ listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
111
+ listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
112
+ listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
113
+ listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('This is a bold option');
114
+ listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('Fox');
115
+ listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('Solve the following');
116
+ listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('alpha');
117
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
118
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
119
+ });
120
+
121
+ it('The order of the responses should not be editable', () => {
122
+ listOrderingPage.steps.verifyOptionNotEditableInGradingViewSeperateList(array);
123
+ listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
124
+ listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
125
+ listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
126
+ listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
127
+ });
128
+
129
+ } else {
130
+ it('The order of the options should be as per the correct answer order', () => {
131
+ listOrderingPage.steps.verifyOptionWithBoldTextInDropzoneCorrectAnswerSectionSeperateList(0);
132
+ listOrderingPage.steps.verifyOptionWithImageInDropzoneCorrectAnswerSectionTabSeperateList(1);
133
+ listOrderingPage.steps.verifyOptionWithEquationTextInDropzoneCorrectAnswerSectionSeperateList(2);
134
+ listOrderingPage.steps.verifyTextContentOfOptionInDropzoneCorrectAnswerSectionSeperateList('alpha', 3);
135
+ });
136
+ }
137
+
138
+ it('CSS of preview contents', { tags: 'css' }, () => {
139
+ utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab(), {
140
+ 'background-color': css.color.defaultBackground,
141
+ 'border': `1px solid ${css.color.draggableOptionBorder}`
142
+ });
143
+ utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
144
+ 'color': css.color.text,
145
+ 'font-size': css.fontSize.default,
146
+ 'font-weight': css.fontWeight.regular
147
+ });
148
+ utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
149
+ 'color': css.color.text,
150
+ 'font-size': css.fontSize.default,
151
+ 'font-weight': css.fontWeight.regular
152
+ });
153
+ switch (view) {
154
+ case 'Question preview':
155
+ case 'Item preview':
156
+ case 'Item view':
157
+ case 'Item preview':
158
+ case 'Student view':
159
+ case 'Grading view':
160
+ utilities.verifyCSS(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), 1).find('.drag-icon-button path').eq(1), {
161
+ 'color': css.color.secondaryBtn
162
+ });
163
+ break;
164
+ case 'Correct answer view':
165
+ break;
166
+ default:
167
+ throw new Error('Invalid view');
168
+ }
169
+ });
170
+
171
+ it('Accessibility of preview contents', { tags: 'a11y' }, () => {
172
+ cy.checkAccessibility(listOrderingPage.horizontalOptionPreviewTab().parents('[class*="question-preview-wrapper"]'));
173
+ });
174
+ });
175
+ });
176
+ });