itemengine-cypress-automation 1.0.240-textentrychangesreverted-28d08d1.0 → 1.0.240
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/ChartsBar/headerSection.js +22 -5
- package/cypress/e2e/ILC/ChartsLine/headerSection.js +23 -5
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +3 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +4 -6
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +1 -3
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +4 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +172 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +3 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +16 -16
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/Graphing/headerSection.js +2 -3
- package/cypress/e2e/ILC/GridFill/headerSection.js +2 -4
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +6 -3
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -4
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
- package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -8
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +2 -8
- package/cypress/e2e/ILC/ListOrderingNew/optionsOrientationSection.js +150 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/horizontalOrientationAllOrNothingForAllViews.smoke.js +218 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +170 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +170 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +230 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js +64 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/manuallyAndNonScored.js +110 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +249 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +172 -0
- package/cypress/e2e/ILC/Matching/clickAndDrop.js +6 -10
- package/cypress/e2e/ILC/Matching/headerSection.js +2 -10
- package/cypress/e2e/ILC/Matching/matchingConnector.js +128 -0
- package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
- package/cypress/e2e/ILC/MatchingDropdown/editTabBasicSection.js +154 -0
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +4 -6
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +3 -9
- package/cypress/e2e/ILC/NumberLine/headerSection.js +2 -3
- package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -4
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +2 -5
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +2 -9
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +210 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +210 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +258 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +246 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +541 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +243 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +242 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +195 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +8 -1
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +12 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/singleSelectionPreviewScoring.js +247 -0
- package/cypress/e2e/ILC/TextSelection/headerSection.js +4 -5
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
- package/cypress/e2e/ILC/TextSelection/singleMultipleSelection.js +100 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionOutline.js +248 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionStrikethrough.js +247 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionUnderline.js +239 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionStyle.js +150 -0
- package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +3 -2
- package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
- package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +21 -5
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +1 -0
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -11
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -29
- package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +2 -3
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -2
- package/cypress/pages/components/optionsWrapperComponent.js +2 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +2 -2
- package/cypress/pages/components/questionInputFieldComponent.js +1 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -2
- package/cypress/pages/components/singleMultipleSelectionModeComponent.js +1 -1
- package/cypress/pages/createItemPage.js +1 -1
- package/cypress/pages/dialogBoxBase.js +21 -9
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -5
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +83 -5
- package/cypress/pages/graphingPage.js +4 -7
- package/cypress/pages/gridFillPage.js +15 -16
- package/cypress/pages/listOrderingPage.js +373 -2
- package/cypress/pages/matchingPage.js +89 -33
- package/cypress/pages/multipleSelectionGridPage.js +11 -13
- package/cypress/pages/multipleSelectionPage.js +4 -5
- package/cypress/pages/numberLinePage.js +2 -13
- package/cypress/pages/shortTextResponsePage.js +2 -3
- package/cypress/pages/textEntryMathPage.js +28 -0
- package/cypress/pages/textSelectionPage.js +242 -3
- package/cypress/pages/videoResponsePage.js +0 -2
- package/package.json +1 -1
- /package/cypress/e2e/ILC/TextSelection/{styleAndLayoutCustomizationAccordion.js → styleAndLayoutCustomizationAccordionFilledIn.js} +0 -0
package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
import { listOrderingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let options = ['sprout', 'plant', 'flower', 'seed'];
|
5
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
6
|
+
|
7
|
+
describe('Create item page - List ordering: All or nothing penalty scoring', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
18
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
19
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
20
|
+
listOrderingPage.steps.allotPoints(20);
|
21
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
22
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
23
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
24
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
25
|
+
listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
|
26
|
+
});
|
27
|
+
|
28
|
+
//Penalty points for the entire question
|
29
|
+
it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
30
|
+
listOrderingPage.steps.expandPenaltyScoringDropdown();
|
31
|
+
listOrderingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
32
|
+
listOrderingPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
33
|
+
listOrderingPage.steps.allotPenaltyPoints(2);
|
34
|
+
listOrderingPage.steps.switchToPreviewTab();
|
35
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
36
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
37
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
38
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
39
|
+
listOrderingPage.steps.verifyPreviewScore(-2, 20);
|
40
|
+
});
|
41
|
+
|
42
|
+
it('When the user attempts the question partially correct, then penalty points should get deducted from the awarded points', () => {
|
43
|
+
listOrderingPage.steps.resetQuestionPreview();
|
44
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
45
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
46
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
47
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
48
|
+
listOrderingPage.steps.verifyPreviewScore(-2, 20);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
52
|
+
listOrderingPage.steps.switchToEditTab();
|
53
|
+
listOrderingPage.steps.expandMinimumScoringDropdown();
|
54
|
+
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
55
|
+
listOrderingPage.steps.allotMinimumPoints(3);
|
56
|
+
listOrderingPage.steps.switchToPreviewTab();
|
57
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
58
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
59
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
60
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
61
|
+
listOrderingPage.steps.verifyPreviewScore(3, 20);
|
62
|
+
});
|
63
|
+
});
|
64
|
+
});
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { listOrderingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
5
|
+
const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
6
|
+
|
7
|
+
describe('Create Item page - List ordering: Manually and non scored', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Question Preview: Manually Scored', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
18
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
19
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
20
|
+
listOrderingPage.steps.expandScoringTypeDropdown();
|
21
|
+
listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
22
|
+
listOrderingPage.steps.switchToPreviewTab();
|
23
|
+
});
|
24
|
+
|
25
|
+
it('Question instructions and options should be displayed in the preview tab', () => {
|
26
|
+
listOrderingPage.steps.verifyQuestionInstructionsTextPreviewTab('Arrange options in correct order.');
|
27
|
+
utilities.verifyElementCount(listOrderingPage.optionsSeperateList(), 4);
|
28
|
+
options.forEach((optionText, index) => {
|
29
|
+
listOrderingPage.steps.verifyTextContentOfOptionInPreviewTabSeperateList(optionText, index);
|
30
|
+
});
|
31
|
+
});
|
32
|
+
|
33
|
+
listOrderingPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
|
34
|
+
});
|
35
|
+
|
36
|
+
describe('Question Preview: Non Scored', () => {
|
37
|
+
abortEarlySetup();
|
38
|
+
before(() => {
|
39
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
40
|
+
cy.barsPreLoaderWait();
|
41
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
42
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
43
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
44
|
+
listOrderingPage.steps.expandScoringTypeDropdown();
|
45
|
+
listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
46
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
47
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
48
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
49
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
50
|
+
listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
|
51
|
+
listOrderingPage.steps.switchToPreviewTab();
|
52
|
+
});
|
53
|
+
|
54
|
+
listOrderingPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
55
|
+
|
56
|
+
it('When the user switches to the \'Grading view\' without attempting the question, then correct/incorrect icons should be displayed for the default list order, "Your answer is incorrect" label and correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion', () => {
|
57
|
+
listOrderingPage.steps.switchToGradingView();
|
58
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
59
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
60
|
+
});
|
61
|
+
|
62
|
+
it('When the user attempts the question incorrectly 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 should be displayed', () => {
|
63
|
+
listOrderingPage.steps.resetQuestionPreview();
|
64
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
65
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
66
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
67
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
68
|
+
listOrderingPage.steps.switchToGradingView();
|
69
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
|
70
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
|
71
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
|
72
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
|
73
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
74
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
75
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When the user attempts the question partially correct, then 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', () => {
|
79
|
+
listOrderingPage.steps.resetQuestionPreview();
|
80
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
81
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
82
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
83
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
84
|
+
listOrderingPage.steps.switchToGradingView();
|
85
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
|
86
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
|
87
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
|
88
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
|
89
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
90
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
91
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When user attempts the question correctly, then 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', () => {
|
95
|
+
listOrderingPage.steps.resetQuestionPreview();
|
96
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
97
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
98
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
99
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
100
|
+
listOrderingPage.steps.switchToGradingView();
|
101
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
|
102
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
|
103
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
|
104
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
|
105
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
106
|
+
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
107
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
108
|
+
});
|
109
|
+
});
|
110
|
+
});
|
@@ -0,0 +1,249 @@
|
|
1
|
+
import { dialogBoxBase, listOrderingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const grepTags = Cypress.env('grepTags');
|
6
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
7
|
+
const views = utilities.getViews(correctAnswerViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
10
|
+
const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
11
|
+
|
12
|
+
describe('Create item page - List ordering: All or nothing ', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
18
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
24
|
+
listOrderingPage.steps.switchToPreviewTab();
|
25
|
+
});
|
26
|
+
|
27
|
+
listOrderingPage.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
|
+
listOrderingPage.steps.switchToEditTab();
|
31
|
+
listOrderingPage.steps.allotPoints(20);
|
32
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
33
|
+
options.forEach((option, index) => {
|
34
|
+
listOrderingPage.steps.verifyTextContentOfOptionSeperateList(option, index);
|
35
|
+
});
|
36
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
37
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
38
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
39
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
40
|
+
listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
|
41
|
+
listOrderingPage.steps.switchToPreviewTab();
|
42
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
43
|
+
});
|
44
|
+
|
45
|
+
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', () => {
|
46
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
47
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
48
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
49
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
50
|
+
listOrderingPage.steps.resetQuestionPreview();
|
51
|
+
options.forEach((option, index) => {
|
52
|
+
listOrderingPage.steps.verifyTextContentOfOptionSeperateList(option, index);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
});
|
56
|
+
};
|
57
|
+
|
58
|
+
views.forEach((view) => {
|
59
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
60
|
+
abortEarlySetup();
|
61
|
+
before(() => {
|
62
|
+
switch (view) {
|
63
|
+
case 'Question preview':
|
64
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
65
|
+
cy.barsPreLoaderWait();
|
66
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
67
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
68
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
69
|
+
listOrderingPage.steps.allotPoints(20);
|
70
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
71
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
72
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
73
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
74
|
+
listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
|
75
|
+
listOrderingPage.steps.switchToPreviewTab();
|
76
|
+
break;
|
77
|
+
case 'Item preview':
|
78
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
79
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
80
|
+
break;
|
81
|
+
case 'Grading view':
|
82
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
83
|
+
break;
|
84
|
+
};
|
85
|
+
});
|
86
|
+
|
87
|
+
beforeEach(() => {
|
88
|
+
switch (view) {
|
89
|
+
case 'Question preview':
|
90
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
91
|
+
listOrderingPage.steps.resetQuestionPreview();
|
92
|
+
break;
|
93
|
+
case 'Item preview':
|
94
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
95
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
96
|
+
break;
|
97
|
+
case 'Grading view':
|
98
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
|
103
|
+
if (view === 'Question preview') {
|
104
|
+
after(() => {
|
105
|
+
listOrderingPage.steps.clickOnSaveQuestionButton();
|
106
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
107
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
108
|
+
});
|
109
|
+
};
|
110
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
111
|
+
it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons and correct incorrect status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
|
112
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
113
|
+
listOrderingPage.steps.switchToGradingView();
|
114
|
+
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
115
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
116
|
+
utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
|
117
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
118
|
+
});
|
119
|
+
};
|
120
|
+
|
121
|
+
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 should be displayed', () => {
|
122
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
123
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
124
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
125
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
126
|
+
if (view === 'Grading view') {
|
127
|
+
studentViewPage.steps.submitResponse();
|
128
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
129
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
130
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
131
|
+
};
|
132
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
133
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
134
|
+
listOrderingPage.steps.switchToGradingView();
|
135
|
+
};
|
136
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
|
137
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
|
138
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
|
139
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
|
140
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
141
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user attempts the question partially correct, 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 should be displayed', () => {
|
145
|
+
if (view === 'Grading view') {
|
146
|
+
studentViewPage.steps.clearResponses();
|
147
|
+
};
|
148
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
149
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
150
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
151
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
152
|
+
if (view === 'Grading view') {
|
153
|
+
studentViewPage.steps.submitResponse();
|
154
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
155
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
156
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
157
|
+
};
|
158
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
159
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
160
|
+
listOrderingPage.steps.switchToGradingView();
|
161
|
+
};
|
162
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
|
163
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
|
164
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
|
165
|
+
listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
|
166
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
167
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
168
|
+
});
|
169
|
+
|
170
|
+
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', () => {
|
171
|
+
if (view === 'Grading view') {
|
172
|
+
studentViewPage.steps.clearResponses();
|
173
|
+
};
|
174
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
175
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
176
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
177
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
178
|
+
if (view === 'Grading view') {
|
179
|
+
studentViewPage.steps.submitResponse();
|
180
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
181
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
182
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
183
|
+
};
|
184
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
185
|
+
listOrderingPage.steps.verifyPreviewScore(20, 20);
|
186
|
+
listOrderingPage.steps.switchToGradingView();
|
187
|
+
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
188
|
+
};
|
189
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
|
190
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
|
191
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
|
192
|
+
listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
|
193
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
194
|
+
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
195
|
+
});
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
200
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
201
|
+
abortEarlySetup();
|
202
|
+
before(() => {
|
203
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
204
|
+
cy.barsPreLoaderWait();
|
205
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
206
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
207
|
+
listOrderingPage.steps.allotPoints(20);
|
208
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
209
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
210
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
211
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
212
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
213
|
+
listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
|
214
|
+
});
|
215
|
+
|
216
|
+
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', () => {
|
217
|
+
listOrderingPage.steps.expandMinimumScoringDropdown();
|
218
|
+
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
219
|
+
listOrderingPage.steps.allotMinimumPoints(2);
|
220
|
+
listOrderingPage.steps.switchToPreviewTab();
|
221
|
+
listOrderingPage.steps.switchToGradingView();
|
222
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
223
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
224
|
+
});
|
225
|
+
|
226
|
+
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', () => {
|
227
|
+
listOrderingPage.steps.resetQuestionPreview();
|
228
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
|
229
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
|
230
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
|
231
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
|
232
|
+
listOrderingPage.steps.switchToGradingView();
|
233
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
234
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
235
|
+
});
|
236
|
+
|
237
|
+
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 no points', () => {
|
238
|
+
listOrderingPage.steps.switchToEditTab();
|
239
|
+
listOrderingPage.steps.expandMinimumScoringDropdown();
|
240
|
+
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
241
|
+
listOrderingPage.steps.allotMinimumPoints(2);
|
242
|
+
listOrderingPage.steps.switchToPreviewTab();
|
243
|
+
listOrderingPage.steps.switchToGradingView();
|
244
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
245
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
246
|
+
});
|
247
|
+
});
|
248
|
+
};
|
249
|
+
});
|
package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
import { itemPreviewPage, listOrderingPage, studentViewPage } from "../../../pages";
|
2
|
+
import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
7
|
+
const array = ['This is a bold option', 'Fox', 'Solve the following', 'alpha'];
|
8
|
+
const views = utilities.getViews(previewContentViews);
|
9
|
+
var itemReferenceID = "";
|
10
|
+
const css = Cypress.env('css');
|
11
|
+
|
12
|
+
describe('Create item page - List ordering - Preview contents in all views', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
views.forEach((view) => {
|
18
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
switch (view) {
|
22
|
+
case 'Question preview':
|
23
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
|
26
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
27
|
+
listOrderingPage.steps.allotPoints(10);
|
28
|
+
cy.log('Add image to option input field')
|
29
|
+
listOrderingPage.steps.focusInOptionsInputField(0);
|
30
|
+
ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar();
|
31
|
+
ckEditorToolbar.steps.addImageToInputField();
|
32
|
+
listOrderingPage.steps.enterTextInOptionInputField(0, 'Fox');
|
33
|
+
cy.log('Add bold text to option input field')
|
34
|
+
listOrderingPage.steps.focusInOptionsInputField(1);
|
35
|
+
ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
|
36
|
+
listOrderingPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
|
37
|
+
cy.log('Add equation to option input field')
|
38
|
+
listOrderingPage.steps.enterTextInOptionInputField(2, 'Solve the following');
|
39
|
+
listOrderingPage.steps.focusInOptionsInputField(2);
|
40
|
+
ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
41
|
+
equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
42
|
+
listOrderingPage.steps.enterTextInOptionInputField(3, 'alpha');
|
43
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('This is a bold option');
|
44
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('Fox');
|
45
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('Solve the following');
|
46
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('alpha');
|
47
|
+
listOrderingPage.steps.switchToPreviewTab();
|
48
|
+
break;
|
49
|
+
case 'Item view':
|
50
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
break;
|
52
|
+
case 'Item preview':
|
53
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
54
|
+
listOrderingPage.steps.switchToPreviewTab();
|
55
|
+
break;
|
56
|
+
case 'Student view':
|
57
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
58
|
+
break;
|
59
|
+
case 'Grading view':
|
60
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
61
|
+
break;
|
62
|
+
case 'Correct answer view':
|
63
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
64
|
+
break;
|
65
|
+
default:
|
66
|
+
throw new Error('Invalid view');
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
after(() => {
|
71
|
+
if (view === 'Question preview') {
|
72
|
+
listOrderingPage.steps.clickOnSaveQuestionButton();
|
73
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
74
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
75
|
+
}
|
76
|
+
if (view === 'Student view') {
|
77
|
+
studentViewPage.steps.submitResponse();
|
78
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
it('Question instructions should be visible', () => {
|
83
|
+
utilities.verifyInnerText(listOrderingPage.questionInstructionsText(), 'Arrange options in correct order.');
|
84
|
+
utilities.verifyElementVisibilityState(listOrderingPage.questionInstructionsText(), 'visible');
|
85
|
+
});
|
86
|
+
|
87
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
88
|
+
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}`, () => {
|
89
|
+
listOrderingPage.steps.verifyOptionWithImageInOptionsContainerPreviewTabSeperateList(0);
|
90
|
+
listOrderingPage.steps.verifyOptionWithBoldTextInOptionsContainerPreviewTabSeperateList(1);
|
91
|
+
listOrderingPage.steps.verifyOptionWithEquationTextInOptionsContainerPreviewTabSeperateList(2);
|
92
|
+
});
|
93
|
+
|
94
|
+
it('User should be able to drop the options in the dropzone containing image, bold text and equation options in the list', () => {
|
95
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('This is a bold option');
|
96
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('Fox');
|
97
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('Solve the following');
|
98
|
+
listOrderingPage.steps.clickAndDropOptionSeperateList('alpha');
|
99
|
+
listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
|
100
|
+
listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
|
101
|
+
listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
|
102
|
+
listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
|
103
|
+
});
|
104
|
+
} else if (view === 'Grading view') {
|
105
|
+
it(`The order of the responses should be as per the submitted response`, () => {
|
106
|
+
listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
|
107
|
+
listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
|
108
|
+
listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
|
109
|
+
listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
|
110
|
+
listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('This is a bold option');
|
111
|
+
listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('Fox');
|
112
|
+
listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('Solve the following');
|
113
|
+
listOrderingPage.steps.verifyCorrectOptionIconOrientationSeperateList('alpha');
|
114
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
115
|
+
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
116
|
+
});
|
117
|
+
|
118
|
+
it('The order of the responses should not be editable', () => {
|
119
|
+
listOrderingPage.steps.verifyOptionNotEditableInGradingViewSeperateList(array);
|
120
|
+
listOrderingPage.steps.verifyOptionWithBoldTextInDropzonePreviewTabSeperateList(0);
|
121
|
+
listOrderingPage.steps.verifyOptionWithImageInDropzonePreviewTabSeperateList(1);
|
122
|
+
listOrderingPage.steps.verifyOptionWithEquationTextInDropzonePreviewTabSeperateList(2);
|
123
|
+
listOrderingPage.steps.verifyTextContentOfOptionInDropzonePreviewTabSeperateList('alpha', 3);
|
124
|
+
});
|
125
|
+
} else {
|
126
|
+
it('The order of the options should be as per the correct answer order', () => {
|
127
|
+
listOrderingPage.steps.verifyOptionWithBoldTextInDropzoneCorrectAnswerSectionSeperateList(0);
|
128
|
+
listOrderingPage.steps.verifyOptionWithImageInDropzoneCorrectAnswerSectionTabSeperateList(1);
|
129
|
+
listOrderingPage.steps.verifyOptionWithEquationTextInDropzoneCorrectAnswerSectionSeperateList(2);
|
130
|
+
listOrderingPage.steps.verifyTextContentOfOptionInDropzoneCorrectAnswerSectionSeperateList('alpha', 3);
|
131
|
+
});
|
132
|
+
}
|
133
|
+
|
134
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
135
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab(), {
|
136
|
+
'background-color': css.color.defaultBackground,
|
137
|
+
'border': `1px solid ${css.color.draggableOptionBorder}`
|
138
|
+
});
|
139
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
|
140
|
+
'color': css.color.text,
|
141
|
+
'font-size': css.fontSize.default,
|
142
|
+
'font-weight': css.fontWeight.regular
|
143
|
+
});
|
144
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
|
145
|
+
'color': css.color.text,
|
146
|
+
'font-size': css.fontSize.default,
|
147
|
+
'font-weight': css.fontWeight.regular
|
148
|
+
});
|
149
|
+
switch (view) {
|
150
|
+
case 'Question preview':
|
151
|
+
case 'Item preview':
|
152
|
+
case 'Item view':
|
153
|
+
case 'Item preview':
|
154
|
+
case 'Student view':
|
155
|
+
case 'Grading view':
|
156
|
+
utilities.verifyCSS(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), 1).find('.drag-icon-button path').eq(1), {
|
157
|
+
'color': css.color.secondaryBtn
|
158
|
+
});
|
159
|
+
break;
|
160
|
+
case 'Correct answer view':
|
161
|
+
break;
|
162
|
+
default:
|
163
|
+
throw new Error('Invalid view');
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
it('Accessibility of preview contents', { tags: 'a11y' }, () => {
|
168
|
+
cy.checkAccessibility(listOrderingPage.horizontalOptionPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
169
|
+
});
|
170
|
+
});
|
171
|
+
});
|
172
|
+
});
|