itemengine-cypress-automation 1.0.340 → 1.0.341

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 (41) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +84 -0
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/checkAddAlternativeButton.js +33 -0
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +2 -4
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +33 -0
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +37 -6
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +96 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/checkAddAlternative.js +37 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +4 -6
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabBasicSection.js +47 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +37 -9
  12. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +12 -0
  13. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +10 -0
  14. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/allOrNothingAlternatePointsMoreThanCorrectPoints.js +80 -0
  15. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/allOrNothingCorrectPointsMoreThanAlternatePoints.js +30 -0
  16. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/checkScoringLabelBannerAndCorrectAnswerSection.js +110 -0
  17. package/cypress/e2e/ILC/TextSelection/checkAddAlternativeButton.js +46 -0
  18. package/cypress/e2e/ILC/TextSelection/editTabBasicSection.js +57 -0
  19. package/cypress/e2e/ILC/TextSelection/headerSection.js +38 -6
  20. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
  21. package/cypress/fixtures/constants.js +5 -1
  22. package/cypress/fixtures/theme/ilc.json +2 -0
  23. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +5 -27
  24. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +0 -67
  25. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +0 -66
  26. package/cypress/pages/components/hideExpressionListComponent.js +53 -0
  27. package/cypress/pages/components/index.js +1 -0
  28. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  29. package/cypress/pages/desmos3DGraphingPage.js +368 -0
  30. package/cypress/pages/desmosGeometryPage.js +308 -0
  31. package/cypress/pages/dragAndDropIntoCategoriesPage.js +26 -6
  32. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -68
  33. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  34. package/cypress/pages/imageHighlightPage.js +0 -66
  35. package/cypress/pages/index.js +3 -2
  36. package/cypress/pages/multipleSelectionGridPage.js +1 -68
  37. package/cypress/pages/multipleSelectionPage.js +0 -67
  38. package/cypress/pages/singleSelectionGridPage.js +1 -68
  39. package/cypress/pages/singleSelectionPage.js +0 -67
  40. package/cypress/pages/textSelectionPage.js +25 -6
  41. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ import { dragAndDropIntoCategoriesPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Drag and Drop into Categories', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Auto Scored With Points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
13
+ cy.barsPreLoaderWait();
14
+ dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct categories');
15
+ dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
16
+ dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
17
+ });
18
+
19
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
20
+ dragAndDropIntoCategoriesPage.steps.checkManuallyScoredScoringLabel();
21
+ });
22
+
23
+ it('In Preview tab, when user switches to grading view then no banner and correct answer should be displayed', () => {
24
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
25
+ dragAndDropIntoCategoriesPage.steps.switchToGradingView();
26
+ dragAndDropIntoCategoriesPage.steps.verifyAnswerStatusBannerNotExist();
27
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExist();
28
+ });
29
+
30
+ 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', () => {
31
+ dragAndDropIntoCategoriesPage.steps.switchToEditTab();
32
+ dragAndDropIntoCategoriesPage.steps.allotPoints(2);
33
+ dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
34
+ dragAndDropIntoCategoriesPage.steps.checkManuallyScoredScoringLabel();
35
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
36
+ dragAndDropIntoCategoriesPage.steps.switchToGradingView();
37
+ dragAndDropIntoCategoriesPage.steps.verifyAnswerStatusBannerNotExist();
38
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExist();
39
+ });
40
+ });
41
+
42
+ describe('Question Preview: Auto Scored Without Points', () => {
43
+ abortEarlySetup();
44
+ before(() => {
45
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
46
+ cy.barsPreLoaderWait();
47
+ dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct categories');
48
+ dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
49
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Option 1': 0, 'Option 2': 1 });
50
+ dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
51
+ });
52
+
53
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
54
+ dragAndDropIntoCategoriesPage.steps.checkManuallyScoredScoringLabel();
55
+ });
56
+
57
+ it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
58
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 1, 'Option 2': 0 });
59
+ dragAndDropIntoCategoriesPage.steps.switchToGradingView();
60
+ dragAndDropIntoCategoriesPage.steps.verifyAnswerStatusBannerExist();
61
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionExist();
62
+ });
63
+ });
64
+
65
+ describe('Question Preview: Non Scored', () => {
66
+ abortEarlySetup();
67
+ before(() => {
68
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
69
+ cy.barsPreLoaderWait();
70
+ dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct categories');
71
+ dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
72
+ });
73
+
74
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
75
+ dragAndDropIntoCategoriesPage.steps.expandScoringTypeDropdown();
76
+ dragAndDropIntoCategoriesPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
77
+ dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
78
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
79
+ dragAndDropIntoCategoriesPage.steps.switchToGradingView();
80
+ dragAndDropIntoCategoriesPage.steps.verifyAnswerStatusBannerNotExist();
81
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExist();
82
+ });
83
+ });
84
+ });
@@ -0,0 +1,33 @@
1
+ import { dragAndDropIntoCategoriesPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create question page - Drag and Drop into Categories', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Check Alternative Answer Button', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
13
+ cy.barsPreLoaderWait();
14
+ dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct categories');
15
+ dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
16
+ });
17
+
18
+ it('When correct answer is not set then alternative answer should be disabled', () => {
19
+ dragAndDropIntoCategoriesPage.steps.checkAlternativeButtonDisabled();
20
+ });
21
+
22
+ it('When correct answer is set then alternative answer should be enabled', () => {
23
+ dragAndDropIntoCategoriesPage.steps.allotPoints(20);
24
+ dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Option 1': 0, 'Option 2': 1 });
25
+ dragAndDropIntoCategoriesPage.steps.checkAlternativeButtonEnabled();
26
+ });
27
+
28
+ 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', () => {
29
+ dragAndDropIntoCategoriesPage.steps.clickOnAddAlternativeAnswerButton();
30
+ dragAndDropIntoCategoriesPage.steps.expandCorrectAnswerAccordion();
31
+ });
32
+ });
33
+ });
@@ -154,8 +154,7 @@ describe('Create Item Page: Drag and drop into categories: Click and drop cases
154
154
  dragAndDropIntoCategoriesPage.steps.clickAndDropOptionFromDropzoneToOptionContainerSpecifyCorrectAnswerSection('Bat');
155
155
  dragAndDropIntoCategoriesPage.steps.clickAndDropOptionFromDropzoneToOptionContainerSpecifyCorrectAnswerSection('Eagle');
156
156
  dragAndDropIntoCategoriesPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['Bat', 'Eagle', 'Parrot', 'Whale']);
157
- utilities.verifyInnerText(dragAndDropIntoCategoriesPage.errorMessage(), 'Error: Please set a correct answer.');
158
- utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.errorMessage(), 'visible');
157
+ utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.errorMessage(), 'notExist');
159
158
  });
160
159
 
161
160
  dragAndDropIntoCategoriesPage.tests.verifyErrorMessageCSSAndA11y();
@@ -482,8 +481,7 @@ describe('Create Item Page: Drag and drop into categories: Click and drop cases
482
481
  dragAndDropIntoCategoriesPage.steps.clickAndDropOptionFromDropzoneToOptionContainerSpecifyCorrectAnswerSection('Eagle');
483
482
  dragAndDropIntoCategoriesPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, groupedOptions[0]);
484
483
  dragAndDropIntoCategoriesPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(1, groupedOptions[1]);
485
- utilities.verifyInnerText(dragAndDropIntoCategoriesPage.errorMessage(), 'Error: Please set a correct answer.');
486
- utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.errorMessage(), 'visible');
484
+ utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.errorMessage(), 'notExist');
487
485
  });
488
486
 
489
487
  dragAndDropIntoCategoriesPage.tests.verifyErrorMessageCSSAndA11y();
@@ -122,10 +122,8 @@ describe('Create Item page - Drag and drop into categories: Draggable options se
122
122
  dragAndDropIntoCategoriesPage.steps.verifyDeleteOptionButtonDisabledState();
123
123
  });
124
124
 
125
- it('When the user clicks on \'Add group\' button without entering text in the option input fields, error message \'Error: Option is required\' should be displayed', () => {
126
- dragAndDropIntoCategoriesPage.steps.addGroup();
127
- dragAndDropIntoCategoriesPage.steps.verifyOptionsInputFieldErrorMessage(0);
128
- dragAndDropIntoCategoriesPage.steps.verifyOptionsInputFieldErrorMessage(1);
125
+ it('\'Add group\' button should be disabled', () => {
126
+ utilities.verifyElementDisabled(draggableOptionsSectionComponent.addGroupButton());
129
127
  });
130
128
 
131
129
  it('When the user enters text in the options input field, the error messages should disappear', () => {
@@ -759,4 +759,37 @@ describe('Create item page - Drag and drop into categories: Question instruction
759
759
  dragAndDropIntoCategoriesPage.steps.verifyCellLabelInPreviewTabTable(2, 'New text');
760
760
  });
761
761
  });
762
+
763
+ describe('User should be able to edit incomplete authored question', () => {
764
+ before(() => {
765
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
766
+ cy.barsPreLoaderWait();
767
+ dragAndDropIntoCategoriesPage.steps.saveAQuestionWithIncompleteAuthoring();
768
+ dragAndDropIntoCategoriesPage.steps.editItem();
769
+ });
770
+
771
+ it('Warning icons should be displayed on the required input fields', () => {
772
+ dragAndDropIntoCategoriesPage.steps.verifyWarningIconOnRequiredFields(
773
+ [
774
+ "Please enter all option values",
775
+ "Please set points"
776
+ ]);
777
+ });
778
+
779
+ it('When required input fields are filled then warning icons should disappear', () => {
780
+ dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
781
+ dragAndDropIntoCategoriesPage.steps.allotPoints(10);
782
+ dragAndDropIntoCategoriesPage.steps.verifyErrorMessageIsNotDisplayed();
783
+ dragAndDropIntoCategoriesPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
784
+ });
785
+
786
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
787
+ dragAndDropIntoCategoriesPage.steps.saveAQuestionAndVerifySnackbar();
788
+ });
789
+
790
+ it('Warning icon should not be visible', () => {
791
+ dragAndDropIntoCategoriesPage.steps.verifyWarningIconNotExist();
792
+ });
793
+ });
794
+
762
795
  });
@@ -1,6 +1,10 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, dragAndDropIntoCategoriesPage } from "../../../pages";
2
+ import { dialogBoxBase, dragAndDropIntoCategoriesPage, itemPreviewPage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components";
4
+ import utilities from "../../../support/helpers/utilities";
5
+
3
6
  const options = ['Bat', 'Eagle'];
7
+ var itemReferenceID = "";
4
8
 
5
9
  describe('Create item page - Drag and drop into categories: Header section and Saving question', () => {
6
10
  before(() => {
@@ -42,14 +46,11 @@ describe('Create item page - Drag and drop into categories: Header section and S
42
46
  });
43
47
 
44
48
  describe('Validation error messages', () => {
45
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
49
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
46
50
 
47
51
  it('Validation error messages should be displayed below required input fields', () => {
48
52
  dragAndDropIntoCategoriesPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
49
- dragAndDropIntoCategoriesPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
50
- dragAndDropIntoCategoriesPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(0);
51
- dragAndDropIntoCategoriesPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
52
- dragAndDropIntoCategoriesPage.steps.verifySpecifyCorrectAnswerErrorMessage();
53
+ dragAndDropIntoCategoriesPage.steps.verifyWarningIconOnRequiredFields(['Please enter all option values', 'Please set points']);
53
54
  });
54
55
 
55
56
  it('Validation error messages should disappear when required input fields are filled', () => {
@@ -69,5 +70,35 @@ describe('Create item page - Drag and drop into categories: Header section and S
69
70
  });
70
71
  dragAndDropIntoCategoriesPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
71
72
  });
73
+
74
+ describe('Saving a question with incomplete authoring', () => {
75
+ abortEarlySetup();
76
+ before(() => {
77
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
78
+ cy.barsPreLoaderWait();
79
+ });
80
+
81
+ it('User should be able to save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
82
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
83
+ dragAndDropIntoCategoriesPage.steps.saveAQuestionWithIncompleteAuthoring();
84
+ });
85
+ dragAndDropIntoCategoriesPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
86
+ });
87
+ });
88
+
89
+ describe('Save as you go - Browse item page contents', () => {
90
+ abortEarlySetup();
91
+ before(() => {
92
+ dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
93
+ cy.barsPreLoaderWait();
94
+ dragAndDropIntoCategoriesPage.steps.saveAQuestionWithIncompleteAuthoring();
95
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
96
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
97
+ browseItemsPage.steps.navigateToBrowseItemsPage();
98
+ });
99
+
100
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
101
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
102
+ });
72
103
  });
73
104
  });
@@ -0,0 +1,96 @@
1
+ import { fillInTheGapsOverImageDragAndDropPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const dropzoneCoordinates = [{ x: 50, y: 50 }, { x: 100, y: 100 }];
5
+
6
+ describe('Create Item page - Fill In the Gaps Over Image Drag and Drop', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Question Preview: Auto Scored With Points', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
15
+ cy.barsPreLoaderWait();
16
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
17
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
18
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
19
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
20
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
21
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
25
+ fillInTheGapsOverImageDragAndDropPage.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
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
30
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
31
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyAnswerStatusBannerNotExist();
32
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionNotExist();
33
+ })
34
+
35
+ 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', () => {
36
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
37
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPoints(2);
38
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
39
+ fillInTheGapsOverImageDragAndDropPage.steps.checkManuallyScoredScoringLabel();
40
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
41
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
42
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyAnswerStatusBannerNotExist();
43
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionNotExist();
44
+ })
45
+
46
+ });
47
+
48
+ describe('Question Preview: Auto Scored Without Points', () => {
49
+ abortEarlySetup();
50
+ before(() => {
51
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
52
+ cy.barsPreLoaderWait();
53
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
54
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
55
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
56
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
57
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
58
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Option 1': 0, 'Option 2': 1 });
59
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
60
+ });
61
+
62
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
63
+ fillInTheGapsOverImageDragAndDropPage.steps.checkManuallyScoredScoringLabel();
64
+ });
65
+
66
+ it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
67
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 1, 'Option 2': 0 });
68
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
69
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyAnswerStatusBannerExist();
70
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionExist();
71
+ })
72
+ });
73
+
74
+ describe('Question Preview: Non Scored', () => {
75
+ abortEarlySetup();
76
+ before(() => {
77
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
78
+ cy.barsPreLoaderWait();
79
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
80
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
81
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
82
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
83
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
84
+ });
85
+
86
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
87
+ fillInTheGapsOverImageDragAndDropPage.steps.expandScoringTypeDropdown();
88
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
89
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
90
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Option 1': 0, 'Option 2': 1 });
91
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
92
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyAnswerStatusBannerNotExist();
93
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyCorrectAnswerSectionNotExist();
94
+ });
95
+ });
96
+ });
@@ -0,0 +1,37 @@
1
+ import { fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create question page - Fill In the Gaps Over Image Drag and Drop', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Check Alternative Answer Button', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsOverImageDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
15
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
16
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
17
+ fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
18
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
19
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Option 1', 'Option 2']);
20
+ });
21
+
22
+ it('When correct answer is not set then alternative answer should be disabled', () => {
23
+ fillInTheGapsOverImageDragAndDropPage.steps.checkAlternativeButtonDisabled();
24
+ });
25
+
26
+ it('When correct answer is set then alternative answer should be enabled', () => {
27
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPoints(20);
28
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Option 1': 0 });
29
+ fillInTheGapsOverImageDragAndDropPage.steps.checkAlternativeButtonEnabled();
30
+ });
31
+
32
+ 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', () => {
33
+ fillInTheGapsOverImageDragAndDropPage.steps.clickOnAddAlternativeAnswerButton();
34
+ fillInTheGapsOverImageDragAndDropPage.steps.expandCorrectAnswerAccordion();
35
+ });
36
+ });
37
+ });
@@ -153,12 +153,11 @@ describe('Create Item Page: Fill in the gaps over image - drag and drop: Click a
153
153
  fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
154
154
  });
155
155
 
156
- it('When the user selects a filled option and clicks in the options container, the selected option should get back in the options container an \'Error: Please set a correct answer\' error message should be displayed', () => {
156
+ it('When the user selects a filled option and clicks in the options container, the selected option should get back in the options container and \'Error: Please set a correct answer\' error message should be displayed', () => {
157
157
  fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
158
158
  fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Flower');
159
159
  fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['Petals', 'Flower', 'Stem', 'Seed']);
160
- utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'Error: Please set a correct answer.');
161
- utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'visible');
160
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'notExist');
162
161
  });
163
162
 
164
163
  fillInTheGapsOverImageDragAndDropPage.tests.verifyErrorMessageCSSAndA11y();
@@ -483,13 +482,12 @@ describe('Create Item Page: Fill in the gaps over image - drag and drop: Click a
483
482
  fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
484
483
  });
485
484
 
486
- it('When the user selects a filled option and clicks in the options container, the selected option should get back in the options container an error message should be displayed', () => {
485
+ it('When the user selects a filled option and clicks in the options container, the selected option should get back in the options container and no error message should be displayed', () => {
487
486
  fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropGroupedOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
488
487
  fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropGroupedOptionInOptionsContainerInSpecifyCorrectAnswerSection('Flower');
489
488
  fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, groupedOptions[0]);
490
489
  fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(1, groupedOptions[1]);
491
- utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'Error: Please set a correct answer.');
492
- utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'visible');
490
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'notExist');
493
491
  });
494
492
 
495
493
  fillInTheGapsOverImageDragAndDropPage.tests.verifyErrorMessageCSSAndA11y();
@@ -0,0 +1,47 @@
1
+ import { fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill In the Gaps Over Image Drag and Drop', () => {
5
+
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('User should be able to edit incomplete authored question', () => {
11
+ before(() => {
12
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsOverImageDragAndDropPage.steps.saveAQuestionWithIncompleteAuthoring();
15
+ fillInTheGapsOverImageDragAndDropPage.steps.editItem();
16
+ });
17
+
18
+ it('Warning icons should be displayed on the required input fields', () => {
19
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyWarningIconOnRequiredFields(
20
+ [
21
+ "Please enter all option values",
22
+ "Please upload an image",
23
+ "Please set points"
24
+ ]);
25
+ });
26
+
27
+ it('When required input fields are filled then warning icons should disappear', () => {
28
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
29
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
30
+ fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
31
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
32
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
33
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
34
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPoints(10);
35
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyErrorMessageIsNotDisplayed();
36
+ fillInTheGapsOverImageDragAndDropPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
37
+ });
38
+
39
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
40
+ fillInTheGapsOverImageDragAndDropPage.steps.saveAQuestionAndVerifySnackbar();
41
+ });
42
+
43
+ it('Warning icon should not be visible', () => {
44
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyWarningIconNotExist();
45
+ });
46
+ });
47
+ });
@@ -1,7 +1,11 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
2
+ import { dialogBoxBase, fillInTheGapsOverImageDragAndDropPage, itemPreviewPage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components";
3
4
  import utilities from "../../../support/helpers/utilities";
5
+
4
6
  const options = ['Flower', 'Leaves'];
7
+ var itemReferenceID = "";
8
+
5
9
 
6
10
  describe('Create item page - Fill in the gaps over image - drag and drop: Header section and Saving question', () => {
7
11
  before(() => {
@@ -43,17 +47,11 @@ describe('Create item page - Fill in the gaps over image - drag and drop: Header
43
47
  });
44
48
 
45
49
  describe('Validation error messages', () => {
46
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
47
-
50
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please upload an image', 'Please set points']);
48
51
 
49
52
  it('Validation error messages should be displayed below required input fields', () => {
50
53
  fillInTheGapsOverImageDragAndDropPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
51
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 0), 'Error: Image is required.');
52
- utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 1), 'Error: Please insert a dropzone.');
53
- fillInTheGapsOverImageDragAndDropPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
54
- fillInTheGapsOverImageDragAndDropPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(0);
55
- fillInTheGapsOverImageDragAndDropPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
56
- fillInTheGapsOverImageDragAndDropPage.steps.verifySpecifyCorrectAnswerErrorMessage();
54
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyWarningIconOnRequiredFields(['Please enter all option values', 'Please upload an image', 'Please set points'])
57
55
  });
58
56
 
59
57
  it('Validation error messages should disappear when required input fields are filled', () => {
@@ -79,5 +77,35 @@ describe('Create item page - Fill in the gaps over image - drag and drop: Header
79
77
  });
80
78
  fillInTheGapsOverImageDragAndDropPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
81
79
  });
80
+
81
+ describe('Saving a question with incomplete authoring', () => {
82
+ abortEarlySetup();
83
+ before(() => {
84
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
85
+ cy.barsPreLoaderWait();
86
+ });
87
+
88
+ it('User should be able to save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
89
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
90
+ fillInTheGapsOverImageDragAndDropPage.steps.saveAQuestionWithIncompleteAuthoring();
91
+ });
92
+ fillInTheGapsOverImageDragAndDropPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
93
+ });
94
+ });
95
+
96
+ describe('Save as you go - Browse item page contents', () => {
97
+ abortEarlySetup();
98
+ before(() => {
99
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
100
+ cy.barsPreLoaderWait();
101
+ fillInTheGapsOverImageDragAndDropPage.steps.saveAQuestionWithIncompleteAuthoring();
102
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
103
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
104
+ browseItemsPage.steps.navigateToBrowseItemsPage();
105
+ });
106
+
107
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
108
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
109
+ });
82
110
  });
83
111
  });
@@ -111,6 +111,12 @@ describe('Create item page - Grid fill: Customize layout section - \'Fill Image\
111
111
  gridFillPage.steps.verifyFilledImageFileNameLabel('highlightImage.jpg');
112
112
  });
113
113
 
114
+ it('When the user adds the image more than of 10MB, then error should be displayed', () => {
115
+ gridFillPage.steps.uploadFilledImageFile('20mbFile.png');
116
+ utilities.verifyElementVisibilityState(gridFillPage.errorMessage(), 'visible');
117
+ utilities.verifyInnerText(gridFillPage.errorMessage(), 'Error: The file could not be uploaded. The file is 21 MB exceeding the maximum size of 10 MB.');
118
+ });
119
+
114
120
  it('Delete button should appear beside uploaded file\'s name', () => {
115
121
  utilities.verifyElementVisibilityState(gridFillPage.filledImageDeleteImageButton(), 'visible');
116
122
  });
@@ -312,6 +318,12 @@ describe('Create item page - Grid fill: Customize layout section - \'Fill Image\
312
318
  it('When user has deleted the uploaded background image, then the image should not be displayed as background in grids in edit tab', () => {
313
319
  gridFillPage.steps.verifyBackgroundImageIsNotDisplayedInEditTabGrids();
314
320
  });
321
+
322
+ it('When the user adds the image more than of 10MB, then error should be displayed', () => {
323
+ gridFillPage.steps.uploadFile('20mbFile.png');
324
+ utilities.verifyElementVisibilityState(gridFillPage.errorMessage(), 'visible');
325
+ utilities.verifyInnerText(gridFillPage.errorMessage(), 'Error: The file could not be uploaded. The file is 21 MB exceeding the maximum size of 10 MB.');
326
+ });
315
327
  });
316
328
 
317
329
  describe('\'Background image\' - Image properties section edit tab', () => {
@@ -86,6 +86,16 @@ describe('Ruler: Edit tab functionality', () => {
86
86
  rulerPage.steps.verifyWidthAndHeightOfImageInPreviewTab();
87
87
  });
88
88
 
89
+ it('When the user chooses \'Custom image\' in the \'Unit of Measurement\' dropdown and adds an image file more than 10MB, then error message should be displayed', () => {
90
+ cy.log('Switching to Edit Tab');
91
+ rulerPage.steps.switchToEditTab();
92
+ rulerPage.steps.expandUnitOfMeasurementDropdown();
93
+ rulerPage.steps.selectOptionFromUnitOfMeasurementDropdown('Custom image');
94
+ rulerPage.steps.uploadFile('uploads/20mbFile.png');
95
+ utilities.verifyElementVisibilityState(rulerPage.errorMessage(), 'visible');
96
+ utilities.verifyInnerText(rulerPage.errorMessage(), 'Error: The file could not be uploaded. The file is 21 MB exceeding the maximum size of 10 MB.');
97
+ });
98
+
89
99
  it('When user updates width and height in edit tab, then updated changes should be reflected in preview tab', () => {
90
100
  cy.log('Switching to Edit Tab');
91
101
  rulerPage.steps.switchToEditTab();