itemengine-cypress-automation 1.0.573-IEI-7080-f70315e.0 → 1.0.573-IEI-7065-Improve-test-coverage-for-essay-response-c25d1ee.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/cypress/e2e/ILC/EssayResponse/additionalSettings.js +8 -2
  2. package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +14 -1
  4. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
  5. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +116 -4
  6. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +93 -0
  7. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +11 -1
  9. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +29 -2
  10. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +11 -1
  11. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +75 -0
  12. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +13 -0
  13. package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +181 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +37 -2
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +72 -4
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +19 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +56 -1
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +57 -3
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +15 -18
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +54 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +12 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomizationAllViews.js +156 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +0 -2
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +7 -108
  26. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +7 -108
  27. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +7 -108
  28. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +9 -124
  29. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -123
  30. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +8 -123
  31. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +7 -108
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +6 -93
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +7 -108
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +2 -23
  35. package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
  36. package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
  37. package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
  38. package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
  39. package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
  40. package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
  41. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
  42. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +284 -17
  43. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +397 -25
  44. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +320 -20
  45. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
  46. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +97 -10
  47. package/cypress/e2e/ILC/dataApi/saveItems.js +1 -1
  48. package/cypress/e2e/ILC/dataApi/saveQuestions.js +7 -7
  49. package/cypress/e2e/ILC/dataApi/saveQuestionsMCQAlternateAnswers.js +6 -6
  50. package/cypress/pages/components/additionalSettingsPanel.js +9 -0
  51. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  52. package/cypress/pages/components/colorPopupComponent.js +1 -1
  53. package/cypress/pages/components/equationEditorSectionCommonComponent.js +21 -0
  54. package/cypress/pages/components/essayResponseCommonComponents.js +20 -1
  55. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +4 -10
  56. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +14 -37
  57. package/cypress/pages/components/gradingViewEnumerationComponent.js +5 -0
  58. package/cypress/pages/components/imageCanvasComponent.js +0 -3
  59. package/cypress/pages/components/placeholderTextSectionComponent.js +10 -0
  60. package/cypress/pages/components/showAlternativeAnswersComponent.js +41 -65
  61. package/cypress/pages/essayResponsePage.js +2 -0
  62. package/cypress/pages/fillInTheGapsOverImageTextPage.js +21 -1
  63. package/cypress/pages/imageHighlightPage.js +184 -7
  64. package/cypress/pages/itemPreviewPage.js +1 -0
  65. package/cypress/pages/multipleSelectionPage.js +32 -0
  66. package/cypress/pages/singleSelectionPage.js +17 -0
  67. package/cypress/support/helpers/utilities.js +16 -0
  68. package/package.json +1 -1
  69. package/scripts/sorry-cypress.mjs +47 -53
  70. package/service.yaml +2 -2
@@ -0,0 +1,156 @@
1
+ import { fillInTheGapsOverImageTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import { colorPopupComponent } from "../../../pages/components";
5
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(correctAnswerViews);
7
+ const css = Cypress.env('css');
8
+ let itemReferenceID = "";
9
+ const modifiedColor = 'rgb(121, 60, 60)';
10
+
11
+ describe('Create Item page - Drag and drop into categories: Style and layout customization', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ views.forEach((view) => {
17
+ describe(`${view}: Style and Layout Customization - Default State`, () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ switch (view) {
21
+ case 'Question preview':
22
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
23
+ cy.barsPreLoaderWait();
24
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
25
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
26
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
27
+ fillInTheGapsOverImageTextPage.steps.selectResponseArea(0);
28
+ fillInTheGapsOverImageTextPage.steps.selectResponseAreaPointerStyle('left');
29
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
30
+ break;
31
+ case 'Item preview':
32
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
33
+ itemPreviewPage.steps.switchToPreviewTab();
34
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
35
+ break;
36
+ case 'Student view':
37
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
38
+ break;
39
+ case 'Grading view':
40
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
41
+ break;
42
+ case 'Correct answer view':
43
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
44
+ break;
45
+ };
46
+ });
47
+
48
+ beforeEach(() => {
49
+ switch (view) {
50
+ case 'Question preview':
51
+ break;
52
+ case 'Item preview':
53
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
54
+ itemPreviewPage.steps.resetQuestionPreview();
55
+ break;
56
+ }
57
+ });
58
+
59
+ if (view === 'Question preview') {
60
+ after(() => {
61
+ fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
62
+ fillInTheGapsOverImageTextPage.steps.clickOnConfirmButton();
63
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
64
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
65
+ });
66
+ };
67
+
68
+ it(`Text container should have default border color, fill color, and border style in ${view}`, () => {
69
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldFillColor(0, css.color.optionsBg);
70
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderColor(0, `1px solid ${css.color.activeComponentBorder}`);
71
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderStyle(0, 'solid');
72
+ });
73
+
74
+ it(`text container connector style should be displayed in default state in ${view}`, () => {
75
+ fillInTheGapsOverImageTextPage.steps.verifyResponseAreaConnectorEndPointShapePreviewTab('Circle');
76
+ });
77
+ });
78
+ });
79
+
80
+ views.forEach((view) => {
81
+ describe(`${view}: Style and Layout Customization - modified State`, () => {
82
+ abortEarlySetup();
83
+ before(() => {
84
+ switch (view) {
85
+ case 'Question preview':
86
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
87
+ cy.barsPreLoaderWait();
88
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
89
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
90
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
91
+ fillInTheGapsOverImageTextPage.steps.selectResponseArea(0);
92
+ fillInTheGapsOverImageTextPage.steps.selectResponseAreaPointerStyle('left');
93
+ fillInTheGapsOverImageTextPage.steps.expandStyleAndLayoutCustomizationAccordion();
94
+ fillInTheGapsOverImageTextPage.steps.selectEndPointShapeButton('Square');
95
+ fillInTheGapsOverImageTextPage.steps.editColor(0);
96
+ colorPopupComponent.steps.clickInColorSaturationPalette();
97
+ colorPopupComponent.steps.clickOnOkButton();
98
+ fillInTheGapsOverImageTextPage.steps.editColor(1);
99
+ colorPopupComponent.steps.clickInColorSaturationPalette();
100
+ colorPopupComponent.steps.clickOnOkButton();
101
+ fillInTheGapsOverImageTextPage.steps.selectBorderStyleToggleButton('Dotted');
102
+ fillInTheGapsOverImageTextPage.steps.checkSetHeightAndWidthForAllTextContainersCheckbox();
103
+ fillInTheGapsOverImageTextPage.steps.setTextContainerHeight(100);
104
+ fillInTheGapsOverImageTextPage.steps.setTextContainerWidth(200);
105
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
106
+ break;
107
+ case 'Item preview':
108
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
109
+ itemPreviewPage.steps.switchToPreviewTab();
110
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
111
+ break;
112
+ case 'Grading view':
113
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
114
+ break;
115
+ };
116
+ });
117
+
118
+ beforeEach(() => {
119
+ switch (view) {
120
+ case 'Question preview':
121
+ break;
122
+ case 'Item preview':
123
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
124
+ itemPreviewPage.steps.resetQuestionPreview();
125
+ break;
126
+ case 'Grading view':
127
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
128
+ break;
129
+ }
130
+ });
131
+
132
+ if (view === 'Question preview') {
133
+ after(() => {
134
+ fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
135
+ fillInTheGapsOverImageTextPage.steps.clickOnConfirmButton();
136
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
137
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
138
+ });
139
+ };
140
+
141
+ it(`Text container should have default border color, fill color, and border style in ${view}`, () => {
142
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldFillColor(0, modifiedColor);
143
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderColor(0, `1px dotted ${modifiedColor}`);
144
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderStyle(0, 'dotted');
145
+ });
146
+
147
+ it(`text container connector style should be displayed in default state in ${view}`, () => {
148
+ fillInTheGapsOverImageTextPage.steps.verifyResponseAreaConnectorEndPointShapePreviewTab('Square');
149
+ });
150
+
151
+ it(`Text containers should have modified height and width in ${view}`, () => {
152
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldHeightAndWidthInAllViews(0, '100px', '200px');
153
+ });
154
+ });
155
+ });
156
+ });
@@ -43,7 +43,5 @@ describe('Create item page - Fill in the gaps over image with text: Supported fi
43
43
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'notExist');
44
44
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.canvasUploadedImage(), 'notExist');
45
45
  });
46
-
47
- fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
48
46
  });
49
47
  });
@@ -1,10 +1,7 @@
1
1
  import { fillInTheGapsTextPage } from "../../../../pages";
2
- import { showAlternativeAnswersComponent } from "../../../../pages/components";
3
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
3
  const css = Cypress.env('css');
5
4
 
6
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
7
-
8
5
  describe('Create item page - Fill in the gaps with text: All or nothing with alternative answers', () => {
9
6
  before(() => {
10
7
  cy.loginAs('admin');
@@ -29,21 +26,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
29
26
  fillInTheGapsTextPage.steps.switchToGradingView();
30
27
  fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
31
28
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
32
- if (alternativeAnswerCheck) {
33
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
34
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
35
- {
36
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
37
- points: ['(20 points)'],
38
- },
39
- {
40
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
41
- points: ['(10 points)'],
42
- }
43
- ]);
44
- } else {
45
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
46
- }
29
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
47
30
  });
48
31
 
49
32
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded with points specified for correct accordion (less than overall points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
@@ -95,21 +78,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
95
78
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
96
79
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
97
80
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
98
- if (alternativeAnswerCheck) {
99
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
100
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
101
- {
102
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
103
- points: ['(20 points)'],
104
- },
105
- {
106
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
107
- points: ['(10 points)'],
108
- }
109
- ]);
110
- } else {
111
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
112
- }
81
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
113
82
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
114
83
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
115
84
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -129,21 +98,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
129
98
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
130
99
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
131
100
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
132
- if (alternativeAnswerCheck) {
133
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
134
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
135
- {
136
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
137
- points: ['(20 points)'],
138
- },
139
- {
140
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
141
- points: ['(10 points)'],
142
- }
143
- ]);
144
- } else {
145
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
146
- }
101
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
147
102
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
148
103
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
149
104
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -163,21 +118,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
163
118
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
164
119
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
165
120
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
166
- if (alternativeAnswerCheck) {
167
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
168
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
169
- {
170
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
171
- points: ['(20 points)'],
172
- },
173
- {
174
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
175
- points: ['(10 points)'],
176
- }
177
- ]);
178
- } else {
179
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
180
- }
121
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
181
122
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
123
  /*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion and no icon should be displayed for unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
183
124
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -197,21 +138,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
197
138
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
198
139
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
199
140
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
200
- if (alternativeAnswerCheck) {
201
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
202
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
203
- {
204
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
205
- points: ['(20 points)'],
206
- },
207
- {
208
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
209
- points: ['(10 points)'],
210
- }
211
- ]);
212
- } else {
213
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
214
- }
141
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
215
142
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
216
143
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
217
144
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -231,21 +158,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
231
158
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
232
159
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
233
160
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
234
- if (alternativeAnswerCheck) {
235
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
236
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
237
- {
238
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
239
- points: ['(20 points)'],
240
- },
241
- {
242
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
243
- points: ['(10 points)'],
244
- }
245
- ]);
246
- } else {
247
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
248
- }
161
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
249
162
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
250
163
  /*cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
251
164
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -265,21 +178,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
265
178
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
266
179
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
267
180
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
268
- if (alternativeAnswerCheck) {
269
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
270
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
271
- {
272
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
273
- points: ['(20 points)'],
274
- },
275
- {
276
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
277
- points: ['(10 points)'],
278
- }
279
- ]);
280
- } else {
281
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
282
- }
181
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Petals', 'Leaves', 'Stem']);
283
182
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
284
183
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed for unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
285
184
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -1,9 +1,6 @@
1
1
  import { fillInTheGapsTextPage } from "../../../../pages";
2
- import { showAlternativeAnswersComponent } from "../../../../pages/components";
3
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
3
 
5
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
6
-
7
4
  describe('Create item page - Fill in the gaps with text: All or nothing with alternative answers', () => {
8
5
  before(() => {
9
6
  cy.loginAs('admin');
@@ -28,21 +25,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
28
25
  fillInTheGapsTextPage.steps.switchToGradingView();
29
26
  fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
30
27
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
31
- if (alternativeAnswerCheck) {
32
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
33
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
34
- {
35
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
36
- points: ['(20 points)'],
37
- },
38
- {
39
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
40
- points: ['(20 points)'],
41
- }
42
- ]);
43
- } else {
44
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
45
- }
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
46
29
  });
47
30
 
48
31
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
@@ -94,21 +77,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
94
77
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
95
78
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
96
79
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
97
- if (alternativeAnswerCheck) {
98
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
99
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
100
- {
101
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
102
- points: ['(20 points)'],
103
- },
104
- {
105
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
106
- points: ['(20 points)'],
107
- }
108
- ]);
109
- } else {
110
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
111
- }
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
112
81
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
113
82
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
114
83
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -128,21 +97,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
128
97
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
129
98
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
130
99
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
131
- if (alternativeAnswerCheck) {
132
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
133
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
134
- {
135
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
136
- points: ['(20 points)'],
137
- },
138
- {
139
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
140
- points: ['(20 points)'],
141
- }
142
- ]);
143
- } else {
144
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
145
- }
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
146
101
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
147
102
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
148
103
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -162,21 +117,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
162
117
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
163
118
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
164
119
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
165
- if (alternativeAnswerCheck) {
166
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
167
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
168
- {
169
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
170
- points: ['(20 points)'],
171
- },
172
- {
173
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
174
- points: ['(20 points)'],
175
- }
176
- ]);
177
- } else {
178
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
179
- }
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
180
121
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
181
122
  /*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the alternative accordion, incorrect icon should be displayed besides the empty response, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
182
123
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -196,21 +137,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
196
137
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
197
138
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
198
139
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
199
- if (alternativeAnswerCheck) {
200
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
201
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
202
- {
203
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
204
- points: ['(20 points)'],
205
- },
206
- {
207
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
208
- points: ['(20 points)'],
209
- }
210
- ]);
211
- } else {
212
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
213
- }
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
214
141
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
215
142
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside option from the alternative accordion a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
216
143
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -230,21 +157,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
230
157
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
231
158
  fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
232
159
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
233
- if (alternativeAnswerCheck) {
234
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
235
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
236
- {
237
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
238
- points: ['(20 points)'],
239
- },
240
- {
241
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
242
- points: ['(20 points)'],
243
- }
244
- ]);
245
- } else {
246
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
247
- }
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
248
161
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
249
162
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
250
163
  fillInTheGapsTextPage.steps.checkAnswer();
@@ -264,21 +177,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
264
177
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
265
178
  fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
266
179
  fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
267
- if (alternativeAnswerCheck) {
268
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
269
- fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
270
- {
271
- correctAnswers: [['Flower'],['Leaf'],['Stem']],
272
- points: ['(20 points)'],
273
- },
274
- {
275
- correctAnswers: [['Petals'],['Leaves'],['Stem']],
276
- points: ['(20 points)'],
277
- }
278
- ]);
279
- } else {
280
- fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
281
- }
180
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
282
181
  fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
283
182
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
284
183
  fillInTheGapsTextPage.steps.checkAnswer();