itemengine-cypress-automation 1.0.337-IEI-5508-automated-tests-9e03453.0 → 1.0.338
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.
- package/cypress/e2e/ILC/ChartsBar/HorizontalOrientationBarChart/editQuestion.smoke.js +94 -0
- package/cypress/e2e/ILC/ChartsBar/editQuestion.smoke.js +93 -0
- package/cypress/e2e/ILC/ChartsDotsPlot/editQuestion.smoke.js +92 -0
- package/cypress/e2e/ILC/ChartsLine/editQuestion.smoke.js +84 -0
- package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/CkEditorEquationEditor/selectModeEditorBasic.js +1 -1
- package/cypress/e2e/ILC/CkEditorInsertImage/insertImageBasicFile.js +1 -1
- package/cypress/e2e/ILC/CkEditorInsertImage/upload.js +1 -1
- package/cypress/e2e/ILC/CkEditorInsertTable/insertTableEditorBasicFile.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +12 -9
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +2 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +63 -1
- package/cypress/e2e/ILC/EssayResponse/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponseBasic/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponseMath/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/checkScoringLableBannerAndCorrectAnswer.js +84 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAddAlternativeButton.js +33 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +2 -8
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +32 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +39 -6
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViewInIncompleteAuthoring.smoke.js +119 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +91 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAddAlternativeButton.js +37 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editQuestion.smoke.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +36 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +36 -6
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +103 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +96 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAddAlternativeButton.js +38 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editQuestion.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +39 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +39 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViewsInIncompleteuthoring.smoke.js +106 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +38 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +88 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/checkAddAlternative.js +35 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editQuestion.smoke.js +33 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViewsInIncompleteAuthoring.js +97 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +79 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAddAlternativeButton.js +32 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +30 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +35 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViewsInIncompleteAuthoring.smoke.js +99 -0
- package/cypress/e2e/ILC/GridFill/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +109 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +45 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/checkScoringLableBannerAndCorrectAnswer.js +96 -0
- package/cypress/e2e/ILC/ImageHighlight/checkAddAlternativeButton.js +39 -0
- package/cypress/e2e/ILC/ImageHighlight/editQuestion.smoke.js +76 -0
- package/cypress/e2e/ILC/ImageHighlight/editTabBasicSection.js +46 -0
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +35 -5
- package/cypress/e2e/ILC/ImageHighlight/previewContentForAllViewInIncompleteAuthoring.js +118 -0
- package/cypress/e2e/ILC/ListOrderingNew/editQuestion.smoke.js +3 -0
- package/cypress/e2e/ILC/Matching/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationLayoutProperties.js +3 -3
- package/cypress/e2e/ILC/NumberLine/editQuestion.smoke.js +79 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +5 -5
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/editQuestion.smoke.js +72 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +1 -0
- package/cypress/e2e/ILC/NumberLineLabel/editQuestion.smoke.js +80 -0
- package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/editQuestion.smoke.js +81 -0
- package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/editQuestion.smoke.js +56 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +5 -6
- package/cypress/e2e/ILC/SingleSelection/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/editQuestion.smoke.js +76 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/editQuestion.smoke.js +92 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/TextSelection/editQuestion.smoke.js +0 -3
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +9 -9
- package/cypress/e2e/ILC/chartsDotsPlot/gradingViewAndCorrectAnswerView.smoke.js +2 -2
- package/cypress/e2e/ILC/chartsDotsPlot/numberLineAxisSettings.js +1 -0
- package/cypress/e2e/ILC/chartsDotsPlot/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/fixtures/uploadResponseFileType.js +1 -1
- package/cypress/pages/chartsBarPage.js +3 -0
- package/cypress/pages/chartsDotPlotPage.js +2 -0
- package/cypress/pages/chartsLinePage.js +38 -2
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -0
- package/cypress/pages/components/browseItemsPage.js +4 -4
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +22 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +67 -0
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +66 -0
- package/cypress/pages/components/layoutSectionComponent.js +1 -1
- package/cypress/pages/components/optionsWrapperComponent.js +1 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +2 -1
- package/cypress/pages/createItemPage.js +7 -0
- package/cypress/pages/dialogBoxBase.js +13 -7
- package/cypress/pages/drawingResponsePage.js +73 -2
- package/cypress/pages/feedbackScalePage.js +2 -0
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +71 -4
- package/cypress/pages/fillInTheGapsDropdownPage.js +21 -0
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -2
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +22 -0
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +22 -0
- package/cypress/pages/fillInTheGapsTextPage.js +24 -2
- package/cypress/pages/imageHighlightPage.js +106 -6
- package/cypress/pages/listOrderingPage.js +4 -2
- package/cypress/pages/menuBarPage.js +65 -65
- package/cypress/pages/multipleSelectionGridPage.js +68 -1
- package/cypress/pages/multipleSelectionPage.js +67 -0
- package/cypress/pages/numberLineLabelPage.js +4 -1
- package/cypress/pages/numberLinePage.js +2 -0
- package/cypress/pages/shortTextResponsePage.js +2 -0
- package/cypress/pages/singleSelectionGridPage.js +68 -1
- package/cypress/pages/singleSelectionPage.js +67 -0
- package/cypress/pages/textEntryMathPage.js +7 -3
- package/cypress/pages/textEntryMathWithImagePage.js +3 -0
- package/package.json +2 -2
@@ -0,0 +1,106 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
5
|
+
const views = utilities.getViews(previewContentViews);
|
6
|
+
var itemReferenceID = "";
|
7
|
+
|
8
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
9
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
10
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
11
|
+
|
12
|
+
describe('Create item page - Fill in the gaps over image - dropdown - Preview contents in all views when authoring is incomplete', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
beforeEach(() => {
|
18
|
+
cy.startApplitools();
|
19
|
+
});
|
20
|
+
|
21
|
+
afterEach(() => {
|
22
|
+
cy.eyesClose();
|
23
|
+
});
|
24
|
+
|
25
|
+
views.forEach((view) => {
|
26
|
+
describe(`Preview tab contents when authoring is incomplete - ${view}`, { tags: 'smoke' }, () => {
|
27
|
+
abortEarlySetup();
|
28
|
+
before(() => {
|
29
|
+
switch (view) {
|
30
|
+
case 'Question preview':
|
31
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image with dropdown');
|
32
|
+
cy.barsPreLoaderWait();
|
33
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
34
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
35
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
36
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(30);
|
37
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
38
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
39
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
40
|
+
break;
|
41
|
+
case 'Item view':
|
42
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
43
|
+
break;
|
44
|
+
case 'Item preview':
|
45
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
46
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
47
|
+
break;
|
48
|
+
case 'Student view':
|
49
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
50
|
+
break;
|
51
|
+
case 'Grading view':
|
52
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
53
|
+
break;
|
54
|
+
case 'Correct answer view':
|
55
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
56
|
+
break;
|
57
|
+
default:
|
58
|
+
throw new Error('Invalid view');
|
59
|
+
}
|
60
|
+
});
|
61
|
+
|
62
|
+
after(() => {
|
63
|
+
if (view === 'Question preview') {
|
64
|
+
fillInTheGapsOverImageDropdownPage.steps.saveAQuestionWithIncompleteAuthoring();
|
65
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
66
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
67
|
+
}
|
68
|
+
if (view === 'Student view') {
|
69
|
+
studentViewPage.steps.submitResponse();
|
70
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
71
|
+
}
|
72
|
+
});
|
73
|
+
|
74
|
+
it(`${view} - Fill in the gaps over image dropdown Question instructions should be visible`, () => {
|
75
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.questionInstructionsText(), 'Fill in the gaps');
|
76
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.questionInstructionsText(), 'visible');
|
77
|
+
cy.eyesCheckWindow(`${view} - Fill in the gaps over image dropdown - default state`);
|
78
|
+
});
|
79
|
+
|
80
|
+
it('The image uploaded in the \'Background image\' section should be displayed', () => {
|
81
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab(), 'visible');
|
82
|
+
});
|
83
|
+
|
84
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
85
|
+
it('The added dropdowns should be displayed in the preview tab and they should be empty', () => {
|
86
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), 2);
|
87
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: '' }]);
|
88
|
+
});
|
89
|
+
|
90
|
+
it(`User should be able to select an option from the dropdown`, () => {
|
91
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }]);
|
92
|
+
});
|
93
|
+
} else if (view === 'Grading view') {
|
94
|
+
it('The dropdowns should be displayed filled with answers', () => {
|
95
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), 2);
|
96
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: correctAnswerArray[0] }]);
|
97
|
+
});
|
98
|
+
|
99
|
+
it('The dropdowns should not be editable', () => {
|
100
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownIsDisabled(0);
|
101
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownIsDisabled(1);
|
102
|
+
});
|
103
|
+
}
|
104
|
+
});
|
105
|
+
});
|
106
|
+
});
|
@@ -38,10 +38,9 @@ describe('Create item page - Fill in the gaps over image with dropdown: Supporte
|
|
38
38
|
});
|
39
39
|
});
|
40
40
|
|
41
|
-
it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should be displayed', () => {
|
41
|
+
it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should not be displayed', () => {
|
42
42
|
fillInTheGapsOverImageDropdownPage.steps.uploadFile('sample.heic');
|
43
|
-
utilities.
|
44
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.errorMessage(), 'visible');
|
43
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.errorMessage(), 'notExist');
|
45
44
|
});
|
46
45
|
|
47
46
|
fillInTheGapsOverImageDropdownPage.tests.verifyErrorMessageCSSAndA11y();
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
-
import { dialogBoxBase, fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import { dialogBoxBase, fillInTheGapsOverImageTextPage, itemPreviewPage } from "../../../pages";
|
3
|
+
import { browseItemsPage } from "../../../pages/components";
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
5
|
+
var itemReferenceID = ""
|
6
|
+
|
4
7
|
const options = ['Flower', 'Leaves'];
|
5
8
|
|
6
9
|
describe('Create item page - Fill in the gaps over image - text: Header section and saving question', () => {
|
@@ -46,13 +49,11 @@ describe('Create item page - Fill in the gaps over image - text: Header section
|
|
46
49
|
});
|
47
50
|
|
48
51
|
describe('Validation error messages', () => {
|
49
|
-
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
52
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please upload an image', 'Please insert a text container', 'Please set points']);
|
50
53
|
|
51
54
|
it('Validation error messages should be displayed below required input fields', () => {
|
52
55
|
fillInTheGapsOverImageTextPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
|
53
|
-
fillInTheGapsOverImageTextPage.steps.
|
54
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageTextPage.errorMessage(), 0), 'Error: Image is required.');
|
55
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageTextPage.errorMessage(), 1), 'Error: Please insert a text container.');
|
56
|
+
fillInTheGapsOverImageTextPage.steps.verifyWarningIconOnRequiredFields(['Please upload an image', 'Please insert a text container', 'Please set points']);
|
56
57
|
});
|
57
58
|
|
58
59
|
it('Validation error messages should disappear when required input fields are filled', () => {
|
@@ -75,5 +76,37 @@ describe('Create item page - Fill in the gaps over image - text: Header section
|
|
75
76
|
});
|
76
77
|
fillInTheGapsOverImageTextPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
77
78
|
});
|
79
|
+
|
80
|
+
describe('Saving a question with incomplete authoring', () => {
|
81
|
+
abortEarlySetup();
|
82
|
+
before(() => {
|
83
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
84
|
+
cy.barsPreLoaderWait();
|
85
|
+
});
|
86
|
+
|
87
|
+
it('Should save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
|
88
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please upload an image', 'Please set points']);
|
89
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
90
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please insert a text container', 'Please set points']);
|
91
|
+
fillInTheGapsOverImageTextPage.steps.saveAQuestionWithIncompleteAuthoring();
|
92
|
+
});
|
93
|
+
fillInTheGapsOverImageTextPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
94
|
+
});
|
95
|
+
|
96
|
+
describe('Save as you go - Browse item page contents', () => {
|
97
|
+
abortEarlySetup();
|
98
|
+
before(() => {
|
99
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with dropdown');
|
100
|
+
cy.barsPreLoaderWait();
|
101
|
+
fillInTheGapsOverImageTextPage.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
|
+
});
|
110
|
+
});
|
78
111
|
});
|
79
112
|
});
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create Item page - Fill in the gaps over image with text', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question Preview: Auto Scored With Points', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
13
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
14
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
15
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
|
21
|
+
fillInTheGapsOverImageTextPage.steps.checkManuallyScoredScoringLabel();
|
22
|
+
});
|
23
|
+
|
24
|
+
it('In Preview tab, when user switches to grading view then no banner and correct answer should be displayed', () => {
|
25
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
26
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
27
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerStatusBannerNotExist();
|
28
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerSectionNotExist();
|
29
|
+
})
|
30
|
+
|
31
|
+
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', () => {
|
32
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
33
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(2);
|
34
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
35
|
+
fillInTheGapsOverImageTextPage.steps.checkManuallyScoredScoringLabel();
|
36
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
37
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
38
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerStatusBannerNotExist();
|
39
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerSectionNotExist();
|
40
|
+
})
|
41
|
+
|
42
|
+
});
|
43
|
+
|
44
|
+
describe('Question Preview: Auto Scored Without Points', () => {
|
45
|
+
abortEarlySetup();
|
46
|
+
before(() => {
|
47
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
48
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
49
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
50
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
51
|
+
cy.barsPreLoaderWait();
|
52
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }]);
|
53
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
54
|
+
});
|
55
|
+
|
56
|
+
it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
|
57
|
+
fillInTheGapsOverImageTextPage.steps.checkManuallyScoredScoringLabel();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
|
61
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Leaf' }]);
|
62
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
63
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerStatusBannerExist();
|
64
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerSectionExist();
|
65
|
+
})
|
66
|
+
});
|
67
|
+
|
68
|
+
describe('Question Preview: Non Scored', () => {
|
69
|
+
abortEarlySetup();
|
70
|
+
before(() => {
|
71
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
72
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
73
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
74
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
75
|
+
cy.barsPreLoaderWait();
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
|
79
|
+
fillInTheGapsOverImageTextPage.steps.expandScoringTypeDropdown();
|
80
|
+
fillInTheGapsOverImageTextPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
81
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
82
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
83
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
84
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerStatusBannerNotExist();
|
85
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerSectionNotExist();
|
86
|
+
});
|
87
|
+
});
|
88
|
+
});
|
@@ -154,7 +154,7 @@ describe('Create item page - Fill in the gaps over image - text: All or nothing
|
|
154
154
|
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
155
155
|
});
|
156
156
|
|
157
|
-
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
157
|
+
it('FIG over image Text - When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
158
158
|
if (view === 'Grading view') {
|
159
159
|
studentViewPage.steps.clearResponses();
|
160
160
|
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create question page - Fill in the gaps over image with text ', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Check Alternative Answer Button', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
15
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
16
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
17
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
18
|
+
});
|
19
|
+
|
20
|
+
it('When correct answer is not set then alternative answer should be disabled', () => {
|
21
|
+
fillInTheGapsOverImageTextPage.steps.checkAlternativeButtonDisabled();
|
22
|
+
});
|
23
|
+
|
24
|
+
it('When correct answer is set then alternative answer should be enabled', () => {
|
25
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(20);
|
26
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }]);
|
27
|
+
fillInTheGapsOverImageTextPage.steps.checkAlternativeButtonEnabled();
|
28
|
+
});
|
29
|
+
|
30
|
+
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', () => {
|
31
|
+
fillInTheGapsOverImageTextPage.steps.clickOnAddAlternativeAnswerButton();
|
32
|
+
fillInTheGapsOverImageTextPage.steps.expandCorrectAnswerAccordion();
|
33
|
+
});
|
34
|
+
});
|
35
|
+
});
|
@@ -47,7 +47,7 @@ describe('Edit item - fill in the gaps with text', () => {
|
|
47
47
|
fillInTheGapsOverImageTextPage.steps.verifyPointInQuestionPreview(30);
|
48
48
|
});
|
49
49
|
|
50
|
-
it('User should be able to change scoring type to manually and save the question', () => {
|
50
|
+
it('User should be able to change scoring type to manually scored and save the question', () => {
|
51
51
|
fillInTheGapsOverImageTextPage.steps.editItem();
|
52
52
|
fillInTheGapsOverImageTextPage.steps.expandScoringTypeDropdown();
|
53
53
|
fillInTheGapsOverImageTextPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
@@ -62,4 +62,36 @@ describe('Edit item - fill in the gaps with text', () => {
|
|
62
62
|
fillInTheGapsOverImageTextPage.steps.saveAQuestionAndVerifySnackbar();
|
63
63
|
});
|
64
64
|
});
|
65
|
+
|
66
|
+
describe('User should be able to edit incomplete authored question', () => {
|
67
|
+
abortEarlySetup();
|
68
|
+
before(() => {
|
69
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
70
|
+
cy.barsPreLoaderWait();
|
71
|
+
fillInTheGapsOverImageTextPage.steps.saveAQuestionWithIncompleteAuthoring();
|
72
|
+
fillInTheGapsOverImageTextPage.steps.editItem();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
76
|
+
fillInTheGapsOverImageTextPage.steps.verifyWarningIconOnRequiredFields(['Please upload an image','Please set points']);
|
77
|
+
});
|
78
|
+
|
79
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
80
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
81
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
82
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
83
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }]);
|
84
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(10);
|
85
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
86
|
+
fillInTheGapsOverImageTextPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
|
87
|
+
});
|
88
|
+
|
89
|
+
it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
90
|
+
fillInTheGapsOverImageTextPage.steps.saveAQuestionAndVerifySnackbar();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('Warning icon should not be visible', () => {
|
94
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.warningIcon(), 'notExist');
|
95
|
+
});
|
96
|
+
});
|
65
97
|
});
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
5
|
+
const views = utilities.getViews(previewContentViews);
|
6
|
+
var itemReferenceID = "";
|
7
|
+
describe('Create item page - Fill in the gaps over image - text - Preview contents in all views', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
views.forEach((view) => {
|
13
|
+
describe(`Preview tab contents when authoring is incomplete - ${view}`, { tags: 'smoke' }, () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
switch (view) {
|
17
|
+
case 'Question preview':
|
18
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
21
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
22
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(10);
|
23
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
24
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
25
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(60);
|
26
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
27
|
+
fillInTheGapsOverImageTextPage.steps.selectAcceptedStudentInputType(1, 'Number');
|
28
|
+
fillInTheGapsOverImageTextPage.steps.selectAcceptedStudentInputType(2, 'Integer');
|
29
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
30
|
+
break;
|
31
|
+
case 'Item view':
|
32
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
33
|
+
break;
|
34
|
+
case 'Item preview':
|
35
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
36
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
37
|
+
break;
|
38
|
+
case 'Student view':
|
39
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
40
|
+
break;
|
41
|
+
case 'Grading view':
|
42
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
43
|
+
break;
|
44
|
+
case 'Correct answer view':
|
45
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
46
|
+
break;
|
47
|
+
default:
|
48
|
+
throw new Error('Invalid view');
|
49
|
+
}
|
50
|
+
});
|
51
|
+
|
52
|
+
after(() => {
|
53
|
+
if (view === 'Question preview') {
|
54
|
+
fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
|
55
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
56
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
57
|
+
}
|
58
|
+
if (view === 'Student view') {
|
59
|
+
studentViewPage.steps.submitResponse();
|
60
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
61
|
+
}
|
62
|
+
});
|
63
|
+
|
64
|
+
it(`${view} - Fill in the gaps over image text Question instructions should be visible`, () => {
|
65
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.questionInstructionsText(), 'Fill in the gaps');
|
66
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.questionInstructionsText(), 'visible');
|
67
|
+
});
|
68
|
+
|
69
|
+
it('The image uploaded in the \'Background image\' section should be displayed', () => {
|
70
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.canvasImageInPreviewTab(), 'visible');
|
71
|
+
});
|
72
|
+
|
73
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
74
|
+
it('The added answer input fields should be displayed in the preview tab and they should be empty', () => {
|
75
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), 3);
|
76
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: '' }, { responseIndex: 1, responseText: '' }, { responseIndex: 2, responseText: '' }]);
|
77
|
+
});
|
78
|
+
|
79
|
+
it(`User should be able to enter text in the answer input fields`, () => {
|
80
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
|
81
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
|
82
|
+
});
|
83
|
+
} else if (view === 'Grading view') {
|
84
|
+
it(`The answer input fields should be displayed filled with answers`, () => {
|
85
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), 3);
|
86
|
+
fillInTheGapsOverImageTextPage.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: '20.00' }, { responseIndex: 2, responseText: '7' }]);
|
87
|
+
});
|
88
|
+
|
89
|
+
it('The input fields should not be editable', () => {
|
90
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldDisabled(0);
|
91
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldDisabled(1);
|
92
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldDisabled(2);
|
93
|
+
});
|
94
|
+
}
|
95
|
+
});
|
96
|
+
});
|
97
|
+
});
|
@@ -39,12 +39,11 @@ describe('Create item page - Fill in the gaps over image with text: Supported fi
|
|
39
39
|
});
|
40
40
|
|
41
41
|
it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should be displayed', () => {
|
42
|
-
fillInTheGapsOverImageTextPage.steps.
|
43
|
-
utilities.
|
44
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
|
42
|
+
fillInTheGapsOverImageTextPage.steps.uploadFileWithoutVerification('uploads/sample.heif');
|
43
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'notExist');
|
45
44
|
fillInTheGapsOverImageTextPage.steps.verifyCanvasImageNotExist();
|
46
45
|
});
|
47
46
|
|
48
47
|
fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
|
49
|
-
})
|
48
|
+
});
|
50
49
|
});
|
package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
import { fillInTheGapsTextPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create Item page - Fill in the gaps with text', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question Preview: Auto Scored With Points', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
15
|
+
});
|
16
|
+
|
17
|
+
it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
|
18
|
+
fillInTheGapsTextPage.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
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
|
23
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
24
|
+
fillInTheGapsTextPage.steps.verifyAnswerStatusBannerNotExist();
|
25
|
+
fillInTheGapsTextPage.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
|
+
fillInTheGapsTextPage.steps.switchToEditTab();
|
30
|
+
fillInTheGapsTextPage.steps.allotPoints(2);
|
31
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
32
|
+
fillInTheGapsTextPage.steps.checkManuallyScoredScoringLabel();
|
33
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
34
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
35
|
+
fillInTheGapsTextPage.steps.verifyAnswerStatusBannerNotExist();
|
36
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExist();
|
37
|
+
})
|
38
|
+
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Question Preview: Auto Scored Without Points', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
45
|
+
cy.barsPreLoaderWait();
|
46
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
|
47
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
48
|
+
});
|
49
|
+
|
50
|
+
it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
|
51
|
+
fillInTheGapsTextPage.steps.checkManuallyScoredScoringLabel();
|
52
|
+
});
|
53
|
+
|
54
|
+
it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
|
55
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
56
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
57
|
+
fillInTheGapsTextPage.steps.verifyAnswerStatusBannerExist();
|
58
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionExist();
|
59
|
+
})
|
60
|
+
});
|
61
|
+
|
62
|
+
describe('Question Preview: Non Scored', () => {
|
63
|
+
abortEarlySetup();
|
64
|
+
before(() => {
|
65
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
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
|
+
fillInTheGapsTextPage.steps.expandScoringTypeDropdown();
|
71
|
+
fillInTheGapsTextPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
72
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
73
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
|
74
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
75
|
+
fillInTheGapsTextPage.steps.verifyAnswerStatusBannerNotExist();
|
76
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExist();
|
77
|
+
});
|
78
|
+
});
|
79
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { fillInTheGapsTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create question page - Fill in the gaps text ', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Check Alternative Answer Button', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
15
|
+
});
|
16
|
+
|
17
|
+
it('When correct answer is not set then alternative answer should be disabled', () => {
|
18
|
+
fillInTheGapsTextPage.steps.checkAlternativeButtonDisabled();
|
19
|
+
});
|
20
|
+
|
21
|
+
it('When correct answer is set then alternative answer should be enabled', () => {
|
22
|
+
fillInTheGapsTextPage.steps.allotPoints(20);
|
23
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
|
24
|
+
fillInTheGapsTextPage.steps.checkAlternativeButtonEnabled();
|
25
|
+
});
|
26
|
+
|
27
|
+
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', () => {
|
28
|
+
fillInTheGapsTextPage.steps.clickOnAddAlternativeAnswerButton();
|
29
|
+
fillInTheGapsTextPage.steps.expandCorrectAnswerAccordion();
|
30
|
+
});
|
31
|
+
});
|
32
|
+
});
|
@@ -42,7 +42,7 @@ describe('Edit item - fill in the gaps with text', () => {
|
|
42
42
|
fillInTheGapsTextPage.steps.verifyPointInQuestionPreview(30);
|
43
43
|
});
|
44
44
|
|
45
|
-
it('User should be able to change scoring type to manually and save the question', () => {
|
45
|
+
it('User should be able to change scoring type to manually scored and save the question', () => {
|
46
46
|
fillInTheGapsTextPage.steps.editItem();
|
47
47
|
fillInTheGapsTextPage.steps.expandScoringTypeDropdown();
|
48
48
|
fillInTheGapsTextPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|