itemengine-cypress-automation 1.0.336 → 1.0.338-12thMarchRegressionFixes-1cd5906.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 (114) hide show
  1. package/cypress/e2e/ILC/ChartsBar/HorizontalOrientationBarChart/editQuestion.smoke.js +94 -0
  2. package/cypress/e2e/ILC/ChartsBar/editQuestion.smoke.js +93 -0
  3. package/cypress/e2e/ILC/ChartsDotsPlot/editQuestion.smoke.js +92 -0
  4. package/cypress/e2e/ILC/ChartsLine/editQuestion.smoke.js +84 -0
  5. package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +2 -2
  6. package/cypress/e2e/ILC/CkEditorEquationEditor/selectModeEditorBasic.js +1 -1
  7. package/cypress/e2e/ILC/CkEditorInsertImage/insertImageBasicFile.js +1 -1
  8. package/cypress/e2e/ILC/CkEditorInsertImage/upload.js +1 -1
  9. package/cypress/e2e/ILC/CkEditorInsertTable/insertTableEditorBasicFile.js +1 -1
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editQuestion.smoke.js +1 -1
  11. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +12 -9
  12. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +2 -1
  13. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +63 -1
  14. package/cypress/e2e/ILC/EssayResponse/editQuestion.smoke.js +1 -1
  15. package/cypress/e2e/ILC/EssayResponseBasic/editQuestion.smoke.js +1 -1
  16. package/cypress/e2e/ILC/EssayResponseMath/editQuestion.smoke.js +1 -1
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/checkScoringLableBannerAndCorrectAnswer.js +84 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAddAlternativeButton.js +33 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +2 -8
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editQuestion.smoke.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +32 -2
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +39 -6
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViewInIncompleteAuthoring.smoke.js +119 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +91 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAddAlternativeButton.js +37 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editQuestion.smoke.js +3 -3
  29. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +36 -2
  30. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +36 -6
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +103 -0
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editQuestion.smoke.js +1 -1
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +96 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAddAlternativeButton.js +38 -0
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editQuestion.smoke.js +2 -2
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +39 -0
  38. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +39 -8
  39. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +1 -1
  40. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViewsInIncompleteuthoring.smoke.js +106 -0
  41. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
  42. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +38 -5
  43. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +88 -0
  44. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +1 -1
  45. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/checkAddAlternative.js +35 -0
  46. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editQuestion.smoke.js +33 -1
  47. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViewsInIncompleteAuthoring.js +97 -0
  48. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +3 -4
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
  50. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAddAlternativeButton.js +32 -0
  51. package/cypress/e2e/ILC/FillInTheGapsTextNew/editQuestion.smoke.js +1 -1
  52. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +30 -2
  53. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +35 -4
  54. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +99 -0
  55. package/cypress/e2e/ILC/GridFill/editQuestion.smoke.js +1 -1
  56. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +109 -0
  57. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +45 -0
  58. package/cypress/e2e/ILC/ImageHighlight/Scoring/checkScoringLableBannerAndCorrectAnswer.js +96 -0
  59. package/cypress/e2e/ILC/ImageHighlight/checkAddAlternativeButton.js +39 -0
  60. package/cypress/e2e/ILC/ImageHighlight/editQuestion.smoke.js +76 -0
  61. package/cypress/e2e/ILC/ImageHighlight/editTabBasicSection.js +46 -0
  62. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +35 -5
  63. package/cypress/e2e/ILC/ImageHighlight/previewContentForAllViewInIncompleteAuthoring.js +118 -0
  64. package/cypress/e2e/ILC/ListOrderingNew/editQuestion.smoke.js +3 -0
  65. package/cypress/e2e/ILC/Matching/editQuestion.smoke.js +1 -1
  66. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationLayoutProperties.js +3 -3
  67. package/cypress/e2e/ILC/NumberLine/editQuestion.smoke.js +79 -0
  68. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +5 -5
  69. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/editQuestion.smoke.js +72 -0
  70. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +1 -0
  71. package/cypress/e2e/ILC/NumberLineLabel/editQuestion.smoke.js +80 -0
  72. package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/editQuestion.smoke.js +81 -0
  73. package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +2 -2
  74. package/cypress/e2e/ILC/ShortTextResponseNew/editQuestion.smoke.js +56 -0
  75. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +5 -6
  76. package/cypress/e2e/ILC/SingleSelection/editQuestion.smoke.js +1 -1
  77. package/cypress/e2e/ILC/SingleSelection/editTabBasicSection.js +1 -1
  78. package/cypress/e2e/ILC/SingleSelectionGridNew/editQuestion.smoke.js +1 -1
  79. package/cypress/e2e/ILC/TextEntryMath/editQuestion.smoke.js +76 -0
  80. package/cypress/e2e/ILC/TextEntryMathWithImage/editQuestion.smoke.js +92 -0
  81. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +1 -1
  82. package/cypress/e2e/ILC/TextSelection/editQuestion.smoke.js +0 -3
  83. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
  84. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +9 -9
  85. package/cypress/e2e/ILC/chartsDotsPlot/gradingViewAndCorrectAnswerView.smoke.js +2 -2
  86. package/cypress/e2e/ILC/chartsDotsPlot/numberLineAxisSettings.js +1 -0
  87. package/cypress/e2e/ILC/chartsDotsPlot/previewContentsForAllViews.smoke.js +1 -1
  88. package/cypress/fixtures/uploadResponseFileType.js +1 -1
  89. package/cypress/pages/chartsBarPage.js +3 -0
  90. package/cypress/pages/chartsDotPlotPage.js +2 -0
  91. package/cypress/pages/chartsLinePage.js +38 -2
  92. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -0
  93. package/cypress/pages/components/browseItemsPage.js +4 -4
  94. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +22 -1
  95. package/cypress/pages/components/layoutSectionComponent.js +1 -1
  96. package/cypress/pages/components/optionsWrapperComponent.js +1 -0
  97. package/cypress/pages/components/scoringSectionBaseEditTab.js +2 -1
  98. package/cypress/pages/createItemPage.js +7 -0
  99. package/cypress/pages/drawingResponsePage.js +73 -2
  100. package/cypress/pages/feedbackScalePage.js +2 -0
  101. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -0
  102. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -2
  103. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +22 -0
  104. package/cypress/pages/fillInTheGapsOverImageTextPage.js +22 -0
  105. package/cypress/pages/fillInTheGapsTextPage.js +24 -2
  106. package/cypress/pages/imageHighlightPage.js +37 -2
  107. package/cypress/pages/listOrderingPage.js +4 -2
  108. package/cypress/pages/menuBarPage.js +65 -65
  109. package/cypress/pages/numberLineLabelPage.js +4 -1
  110. package/cypress/pages/numberLinePage.js +2 -0
  111. package/cypress/pages/shortTextResponsePage.js +2 -0
  112. package/cypress/pages/textEntryMathPage.js +7 -3
  113. package/cypress/pages/textEntryMathWithImagePage.js +3 -0
  114. package/package.json +2 -2
@@ -98,12 +98,12 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
98
98
  };
99
99
  });
100
100
 
101
- it('When the user removes all response areas from the question input field, an error message \'Error: Minimum one response token is required.\' should be displayed', () => {
101
+ it('When the user removes all response areas from the question input field, an error message should not be displayed', () => {
102
102
  cy.log('Switching to edit tab')
103
103
  fillInTheGapsTextPage.steps.switchToEditTab();
104
104
  fillInTheGapsTextPage.steps.deleteAResponseArea(0);
105
105
  fillInTheGapsTextPage.steps.deleteAResponseArea(0);
106
- utilities.verifyInnerText(fillInTheGapsTextPage.errorMessage(), 'Error: Minimum one response token is required.')
106
+ utilities.verifyElementVisibilityState(fillInTheGapsTextPage.errorMessage(), 'notExist')
107
107
  });
108
108
 
109
109
  fillInTheGapsTextPage.tests.verifyErrorMessageCSSAndA11y();
@@ -141,6 +141,34 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
141
141
  });
142
142
  });
143
143
 
144
+ describe('User should be able to edit incomplete authored question', () => {
145
+ abortEarlySetup();
146
+ before(() => {
147
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
148
+ cy.barsPreLoaderWait();
149
+ fillInTheGapsTextPage.steps.saveAQuestionWithIncompleteAuthoring();
150
+ fillInTheGapsTextPage.steps.editItem(1);
151
+ });
152
+
153
+ it('Warning icons should be displayed on the required input fields', () => {
154
+ fillInTheGapsTextPage.steps.verifyWarningIconOnRequiredFields(['Please set points']);
155
+ });
156
+
157
+ it('When required input fields are filled then warning icons should disappear', () => {
158
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
159
+ fillInTheGapsTextPage.steps.allotPoints(10);
160
+ fillInTheGapsTextPage.steps.verifyErrorMessageIsNotDisplayed();
161
+ fillInTheGapsTextPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
162
+ });
163
+
164
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
165
+ fillInTheGapsTextPage.steps.saveAQuestionAndVerifySnackbar();
166
+ });
167
+
168
+ it('Warning icon should not be visible', () => {
169
+ utilities.verifyElementVisibilityState(fillInTheGapsTextPage.warningIcon(), 'notExist');
170
+ });
171
+ });
144
172
  //https://weldnorthed.atlassian.net/browse/IEI-5098
145
173
  describe('Fill in the gaps text: Answer input field - Specify correct answer section', () => {
146
174
  abortEarlySetup();
@@ -1,7 +1,9 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, fillInTheGapsTextPage } from "../../../pages";
2
+ import { dialogBoxBase, itemPreviewPage, fillInTheGapsTextPage } from "../../../pages";
3
3
  import utilities from "../../../support/helpers/utilities";
4
+ import { browseItemsPage } from "../../../pages/components";
4
5
  const options = ['Flower', 'Leaves'];
6
+ var itemReferenceID = ""
5
7
 
6
8
  describe('Create item page - Fill in the gaps with text: Header section and saving question', () => {
7
9
  before(() => {
@@ -46,12 +48,11 @@ describe('Create item page - Fill in the gaps with text: Header section and savi
46
48
  });
47
49
 
48
50
  describe('Validation error messages', () => {
49
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
51
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please set points']);
50
52
 
51
53
  it('Validation error messages should be displayed below required input fields', () => {
52
54
  fillInTheGapsTextPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
53
- fillInTheGapsTextPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
54
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsTextPage.errorMessage(), 0), 'Error: Answer is required.');
55
+ fillInTheGapsTextPage.steps.verifyWarningIconOnRequiredFields(['Please set points']);
55
56
  });
56
57
 
57
58
  it('Validation error messages should disappear when required input fields are filled', () => {
@@ -71,5 +72,35 @@ describe('Create item page - Fill in the gaps with text: Header section and savi
71
72
 
72
73
  fillInTheGapsTextPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
73
74
  });
75
+
76
+ describe('Saving a question with incomplete authoring', () => {
77
+ abortEarlySetup();
78
+ before(() => {
79
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
80
+ cy.barsPreLoaderWait();
81
+ });
82
+
83
+ it('Should save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
84
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please set points']);
85
+ fillInTheGapsTextPage.steps.saveAQuestionWithIncompleteAuthoring();
86
+ });
87
+ fillInTheGapsTextPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
88
+ });
89
+
90
+ describe('Save as you go - Browse item page contents', () => {
91
+ abortEarlySetup();
92
+ before(() => {
93
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
94
+ cy.barsPreLoaderWait();
95
+ fillInTheGapsTextPage.steps.saveAQuestionWithIncompleteAuthoring();
96
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
97
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
98
+ browseItemsPage.steps.navigateToBrowseItemsPage();
99
+ });
100
+
101
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
102
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
103
+ });
104
+ });
74
105
  });
75
106
  });
@@ -0,0 +1,99 @@
1
+ import { fillInTheGapsTextPage, 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
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+
9
+ describe('Create item page - Fill In The Gaps Text: Preview contents', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ views.forEach((view) => {
15
+ describe(`Preview tab contents when authoring is incomplete - ${view}`, { tags: 'smoke' }, () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ switch (view) {
19
+ case 'Question preview':
20
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
21
+ cy.barsPreLoaderWait();
22
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
23
+ fillInTheGapsTextPage.steps.addResponseArea();
24
+ fillInTheGapsTextPage.steps.selectAcceptedStudentInputType(1, 'Number');
25
+ fillInTheGapsTextPage.steps.selectAcceptedStudentInputType(2, 'Integer');
26
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
27
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
28
+ break;
29
+ case 'Item view':
30
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
31
+ break;
32
+ case 'Item preview':
33
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
34
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
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
+ default:
46
+ throw new Error('Invalid view');
47
+ }
48
+ });
49
+
50
+ after(() => {
51
+ if (view === 'Question preview') {
52
+ fillInTheGapsTextPage.steps.saveAQuestionWithIncompleteAuthoring();
53
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
54
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
55
+ }
56
+
57
+ if (view === 'Student view') {
58
+ studentViewPage.steps.submitResponse();
59
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
60
+ }
61
+ });
62
+
63
+ if (view === 'Item view') {
64
+ it('Warning icon should be visible', () => {
65
+ utilities.verifyElementVisibilityState(fillInTheGapsTextPage.warningIcon(), 'visible');
66
+ });
67
+ }
68
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
69
+ it('The sample \'Lorem Ipsum\' text along with three answer input fields should be displayed in the question field and they should be empty.', () => {
70
+ utilities.verifyInnerText(fillInTheGapsTextPage.questionContainerPreviewTab(), 'Lorem ipsum dolor sit amet, \n​\n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n​\n tempus tellus dapibus.\n​');
71
+ utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
72
+ fillInTheGapsTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: '' }, { responseIndex: 1, responseText: '' }, { responseIndex: 2, responseText: '' }]);
73
+ });
74
+
75
+ it('User should be able to enter text in the answer input fields', () => {
76
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
77
+ fillInTheGapsTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
78
+ });
79
+ } else if (view === 'Grading view') {
80
+ it('The answer input fields should be displayed filled with answers', () => {
81
+ utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
82
+ fillInTheGapsTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
83
+ });
84
+
85
+ it('The input fields should not be editable', () => {
86
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(0);
87
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(1);
88
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(2);
89
+ });
90
+ } else {
91
+ it('The answer input fields should be displayed filled with correct answers', () => {
92
+ utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
93
+ fillInTheGapsTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
94
+ });
95
+ }
96
+ });
97
+ });
98
+
99
+ });
@@ -49,7 +49,7 @@ describe('Edit item - Grid fill', () => {
49
49
  gridFillPage.steps.verifyPointInQuestionPreview(30);
50
50
  });
51
51
 
52
- it('User should be able to change scoring type to manually and save the question', () => {
52
+ it('User should be able to change scoring type to manually scored and save the question', () => {
53
53
  gridFillPage.steps.editItem();
54
54
  gridFillPage.steps.expandScoringTypeDropdown();
55
55
  gridFillPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
@@ -239,4 +239,113 @@ describe('Create Item page - Image highlight: All or nothing with alternative an
239
239
  imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');*/
240
240
  });
241
241
  });
242
+
243
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When alternative answer points are more than correct answer points and alternative has no region highlighted', () => {
244
+ abortEarlySetup();
245
+ before(() => {
246
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
247
+ cy.barsPreLoaderWait();
248
+ imageHighlightPage.steps.addQuestionInstructions();
249
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
250
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
251
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
252
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
253
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
254
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
255
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
256
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
257
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
258
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
259
+ imageHighlightPage.steps.allotPoints(12);
260
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
261
+ imageHighlightPage.steps.allotPoints(20);
262
+ imageHighlightPage.steps.switchToPreviewTab();
263
+ });
264
+
265
+ it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted and correct answer section with the answers of the alternative accordion should be displayed', () => {
266
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
267
+ imageHighlightPage.steps.switchToGradingView();
268
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents([''], [1]);
269
+ });
270
+
271
+ it('When user attempts the question with responses from the correct accordion, then the user should be awarded points specified for correct points accordion(less than 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\' should be displayed and correct answer section should not be displayed', () => {
272
+ imageHighlightPage.steps.resetQuestionPreview();
273
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
274
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
275
+ imageHighlightPage.steps.verifyPreviewScore(12, 20);
276
+ imageHighlightPage.steps.switchToGradingView();
277
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
278
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
279
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
280
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
281
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
282
+ });
283
+
284
+ it('When user selects and deselects an option then full score should be awarded as alternative accordion has blank response', () => {
285
+ imageHighlightPage.steps.resetQuestionPreview();
286
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
287
+ imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(0);
288
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
289
+ imageHighlightPage.steps.switchToGradingView();
290
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
291
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
292
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
293
+ });
294
+ });
295
+
296
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When alternative answer points are more than correct answer points and correct answer has no region highlighted', () => {
297
+ abortEarlySetup();
298
+ before(() => {
299
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
300
+ cy.barsPreLoaderWait();
301
+ imageHighlightPage.steps.addQuestionInstructions();
302
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
303
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
304
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
305
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
306
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
307
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
308
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
309
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
310
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
311
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
312
+ imageHighlightPage.steps.allotPoints(12);
313
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
314
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
315
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
316
+ imageHighlightPage.steps.allotPoints(20);
317
+ imageHighlightPage.steps.expandCorrectAnswerAccordion();
318
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(0);
319
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(3);
320
+ imageHighlightPage.steps.switchToPreviewTab();
321
+ });
322
+
323
+ it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted and correct answer section with the answers of the alternative accordion should be displayed', () => {
324
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
325
+ imageHighlightPage.steps.switchToGradingView();
326
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
327
+ });
328
+
329
+ it('When user attempts the question with responses from the correct accordion i.e select and deselects an option, then the user should be awarded points specified for correct points accordion(less than 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\' should be displayed and correct answer section should not be displayed', () => {
330
+ imageHighlightPage.steps.resetQuestionPreview();
331
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
332
+ imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(0);
333
+ imageHighlightPage.steps.verifyPreviewScore(12, 20);
334
+ imageHighlightPage.steps.switchToGradingView();
335
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
336
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
337
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
338
+ });
339
+
340
+ it('When user attempts the question with responses from the alternative accordion then full score should be awarded', () => {
341
+ imageHighlightPage.steps.resetQuestionPreview();
342
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
343
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
344
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
345
+ imageHighlightPage.steps.switchToGradingView();
346
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
347
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
348
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
349
+ });
350
+ });
242
351
  });
@@ -283,4 +283,49 @@ describe('Create Item page - Image highlight: All or nothing with alternative an
283
283
  cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
284
284
  });
285
285
  });
286
+
287
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When correct answer points are more than alternate answer points and correct answer as no region highlighted', () => {
288
+ abortEarlySetup();
289
+ before(() => {
290
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
291
+ cy.barsPreLoaderWait();
292
+ imageHighlightPage.steps.addQuestionInstructions();
293
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
294
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
295
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
296
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
297
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
298
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
299
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
300
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
301
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
302
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
303
+ imageHighlightPage.steps.allotPoints(20);
304
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
305
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
306
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
307
+ imageHighlightPage.steps.allotPoints(12);
308
+ imageHighlightPage.steps.expandCorrectAnswerAccordion();
309
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(0);
310
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(3);
311
+ imageHighlightPage.steps.switchToPreviewTab();
312
+ });
313
+
314
+ it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted and the correct answer section with the answers of the correct accordion should be displayed', () => {
315
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
316
+ imageHighlightPage.steps.switchToGradingView();
317
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents([''], [1]);
318
+ });
319
+
320
+ 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, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
321
+ imageHighlightPage.steps.resetQuestionPreview();
322
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
323
+ imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(0);
324
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
325
+ imageHighlightPage.steps.switchToGradingView();
326
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
327
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
328
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
329
+ });
330
+ });
286
331
  });
@@ -0,0 +1,96 @@
1
+ import { imageHighlightPage } from "../../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../../pages/components/uploadImageSectionComponent";
3
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
+
5
+ const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
6
+ const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
7
+
8
+ describe('Create Item page - Image Highlight', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question Preview: Auto Scored With Points', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
17
+ cy.barsPreLoaderWait();
18
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
19
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
20
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
21
+ imageHighlightPage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
25
+ imageHighlightPage.steps.checkManuallyScoredScoringLabel();
26
+ });
27
+
28
+ it('In Preview tab, when user switches to grading view then no banner and correct answer should be displayed', () => {
29
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
30
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
31
+ imageHighlightPage.steps.switchToGradingView();
32
+ imageHighlightPage.steps.verifyAnswerStatusBannerNotExist();
33
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExist();
34
+ })
35
+
36
+ it('When user allocates points to the question then the scoring label should be displayed as manually scored and banner and correct answer status should not exist', () => {
37
+ imageHighlightPage.steps.switchToEditTab();
38
+ imageHighlightPage.steps.allotPoints(2);
39
+ imageHighlightPage.steps.switchToPreviewTab();
40
+ imageHighlightPage.steps.checkManuallyScoredScoringLabel();
41
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
42
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
43
+ imageHighlightPage.steps.switchToGradingView();
44
+ imageHighlightPage.steps.verifyAnswerStatusBannerNotExist();
45
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExist();
46
+ })
47
+
48
+ });
49
+
50
+ describe('Question Preview: Auto Scored Without Points', () => {
51
+ abortEarlySetup();
52
+ before(() => {
53
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
54
+ cy.barsPreLoaderWait();
55
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
56
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
57
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
58
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
59
+ imageHighlightPage.steps.switchToPreviewTab();
60
+ });
61
+
62
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
63
+ imageHighlightPage.steps.checkManuallyScoredScoringLabel();
64
+ });
65
+
66
+ it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
67
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
68
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
69
+ imageHighlightPage.steps.switchToGradingView();
70
+ imageHighlightPage.steps.verifyAnswerStatusBannerExist();
71
+ imageHighlightPage.steps.verifyCorrectAnswerSectionExist();
72
+ })
73
+ });
74
+
75
+ describe('Question Preview: Non Scored', () => {
76
+ abortEarlySetup();
77
+ before(() => {
78
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
79
+ cy.barsPreLoaderWait();
80
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
81
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
82
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
83
+ });
84
+
85
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
86
+ imageHighlightPage.steps.expandScoringTypeDropdown();
87
+ imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
88
+ imageHighlightPage.steps.switchToPreviewTab();
89
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
90
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
91
+ imageHighlightPage.steps.switchToGradingView();
92
+ imageHighlightPage.steps.verifyAnswerStatusBannerNotExist();
93
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExist();
94
+ });
95
+ });
96
+ });
@@ -0,0 +1,39 @@
1
+ import { imageHighlightPage } from "../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+
5
+ const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
6
+ const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
7
+
8
+ describe('Create question page - Image Highlight', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Check Alternative Answer Button', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
17
+ cy.barsPreLoaderWait();
18
+ imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Highlight the correct areas on the image');
19
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
20
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
21
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
22
+ });
23
+
24
+ it('When correct answer is not set then alternative answer should be disabled', () => {
25
+ imageHighlightPage.steps.checkAlternativeButtonDisabled();
26
+ });
27
+
28
+ it('When correct answer is set then alternative answer should be enabled', () => {
29
+ imageHighlightPage.steps.allotPoints(20);
30
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
31
+ imageHighlightPage.steps.checkAlternativeButtonEnabled();
32
+ });
33
+
34
+ it('User should be able to add \'Alternative\' answer using the \'Add alternative\' button, when user has not set any answer in the \'Alternative\' accordion and clicks on the \'Correct\' accordion then \'Correct\' accordion should be expanded', () => {
35
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
36
+ imageHighlightPage.steps.expandCorrectAnswerAccordion();
37
+ });
38
+ });
39
+ });
@@ -0,0 +1,76 @@
1
+ import { imageHighlightPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
4
+ const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
5
+ const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
6
+
7
+ describe('Edit item - Image highlight', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Edit image highlight question', { tags: 'smoke' }, () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
16
+ cy.barsPreLoaderWait();
17
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
18
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
19
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
20
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
21
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
22
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
23
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
24
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
25
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
26
+ imageHighlightPage.steps.allotPoints(20);
27
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
28
+ });
29
+
30
+ it('User should be able to edit question instruction and save the question', () => {
31
+ imageHighlightPage.steps.editItem();
32
+ imageHighlightPage.steps.clearQuestionInstructionsInputField();
33
+ imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Image highlight question instruction Updated');
34
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
35
+ imageHighlightPage.steps.verifyQuestionInstructionsTextPreviewTab('Image highlight question instruction Updated');
36
+ });
37
+
38
+ it('User should be able to edit correct answer and save the question', () => {
39
+ imageHighlightPage.steps.editItem();
40
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
41
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(0);
42
+ imageHighlightPage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(2);
43
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
44
+ });
45
+
46
+ it('User should be able to edit points and save the question', () => {
47
+ imageHighlightPage.steps.editItem();
48
+ imageHighlightPage.steps.allotPoints(30);
49
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
50
+ imageHighlightPage.steps.verifyPointInQuestionPreview(30);
51
+ });
52
+
53
+ it('User should be able to change scoring type to manually scored and save the question', () => {
54
+ imageHighlightPage.steps.editItem();
55
+ imageHighlightPage.steps.expandScoringTypeDropdown();
56
+ imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
57
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
58
+ });
59
+
60
+ it('User should be able to change scoring type to non scored and save the question', () => {
61
+ imageHighlightPage.steps.editItem();
62
+ imageHighlightPage.steps.expandScoringTypeDropdown();
63
+ imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
64
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
65
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
66
+ });
67
+
68
+ it('User should be able to updated the uploaded image for the question and save the question', () => {
69
+ imageHighlightPage.steps.editItem();
70
+ imageHighlightPage.steps.uploadFile('image.png');
71
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
72
+ imageHighlightPage.steps.verifyFileNameLabel('image.png');
73
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
74
+ });
75
+ });
76
+ });
@@ -0,0 +1,46 @@
1
+ import { imageHighlightPage } from "../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+
6
+ const flowerHighlightRegion = [[30, 10], [30, 20], [45, 20], [45, 10]];
7
+ const branchesHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
8
+
9
+ describe('Create item page - Image Highlight', () => {
10
+
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ describe('User should be able to edit incomplete authored question', () => {
16
+ before(() => {
17
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
18
+ cy.barsPreLoaderWait();
19
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
20
+ imageHighlightPage.steps.editItem();
21
+ });
22
+
23
+ it('Warning icons should be displayed on the required input fields', () => {
24
+ imageHighlightPage.steps.verifyWarningIconOnRequiredFields(['Please upload an image', 'Please set points']);
25
+ });
26
+
27
+ it('When required input fields are filled then warning icons should disappear', () => {
28
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
29
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
30
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
31
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
32
+ imageHighlightPage.steps.allotPoints(10);
33
+ imageHighlightPage.steps.allotPoints(10);
34
+ imageHighlightPage.steps.verifyErrorMessageIsNotDisplayed();
35
+ imageHighlightPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
36
+ });
37
+
38
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
39
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
40
+ });
41
+
42
+ it('Warning icon should not be visible', () => {
43
+ imageHighlightPage.steps.verifyWarningIconNotExist();
44
+ });
45
+ });
46
+ });