itemengine-cypress-automation 1.0.326-IEI-4285-3f1c280.0 → 1.0.328-UpdateRepo28thFeb-24a9148.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 (82) 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/FillInTheGapsTextNew/editTabBasicSection.js +80 -0
  12. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js +1 -1
  13. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +2 -1
  14. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +1 -1
  15. package/cypress/e2e/ILC/Matching/draggableOptions.js +29 -0
  16. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneConnectorStyle.js +52 -47
  17. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionAlignment.js +6 -4
  18. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionPlacement.js +60 -54
  19. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +1 -1
  20. package/cypress/e2e/ILC/MultipleSelection/checkAddAlternativeButton.js +34 -0
  21. package/cypress/e2e/ILC/MultipleSelection/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
  22. package/cypress/e2e/ILC/MultipleSelection/editQuestion.smoke.js +1 -1
  23. package/cypress/e2e/ILC/MultipleSelection/editTabBasicSection.js +31 -0
  24. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +36 -7
  25. package/cypress/e2e/ILC/MultipleSelection/previewContentsForInCompleteAuthoring.js +98 -0
  26. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/blankResponseScoring.js +5 -19
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +80 -0
  28. package/cypress/e2e/ILC/MultipleSelectionGridNew/checkAddAlternativeButton.js +38 -0
  29. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +35 -1
  30. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +36 -10
  31. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentForAllViewsInIncompleteAuthoring.smoke.js +71 -0
  32. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +88 -2
  33. package/cypress/e2e/ILC/SingleSelection/checkAddAlternativeButton.js +34 -0
  34. package/cypress/e2e/ILC/SingleSelection/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
  35. package/cypress/e2e/ILC/SingleSelection/editQuestion.smoke.js +72 -0
  36. package/cypress/e2e/ILC/SingleSelection/editTabBasicSection.js +31 -0
  37. package/cypress/e2e/ILC/SingleSelection/headerSection.js +36 -11
  38. package/cypress/e2e/ILC/SingleSelection/previewContentsForInCompleteAuthoring.js +92 -0
  39. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/blankResponseScoring.js +4 -18
  40. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +79 -0
  41. package/cypress/e2e/ILC/SingleSelectionGridNew/checkAddAlternativeButton.js +35 -0
  42. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +34 -0
  43. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +37 -10
  44. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +69 -0
  45. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +5 -6
  46. package/cypress/e2e/ILC/TextEntryMath/customSettings.js +1 -1
  47. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +33 -0
  48. package/cypress/e2e/ILC/TextSelection/ScoringGeneric/basicScoringForAllTextSelectionTypes.smoke.js +7 -7
  49. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +8 -8
  50. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
  51. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +0 -41
  52. package/cypress/e2e/ILC/UploadResponse/thumbNail.smoke.js +1 -17
  53. package/cypress/e2e/ILC/VideoResponseNew/compactRecorderStyle.smoke.js +3 -3
  54. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +6 -6
  55. package/cypress/pages/components/autoScoredScoringPreviewTab.js +0 -1
  56. package/cypress/pages/components/barAndLineChartComponent.js +1 -1
  57. package/cypress/pages/components/ckEditorInsertTableComponent.js +1 -1
  58. package/cypress/pages/components/ckEditorToolbar.js +1 -1
  59. package/cypress/pages/components/equationEditorSectionCommonComponent.js +2 -2
  60. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +11 -0
  61. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +11 -0
  62. package/cypress/pages/components/gridQuestionCommonComponent.js +3 -4
  63. package/cypress/pages/components/imageCanvasComponent.js +2 -0
  64. package/cypress/pages/components/layoutSectionComponent.js +1 -1
  65. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  66. package/cypress/pages/components/numberLineCommonComponent.js +3 -3
  67. package/cypress/pages/createItemPage.js +0 -7
  68. package/cypress/pages/dragAndDropIntoCategoriesPage.js +32 -0
  69. package/cypress/pages/drawingResponsePage.js +13 -3
  70. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +6 -5
  71. package/cypress/pages/fillInTheGapsOverImageTextPage.js +14 -4
  72. package/cypress/pages/graphingPage.js +12 -12
  73. package/cypress/pages/matchingPage.js +3 -3
  74. package/cypress/pages/multipleSelectionGridPage.js +4 -5
  75. package/cypress/pages/multipleSelectionPage.js +4 -6
  76. package/cypress/pages/shortTextResponsePage.js +20 -2
  77. package/cypress/pages/singleSelectionPage.js +2 -3
  78. package/cypress/pages/textEntryMathPage.js +13 -2
  79. package/cypress/pages/textEntryMathWithImagePage.js +2 -2
  80. package/cypress/pages/uploadResponsePage.js +2 -2
  81. package/package.json +1 -1
  82. package/cypress/e2e/ILC/ThinkSphere/dummyTest.js +0 -17
@@ -0,0 +1,80 @@
1
+ import { multipleSelectionGridPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Multiple selection grid', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Auto Scored With Points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
13
+ cy.barsPreLoaderWait();
14
+ multipleSelectionGridPage.steps.switchToPreviewTab();
15
+ });
16
+
17
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
18
+ multipleSelectionGridPage.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
+ multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
23
+ multipleSelectionGridPage.steps.switchToGradingView();
24
+ multipleSelectionGridPage.steps.verifyAnswerStatusBannerNotExist();
25
+ multipleSelectionGridPage.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
+ multipleSelectionGridPage.steps.switchToEditTab();
30
+ multipleSelectionGridPage.steps.allotPoints(2);
31
+ multipleSelectionGridPage.steps.switchToPreviewTab();
32
+ multipleSelectionGridPage.steps.checkManuallyScoredScoringLabel();
33
+ multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
34
+ multipleSelectionGridPage.steps.switchToGradingView();
35
+ multipleSelectionGridPage.steps.verifyAnswerStatusBannerNotExist();
36
+ multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
37
+ })
38
+
39
+ });
40
+
41
+ describe('Question Preview: Auto Scored Without Points', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
45
+ cy.barsPreLoaderWait();
46
+ multipleSelectionGridPage.steps.addInputToColumnInputStepper(4);
47
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 2 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 3, column: 1 }, { row: 4, column: 1 }, { row: 4, column: 2 }]);
48
+ multipleSelectionGridPage.steps.switchToPreviewTab();
49
+ });
50
+
51
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
52
+ multipleSelectionGridPage.steps.checkManuallyScoredScoringLabel();
53
+ });
54
+
55
+ it('In Preview tab, when user switches to grading view then banner and correct Answer should be displayed', () => {
56
+ multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
57
+ multipleSelectionGridPage.steps.switchToGradingView();
58
+ multipleSelectionGridPage.steps.verifyAnswerStatusBannerExist();
59
+ multipleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
60
+ })
61
+ });
62
+
63
+ describe('Question Preview: Non Scored', () => {
64
+ abortEarlySetup();
65
+ before(() => {
66
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
67
+ cy.barsPreLoaderWait();
68
+ });
69
+
70
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
71
+ multipleSelectionGridPage.steps.expandScoringTypeDropdown();
72
+ multipleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
73
+ multipleSelectionGridPage.steps.switchToPreviewTab();
74
+ multipleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
75
+ multipleSelectionGridPage.steps.switchToGradingView();
76
+ multipleSelectionGridPage.steps.verifyAnswerStatusBannerNotExist();
77
+ multipleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExist();
78
+ });
79
+ });
80
+ });
@@ -0,0 +1,38 @@
1
+ import { multipleSelectionGridPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create question page - Multiple selection grid ', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Check Alternative Answer Button', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
13
+ cy.barsPreLoaderWait();
14
+ multipleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
15
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
16
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
17
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
18
+ });
19
+
20
+ it('When correct answer is not set then alternative answer should be disabled', () => {
21
+ multipleSelectionGridPage.steps.checkAlternativeButtonDisabled();
22
+ });
23
+
24
+ it('When correct answer is set then alternative answer should be enabled', () => {
25
+ multipleSelectionGridPage.steps.allotPoints(20);
26
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }]);
27
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 2, column: 0 }, { row: 2, column: 1 }]);
28
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 3, column: 0 }, { row: 3, column: 1 }]);
29
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 4, column: 0 }, { row: 4, column: 1 }]);
30
+ multipleSelectionGridPage.steps.checkAlternativeButtonEnabled();
31
+ });
32
+
33
+ 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', () => {
34
+ multipleSelectionGridPage.steps.clickOnAddAlternativeAnswerButton();
35
+ multipleSelectionGridPage.steps.expandCorrectAnswerAccordion();
36
+ });
37
+ });
38
+ });
@@ -572,7 +572,7 @@ describe('Create item page - Multiple selection grid: Question instructions, Spe
572
572
  };
573
573
  });
574
574
 
575
- it('CSS of \'Same checkbox text in each column\' checkbox and label', {tags: 'css'}, () => {
575
+ it('CSS of \'Same checkbox text in each column\' checkbox and label', { tags: 'css' }, () => {
576
576
  utilities.verifyCSS(multipleSelectionGridPage.sameCheckboxTextInEachColumnCheckboxLabel(), {
577
577
  'color': css.color.labels,
578
578
  'font-size': css.fontSize.normal,
@@ -1031,4 +1031,38 @@ describe('Create item page - Multiple selection grid: Question instructions, Spe
1031
1031
  multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: 2, column: 1 }, 'No checkbox');
1032
1032
  });
1033
1033
  });
1034
+
1035
+ describe('User should be able to edit incomplete authored question', () => {
1036
+ abortEarlySetup();
1037
+ before(() => {
1038
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
1039
+ cy.barsPreLoaderWait();
1040
+ multipleSelectionGridPage.steps.saveAQuestionWithIncompleteAuthoring();
1041
+ multipleSelectionGridPage.steps.editItem();
1042
+ });
1043
+
1044
+ it('Warning icons should be displayed on the required input fields', () => {
1045
+ multipleSelectionGridPage.steps.verifyWarningIconOnRequiredFields(['Please enter all questions', 'Please set points']);
1046
+ });
1047
+
1048
+ it('Warning icons should disappear when required input fields are filled', () => {
1049
+ multipleSelectionGridPage.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.');
1050
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 1, column: 0 }, 'Pollution caused by treating chemical waste');
1051
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 2, column: 0 }, 'Pollution caused by cement production');
1052
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Pollution caused by methane production');
1053
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Pollution caused by cement and methane production');
1054
+ multipleSelectionGridPage.steps.allotPoints(10);
1055
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
1056
+ multipleSelectionGridPage.steps.verifyErrorMessageIsNotDisplayed();
1057
+ multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
1058
+ });
1059
+
1060
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
1061
+ multipleSelectionGridPage.steps.saveAQuestionAndVerifySnackbar();
1062
+ });
1063
+
1064
+ it('Warning icon should not be visible', () => {
1065
+ utilities.verifyElementVisibilityState(multipleSelectionGridPage.warningIcon(), 'notExist');
1066
+ });
1067
+ });
1034
1068
  });
@@ -1,6 +1,8 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, multipleSelectionGridPage } from "../../../pages";
2
+ import { dialogBoxBase, itemPreviewPage, multipleSelectionGridPage } from "../../../pages";
3
3
  import utilities from "../../../support/helpers/utilities";
4
+ import { browseItemsPage, commonComponents } from "../../../pages/components";
5
+ var itemReferenceID = ""
4
6
 
5
7
  describe('Create item page - Multiple selection grid: Header section and Saving question', () => {
6
8
  before(() => {
@@ -42,18 +44,11 @@ describe('Create item page - Multiple selection grid: Header section and Saving
42
44
  });
43
45
 
44
46
  describe('Validation error messages', () => {
45
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
47
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all questions in the grid', 'Please set points']);
46
48
 
47
49
  it('Validation error messages should be displayed below required input fields', () => {
48
50
  multipleSelectionGridPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
49
- multipleSelectionGridPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
50
- utilities.verifyInnerText(utilities.getNthElement(multipleSelectionGridPage.errorMessage(), 0), 'Error: Please enter some text.');
51
- utilities.verifyInnerText(utilities.getNthElement(multipleSelectionGridPage.errorMessage(), 1), 'Error: Please set a correct answer.');
52
- for (let index = 1; index < 4; index++) {
53
- multipleSelectionGridPage.steps.verifyErrorIconInSpecifyColumnsAndRowsGrid(index);
54
- }
55
- multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
56
- multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorMessage();
51
+ multipleSelectionGridPage.steps.verifyWarningIconOnRequiredFields(['Please enter all questions in the grid', 'Please set points']);
57
52
  });
58
53
 
59
54
  it('Validation error messages should disappear when required input fields are filled', () => {
@@ -67,6 +62,7 @@ describe('Create item page - Multiple selection grid: Header section and Saving
67
62
  multipleSelectionGridPage.steps.allotPoints(10);
68
63
  multipleSelectionGridPage.steps.verifyErrorMessageIsNotDisplayed();
69
64
  multipleSelectionGridPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
65
+ multipleSelectionGridPage.steps.verifyPointsWarningIconNotExists();
70
66
  });
71
67
 
72
68
  multipleSelectionGridPage.tests.verifyCreateItemWrapperContentsA11y();
@@ -79,5 +75,35 @@ describe('Create item page - Multiple selection grid: Header section and Saving
79
75
 
80
76
  multipleSelectionGridPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
81
77
  });
78
+
79
+ describe('Saving a question with incomplete authoring', () => {
80
+ abortEarlySetup();
81
+ before(() => {
82
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
83
+ cy.barsPreLoaderWait();
84
+ });
85
+
86
+ it('Should save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
87
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all questions in the grid', 'Please set points']);
88
+ multipleSelectionGridPage.steps.saveAQuestionWithIncompleteAuthoring();
89
+ });
90
+ multipleSelectionGridPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
91
+ });
92
+
93
+ describe('Save as you go - Browse item page contents', () => {
94
+ abortEarlySetup();
95
+ before(() => {
96
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection');
97
+ cy.barsPreLoaderWait();
98
+ multipleSelectionGridPage.steps.saveAQuestionWithIncompleteAuthoring();
99
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
100
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
101
+ browseItemsPage.steps.navigateToBrowseItemsPage();
102
+ });
103
+
104
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
105
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
106
+ });
107
+ });
82
108
  });
83
109
  });
@@ -0,0 +1,71 @@
1
+ import { multipleSelectionGridPage, 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 - Multiple selection grid: 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
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
21
+ cy.barsPreLoaderWait();
22
+ multipleSelectionGridPage.steps.modifyTableCellPropertyForOptionCells({ row: 1, column: 1 }, 'Checkbox with text');
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
+ multipleSelectionGridPage.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
+ multipleSelectionGridPage.steps.saveAQuestionWithIncompleteAuthoring();
48
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
49
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
50
+ }
51
+
52
+ if (view === 'Student view') {
53
+ studentViewPage.steps.submitResponse();
54
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
55
+ }
56
+ });
57
+
58
+ if (view === 'Item view') {
59
+ it('Warning icon should be visible', () => {
60
+ utilities.verifyElementVisibilityState(multipleSelectionGridPage.warningIcon(), 'visible');
61
+ });
62
+ }
63
+
64
+ it(`The question grid as set by the user should be displayed in the ${view}`, () => {
65
+ multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
66
+ multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 1 }, 'Checkbox with text');
67
+ });
68
+ });
69
+ });
70
+
71
+ });
@@ -432,7 +432,7 @@ describe('Create question page - Short text response: Question Instructions, Set
432
432
 
433
433
  it('When the user enters the character less than the minimum character limit value set by the user and focus out of response field, then the warning message \'Minimum # characters are required\' should be displayed', () => {
434
434
  shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Lo');
435
- shortTextResponsePage.steps.focusOutOfResponseField();
435
+ shortTextResponsePage.steps.focusOutOfSpecifyCorrectAnswerInputField();
436
436
  shortTextResponsePage.steps.verifyWarningMessagePreviewTab('Minimum 3 characters are required.');
437
437
  });
438
438
 
@@ -493,7 +493,7 @@ describe('Create question page - Short text response: Question Instructions, Set
493
493
  it('When the user enters the word less than the minimum word limit value set by the user and focus out of response field, then the warning message \'Minimum 3 words are required\' should be displayed', () => {
494
494
  cy.log('Pre-step: Clearing the response field');
495
495
  shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('abc abc');
496
- shortTextResponsePage.steps.focusOutOfResponseField();
496
+ shortTextResponsePage.steps.focusOutOfSpecifyCorrectAnswerInputField();
497
497
  shortTextResponsePage.steps.verifyWarningMessagePreviewTab('Minimum 3 words are required.');
498
498
  });
499
499
 
@@ -513,4 +513,90 @@ describe('Create question page - Short text response: Question Instructions, Set
513
513
  shortTextResponsePage.steps.verifyWarningMessageNotExist();
514
514
  });
515
515
  });
516
+
517
+ //https://weldnorthed.atlassian.net/browse/IEI-5098
518
+ describe('Short text response: Answer input field - Specify correct answer section', () => {
519
+ abortEarlySetup();
520
+ before(() => {
521
+ cy.log('Navigating to Short text response question type');
522
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
523
+ cy.barsPreLoaderWait();
524
+ shortTextResponsePage.steps.selectNoneRadioButton();
525
+ });
526
+
527
+ it('When the input field is empty, then the user should be able to focus in the input field', () => {
528
+ shortTextResponsePage.steps.focusInSpecifyCorrectAnswerInputField();
529
+ });
530
+
531
+ it('When the user enters some text, then the user should be able to enter text and focus in and out', () => {
532
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Lorem Ipsum');
533
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('Lorem Ipsum');
534
+ shortTextResponsePage.steps.focusOutOfSpecifyCorrectAnswerInputField();
535
+ });
536
+
537
+ it('When the user enters text that triggers the tooltip, then the user should be able to enter text and focus out', () => {
538
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus.Lorem ipsum');
539
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus.Lorem ipsum');
540
+ shortTextResponsePage.steps.focusOutOfSpecifyCorrectAnswerInputField();
541
+ });
542
+
543
+ it('When the user enters text that triggers the tooltip, then the user should be able to enter text and focus in', () => {
544
+ shortTextResponsePage.steps.focusOutOfSpecifyCorrectAnswerInputField();
545
+ });
546
+
547
+ //Unable to check tooltip using cypress
548
+ it.skip('When the user enters a long text, then the user should be able to see the tooltip', () => {
549
+ shortTextResponsePage.answerInputFieldSpecifyCorrectAnswerSection()
550
+ .verifyTooltip('Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus.Lorem ipsum');
551
+ });
552
+
553
+ it('When the user removes text, then the user should be able to check focus', () => {
554
+ shortTextResponsePage.steps.clearSpecifyCorrectAnswerInputField();
555
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldSpecifyCorrectAnswerSection('');
556
+ shortTextResponsePage.steps.focusInSpecifyCorrectAnswerInputField();
557
+ });
558
+ });
559
+
560
+ describe('Short text response: Answer input field - Preview tab functionality', () => {
561
+ abortEarlySetup();
562
+ before(() => {
563
+ cy.log('Navigating to Short text response question type');
564
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
565
+ cy.barsPreLoaderWait();
566
+ shortTextResponsePage.steps.selectNoneRadioButton();
567
+ shortTextResponsePage.steps.switchToPreviewTab();
568
+ });
569
+
570
+ it('When the input field is empty, then the user should be able to focus in the input field', () => {
571
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
572
+ });
573
+
574
+ it('When the user enters some text, then the user should be able to enter text and focus in and out', () => {
575
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Lorem Ipsum');
576
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('Lorem Ipsum');
577
+ shortTextResponsePage.steps.focusOutOfResponseField();
578
+ });
579
+
580
+ it('When the user enters text that triggers the tooltip, then the user should be able to enter text and focus out', () => {
581
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor, eget tempus tellus dapibus. Lorem ipsum');
582
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor, eget tempus tellus dapibus. Lorem ipsum');
583
+ shortTextResponsePage.steps.focusOutOfResponseField();
584
+ });
585
+
586
+ //Unable to check tooltip using cypress
587
+ it.skip('When the character limit is reached, then the tooltip should appear', () => {
588
+ shortTextResponsePage.previewTabResponseField()
589
+ .verifyTooltip('Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus.Lorem ipsum')
590
+ });
591
+
592
+ it('When the user enters text that triggers the tooltip, then the user should be able to enter text and focus in', () => {
593
+ shortTextResponsePage.steps.focusOutOfResponseField();
594
+ });
595
+
596
+ it('When the user removes text, then the user should be able to check focus', () => {
597
+ shortTextResponsePage.steps.clearAndFocusOutOfResponseInputFieldPreviewTab();
598
+ shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('');
599
+ shortTextResponsePage.steps.focusInAnswerInputFieldPreviewTab();
600
+ });
601
+ });
516
602
  });
@@ -0,0 +1,34 @@
1
+ import { singleSelectionPage } from "../../../pages/singleSelectionPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ 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'];
5
+
6
+ describe('Create question page - Single selection', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Check Alternative Answer Button', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
15
+ cy.barsPreLoaderWait();
16
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
17
+ });
18
+
19
+ it('When correct answer is not set then alternative answer should be disabled', () => {
20
+ singleSelectionPage.steps.checkAlternativeButtonDisabled();
21
+ });
22
+
23
+ it('When correct answer is set then alternative answer should be enabled', () => {
24
+ singleSelectionPage.steps.allotPoints(20);
25
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
26
+ singleSelectionPage.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
+ singleSelectionPage.steps.clickOnAddAlternativeAnswerButton();
31
+ singleSelectionPage.steps.expandCorrectAnswerAccordion();
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,79 @@
1
+ import { singleSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Single selection', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Auto Scored With Points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
13
+ cy.barsPreLoaderWait();
14
+ singleSelectionPage.steps.switchToPreviewTab();
15
+ });
16
+
17
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
18
+ singleSelectionPage.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
+ singleSelectionPage.steps.checkOptionInPreviewTab(1);
23
+ singleSelectionPage.steps.switchToGradingView();
24
+ singleSelectionPage.steps.verifyAnswerBannerNotExist();
25
+ singleSelectionPage.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
+ singleSelectionPage.steps.switchToEditTab();
30
+ singleSelectionPage.steps.allotPoints(2);
31
+ singleSelectionPage.steps.switchToPreviewTab();
32
+ singleSelectionPage.steps.checkManuallyScoredScoringLabel();
33
+ singleSelectionPage.steps.checkOptionInPreviewTab(1);
34
+ singleSelectionPage.steps.switchToGradingView();
35
+ singleSelectionPage.steps.verifyAnswerBannerNotExist();
36
+ singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
37
+ })
38
+
39
+ });
40
+
41
+ describe('Question Preview: Auto Scored Without Points', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
45
+ cy.barsPreLoaderWait();
46
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
47
+ singleSelectionPage.steps.switchToPreviewTab();
48
+ });
49
+
50
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
51
+ singleSelectionPage.steps.checkManuallyScoredScoringLabel();
52
+ });
53
+
54
+ it('In Preview tab, when user switches to grading view then banner and correct Answer should be displayed', () => {
55
+ singleSelectionPage.steps.checkOptionInPreviewTab(1);
56
+ singleSelectionPage.steps.switchToGradingView();
57
+ singleSelectionPage.steps.verifyAnswerBannerExist();
58
+ singleSelectionPage.steps.verifyCorrectAnswerSectionExist();
59
+ })
60
+ });
61
+
62
+ describe('Question Preview: Non Scored', () => {
63
+ abortEarlySetup();
64
+ before(() => {
65
+ singleSelectionPage.steps.navigateToCreateQuestion('single 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
+ singleSelectionPage.steps.expandScoringTypeDropdown();
71
+ singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
72
+ singleSelectionPage.steps.switchToPreviewTab();
73
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
74
+ singleSelectionPage.steps.switchToGradingView();
75
+ singleSelectionPage.steps.verifyAnswerBannerNotExist();
76
+ singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
77
+ });
78
+ });
79
+ });
@@ -0,0 +1,72 @@
1
+ import { singleSelectionPage } from "../../../pages/singleSelectionPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const css = Cypress.env('css');
6
+
7
+ const options = ['Animal', 'Vehicle', 'Birds', 'Insects'];
8
+ const options2 = ['Car', 'Vehicle', 'Birds', 'Bike'];
9
+
10
+
11
+ describe('Edit item - Single Selection', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Edit Single Selection Question', { tags: 'smoke' }, () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
20
+ cy.barsPreLoaderWait();
21
+ singleSelectionPage.steps.addQuestionInstructions();
22
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
23
+ singleSelectionPage.steps.allotPoints(20);
24
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
25
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
26
+ });
27
+
28
+ it('User should be able to edit question instruction and save the question', () => {
29
+ singleSelectionPage.steps.editItem();
30
+ singleSelectionPage.steps.clearQuestionInstructionsInputField();
31
+ singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Single selection question instruction Updated');
32
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
33
+ singleSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Single selection question instruction Updated');
34
+ });
35
+
36
+ it('User should be able to edit options and save the question', () => {
37
+ singleSelectionPage.steps.editItem();
38
+ singleSelectionPage.steps.editOptionInputField(0, 'Car');
39
+ singleSelectionPage.steps.editOptionInputField(3, 'Bike');
40
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
41
+ singleSelectionPage.steps.verifyOptionFieldContentsInOptionsSection(options2);
42
+ });
43
+
44
+ it('User should be able to edit correct answer and save the question', () => {
45
+ singleSelectionPage.steps.editItem();
46
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
47
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
48
+ });
49
+
50
+ it('User should be able to edit points and save the question', () => {
51
+ singleSelectionPage.steps.editItem();
52
+ singleSelectionPage.steps.allotPoints(30);
53
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
54
+ singleSelectionPage.steps.verifyPointInQuestionPreview(30);
55
+ });
56
+
57
+ it('User should be able to change scoring type to manually and save the question', () => {
58
+ singleSelectionPage.steps.editItem();
59
+ singleSelectionPage.steps.expandScoringTypeDropdown();
60
+ singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
61
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
62
+ });
63
+
64
+ it('User should be able to change scoring type to non scored and save the question', () => {
65
+ singleSelectionPage.steps.editItem();
66
+ singleSelectionPage.steps.expandScoringTypeDropdown();
67
+ singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
68
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
69
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
70
+ });
71
+ });
72
+ });
@@ -163,4 +163,35 @@ describe('Create item page - Single selection: Question instructions, Options se
163
163
  singleSelectionPage.steps.verifyOptionWrapperContentsPreviewTab(3);
164
164
  });
165
165
  });
166
+
167
+ describe('User should be able to edit incomplete authored question', () => {
168
+ abortEarlySetup();
169
+ before(() => {
170
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
171
+ cy.barsPreLoaderWait();
172
+ singleSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
173
+ singleSelectionPage.steps.editItem();
174
+ });
175
+
176
+ it('Warning icons should be displayed on the required input fields', () => {
177
+ singleSelectionPage.steps.verifyWarningIconOnRequiredFields(['Please enter all option values', 'Please set points']);
178
+ });
179
+
180
+ it('Warning icons should disappear when required input fields are filled', () => {
181
+ singleSelectionPage.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.');
182
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
183
+ singleSelectionPage.steps.allotPoints(10);
184
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
185
+ singleSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
186
+ singleSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
187
+ });
188
+
189
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
190
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
191
+ });
192
+
193
+ it('Warning icon should not be visible', () => {
194
+ utilities.verifyElementVisibilityState(singleSelectionPage.warningIcon(), 'notExist');
195
+ });
196
+ });
166
197
  });