itemengine-cypress-automation 1.0.119 → 1.0.121
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
- package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
- package/cypress/e2e/migration/migration.js +6 -5
- package/cypress/e2e/migration/migration2.js +4 -3
- package/cypress/e2e/migration/migration3.js +4 -3
- package/cypress/e2e/migration/migration4.js +4 -3
- package/cypress/e2e/migration/migration5.js +4 -3
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioResponsePage.js +2 -1
- package/cypress/pages/components/additionalSettingsPanel.js +27 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredScoringSection.js +1 -1
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
- package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
- package/cypress/pages/components/index.js +3 -3
- package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +49 -23
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/createItemPage.js +67 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
- package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
- package/cypress/pages/fillInTheGapsTextPage.js +52 -199
- package/cypress/pages/index.js +5 -5
- package/cypress/pages/multipleSelectionPage.js +1 -0
- package/cypress/pages/shortTextResponsePage.js +575 -33
- package/cypress/pages/singleSelectionGridPage.js +1 -2
- package/cypress/pages/singleSelectionPage.js +5 -6
- package/cypress/pages/textEntryMathPage.js +46 -22
- package/cypress/pages/textEntryMathWithImagePage.js +212 -0
- package/cypress/pages/uploadResponsePage.js +74 -21
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
- package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
- package/cypress/pages/fillInTheGapsScoring.js +0 -5872
- package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -94,7 +94,7 @@ describe('Create Item page - Audio response: Question instructions, Audio record
|
|
94
94
|
|
95
95
|
audioResponsePage.tests.verifyMaximumRecorderLengthLabelAndInputField();
|
96
96
|
|
97
|
-
audioResponsePage.tests.
|
97
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthInputFieldErrorMessagesForSecsDuration();
|
98
98
|
|
99
99
|
audioResponsePage.tests.verifyMaximumRecorderLengthCharacterAcceptanceCriteria();
|
100
100
|
|
@@ -102,6 +102,18 @@ describe('Create Item page - Audio response: Question instructions, Audio record
|
|
102
102
|
audioResponsePage.steps.setMaximumRecorderLength('9999');
|
103
103
|
audioResponsePage.steps.verifyMaximumRecorderLength('3600');
|
104
104
|
});
|
105
|
+
|
106
|
+
it('When the user toggles to "Mins", "15" should be displayed in \'Maximum recorder length\' field', () => {
|
107
|
+
audioResponsePage.steps.toggleMaximumRecorderLengthInputField('Mins');
|
108
|
+
audioResponsePage.steps.verifyMaximumRecorderLength(15);
|
109
|
+
});
|
110
|
+
|
111
|
+
audioResponsePage.tests.verifyMaximumRecorderLengthInputFieldErrorMessagesForMinsDuration();
|
112
|
+
|
113
|
+
it('When user tries to add a value greater than 60 it should be automatically set back to 60 and should not allow to add greater than set value', () => {
|
114
|
+
audioResponsePage.steps.setMaximumRecorderLength('70');
|
115
|
+
audioResponsePage.steps.verifyMaximumRecorderLength('60');
|
116
|
+
});
|
105
117
|
});
|
106
118
|
|
107
119
|
describe('Maximum recorder length: Preview tab', () => {
|
@@ -14,6 +14,7 @@ describe('Create item page - audio response: Grading view, Correct answer view c
|
|
14
14
|
|
15
15
|
if (views.includes('Grading view')) {
|
16
16
|
describe('Grading view contents', { tags: 'smoke' }, () => {
|
17
|
+
let actualAudioSeekedInPercent = 50
|
17
18
|
abortEarlySetup();
|
18
19
|
before(() => {
|
19
20
|
audioResponsePage.steps.navigateToCreateQuestion('audio response');
|
@@ -65,6 +66,7 @@ describe('Create item page - audio response: Grading view, Correct answer view c
|
|
65
66
|
});
|
66
67
|
|
67
68
|
it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
|
69
|
+
audioResponsePage.steps.startPlayback();
|
68
70
|
audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:10', '00:10');
|
69
71
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
|
70
72
|
utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
|
@@ -5,6 +5,7 @@ const css = Cypress.env('css');
|
|
5
5
|
let previewContentViews = ['Question preview', 'Item preview', 'Student view'];
|
6
6
|
const views = utilities.getViews(previewContentViews);
|
7
7
|
var itemReferenceID = "";
|
8
|
+
const grepTags = Cypress.env('grepTags');
|
8
9
|
|
9
10
|
describe('Create item page - Audio response: Preview contents', () => {
|
10
11
|
before(() => {
|
@@ -3,6 +3,8 @@ import { audioResponsePage } from "../../../pages/audioResponsePage";
|
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
5
5
|
const css = Cypress.env('css');
|
6
|
+
const grepTags = Cypress.env('grepTags');
|
7
|
+
|
6
8
|
describe('Preview of Audio response for standard audio recorder style', () => {
|
7
9
|
before(() => {
|
8
10
|
cy.loginAs('admin');
|
@@ -111,7 +111,7 @@ describe('Create item page - Drag and drop into categories: All or nothing with
|
|
111
111
|
'font-weight': css.fontWeight.bold
|
112
112
|
});
|
113
113
|
cy.log('Verifying css of an correct option')
|
114
|
-
utilities.verifyCSS(dragAndDropIntoCategoriesPage.correctOptionWrapper().find('
|
114
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.correctOptionWrapper().find('.draggable-options-item'), {
|
115
115
|
'background-color': css.color.defaultBackground,
|
116
116
|
'border': `1px solid ${css.color.correctAnswer}`
|
117
117
|
});
|
@@ -493,7 +493,7 @@ describe('Create Item Page: Drag and drop into categories: Click and drop cases
|
|
493
493
|
});
|
494
494
|
|
495
495
|
it('When user has dropped all the options from a group in the response areas, then empty group should be displayed in the options container', () => {
|
496
|
-
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Eagle': 0, 'Whale': 0, 'Platypus':
|
496
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Eagle': 0, 'Whale': 0, 'Platypus': 1 });
|
497
497
|
dragAndDropIntoCategoriesPage.steps.verifyGroupedOptionsTitleSpecifyCorrectAnswerSection(0, 'Group A')
|
498
498
|
dragAndDropIntoCategoriesPage.steps.verifyEmptyGroupInSpecifyCorrectAnswerSection(0);
|
499
499
|
});
|
@@ -658,7 +658,7 @@ describe('Create Item Page: Drag and drop into categories: Click and drop cases
|
|
658
658
|
|
659
659
|
it('When user has dropped all the options from a group in the response areas, then empty group should be displayed in the options container', () => {
|
660
660
|
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Whale': 0, 'Platypus': 0 });
|
661
|
-
dragAndDropIntoCategoriesPage.steps.
|
661
|
+
dragAndDropIntoCategoriesPage.steps.verifyGroupedOptionsTitlePreviewTab(0, 'Group A')
|
662
662
|
dragAndDropIntoCategoriesPage.steps.verifyEmptyGroupInPreviewTab(0);
|
663
663
|
});
|
664
664
|
});
|
@@ -258,10 +258,7 @@ describe('Create Item page - drag and drop into categories: Student view setting
|
|
258
258
|
|
259
259
|
dragAndDropIntoCategoriesPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
|
260
260
|
|
261
|
-
|
262
|
-
dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
263
|
-
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.maximumCheckAnswerAttemptsDropdown(), 'visible');
|
264
|
-
});
|
261
|
+
dragAndDropIntoCategoriesPage.tests.verifyMaximumAttemptsDropdownDisplayedWhenAllowStudentsToCheckAnswerIsChecked();
|
265
262
|
|
266
263
|
dragAndDropIntoCategoriesPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
|
267
264
|
|
@@ -0,0 +1,273 @@
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsDragAndDropPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const grepTags = Cypress.env('grepTags');
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - Fill in the gaps - drag and drop: All or nothing ', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
15
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
21
|
+
fillInTheGapsDragAndDropPage.steps.addOption();
|
22
|
+
fillInTheGapsDragAndDropPage.steps.addOption();
|
23
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
|
24
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
25
|
+
});
|
26
|
+
|
27
|
+
fillInTheGapsDragAndDropPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
28
|
+
|
29
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
30
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
31
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
32
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
33
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
34
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
|
38
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 2 });
|
39
|
+
fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
|
40
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, '');
|
41
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(1, '');
|
42
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, '');
|
43
|
+
});
|
44
|
+
});
|
45
|
+
};
|
46
|
+
|
47
|
+
views.forEach((view) => {
|
48
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
49
|
+
abortEarlySetup();
|
50
|
+
before(() => {
|
51
|
+
switch (view) {
|
52
|
+
case 'Question preview':
|
53
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
54
|
+
cy.barsPreLoaderWait();
|
55
|
+
fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
|
56
|
+
fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
|
57
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
58
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
|
59
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
60
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
61
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
62
|
+
break;
|
63
|
+
case 'Item preview':
|
64
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
65
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
66
|
+
break;
|
67
|
+
case 'Grading view':
|
68
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
69
|
+
break;
|
70
|
+
};
|
71
|
+
});
|
72
|
+
|
73
|
+
beforeEach(() => {
|
74
|
+
switch (view) {
|
75
|
+
case 'Question preview':
|
76
|
+
fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
77
|
+
fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
|
78
|
+
break;
|
79
|
+
case 'Item preview':
|
80
|
+
fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
81
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
82
|
+
break;
|
83
|
+
case 'Grading view':
|
84
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
85
|
+
break;
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
if (view === 'Question preview') {
|
90
|
+
after(() => {
|
91
|
+
fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
|
92
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
93
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
94
|
+
});
|
95
|
+
};
|
96
|
+
|
97
|
+
it('When the user selects \'Grading\' view without attempting the question, dropzone numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
98
|
+
if (view === 'Grading view') {
|
99
|
+
studentViewPage.steps.submitResponse();
|
100
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
101
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
102
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
103
|
+
};
|
104
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
105
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
106
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
107
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
108
|
+
};
|
109
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
|
110
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers:');
|
111
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
|
112
|
+
});
|
113
|
+
|
114
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
115
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Leaves': 0, 'Petals': 1, 'Roots': 2 });
|
116
|
+
if (view === 'Grading view') {
|
117
|
+
studentViewPage.steps.submitResponse();
|
118
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
119
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
120
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
121
|
+
};
|
122
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
123
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
124
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
125
|
+
};
|
126
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
|
127
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
|
128
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
|
129
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
130
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
|
131
|
+
});
|
132
|
+
|
133
|
+
it('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
134
|
+
if (view === 'Grading view') {
|
135
|
+
studentViewPage.steps.clearResponses();
|
136
|
+
};
|
137
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 2 });
|
138
|
+
if (view === 'Grading view') {
|
139
|
+
studentViewPage.steps.submitResponse();
|
140
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
141
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
142
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
143
|
+
};
|
144
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
145
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
146
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
147
|
+
};
|
148
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
149
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
150
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
|
151
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
152
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When the user attempts the question partially correct with all the dropzone correctly attempted but one dropzone incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
156
|
+
if (view === 'Grading view') {
|
157
|
+
studentViewPage.steps.clearResponses();
|
158
|
+
};
|
159
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Leaves': 1, 'Stem': 2 })
|
160
|
+
if (view === 'Grading view') {
|
161
|
+
studentViewPage.steps.submitResponse();
|
162
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
163
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
164
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
165
|
+
};
|
166
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
167
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
168
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
169
|
+
};
|
170
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
171
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
|
172
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
|
173
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
174
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
|
175
|
+
});
|
176
|
+
|
177
|
+
it('When the user attempts the question partially correct with all the dropzone correctly attempted but with an extra option which is not set as correct answer, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section should be displayed along with numeration', () => {
|
178
|
+
if (view === 'Grading view') {
|
179
|
+
studentViewPage.steps.clearResponses();
|
180
|
+
};
|
181
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 1, 'Stem': 2 });
|
182
|
+
if (view === 'Grading view') {
|
183
|
+
studentViewPage.steps.submitResponse();
|
184
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
185
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
186
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
187
|
+
};
|
188
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
189
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
190
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
191
|
+
};
|
192
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
193
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
|
194
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
|
195
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
196
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
|
197
|
+
});
|
198
|
+
|
199
|
+
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', () => {
|
200
|
+
if (view === 'Grading view') {
|
201
|
+
studentViewPage.steps.clearResponses();
|
202
|
+
};
|
203
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
204
|
+
if (view === 'Grading view') {
|
205
|
+
studentViewPage.steps.submitResponse();
|
206
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
207
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
208
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
209
|
+
};
|
210
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
211
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(20, 20);
|
212
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
213
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
214
|
+
};
|
215
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
216
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
|
217
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
|
218
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
219
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
220
|
+
});
|
221
|
+
});
|
222
|
+
});
|
223
|
+
|
224
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
225
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
226
|
+
abortEarlySetup();
|
227
|
+
before(() => {
|
228
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
229
|
+
cy.barsPreLoaderWait();
|
230
|
+
fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
|
231
|
+
fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
|
232
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
233
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
|
234
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
235
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
236
|
+
});
|
237
|
+
|
238
|
+
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
239
|
+
fillInTheGapsDragAndDropPage.steps.expandMinimumScoringDropdown();
|
240
|
+
fillInTheGapsDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
241
|
+
fillInTheGapsDragAndDropPage.steps.allotMinimumPoints(2);
|
242
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
243
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
244
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(2, 20);
|
245
|
+
fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
246
|
+
});
|
247
|
+
|
248
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
249
|
+
fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
|
250
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 2 });
|
251
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(2, 20);
|
252
|
+
fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
253
|
+
});
|
254
|
+
|
255
|
+
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
|
256
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
257
|
+
fillInTheGapsDragAndDropPage.steps.expandMinimumScoringDropdown();
|
258
|
+
fillInTheGapsDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
259
|
+
fillInTheGapsDragAndDropPage.steps.allotMinimumPoints(2);
|
260
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
261
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
262
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
|
263
|
+
fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
264
|
+
});
|
265
|
+
|
266
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
267
|
+
fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
|
268
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0, 'Leaves': 1, 'Stem': 2 });
|
269
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(2, 20);
|
270
|
+
});
|
271
|
+
});
|
272
|
+
};
|
273
|
+
});
|
package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
var itemReferenceID = "";
|
5
|
+
const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(checkAnswerViews);
|
7
|
+
|
8
|
+
describe('Create item page - Fill in the gaps with drag and drop - Check answer functionality', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
views.forEach((view) => {
|
14
|
+
//Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
|
15
|
+
const checkAnswer = (view) => {
|
16
|
+
switch (view) {
|
17
|
+
case 'Question preview':
|
18
|
+
case 'Item preview':
|
19
|
+
fillInTheGapsDragAndDropPage.steps.checkAnswer();
|
20
|
+
break;
|
21
|
+
case 'Student view':
|
22
|
+
studentViewPage.steps.checkAnswer();
|
23
|
+
break;
|
24
|
+
default:
|
25
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
26
|
+
}
|
27
|
+
};
|
28
|
+
describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
switch (view) {
|
32
|
+
case 'Question preview':
|
33
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
34
|
+
cy.barsPreLoaderWait();
|
35
|
+
fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
|
36
|
+
fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(2);
|
37
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
38
|
+
fillInTheGapsDragAndDropPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
39
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem']);
|
40
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
41
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
42
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
43
|
+
break;
|
44
|
+
case 'Item preview':
|
45
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
46
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
47
|
+
break;
|
48
|
+
case 'Student view':
|
49
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
50
|
+
break;
|
51
|
+
}
|
52
|
+
});
|
53
|
+
|
54
|
+
beforeEach(() => {
|
55
|
+
switch (view) {
|
56
|
+
case 'Question preview':
|
57
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
58
|
+
fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
|
59
|
+
break;
|
60
|
+
case 'Item preview':
|
61
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
62
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
63
|
+
break;
|
64
|
+
case 'Student view':
|
65
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
66
|
+
break;
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
if (view === 'Question preview') {
|
71
|
+
after(() => {
|
72
|
+
fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
|
73
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
74
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
75
|
+
});
|
76
|
+
};
|
77
|
+
|
78
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message and correct answer section should not be displayed', () => {
|
79
|
+
checkAnswer(view);
|
80
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconsNotExist();
|
81
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
82
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
83
|
+
});
|
84
|
+
|
85
|
+
it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
86
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Leaves': 0, 'Petals': 1, 'Roots': 2 });
|
87
|
+
checkAnswer(view);
|
88
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
|
89
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
|
90
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
|
91
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
92
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
93
|
+
});
|
94
|
+
|
95
|
+
it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
|
96
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 2 });
|
97
|
+
checkAnswer(view);
|
98
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
99
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
|
100
|
+
fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
|
101
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
102
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
103
|
+
});
|
104
|
+
|
105
|
+
it('When user attempts the question correctly, and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, a status message with text \'Your answer is correct\' should be displayed. Correct answer section should not be displayed', () => {
|
106
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Stem': 2 });
|
107
|
+
checkAnswer(view);
|
108
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
109
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
|
110
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
|
111
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
112
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
|
113
|
+
});
|
114
|
+
});
|
115
|
+
});
|
116
|
+
});
|
@@ -0,0 +1,136 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage, 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
|
+
describe('Preview tab contents for all views', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
views.forEach((view) => {
|
14
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
switch (view) {
|
18
|
+
case 'Question preview':
|
19
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop the options in appropriate dropzone');
|
22
|
+
fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(1);
|
23
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
24
|
+
cy.log('Add image to option input field')
|
25
|
+
fillInTheGapsDragAndDropPage.steps.focusInOptionsInputField(0);
|
26
|
+
fillInTheGapsDragAndDropPage.steps.selectImageOptionFromCKEditorToolbar();
|
27
|
+
fillInTheGapsDragAndDropPage.steps.addImageToInputField();
|
28
|
+
fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(0, 'Petals');
|
29
|
+
cy.log('Add bold text to input field')
|
30
|
+
fillInTheGapsDragAndDropPage.steps.focusInOptionsInputField(1);
|
31
|
+
fillInTheGapsDragAndDropPage.steps.selectBoldOptionFromCKEditorToolbar();
|
32
|
+
fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
|
33
|
+
cy.log('Add equation to option input field')
|
34
|
+
fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(2, 'Solve the following');
|
35
|
+
fillInTheGapsDragAndDropPage.steps.focusInOptionsInputField(2);
|
36
|
+
fillInTheGapsDragAndDropPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
37
|
+
fillInTheGapsDragAndDropPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
38
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'This is a bold option': 0, 'Solve the following': 1 , 'Petals': 2});
|
39
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
40
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
41
|
+
break;
|
42
|
+
case 'Item view':
|
43
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
44
|
+
break;
|
45
|
+
case 'Item preview':
|
46
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
47
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
48
|
+
break;
|
49
|
+
case 'Student view':
|
50
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
break;
|
52
|
+
case 'Grading view':
|
53
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
54
|
+
break;
|
55
|
+
case 'Correct answer view':
|
56
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
57
|
+
break;
|
58
|
+
default:
|
59
|
+
throw new Error('Invalid view');
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
after(() => {
|
64
|
+
if (view === 'Question preview') {
|
65
|
+
fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
|
66
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
67
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
68
|
+
}
|
69
|
+
if (view === 'Student view') {
|
70
|
+
studentViewPage.steps.submitResponse();
|
71
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
72
|
+
}
|
73
|
+
});
|
74
|
+
|
75
|
+
it('Question instructions should be visible', () => {
|
76
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.questionInstructionsText(), 'Drag and drop the options in appropriate dropzone');
|
77
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.questionInstructionsText(), 'visible');
|
78
|
+
});
|
79
|
+
|
80
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
81
|
+
it('The sample \'Lorem Ipsum\' text along with three dropzone should be displayed in the question field and they should be empty.', () => {
|
82
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.questionContainerPreviewTab(), 'Lorem ipsum dolor sit amet, \n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n tempus tellus dapibus.');
|
83
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.dropzonePreviewTab(), 3);
|
84
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, '');
|
85
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(1, '');
|
86
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, '');
|
87
|
+
});
|
88
|
+
|
89
|
+
it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
|
90
|
+
fillInTheGapsDragAndDropPage.steps.verifyDraggableOptionWithImageInPreviewTab(0);
|
91
|
+
fillInTheGapsDragAndDropPage.steps.verifyDraggableOptionWithBoldTextInPreviewTab(1);
|
92
|
+
fillInTheGapsDragAndDropPage.steps.verifyDraggableOptionWithEquationTextInPreviewTab(2);
|
93
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.dropzonePreviewTab(), 3);
|
94
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, '');
|
95
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(1, '');
|
96
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, '');
|
97
|
+
});
|
98
|
+
|
99
|
+
it('User should be able to drag and drop image, bold text and equation options in the dropzone', () => {
|
100
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'This is a bold option': 0, 'Solve the following': 1 , 'Petals': 2});
|
101
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, 'Petals');
|
102
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithImageInPreviewTab(2);
|
103
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, 'This is a bold option');
|
104
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneContainsTextPreviewTab(1, 'Solve the following');
|
105
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithEquationTextInPreviewTab(1);
|
106
|
+
});
|
107
|
+
} else if (view === 'Grading view') {
|
108
|
+
it(`The submitted options should be in the respective dropzone and the options container should not be displayed`, () => {
|
109
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, '3\nPetals');
|
110
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithImageInPreviewTab(2);
|
111
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, '1\nThis is a bold option');
|
112
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithEquationTextInPreviewTab(1);
|
113
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
|
114
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
|
115
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
|
116
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
117
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.optionContainerOptionsPreviewTab(), 'notExist');
|
118
|
+
});
|
119
|
+
|
120
|
+
it('The content in the dropzone should not be editable', () => {
|
121
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewDropzoneOptionDisabled(0);
|
122
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewDropzoneOptionDisabled(1);
|
123
|
+
fillInTheGapsDragAndDropPage.steps.verifyPreviewDropzoneOptionDisabled(2);
|
124
|
+
});
|
125
|
+
} else {
|
126
|
+
it('The dropzone should be displayed filled with answers', () => {
|
127
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.dropzonePreviewTab(), 3);
|
128
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(2, 'Petals');
|
129
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithImageInPreviewTab(2);
|
130
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneTextPreviewTab(0, 'This is a bold option');
|
131
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneWithEquationTextInPreviewTab(1);
|
132
|
+
});
|
133
|
+
}
|
134
|
+
});
|
135
|
+
});
|
136
|
+
});
|