itemengine-cypress-automation 1.0.143-migrationScripts-d059d60.0 → 1.0.143
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/additionalSettingsBasic.js +104 -0
- package/cypress/e2e/ILC/ContentBlocks/additionalSection.js +92 -0
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +11 -1
- package/cypress/e2e/ILC/ContentBlocks/previewTab.js +91 -0
- package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +3 -3
- package/cypress/e2e/ILC/Desmos/desmosFourFunctionCalculatorEditTabBasicSection.js +2 -1
- package/cypress/e2e/ILC/Desmos/desmosFourFunctionCalculatorPreviewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/Desmos/desmosGeometryToolEditTabBasicSection.js +1 -0
- package/cypress/e2e/ILC/Desmos/desmosGeometryToolPreviewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/Desmos/desmosGraphingCalculatorEditTabBasicSection.js +1 -0
- package/cypress/e2e/ILC/Desmos/desmosGraphingCalculatorPreviewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/Desmos/desmosMatrixCalculatorEditTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/Desmos/desmosMatrixCalculatorPreviewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/Desmos/desmosScientificCalculatorEditTabBasicSection.js +3 -2
- package/cypress/e2e/ILC/Desmos/desmosScientificCalculatorPreviewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/DesmosGraphing/additionalSettings.js +0 -5
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +124 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +0 -9
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +17 -17
- package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +83 -0
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +32 -30
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +25 -21
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +40 -41
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +249 -99
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +118 -187
- package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +11 -11
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +1 -3
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsBasic.js +138 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsForDropdowns.js +309 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownSettings.js +181 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettingsBasic.js +132 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +143 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsForDropdowns.js +345 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +49 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +25 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +251 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +49 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsBasic.js +93 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +215 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/textContainerSettings.js +219 -0
- package/cypress/e2e/ILC/GeoGebraTools/3DGraphingCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/3DGraphingCalculatorPreviewTabContents.smoke.js +75 -0
- package/cypress/e2e/ILC/GeoGebraTools/casCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/casCalculatorPreviewTabContents.smoke.js +75 -0
- package/cypress/e2e/ILC/GeoGebraTools/geometryCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/geometryCalculatorPreviewTabContents.smoke.js +76 -0
- package/cypress/e2e/ILC/GeoGebraTools/graphingCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/graphingCalculatorPreviewTabContents.smoke.js +73 -0
- package/cypress/e2e/ILC/GeoGebraTools/probablityCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/probablityCalculatorPreviewTabContents.smoke.js +75 -0
- package/cypress/e2e/ILC/GeoGebraTools/scientificCalculatorEditTabBasicSection.js +96 -0
- package/cypress/e2e/ILC/GeoGebraTools/scientificCalculatorPreviewTabContents.smoke.js +75 -0
- package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +10 -8
- package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +3 -2
- package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +2 -1
- package/cypress/e2e/ILC/GeogebraActivity/insertResourceLink.js +318 -0
- package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +2 -1
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +15 -4
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +280 -0
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +205 -0
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +213 -0
- package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +106 -0
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +79 -0
- package/cypress/e2e/ILC/MultipleSelection/additionalSettingsBasic.js +108 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +251 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +180 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +48 -56
- package/cypress/e2e/ILC/SingleSelection/additionalSettingsBasic.js +107 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +251 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +180 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +12 -3
- package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +4 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +93 -68
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +59 -52
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +59 -52
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +61 -50
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +65 -51
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +55 -46
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +6 -3
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +11 -9
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +4 -3
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +4 -2
- package/cypress/e2e/ILC/UploadResponse/additionalSettingsBasic.js +85 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +12 -12
- package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +1 -1
- package/cypress/fixtures/constants.js +2 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +1114 -1511
- package/cypress/fixtures/theme/ilc.json +7 -1
- package/cypress/pages/audioResponsePage.js +26 -2
- package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +1 -0
- package/cypress/pages/components/additionalSettingsPanel.js +3 -10
- package/cypress/pages/components/ariaLabelSectionComponent.js +84 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +5 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/createCustomCategoryFlyout.js +2 -2
- package/cypress/pages/components/createQuestionBasePage.js +1 -1
- package/cypress/pages/components/desmosToolComponent.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -1
- package/cypress/pages/components/editCategoryFlyout.js +9 -10
- package/cypress/pages/components/equationEditorFlyout.js +20 -11
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +167 -3
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +149 -6
- package/cypress/pages/components/gradingViewEnumerationComponent.js +151 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +390 -0
- package/cypress/pages/components/imageCanvasComponent.js +25 -1
- package/cypress/pages/components/index.js +5 -1
- package/cypress/pages/components/placeholderTextSectionComponent.js +110 -0
- package/cypress/pages/components/responseAreaSettingsPopupComponent.js +2 -2
- package/cypress/pages/contentBlocksPage.js +60 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -17
- package/cypress/pages/essayResponsePage.js +14 -11
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +15 -0
- package/cypress/pages/fillInTheGapsDropdownPage.js +121 -2
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +70 -3
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +33 -3
- package/cypress/pages/fillInTheGapsTextPage.js +81 -4
- package/cypress/pages/geoGebraActivityPage.js +75 -11
- package/cypress/pages/geoGebraToolsPage.js +292 -0
- package/cypress/pages/graphingPage.js +2 -1
- package/cypress/pages/gridFillPage.js +713 -0
- package/cypress/pages/index.js +3 -1
- package/cypress/pages/multipleSelectionGridPage.js +71 -317
- package/cypress/pages/multipleSelectionPage.js +2 -1
- package/cypress/pages/selectQuestionResourceToolPage.js +13 -2
- package/cypress/pages/singleSelectionGridPage.js +78 -329
- package/cypress/pages/singleSelectionPage.js +2 -1
- package/cypress/pages/textEntryMathPage.js +24 -6
- package/cypress/pages/textEntryMathWithImagePage.js +1 -1
- package/cypress/pages/uploadResponsePage.js +4 -3
- package/package.json +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +0 -43
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -642
@@ -0,0 +1,107 @@
|
|
1
|
+
import { singleSelectionPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
|
6
|
+
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
7
|
+
|
8
|
+
describe('Single selection - Additional settings', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Additional settings accordion', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
17
|
+
});
|
18
|
+
|
19
|
+
singleSelectionPage.tests.verifyAdditionalSettingsAccordionProperties();
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Additional settings: Font size - Contents in edit tab', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
26
|
+
cy.barsPreLoaderWait();
|
27
|
+
singleSelectionPage.steps.expandAdditionalSettings();
|
28
|
+
});
|
29
|
+
|
30
|
+
singleSelectionPage.tests.verifyFontSizeSectionContents();
|
31
|
+
});
|
32
|
+
|
33
|
+
describe('Additional settings: Font size - functionality in edit tab', () => {
|
34
|
+
abortEarlySetup();
|
35
|
+
before(() => {
|
36
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
37
|
+
cy.barsPreLoaderWait();
|
38
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Single selection');
|
39
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
40
|
+
singleSelectionPage.steps.expandAdditionalSettings();
|
41
|
+
});
|
42
|
+
|
43
|
+
Object.keys(fontSizes).forEach((option) => {
|
44
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the edit tab options should change to ${fontSizes[option]} accordingly`, () => {
|
45
|
+
singleSelectionPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
46
|
+
utilities.verifyInnerText(singleSelectionPage.fontSizeDropdown(), `${option}`);
|
47
|
+
utilities.verifyCSS(singleSelectionPage.optionsTextSpecifyCorrectAnswerSection(), {
|
48
|
+
'font-size': fontSizes[option]
|
49
|
+
});
|
50
|
+
});
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
describe('Additional settings: Font size - functionality in preview tab', () => {
|
55
|
+
abortEarlySetup();
|
56
|
+
before(() => {
|
57
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
58
|
+
cy.barsPreLoaderWait();
|
59
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Single selection');
|
60
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
61
|
+
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
|
62
|
+
singleSelectionPage.steps.expandAdditionalSettings();
|
63
|
+
});
|
64
|
+
|
65
|
+
Object.keys(fontSizes).forEach((option) => {
|
66
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
|
67
|
+
singleSelectionPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
68
|
+
utilities.verifyInnerText(singleSelectionPage.fontSizeDropdown(), `${option}`);
|
69
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
70
|
+
utilities.verifyCSS(singleSelectionPage.questionInstructionsText(), {
|
71
|
+
'font-size': fontSizes[option]
|
72
|
+
});
|
73
|
+
utilities.verifyCSS(singleSelectionPage.optionTextPreviewTab(), {
|
74
|
+
'font-size': fontSizes[option]
|
75
|
+
});
|
76
|
+
singleSelectionPage.steps.switchToGradingView();
|
77
|
+
utilities.verifyCSS(singleSelectionPage.optionTextPreviewTab(), {
|
78
|
+
'font-size': fontSizes[option]
|
79
|
+
});
|
80
|
+
singleSelectionPage.steps.switchToStudentView();
|
81
|
+
singleSelectionPage.steps.switchToEditTab();
|
82
|
+
});
|
83
|
+
});
|
84
|
+
});
|
85
|
+
|
86
|
+
describe('Additional settings: Accessibility section', () => {
|
87
|
+
abortEarlySetup();
|
88
|
+
before(() => {
|
89
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
90
|
+
cy.barsPreLoaderWait();
|
91
|
+
singleSelectionPage.steps.expandAdditionalSettings();
|
92
|
+
});
|
93
|
+
|
94
|
+
singleSelectionPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
95
|
+
});
|
96
|
+
|
97
|
+
describe('Additional settings: Details section', () => {
|
98
|
+
abortEarlySetup();
|
99
|
+
before(() => {
|
100
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
101
|
+
cy.barsPreLoaderWait();
|
102
|
+
singleSelectionPage.steps.expandAdditionalSettings();
|
103
|
+
});
|
104
|
+
|
105
|
+
singleSelectionPage.tests.verifyDetailsSection();
|
106
|
+
});
|
107
|
+
});
|
@@ -0,0 +1,251 @@
|
|
1
|
+
import { dialogBoxBase, singleSelectionGridPage, 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 - Single selection grid: 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
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
|
21
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
22
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
23
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
24
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
25
|
+
});
|
26
|
+
|
27
|
+
singleSelectionGridPage.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
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
31
|
+
singleSelectionGridPage.steps.allotPoints(20);
|
32
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 1, column: 1 }]);
|
33
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
34
|
+
singleSelectionGridPage.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
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
|
39
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
40
|
+
singleSelectionGridPage.steps.verifyOptionWithRadioButtonUnselectedState({ row: 1, column: 0 });
|
41
|
+
singleSelectionGridPage.steps.verifyOptionWithRadioButtonUnselectedState({ row: 2, column: 1 });
|
42
|
+
});
|
43
|
+
});
|
44
|
+
};
|
45
|
+
|
46
|
+
views.forEach((view) => {
|
47
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
48
|
+
abortEarlySetup();
|
49
|
+
before(() => {
|
50
|
+
switch (view) {
|
51
|
+
case 'Question preview':
|
52
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
53
|
+
cy.barsPreLoaderWait();
|
54
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
|
55
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
56
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
57
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
58
|
+
singleSelectionGridPage.steps.allotPoints(20);
|
59
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
60
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
61
|
+
break;
|
62
|
+
case 'Item preview':
|
63
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
64
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
65
|
+
break;
|
66
|
+
case 'Grading view':
|
67
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
68
|
+
break;
|
69
|
+
};
|
70
|
+
});
|
71
|
+
|
72
|
+
beforeEach(() => {
|
73
|
+
switch (view) {
|
74
|
+
case 'Question preview':
|
75
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
76
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
77
|
+
break;
|
78
|
+
case 'Item preview':
|
79
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
80
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
81
|
+
break;
|
82
|
+
case 'Grading view':
|
83
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
84
|
+
break;
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
if (view === 'Question preview') {
|
89
|
+
after(() => {
|
90
|
+
singleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
91
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
92
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
93
|
+
});
|
94
|
+
};
|
95
|
+
|
96
|
+
it('When the user selects \'Grading\' view without attempting the question, correct answers section with a label \'Correct answers\' should be displayed with a preview of the entire grid with correct answers', () => {
|
97
|
+
if (view === 'Grading view') {
|
98
|
+
studentViewPage.steps.submitResponse();
|
99
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
100
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
101
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
102
|
+
};
|
103
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
104
|
+
singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
|
105
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
106
|
+
singleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
107
|
+
};
|
108
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
109
|
+
});
|
110
|
+
|
111
|
+
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 a preview of the entire grid with correct answers should be displayed', () => {
|
112
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }, { row: 2, column: 0 }]);
|
113
|
+
if (view === 'Grading view') {
|
114
|
+
studentViewPage.steps.submitResponse();
|
115
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
116
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
117
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
118
|
+
};
|
119
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
120
|
+
singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
|
121
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
122
|
+
};
|
123
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
|
124
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
|
125
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
126
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user attempts the question partially correct with incorrect responses, 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 a preview of the entire grid with correct answers should be displayed', () => {
|
130
|
+
if (view === 'Grading view') {
|
131
|
+
studentViewPage.steps.clearResponses();
|
132
|
+
};
|
133
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 1 }, { row: 4, column: 0 }]);
|
134
|
+
if (view === 'Grading view') {
|
135
|
+
studentViewPage.steps.submitResponse();
|
136
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
137
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
138
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
139
|
+
};
|
140
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
141
|
+
singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
|
142
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
143
|
+
};
|
144
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
145
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
146
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 3, column: 1 });
|
147
|
+
singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 4, column: 0 });
|
148
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
149
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
150
|
+
});
|
151
|
+
|
152
|
+
it('When the user attempts the question partially correct with incomplete responses, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icons should be displayed besides unattempted responses, a status message with text \'Your answer is incorrect\' and correct answer section with a preview of the entire grid with correct answers should be displayed', () => {
|
153
|
+
if (view === 'Grading view') {
|
154
|
+
studentViewPage.steps.clearResponses();
|
155
|
+
};
|
156
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
|
157
|
+
if (view === 'Grading view') {
|
158
|
+
studentViewPage.steps.submitResponse();
|
159
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
160
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
161
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
162
|
+
};
|
163
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
164
|
+
singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
|
165
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
166
|
+
};
|
167
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
168
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
169
|
+
//Note: remove after https://redmine.zeuslearning.com/issues/553983 gets resolved
|
170
|
+
//singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
|
171
|
+
//singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
|
172
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
173
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
174
|
+
});
|
175
|
+
|
176
|
+
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', () => {
|
177
|
+
if (view === 'Grading view') {
|
178
|
+
studentViewPage.steps.clearResponses();
|
179
|
+
};
|
180
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
181
|
+
if (view === 'Grading view') {
|
182
|
+
studentViewPage.steps.submitResponse();
|
183
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
184
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
185
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
186
|
+
};
|
187
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
188
|
+
singleSelectionGridPage.steps.verifyPreviewScore(20, 20);
|
189
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
190
|
+
singleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
191
|
+
};
|
192
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
193
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
194
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 3, column: 0 });
|
195
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 4, column: 1 });
|
196
|
+
singleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
197
|
+
singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
|
198
|
+
});
|
199
|
+
});
|
200
|
+
});
|
201
|
+
|
202
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
203
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
204
|
+
abortEarlySetup();
|
205
|
+
before(() => {
|
206
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
207
|
+
cy.barsPreLoaderWait();
|
208
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
|
209
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
210
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
211
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
212
|
+
singleSelectionGridPage.steps.allotPoints(20);
|
213
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
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
|
+
singleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
218
|
+
singleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
219
|
+
singleSelectionGridPage.steps.allotMinimumPoints(2);
|
220
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
221
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
222
|
+
singleSelectionGridPage.steps.verifyPreviewScore(2, 20);
|
223
|
+
singleSelectionGridPage.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
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
228
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }, { row: 2, column: 0 }]);
|
229
|
+
singleSelectionGridPage.steps.verifyPreviewScore(2, 20);
|
230
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
231
|
+
});
|
232
|
+
|
233
|
+
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', () => {
|
234
|
+
singleSelectionGridPage.steps.switchToEditTab();
|
235
|
+
singleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
236
|
+
singleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
237
|
+
singleSelectionGridPage.steps.allotMinimumPoints(2);
|
238
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
239
|
+
singleSelectionGridPage.steps.switchToGradingView();
|
240
|
+
singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
|
241
|
+
singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
242
|
+
});
|
243
|
+
|
244
|
+
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', () => {
|
245
|
+
singleSelectionGridPage.steps.resetQuestionPreview();
|
246
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }, { row: 2, column: 0 }]);
|
247
|
+
singleSelectionGridPage.steps.verifyPreviewScore(2, 20);
|
248
|
+
});
|
249
|
+
});
|
250
|
+
};
|
251
|
+
});
|
@@ -0,0 +1,180 @@
|
|
1
|
+
import { singleSelectionGridPage, itemPreviewPage, 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
|
+
const css = Cypress.env('css');
|
6
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
7
|
+
const views = utilities.getViews(previewContentViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
describe('Create item page - Single selection grid: Preview contents', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select where the following animals are found')
|
23
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
24
|
+
singleSelectionGridPage.steps.modifyTableCellPropertyForOptionCells({ row: 1, column: 1 }, 'Radio button with text');
|
25
|
+
singleSelectionGridPage.steps.modifyTableCellPropertyForOptionCells({ row: 2, column: 2 }, 'No radio button');
|
26
|
+
singleSelectionGridPage.steps.modifyTableCellPropertyForOptionCells({ row: 3, column: 1 }, 'No radio button');
|
27
|
+
singleSelectionGridPage.steps.modifyTableCellPropertyForOptionCells({ row: 4, column: 2 }, 'No radio button');
|
28
|
+
cy.log('Add image to option input field')
|
29
|
+
singleSelectionGridPage.steps.focusInEditTableOptionCellInputField({ row: 1, column: 1 });
|
30
|
+
ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar()
|
31
|
+
ckEditorToolbar.steps.addImageToInputField();
|
32
|
+
cy.log('Add bold text to input field')
|
33
|
+
singleSelectionGridPage.steps.focusInEditTableOptionCellInputField({ row: 3, column: 1 });
|
34
|
+
ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
|
35
|
+
singleSelectionGridPage.steps.enterTextInOptionCellInputField({ row: 3, column: 1 }, 'This is a bold option');
|
36
|
+
cy.log('Add equation to option input field')
|
37
|
+
singleSelectionGridPage.steps.focusInEditTableCellInputField({ row: 3, column: 0 });
|
38
|
+
ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
39
|
+
equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
40
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
41
|
+
singleSelectionGridPage.steps.enterTextInOptionCellInputField({ row: 2, column: 2 }, 'This is a correct option');
|
42
|
+
singleSelectionGridPage.steps.enterTextInOptionCellInputField({ row: 4, column: 2 }, 'This is an incorrect option');
|
43
|
+
singleSelectionGridPage.steps.allotPoints(10);
|
44
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
45
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
46
|
+
break;
|
47
|
+
case 'Item view':
|
48
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
49
|
+
break;
|
50
|
+
case 'Item preview':
|
51
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
52
|
+
singleSelectionGridPage.steps.switchToPreviewTab();
|
53
|
+
break;
|
54
|
+
case 'Student view':
|
55
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
56
|
+
break;
|
57
|
+
case 'Grading view':
|
58
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
59
|
+
break;
|
60
|
+
case 'Correct answer view':
|
61
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
62
|
+
break;
|
63
|
+
default:
|
64
|
+
throw new Error('Invalid view');
|
65
|
+
}
|
66
|
+
});
|
67
|
+
|
68
|
+
after(() => {
|
69
|
+
if (view === 'Question preview') {
|
70
|
+
singleSelectionGridPage.steps.clickOnSaveQuestionButton();
|
71
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
72
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
73
|
+
}
|
74
|
+
if (view === 'Student view') {
|
75
|
+
studentViewPage.steps.submitResponse();
|
76
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
77
|
+
}
|
78
|
+
});
|
79
|
+
|
80
|
+
it('Question instructions should be visible', () => {
|
81
|
+
utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
|
82
|
+
utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsText(), 'visible');
|
83
|
+
});
|
84
|
+
|
85
|
+
//Complete after https://redmine.zeuslearning.com/issues/565255 gets resolved
|
86
|
+
it(`The question grid as set by the user should be displayed in the ${view}`, () => {
|
87
|
+
|
88
|
+
});
|
89
|
+
|
90
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
91
|
+
it(`When the user has added image, equation, bold text to the options, then they should be displayed in the grid in ${view}`, () => {
|
92
|
+
singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
|
93
|
+
singleSelectionGridPage.steps.verifyTableCellWithBoldTextInPreviewTab({ row: 3, column: 1 });
|
94
|
+
singleSelectionGridPage.steps.verifyTableCellWithEquationTextInPreviewTab({ row: 3, column: 0 });
|
95
|
+
});
|
96
|
+
|
97
|
+
it(`User should be able to select options in the ${view}`, () => {
|
98
|
+
singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
99
|
+
});
|
100
|
+
} else if (view === 'Grading view') {
|
101
|
+
it(`The submitted options should be in checked state`, () => {
|
102
|
+
singleSelectionGridPage.steps.verifyOptionWithRadioButtonSelectedState({ row: 1, column: 0 });
|
103
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 2, column: 1 });
|
104
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 3, column: 0 });
|
105
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 4, column: 1 });
|
106
|
+
});
|
107
|
+
|
108
|
+
it('The content in the grid should not be editable', () => {
|
109
|
+
singleSelectionGridPage.steps.verifyOptionDisabledState({ row: 1, column: 1 });
|
110
|
+
});
|
111
|
+
} else {
|
112
|
+
it(`The correct options should be in checked state, correct icons should be displayed besides them, correct background should be displayed behind the option`, () => {
|
113
|
+
singleSelectionGridPage.steps.verifyOptionWithRadioButtonSelectedState({ row: 1, column: 0 });
|
114
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 2, column: 1 });
|
115
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 3, column: 0 });
|
116
|
+
singleSelectionGridPage.steps.verifyOptionWithoutRadioButtonSelectedState({ row: 4, column: 1 });
|
117
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
|
118
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
|
119
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 3, column: 0 });
|
120
|
+
singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 4, column: 1 });
|
121
|
+
});
|
122
|
+
}
|
123
|
+
|
124
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
125
|
+
singleSelectionGridPage.gridPreviewTab()
|
126
|
+
.within(() => {
|
127
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 1), {
|
128
|
+
'background-color': css.color.matrixHeadingCellBg,
|
129
|
+
'border-color': `${css.color.matrixCellBorder}`
|
130
|
+
});
|
131
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 6), {
|
132
|
+
'background-color': css.color.matrixSubheadingCellBg,
|
133
|
+
'border-color': `${css.color.matrixCellBorder}`
|
134
|
+
});
|
135
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 9), {
|
136
|
+
'background-color': css.color.defaultBackground,
|
137
|
+
'border-color': `${css.color.matrixCellBorder}`
|
138
|
+
});
|
139
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 1).find('.question-text-wrapper'), {
|
140
|
+
'color': css.color.text,
|
141
|
+
'font-size': css.fontSize.heading,
|
142
|
+
'font-weight': css.fontWeight.bold
|
143
|
+
});
|
144
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
|
145
|
+
'color': css.color.text,
|
146
|
+
'font-size': css.fontSize.default,
|
147
|
+
'font-weight': css.fontWeight.bold
|
148
|
+
});
|
149
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
|
150
|
+
'color': css.color.text,
|
151
|
+
'font-size': css.fontSize.default,
|
152
|
+
'font-weight': css.fontWeight.regular
|
153
|
+
});
|
154
|
+
});
|
155
|
+
switch (view) {
|
156
|
+
case 'Question preview':
|
157
|
+
case 'Item preview':
|
158
|
+
case 'Item view':
|
159
|
+
case 'Item preview':
|
160
|
+
case 'Student view':
|
161
|
+
break;
|
162
|
+
case 'Grading view':
|
163
|
+
case 'Correct answer view':
|
164
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 10).find('.question-text-wrapper strong'), {
|
165
|
+
'color': css.color.activeButtons,
|
166
|
+
'font-size': css.fontSize.default,
|
167
|
+
'font-weight': css.fontWeight.bold
|
168
|
+
});
|
169
|
+
break;
|
170
|
+
default:
|
171
|
+
throw new Error('Invalid view');
|
172
|
+
}
|
173
|
+
});
|
174
|
+
|
175
|
+
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
176
|
+
cy.checkAccessibility(singleSelectionGridPage.tableCell());
|
177
|
+
});
|
178
|
+
});
|
179
|
+
});
|
180
|
+
});
|
@@ -29,7 +29,10 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
|
|
29
29
|
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
30
30
|
textEntryMathPage.steps.switchToEditTab();
|
31
31
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
32
|
-
textEntryMathPage.steps.
|
32
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
33
|
+
equationEditorFlyout.steps.clearAll();
|
34
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
|
35
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
33
36
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
34
37
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
35
38
|
equationEditorFlyout.steps.enterQuadraticEquation();
|
@@ -65,7 +68,10 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
|
|
65
68
|
textEntryMathPage.steps.addResponseToken();
|
66
69
|
textEntryMathPage.steps.addResponseToken();
|
67
70
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
68
|
-
textEntryMathPage.steps.
|
71
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
72
|
+
equationEditorFlyout.steps.clearAll();
|
73
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
|
74
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
69
75
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
70
76
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
71
77
|
equationEditorFlyout.steps.enterQuadraticEquation();
|
@@ -262,7 +268,10 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
|
|
262
268
|
textEntryMathPage.steps.addResponseToken();
|
263
269
|
textEntryMathPage.steps.addResponseToken();
|
264
270
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
265
|
-
textEntryMathPage.steps.
|
271
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
272
|
+
equationEditorFlyout.steps.clearAll();
|
273
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
|
274
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
266
275
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
267
276
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
268
277
|
equationEditorFlyout.steps.enterQuadraticEquation();
|
@@ -38,7 +38,10 @@ describe('Create item page - Text entry math - Check answer functionality', () =
|
|
38
38
|
textEntryMathPage.steps.addResponseToken();
|
39
39
|
textEntryMathPage.steps.addResponseToken();
|
40
40
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
41
|
-
textEntryMathPage.steps.
|
41
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
42
|
+
equationEditorFlyout.steps.clearAll();
|
43
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
|
44
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
42
45
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
43
46
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
44
47
|
equationEditorFlyout.steps.enterQuadraticEquation();
|