itemengine-cypress-automation 1.0.327-IEI-5098-RCA-for-FIG-text-and-short-text-7bbafe1.0 → 1.0.328-UpdateRepo28thFeb-dedf086.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 (77) hide show
  1. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +5 -4
  2. package/cypress/e2e/ILC/CkEditorInsertTable/updateTable.js +1 -0
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +100 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +1 -0
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +12 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +1 -0
  7. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editQuestion.smoke.js +24 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +5 -4
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/styleAndLayoutCustomization.js +4 -3
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/styleAndLayoutCustomizationDraggableOptionsPanel.js +1 -1
  11. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js +1 -1
  12. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +2 -1
  13. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +1 -1
  14. package/cypress/e2e/ILC/Matching/draggableOptions.js +29 -0
  15. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneConnectorStyle.js +52 -47
  16. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionAlignment.js +6 -4
  17. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionPlacement.js +60 -54
  18. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +1 -1
  19. package/cypress/e2e/ILC/MultipleSelection/checkAddAlternativeButton.js +34 -0
  20. package/cypress/e2e/ILC/MultipleSelection/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
  21. package/cypress/e2e/ILC/MultipleSelection/editQuestion.smoke.js +1 -1
  22. package/cypress/e2e/ILC/MultipleSelection/editTabBasicSection.js +31 -0
  23. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +36 -7
  24. package/cypress/e2e/ILC/MultipleSelection/previewContentsForInCompleteAuthoring.js +98 -0
  25. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/blankResponseScoring.js +5 -19
  26. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +80 -0
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/checkAddAlternativeButton.js +38 -0
  28. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +35 -1
  29. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +36 -10
  30. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentForAllViewsInIncompleteAuthoring.smoke.js +71 -0
  31. package/cypress/e2e/ILC/SingleSelection/checkAddAlternativeButton.js +34 -0
  32. package/cypress/e2e/ILC/SingleSelection/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
  33. package/cypress/e2e/ILC/SingleSelection/editQuestion.smoke.js +72 -0
  34. package/cypress/e2e/ILC/SingleSelection/editTabBasicSection.js +31 -0
  35. package/cypress/e2e/ILC/SingleSelection/headerSection.js +36 -11
  36. package/cypress/e2e/ILC/SingleSelection/previewContentsForInCompleteAuthoring.js +92 -0
  37. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/blankResponseScoring.js +4 -18
  38. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +79 -0
  39. package/cypress/e2e/ILC/SingleSelectionGridNew/checkAddAlternativeButton.js +35 -0
  40. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +34 -0
  41. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +37 -10
  42. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +69 -0
  43. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +5 -6
  44. package/cypress/e2e/ILC/TextEntryMath/customSettings.js +1 -1
  45. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +33 -0
  46. package/cypress/e2e/ILC/TextSelection/ScoringGeneric/basicScoringForAllTextSelectionTypes.smoke.js +7 -7
  47. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +8 -8
  48. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
  49. package/cypress/e2e/ILC/VideoResponseNew/compactRecorderStyle.smoke.js +3 -3
  50. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +6 -6
  51. package/cypress/pages/components/autoScoredScoringPreviewTab.js +0 -1
  52. package/cypress/pages/components/barAndLineChartComponent.js +1 -1
  53. package/cypress/pages/components/ckEditorInsertTableComponent.js +1 -1
  54. package/cypress/pages/components/ckEditorToolbar.js +1 -1
  55. package/cypress/pages/components/equationEditorSectionCommonComponent.js +2 -2
  56. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +11 -0
  57. package/cypress/pages/components/gridQuestionCommonComponent.js +3 -4
  58. package/cypress/pages/components/imageCanvasComponent.js +2 -0
  59. package/cypress/pages/components/layoutSectionComponent.js +1 -1
  60. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  61. package/cypress/pages/components/numberLineCommonComponent.js +3 -3
  62. package/cypress/pages/createItemPage.js +0 -7
  63. package/cypress/pages/dragAndDropIntoCategoriesPage.js +32 -0
  64. package/cypress/pages/drawingResponsePage.js +13 -3
  65. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +6 -5
  66. package/cypress/pages/fillInTheGapsOverImageTextPage.js +14 -4
  67. package/cypress/pages/graphingPage.js +12 -12
  68. package/cypress/pages/matchingPage.js +3 -3
  69. package/cypress/pages/multipleSelectionGridPage.js +4 -5
  70. package/cypress/pages/multipleSelectionPage.js +4 -6
  71. package/cypress/pages/shortTextResponsePage.js +1 -2
  72. package/cypress/pages/singleSelectionPage.js +2 -3
  73. package/cypress/pages/textEntryMathPage.js +13 -2
  74. package/cypress/pages/textEntryMathWithImagePage.js +2 -2
  75. package/cypress/pages/uploadResponsePage.js +1 -0
  76. package/package.json +1 -1
  77. package/cypress/e2e/ILC/ThinkSphere/dummyTest.js +0 -17
@@ -2,63 +2,69 @@ import { matchingPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
 
5
- describe('Option placement in dropzone - Edit tab contents and functionality', () => {
6
- abortEarlySetup();
5
+ describe('Matching : Style and layout customization - Option placement',()=>{
7
6
  before(() => {
8
- matchingPage.steps.navigateToCreateQuestion('matching');
9
- cy.barsPreLoaderWait();
10
- matchingPage.steps.expandStyleAndLayoutCustomizationAccordion();
11
- matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
12
- matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
13
- matchingPage.steps.enterTextInOptionInputField(['Leaves', 'Flower']);
7
+ cy.loginAs('admin');
14
8
  });
15
9
 
16
- it('Option placement in dropzone label should be displayed', () => {
17
- utilities.verifyInnerText(matchingPage.optionAlignmentInPanelLabel(), 'Option placement in dropzone if maximum capacity per dropzone is more than 1');
18
- utilities.verifyElementVisibilityState(matchingPage.optionAlignmentInPanelLabel(), 'visible');
10
+ describe('Option placement in dropzone - Edit tab contents and functionality', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ matchingPage.steps.navigateToCreateQuestion('matching');
14
+ cy.barsPreLoaderWait();
15
+ matchingPage.steps.expandStyleAndLayoutCustomizationAccordion();
16
+ matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
17
+ matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
18
+ matchingPage.steps.enterTextInOptionInputField(['Leaves', 'Flower']);
19
+ });
20
+
21
+ it('Option placement in dropzone label should be displayed', () => {
22
+ utilities.verifyInnerText(matchingPage.optionAlignmentInPanelLabel(), 'Option placement in dropzone if maximum capacity per dropzone is more than 1');
23
+ utilities.verifyElementVisibilityState(matchingPage.optionAlignmentInPanelLabel(), 'visible');
24
+ });
25
+
26
+ it('Inline and Block labels and radio buttons should be displayed and by default, inline should be selected', () => {
27
+ utilities.verifyInnerText(matchingPage.inlineLabel(), 'Inline');
28
+ utilities.verifyElementVisibilityState(matchingPage.inlineRadioButton(), 'exist');
29
+ utilities.verifyInnerText(matchingPage.blockLabel(), 'Block');
30
+ utilities.verifyElementVisibilityState(matchingPage.blockRadioButton(), 'exist');
31
+ matchingPage.steps.verifyInlineRadioButtonChecked();
32
+ });
33
+
34
+ it('When user drops options in the dropzone when \'Inline\' radio button is checked, the options should be displayed inline to each other', () => {
35
+ matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
36
+ matchingPage.steps.verifyInlineOptionPlacementSpecifyCorrectAnswer();
37
+ });
38
+
39
+ it('When the user selects \'Block\' radio button, then the options should be displayed under each other', () => {
40
+ matchingPage.steps.checkBlockRadioButton();
41
+ matchingPage.steps.verifyBlockOptionPlacementSpecifyCorrectAnswer();
42
+ });
19
43
  });
20
-
21
- it('Inline and Block labels and radio buttons should be displayed and by default, inline should be selected', () => {
22
- utilities.verifyInnerText(matchingPage.inlineLabel(), 'Inline');
23
- utilities.verifyElementVisibilityState(matchingPage.inlineRadioButton(), 'exist');
24
- utilities.verifyInnerText(matchingPage.blockLabel(), 'Block');
25
- utilities.verifyElementVisibilityState(matchingPage.blockRadioButton(), 'exist');
26
- matchingPage.steps.verifyInlineRadioButtonChecked();
27
- });
28
-
29
- it('When user drops options in the dropzone when \'Inline\' radio button is checked, the options should be displayed inline to each other', () => {
30
- matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
31
- matchingPage.steps.verifyInlineOptionPlacementSpecifyCorrectAnswer();
32
- });
33
-
34
- it('When the user selects \'Block\' radio button, then the options should be displayed under each other', () => {
35
- matchingPage.steps.checkBlockRadioButton();
36
- matchingPage.steps.verifyBlockOptionPlacementSpecifyCorrectAnswer();
37
- });
38
- });
39
-
40
- describe('Option placement in dropzone - Preview tab functionality', () => {
41
- abortEarlySetup();
42
- before(() => {
43
- matchingPage.steps.navigateToCreateQuestion('matching');
44
- cy.barsPreLoaderWait();
45
- matchingPage.steps.expandStyleAndLayoutCustomizationAccordion();
46
- matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
47
- matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
48
- matchingPage.steps.enterTextInOptionInputField(['Leaves', 'Flower']);
49
- matchingPage.steps.switchToPreviewTab();
50
- });
51
-
52
- it('When user drops options in the dropzone when \'Inline\' radio button is checked, the options should be displayed inline to each other', () => {
53
- matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
54
- matchingPage.steps.verifyInlineOptionPlacementPreviewTab();
55
- });
56
-
57
- it('When the user selects \'Block\' radio button, then the options should be displayed under each other', () => {
58
- matchingPage.steps.switchToEditTab();
59
- matchingPage.steps.checkBlockRadioButton();
60
- matchingPage.steps.switchToPreviewTab();
61
- matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
62
- matchingPage.steps.verifyBlockOptionPlacementPreviewTab();
44
+
45
+ describe('Option placement in dropzone - Preview tab functionality', () => {
46
+ abortEarlySetup();
47
+ before(() => {
48
+ matchingPage.steps.navigateToCreateQuestion('matching');
49
+ cy.barsPreLoaderWait();
50
+ matchingPage.steps.expandStyleAndLayoutCustomizationAccordion();
51
+ matchingPage.steps.expandMaxCapacityPerDropzoneDropdown();
52
+ matchingPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
53
+ matchingPage.steps.enterTextInOptionInputField(['Leaves', 'Flower']);
54
+ matchingPage.steps.switchToPreviewTab();
55
+ });
56
+
57
+ it('When user drops options in the dropzone when \'Inline\' radio button is checked, the options should be displayed inline to each other', () => {
58
+ matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
59
+ matchingPage.steps.verifyInlineOptionPlacementPreviewTab();
60
+ });
61
+
62
+ it('When the user selects \'Block\' radio button, then the options should be displayed under each other', () => {
63
+ matchingPage.steps.switchToEditTab();
64
+ matchingPage.steps.checkBlockRadioButton();
65
+ matchingPage.steps.switchToPreviewTab();
66
+ matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Leaves', dropzoneIndex: 0 }, { optionText: 'Flower', dropzoneIndex: 0 }]);
67
+ matchingPage.steps.verifyBlockOptionPlacementPreviewTab();
68
+ });
63
69
  });
64
70
  });
@@ -138,7 +138,7 @@ describe('Create item page - Matching: All or nothing ', () => {
138
138
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
139
139
  });
140
140
 
141
- it('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options, 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 along with numeration should be displayed', () => {
141
+ it('When the user attempts the question partially correct with some correct, some incomplete and some incorrect options, 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 along with numeration should be displayed', () => {
142
142
  if (view === 'Grading view') {
143
143
  studentViewPage.steps.clearResponses();
144
144
  };
@@ -0,0 +1,34 @@
1
+ import { multipleSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
4
+
5
+ describe('Create question page - Multiple selection', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Check Alternative Answer Button', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
14
+ cy.barsPreLoaderWait();
15
+ multipleSelectionPage.steps.addInputToOptionsInputField(options);
16
+ });
17
+
18
+ it('When correct answer is not set then alternative answer should be disabled', () => {
19
+ multipleSelectionPage.steps.checkAlternativeButtonDisabled();
20
+ });
21
+
22
+ it('When correct answer is set then alternative answer should be enabled', () => {
23
+ multipleSelectionPage.steps.allotPoints(20);
24
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
25
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
26
+ multipleSelectionPage.steps.checkAlternativeButtonEnabled();
27
+ });
28
+
29
+ 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', () => {
30
+ multipleSelectionPage.steps.clickOnAddAlternativeAnswerButton();
31
+ multipleSelectionPage.steps.expandCorrectAnswerAccordion();
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,79 @@
1
+ import { multipleSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Multiple selection', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Auto Scored With Points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
13
+ cy.barsPreLoaderWait();
14
+ multipleSelectionPage.steps.switchToPreviewTab();
15
+ });
16
+
17
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
18
+ multipleSelectionPage.steps.checkManuallyScoredScoringLabel();
19
+ });
20
+
21
+ it('In Preview tab, when user switches to grading view then no banner and correct Answer should be displayed', () => {
22
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
23
+ multipleSelectionPage.steps.switchToGradingView();
24
+ multipleSelectionPage.steps.verifyAnswerBannerNotExist();
25
+ multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
26
+ })
27
+
28
+ 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', () => {
29
+ multipleSelectionPage.steps.switchToEditTab();
30
+ multipleSelectionPage.steps.allotPoints(2);
31
+ multipleSelectionPage.steps.switchToPreviewTab();
32
+ multipleSelectionPage.steps.checkManuallyScoredScoringLabel();
33
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
34
+ multipleSelectionPage.steps.switchToGradingView();
35
+ multipleSelectionPage.steps.verifyAnswerBannerNotExist();
36
+ multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
37
+ })
38
+
39
+ });
40
+
41
+ describe('Question Preview: Auto Scored Without Points', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
45
+ cy.barsPreLoaderWait();
46
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
47
+ multipleSelectionPage.steps.switchToPreviewTab();
48
+ });
49
+
50
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
51
+ multipleSelectionPage.steps.checkManuallyScoredScoringLabel();
52
+ });
53
+
54
+ it('In Preview tab, when user switches to grading view then banner and correct Answer should be displayed', () => {
55
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
56
+ multipleSelectionPage.steps.switchToGradingView();
57
+ multipleSelectionPage.steps.verifyAnswerBannerExist();
58
+ multipleSelectionPage.steps.verifyCorrectAnswerSectionExist();
59
+ })
60
+ });
61
+
62
+ describe('Question Preview: Non Scored', () => {
63
+ abortEarlySetup();
64
+ before(() => {
65
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
66
+ cy.barsPreLoaderWait();
67
+ });
68
+
69
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
70
+ multipleSelectionPage.steps.expandScoringTypeDropdown();
71
+ multipleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
72
+ multipleSelectionPage.steps.switchToPreviewTab();
73
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
74
+ multipleSelectionPage.steps.switchToGradingView();
75
+ multipleSelectionPage.steps.verifyAnswerBannerNotExist();
76
+ multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
77
+ });
78
+ });
79
+ });
@@ -44,7 +44,7 @@ describe('Edit item - multiple Selection', () => {
44
44
 
45
45
  it('User should be able to edit correct answer and save the question', () => {
46
46
  multipleSelectionPage.steps.editItem();
47
- multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
47
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(2);
48
48
  multipleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
49
49
  });
50
50
 
@@ -156,4 +156,35 @@ describe('Create item page - Multiple selection: Question instructions, Options
156
156
  multipleSelectionPage.steps.verifyOptionWrapperContentsPreviewTab(3);
157
157
  });
158
158
  });
159
+
160
+ describe('User should be able to edit incomplete authored question', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
164
+ cy.barsPreLoaderWait();
165
+ multipleSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
166
+ multipleSelectionPage.steps.editItem();
167
+ });
168
+
169
+ it('Warning icons should be displayed on the required input fields', () => {
170
+ multipleSelectionPage.steps.verifyWarningIconOnRequiredFields(['Please enter all option values', 'Please set points']);
171
+ });
172
+
173
+ it('Warning icons should disappear when required input fields are filled', () => {
174
+ multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
175
+ multipleSelectionPage.steps.addInputToOptionsInputField(options);
176
+ multipleSelectionPage.steps.allotPoints(10);
177
+ multipleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
178
+ multipleSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
179
+ multipleSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
180
+ });
181
+
182
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
183
+ multipleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
184
+ });
185
+
186
+ it('Warning icon should not be visible', () => {
187
+ utilities.verifyElementVisibilityState(multipleSelectionPage.warningIcon(), 'notExist');
188
+ });
189
+ });
159
190
  });
@@ -1,7 +1,9 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, multipleSelectionPage } from "../../../pages";
2
+ import { dialogBoxBase, itemPreviewPage, multipleSelectionPage } from "../../../pages";
3
+ import { browseItemsPage, commonComponents } from "../../../pages/components";
4
+ import utilities from "../../../support/helpers/utilities";
3
5
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
4
-
6
+ var itemReferenceID = ""
5
7
  describe('Create item page - Multiple selection: Header section and Saving question', () => {
6
8
  before(() => {
7
9
  cy.loginAs('admin');
@@ -42,14 +44,11 @@ describe('Create item page - Multiple selection: Header section and Saving quest
42
44
  });
43
45
 
44
46
  describe('Validation error messages', () => {
45
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
47
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
46
48
 
47
49
  it('Validation error messages should be displayed below required input fields', () => {
48
50
  multipleSelectionPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
49
- multipleSelectionPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
50
- multipleSelectionPage.steps.verifyOptionsInputFieldErrorMessage(0);
51
- multipleSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
52
- multipleSelectionPage.steps.verifySpecifyCorrectAnswerErrorMessage();
51
+ multipleSelectionPage.steps.verifyWarningIconOnRequiredFields(['Please enter all option values', 'Please set points']);
53
52
  });
54
53
 
55
54
  it('Validation error messages should disappear when required input fields are filled', () => {
@@ -69,5 +68,35 @@ describe('Create item page - Multiple selection: Header section and Saving quest
69
68
  });
70
69
  multipleSelectionPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
71
70
  });
71
+
72
+ describe('Saving a question with incomplete authoring', () => {
73
+ abortEarlySetup();
74
+ before(() => {
75
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
76
+ cy.barsPreLoaderWait();
77
+ });
78
+
79
+ it('should save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
80
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
81
+ multipleSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
82
+ });
83
+ multipleSelectionPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
84
+ });
85
+ });
86
+
87
+ describe('Save as you go - Browse item page contents', () => {
88
+ abortEarlySetup();
89
+ before(() => {
90
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
91
+ cy.barsPreLoaderWait();
92
+ multipleSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
93
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
94
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
95
+ browseItemsPage.steps.navigateToBrowseItemsPage();
96
+ });
97
+
98
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
99
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
100
+ });
72
101
  });
73
102
  });
@@ -0,0 +1,98 @@
1
+ import { multipleSelectionPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
5
+ const views = utilities.getViews(previewContentViews);
6
+ let itemReferenceID = "";
7
+ const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
8
+
9
+ describe('Create item page - Multiple selection: 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
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
21
+ cy.barsPreLoaderWait();
22
+ multipleSelectionPage.steps.switchToPreviewTab();
23
+ break;
24
+ case 'Item view':
25
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
26
+ break;
27
+ case 'Item preview':
28
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
29
+ multipleSelectionPage.steps.switchToPreviewTab();
30
+ break;
31
+ case 'Student view':
32
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
33
+ break;
34
+ case 'Grading view':
35
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
36
+ break;
37
+ case 'Correct answer view':
38
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
39
+ break;
40
+ default:
41
+ throw new Error('Invalid view');
42
+ }
43
+ });
44
+
45
+ after(() => {
46
+ if (view === 'Question preview') {
47
+ multipleSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
48
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
49
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
50
+ }
51
+ if (view === 'Student view') {
52
+ studentViewPage.steps.submitResponse();
53
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
54
+ }
55
+ });
56
+
57
+ if(view === 'Item view') {
58
+ it('Warning icon should be visible', () => {
59
+ utilities.verifyElementVisibilityState(multipleSelectionPage.warningIcon(), 'visible');
60
+ });
61
+ }
62
+
63
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
64
+ it(`All the options should be in unchecked state`, () => {
65
+ for (let index = 0; index < 4; index++) {
66
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabUncheckedState(index);
67
+ };
68
+ });
69
+
70
+ it(`User should able to select options in the ${view}`, () => {
71
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
72
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
73
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabCheckedState(0);
74
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabCheckedState(1);
75
+ });
76
+
77
+ it(`User should able to uncheck options in the ${view}`, () => {
78
+ multipleSelectionPage.steps.uncheckOptionsCheckboxInPreviewTab(0);
79
+ multipleSelectionPage.steps.uncheckOptionsCheckboxInPreviewTab(1);
80
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabUncheckedState(0);
81
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabUncheckedState(1);
82
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
83
+ multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
84
+ });
85
+ } else if (view === 'Grading view') {
86
+ it(`The submitted options should be in checked state and they should not be editable`, () => {
87
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabCheckedState(0);
88
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabCheckedState(1);
89
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabUncheckedState(2);
90
+ multipleSelectionPage.steps.verifyOptionsCheckboxInPreviewTabUncheckedState(3);
91
+ options.forEach((_, index) => {
92
+ multipleSelectionPage.steps.verifyOptionCheckBoxIsDisabled(index);
93
+ });
94
+ });
95
+ }
96
+ });
97
+ });
98
+ });
@@ -18,9 +18,8 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
18
18
  multipleSelectionGridPage.steps.switchToPreviewTab();
19
19
  });
20
20
 
21
- it('When the user has not set any answer in the \'Specify correct answer\' section and switches to the \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers', () => {
21
+ it('When the user has not set any answer in the \'Specify correct answer\' section and switches to the \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed', () => {
22
22
  multipleSelectionGridPage.steps.switchToGradingView();
23
- multipleSelectionGridPage.steps.verifyPreviewScore(0, 24);
24
23
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
25
24
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
26
25
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
@@ -30,15 +29,13 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
30
29
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
31
30
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
32
31
  multipleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
33
- multipleSelectionGridPage.steps.verifyBlankAnswerResponseCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }, { row: 4, column: 1 }]);
34
32
  });
35
33
 
36
- it('When the user has not set any answer in the \'Specify correct answer\' section and interacts with the question in the preview tab then no icons should be displayed beside all the cells, full points should be allocated and correct answer section should not be displayed', () => {
34
+ it('When the user has not set any answer in the \'Specify correct answer\' section and interacts with the question in the preview tab then no icons should be displayed beside all the cells and correct answer section should not be displayed', () => {
37
35
  multipleSelectionGridPage.steps.resetQuestionPreview();
38
36
  multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }]);
39
37
  multipleSelectionGridPage.steps.unselectOptionsInPreviewTab({ row: 1, column: 0 });
40
38
  multipleSelectionGridPage.steps.switchToGradingView();
41
- multipleSelectionGridPage.steps.verifyPreviewScore(24, 24);
42
39
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
43
40
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
44
41
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
@@ -47,16 +44,13 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
47
44
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 1 });
48
45
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
49
46
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
50
- multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
51
47
  multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
52
48
  });
53
49
 
54
- it('When the user has not set any answer in the \'Specify correct answer\' section and selects incorrect cell in the preview tab then no icon should be displayed beside the empty responses, incorrect icons should be displayed beside incorrect cell, zero points should be allocated and correct answer section should be displayed', () => {
50
+ it('When the user has not set any answer in the \'Specify correct answer\' section and selects incorrect cell in the preview tab then no icon should be displayed beside the empty responses, incorrect icons should be displayed beside incorrect cell', () => {
55
51
  multipleSelectionGridPage.steps.resetQuestionPreview();
56
52
  multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }]);
57
53
  multipleSelectionGridPage.steps.switchToGradingView();
58
- multipleSelectionGridPage.steps.verifyPreviewScore(0, 24);
59
- multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
60
54
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
61
55
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
62
56
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 0 });
@@ -64,8 +58,6 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
64
58
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 1 });
65
59
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
66
60
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
67
- multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
68
- multipleSelectionGridPage.steps.verifyBlankAnswerResponseCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }, { row: 4, column: 1 }]);
69
61
  });
70
62
 
71
63
  it('When the user sets an answer in the \'Specify correct answer\' section then on switching to \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers', () => {
@@ -206,9 +198,8 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
206
198
  multipleSelectionGridPage.steps.switchToPreviewTab();
207
199
  });
208
200
 
209
- it('When the user has not set any answer in the \'Specify correct answer\' section and switches to the \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers', () => {
201
+ it('When the user has not set any answer in the \'Specify correct answer\' section and switches to the \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed', () => {
210
202
  multipleSelectionGridPage.steps.switchToGradingView();
211
- multipleSelectionGridPage.steps.verifyPreviewScore(0, 24);
212
203
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
213
204
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
214
205
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
@@ -218,7 +209,6 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
218
209
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
219
210
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
220
211
  multipleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
221
- multipleSelectionGridPage.steps.verifyBlankAnswerResponseCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }, { row: 4, column: 1 }]);
222
212
  });
223
213
 
224
214
  it('When the user has not set any answer in the \'Specify correct answer\' section and interacts with the question in the preview tab then no icons should be displayed beside all the cells, full points should be allocated and correct answer section should not be displayed', () => {
@@ -226,7 +216,6 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
226
216
  multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }]);
227
217
  multipleSelectionGridPage.steps.unselectOptionsInPreviewTab({ row: 1, column: 0 });
228
218
  multipleSelectionGridPage.steps.switchToGradingView();
229
- multipleSelectionGridPage.steps.verifyPreviewScore(24, 24);
230
219
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 1, column: 0 });
231
220
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
232
221
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
@@ -239,12 +228,10 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
239
228
  multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
240
229
  });
241
230
 
242
- it('When the user has not set any answer in the \'Specify correct answer\' section and selects incorrect cell in the preview tab then no icon should be displayed beside the empty responses, incorrect icons should be displayed beside incorrect cell, points should be allocated for the blank rows, correct/incorrect status message should not be displayed and correct answer section should be displayed', () => {
231
+ it('When the user has not set any answer in the \'Specify correct answer\' section and selects incorrect cell in the preview tab then no icon should be displayed beside the empty responses, incorrect icons should be displayed beside incorrect cell, points should be allocated for the blank rows, correct/incorrect status message should not be displayed', () => {
243
232
  multipleSelectionGridPage.steps.resetQuestionPreview();
244
233
  multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }]);
245
234
  multipleSelectionGridPage.steps.switchToGradingView();
246
- multipleSelectionGridPage.steps.verifyPreviewScore(18, 24);
247
- multipleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
248
235
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 2, column: 0 });
249
236
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
250
237
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 0 });
@@ -253,7 +240,6 @@ describe('Create item page - Multiple selection grid : Partial equal weights for
253
240
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 1 });
254
241
  multipleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
255
242
  multipleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
256
- multipleSelectionGridPage.steps.verifyBlankAnswerResponseCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 0 }, { row: 4, column: 1 }]);
257
243
  });
258
244
 
259
245
  it('When the user sets an answer in the \'Specify correct answer\' section then on switching to \'Grading\' view without attempting the question, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers', () => {