itemengine-cypress-automation 1.0.143-migrationScripts-d059d60.0 → 1.0.144-21MatchRepoUpdate-0ab2c79.0
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 +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +0 -43
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -642
@@ -0,0 +1,194 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const penaltyScoringTypeArray = ['No penalty points', 'Penalty points for the entire question', 'Penalty points for each incorrect dropdown'];
|
6
|
+
|
7
|
+
describe('Create item page - Fill in the gaps over image - dropdown: Minimum scoring, Penalty scoring, Rounding - Edit tab', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Scoring section: Minimum scoring - Edit tab', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(10);
|
18
|
+
});
|
19
|
+
|
20
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyMinimumScoringDropdown();
|
21
|
+
|
22
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyMinimumPointsLabelAndInputField();
|
23
|
+
|
24
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyMinimumPointsFieldErrorState();
|
25
|
+
});
|
26
|
+
|
27
|
+
describe('Scoring section: Penalty scoring - Edit tab', () => {
|
28
|
+
abortEarlySetup();
|
29
|
+
before(() => {
|
30
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
31
|
+
cy.barsPreLoaderWait();
|
32
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(10);
|
33
|
+
fillInTheGapsOverImageDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
34
|
+
});
|
35
|
+
|
36
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
|
37
|
+
|
38
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPenaltyPointsLabelAndInputField();
|
39
|
+
|
40
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPenaltyPointsErrorState();
|
41
|
+
|
42
|
+
it('When the user selects \'Penalty points for each incorrect dropdown\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdowns\' label and checkbox should be displayed, by default the checkbox should be unchecked. Two radio buttons with labels - \'Specify total penalty points\' and \'Specify points for each incorrect dropdown\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
|
43
|
+
fillInTheGapsOverImageDropdownPage.steps.expandPenaltyScoringDropdown();
|
44
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect dropdown');
|
45
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdowns');
|
46
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
|
47
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect dropdown');
|
48
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
|
49
|
+
fillInTheGapsOverImageDropdownPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
|
50
|
+
fillInTheGapsOverImageDropdownPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
|
51
|
+
});
|
52
|
+
|
53
|
+
it('When \'Specify total penalty points\' is selected, a penalty points detail section with \'Total penalty points\' label and empty input field, \'Penalty points for each incorrect dropdown: -\' label should be displayed', () => {
|
54
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
|
55
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTotalPenaltyPointsValue('');
|
56
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect dropdown: -');
|
57
|
+
});
|
58
|
+
|
59
|
+
it('When the user allots total penalty points, then \'points for each incorrect dropdown\' should get updated as per the count of incorrect options available', () => {
|
60
|
+
fillInTheGapsOverImageDropdownPage.steps.allotTotalPenaltyPoints(5);
|
61
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPenaltyPointsForEachIncorrectDropdown(2.5);
|
62
|
+
});
|
63
|
+
|
64
|
+
it('When the user adds a new option, then \'points for each incorrect dropdown\' should get updated accordingly', () => {
|
65
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea();
|
66
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPenaltyPointsForEachIncorrectDropdown(1.67);
|
67
|
+
});
|
68
|
+
|
69
|
+
it('When the user deletes an option, then \'points for each incorrect dropdown\' should get updated accordingly', () => {
|
70
|
+
fillInTheGapsOverImageDropdownPage.steps.removeResponseArea(0);
|
71
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPenaltyPointsForEachIncorrectDropdown(2.5);
|
72
|
+
});
|
73
|
+
|
74
|
+
it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
|
75
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.automaticallySetPenaltyPointsCheckboxLabel(), {
|
76
|
+
'color': css.color.labelText,
|
77
|
+
'font-size': css.fontSize.normal,
|
78
|
+
'font-weight': css.fontWeight.regular
|
79
|
+
});
|
80
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
|
81
|
+
'fill': css.color.uncheckedCheckbox
|
82
|
+
});
|
83
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
|
84
|
+
'fill': css.color.activeButtons
|
85
|
+
});
|
86
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
|
87
|
+
'fill': css.color.uncheckedCheckbox
|
88
|
+
});
|
89
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
|
90
|
+
'color': css.color.labelText,
|
91
|
+
'font-size': css.fontSize.normal,
|
92
|
+
'font-weight': css.fontWeight.regular
|
93
|
+
});
|
94
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
|
95
|
+
'color': css.color.labelText,
|
96
|
+
'font-size': css.fontSize.normal,
|
97
|
+
'font-weight': css.fontWeight.regular
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionInputFieldLabel(), {
|
100
|
+
'color': css.color.labels,
|
101
|
+
'font-size': css.fontSize.normal,
|
102
|
+
'font-weight': css.fontWeight.regular
|
103
|
+
});
|
104
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.totalPenaltyPointsInputField(), {
|
105
|
+
'color': css.color.text,
|
106
|
+
'font-size': css.fontSize.default,
|
107
|
+
'font-weight': css.fontWeight.regular
|
108
|
+
});
|
109
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
|
110
|
+
'color': css.color.labels,
|
111
|
+
'font-size': css.fontSize.normal,
|
112
|
+
'font-weight': css.fontWeight.regular
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
|
117
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
|
118
|
+
});
|
119
|
+
|
120
|
+
it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect dropdown:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
|
121
|
+
cy.log('Pre-step: Clearing the total penalty points input field')
|
122
|
+
fillInTheGapsOverImageDropdownPage.steps.clearTotalPenaltyPointsInputField();
|
123
|
+
fillInTheGapsOverImageDropdownPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect option');
|
124
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect dropdown');
|
125
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyPenaltyPointsForEachIncorrectDropdownValue('');
|
126
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user allots Penalty points for each incorrect dropdown, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
|
130
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPenaltyPointsForEachIncorrectDropdown(1);
|
131
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTotalPenaltyPoints(2);
|
132
|
+
});
|
133
|
+
|
134
|
+
it('When the user adds a new option, then \'Total penalty points\' should get updated accordingly', () => {
|
135
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea();
|
136
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTotalPenaltyPoints(3);
|
137
|
+
});
|
138
|
+
|
139
|
+
it('When the user deletes an option, then \'points for each incorrect dropdown\' should get updated accordingly', () => {
|
140
|
+
fillInTheGapsOverImageDropdownPage.steps.removeResponseArea(0);
|
141
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTotalPenaltyPoints(2);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('CSS of the penalty points section - Penalty points for each incorrect dropdown', { tags: 'css' }, () => {
|
145
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionInputFieldLabel(), {
|
146
|
+
'color': css.color.labels,
|
147
|
+
'font-size': css.fontSize.normal,
|
148
|
+
'font-weight': css.fontWeight.regular
|
149
|
+
});
|
150
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.penaltyPointsForEachIncorrectDropdownInputField(), {
|
151
|
+
'color': css.color.text,
|
152
|
+
'font-size': css.fontSize.default,
|
153
|
+
'font-weight': css.fontWeight.regular
|
154
|
+
});
|
155
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
|
156
|
+
'color': css.color.labels,
|
157
|
+
'font-size': css.fontSize.normal,
|
158
|
+
'font-weight': css.fontWeight.regular
|
159
|
+
});
|
160
|
+
});
|
161
|
+
|
162
|
+
it('Accessibility of the penalty points section - Penalty points for each incorrect dropdown', { tags: 'a11y' }, () => {
|
163
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
|
164
|
+
});
|
165
|
+
|
166
|
+
it('When the user switches to the \'Specify total penalty points\' option, the total penalty points input field should be filled as per the total penalty points in \'Specify points for each incorrect dropdown\'', () => {
|
167
|
+
fillInTheGapsOverImageDropdownPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
|
168
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTotalPenaltyPointsValue(2);
|
169
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect dropdown: 1');
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When the user checks the \'Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdowns\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect dropdown\' should get checked, in the penalty points details section, \'Penalty points for each incorrect dropdown: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
|
173
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
|
174
|
+
fillInTheGapsOverImageDropdownPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
|
175
|
+
fillInTheGapsOverImageDropdownPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
|
176
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect dropdown: 5');
|
177
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 10');
|
178
|
+
});
|
179
|
+
});
|
180
|
+
|
181
|
+
describe('Scoring section: Rounding - Edit tab', () => {
|
182
|
+
abortEarlySetup();
|
183
|
+
before(() => {
|
184
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
185
|
+
cy.barsPreLoaderWait();
|
186
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(10);
|
187
|
+
fillInTheGapsOverImageDropdownPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
|
188
|
+
});
|
189
|
+
|
190
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyRoundingDropdown();
|
191
|
+
|
192
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
|
193
|
+
});
|
194
|
+
});
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create item page - Fill in the gaps over image with dropdown: Supported file types', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Supported file types functionality: device popup', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
});
|
16
|
+
|
17
|
+
const supportedFormatFiles = {
|
18
|
+
'jpg': 'highlightImage.jpg',
|
19
|
+
'jpeg': 'sample.jpeg',
|
20
|
+
'png': 'image.png',
|
21
|
+
'gif': 'sample.gif',
|
22
|
+
'svg': 'sample.svg'
|
23
|
+
};
|
24
|
+
|
25
|
+
Object.keys(supportedFormatFiles).forEach((fileType) => {
|
26
|
+
it(`User should be able to upload ${fileType} file in the image section using link text \'device\' and it should be displayed in the \'Image\' section and \'Preview tab\'`, () => {
|
27
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile(supportedFormatFiles[fileType]);
|
28
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
29
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyUploadedImageFormatInBackgroundImageSection(fileType);
|
30
|
+
cy.log('Checking in preview tab')
|
31
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
32
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab(), 'visible');
|
33
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyUploadedImageFormatInPreviewTab(fileType);
|
34
|
+
cy.log('Post step: Delete the image')
|
35
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
36
|
+
fillInTheGapsOverImageDropdownPage.steps.deleteImage();
|
37
|
+
fillInTheGapsOverImageDropdownPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should be displayed', () => {
|
42
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('sample.heic');
|
43
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.');
|
44
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.errorMessage(), 'visible');
|
45
|
+
});
|
46
|
+
|
47
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyErrorMessageCSSAndA11y();
|
48
|
+
});
|
49
|
+
});
|
@@ -17,6 +17,16 @@ describe('Fill In the gaps over image with text - Additional settings', () => {
|
|
17
17
|
fillInTheGapsOverImageTextPage.tests.verifyAdditionalSettingsAccordionProperties();
|
18
18
|
});
|
19
19
|
|
20
|
+
describe('Additional settings: Font size - Contents in edit tab', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
});
|
26
|
+
|
27
|
+
fillInTheGapsOverImageTextPage.tests.verifyFontSizeSectionContents();
|
28
|
+
});
|
29
|
+
|
20
30
|
describe('Additional settings: Font size - functionality in preview tab', () => {
|
21
31
|
abortEarlySetup();
|
22
32
|
before(() => {
|
@@ -53,16 +63,31 @@ describe('Fill In the gaps over image with text - Additional settings', () => {
|
|
53
63
|
utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswerResponse(), {
|
54
64
|
'font-size': fontSizes[option]
|
55
65
|
});
|
66
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctIncorrectStatusMessageText(), {
|
67
|
+
'font-size': fontSizes[option]
|
68
|
+
});
|
56
69
|
fillInTheGapsOverImageTextPage.steps.switchToStudentView();
|
57
70
|
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
58
71
|
});
|
59
72
|
});
|
60
73
|
});
|
74
|
+
|
75
|
+
describe('Additional settings: Accessibility section', () => {
|
76
|
+
abortEarlySetup();
|
77
|
+
before(() => {
|
78
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
79
|
+
cy.barsPreLoaderWait();
|
80
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
81
|
+
});
|
82
|
+
|
83
|
+
fillInTheGapsOverImageTextPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
84
|
+
});
|
61
85
|
|
62
86
|
describe('Additional settings: Details section', () => {
|
63
87
|
abortEarlySetup();
|
64
88
|
before(() => {
|
65
89
|
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
90
|
+
cy.barsPreLoaderWait();
|
66
91
|
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
67
92
|
});
|
68
93
|
|
package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js
ADDED
@@ -0,0 +1,251 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const enumerationOptions = {
|
5
|
+
'Numerical': ['1', '2'],
|
6
|
+
'Alphabet (uppercase)': ['A', 'B'],
|
7
|
+
'Alphabet (lowercase)': ['a', 'b'],
|
8
|
+
'Roman numeral (uppercase)': ['I', 'II'],
|
9
|
+
'Roman numeral (lowercase)': ['i', 'ii'],
|
10
|
+
};
|
11
|
+
const css = Cypress.env('css');
|
12
|
+
|
13
|
+
describe('Fill In the gaps over image with text - Additional settings : Placeholder text, Grading view, ARIA label for text containers', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Additional settings: Placeholder text - Contents in edit tab', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
24
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
25
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
26
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
27
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
28
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
29
|
+
});
|
30
|
+
|
31
|
+
fillInTheGapsOverImageTextPage.tests.verifyPlaceholderTextSectionContents('text containers');
|
32
|
+
|
33
|
+
it('When the user checks the "Customize placeholder text for individual text containers" checkbox, "Placeholder text for text containers" label and two input fields for individual text containers should be displayed', () => {
|
34
|
+
fillInTheGapsOverImageTextPage.steps.checkCustomizePlaceholderTextCheckbox();
|
35
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.individualPlaceholderTextInputField(), 2);
|
36
|
+
fillInTheGapsOverImageTextPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
37
|
+
fillInTheGapsOverImageTextPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
38
|
+
});
|
39
|
+
|
40
|
+
it('When the users adds a new text container, the count of the placeholder text input fields should update accordingly', () => {
|
41
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea();
|
42
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.individualPlaceholderTextInputField(), 3);
|
43
|
+
fillInTheGapsOverImageTextPage.steps.verifyIndividualPlaceholderTextInputFields(2);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user deletes any text container, the count of the placeholder text input fields should update accordingly', () => {
|
47
|
+
fillInTheGapsOverImageTextPage.steps.removeResponseArea(1);
|
48
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.individualPlaceholderTextInputField(), 2);
|
49
|
+
fillInTheGapsOverImageTextPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
50
|
+
fillInTheGapsOverImageTextPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
describe('Additional settings: Placeholder text - functionality in preview tab', () => {
|
55
|
+
abortEarlySetup();
|
56
|
+
before(() => {
|
57
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
58
|
+
cy.barsPreLoaderWait();
|
59
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
60
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
61
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
62
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
63
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
64
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
65
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
66
|
+
});
|
67
|
+
|
68
|
+
fillInTheGapsOverImageTextPage.tests.verifyPlaceholderTextPreviewTabFunctionality();
|
69
|
+
|
70
|
+
fillInTheGapsOverImageTextPage.tests.verifyIndividualPlaceholderTextPreviewTabFunctionality();
|
71
|
+
});
|
72
|
+
|
73
|
+
describe('Additional Settings: Grading view - Contents in edit tab', () => {
|
74
|
+
abortEarlySetup();
|
75
|
+
before(() => {
|
76
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
77
|
+
cy.barsPreLoaderWait();
|
78
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
79
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
80
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
81
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
82
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
83
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
84
|
+
});
|
85
|
+
|
86
|
+
fillInTheGapsOverImageTextPage.tests.verifyGradingViewEnumerationSectionContents('Text container');
|
87
|
+
|
88
|
+
it('When the user selects "Without enumeration" radio button, the identifiers section should disappear', () => {
|
89
|
+
fillInTheGapsOverImageTextPage.steps.selectEnumerationType('without enumeration');
|
90
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.identifiersLabel(), 'notExist');
|
91
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.numericalToggleButton(), 'notExist');
|
92
|
+
});
|
93
|
+
|
94
|
+
it('When the user selects "With enumeration" radio button again, the identifiers section should appear again', () => {
|
95
|
+
fillInTheGapsOverImageTextPage.steps.selectEnumerationType('with enumeration');
|
96
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.identifiersLabel(), 'visible');
|
97
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.numericalToggleButton(), 'visible');
|
98
|
+
})
|
99
|
+
});
|
100
|
+
|
101
|
+
describe('Additional settings: Grading view - functionality in preview tab', () => {
|
102
|
+
abortEarlySetup();
|
103
|
+
before(() => {
|
104
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
105
|
+
cy.barsPreLoaderWait();
|
106
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
107
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
108
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
109
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
110
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
111
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
|
112
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(20);
|
113
|
+
fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
114
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
115
|
+
});
|
116
|
+
|
117
|
+
Object.keys(enumerationOptions).forEach(option => {
|
118
|
+
it(`When "${option}" toggle button is selected in the text container identifiers section, then on switching to the preview tab text container numeration should not be displayed`, () => {
|
119
|
+
fillInTheGapsOverImageTextPage.steps.selectIdentifierToggleButton(option);
|
120
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
121
|
+
fillInTheGapsOverImageTextPage.steps.verifyResponseAreaNumerationNotExists();
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When user clicks on \'Check answer\' button then the numeration should not be displayed in the text containers', () => {
|
125
|
+
fillInTheGapsOverImageTextPage.steps.checkAnswer();
|
126
|
+
fillInTheGapsOverImageTextPage.steps.verifyResponseAreaNumerationNotExists();
|
127
|
+
});
|
128
|
+
|
129
|
+
it(`When the user switches to the "Grading view", then the "${option}" numeration should be displayed in the answer input fields as well as correct answer options in the correct answer section`, () => {
|
130
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
131
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldEnumeration(enumerationOptions[option]);
|
132
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesEnumeration(enumerationOptions[option]);
|
133
|
+
cy.log('Post step: Switch to Edit tab')
|
134
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
135
|
+
});
|
136
|
+
});
|
137
|
+
|
138
|
+
it('When the user selects "without enumeration" radio button, then in the "Grading view", numeration should not be displayed for answer input fields and in the correct answer section, the entire question preview should be displayed with correct answers', () => {
|
139
|
+
fillInTheGapsOverImageTextPage.steps.selectEnumerationType('without enumeration');
|
140
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
141
|
+
fillInTheGapsOverImageTextPage.steps.switchToGradingView();
|
142
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsOverImageTextPage.canvasImageInPreviewTab(), 1), 'visible');
|
143
|
+
fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesWithoutEnumeration(['Flower', 'Leaf']);
|
144
|
+
fillInTheGapsOverImageTextPage.steps.verifyResponseAreaNumerationNotExists();
|
145
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.correctAnswerResponseNumeration(), 'notExist');
|
146
|
+
});
|
147
|
+
|
148
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
149
|
+
fillInTheGapsOverImageTextPage.correctAnswerSectionWithoutEnumerationWrapper()
|
150
|
+
.within(() => {
|
151
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswerResponseWrapperWithoutEnumeration(), {
|
152
|
+
'color': css.color.text,
|
153
|
+
'font-size': css.fontSize.default,
|
154
|
+
'font-weight': css.fontWeight.regular
|
155
|
+
});
|
156
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswerResponseWrapperWithoutEnumeration().parents('.response-input-field'), {
|
157
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
158
|
+
});
|
159
|
+
})
|
160
|
+
});
|
161
|
+
|
162
|
+
|
163
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
164
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.correctAnswerSectionWithoutEnumerationWrapper().parents('[class*="question-preview-wrapper"]'));
|
165
|
+
});
|
166
|
+
});
|
167
|
+
|
168
|
+
describe('Additional settings: ARIA label for text containers - Contents in edit tab', () => {
|
169
|
+
abortEarlySetup();
|
170
|
+
before(() => {
|
171
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
172
|
+
cy.barsPreLoaderWait();
|
173
|
+
fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
174
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
175
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
176
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When the user has not added any text containers, then the "ARIA label for text containers" section should be displayed in the additional settings panel', () => {
|
180
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ariaLabelSectionLabel(), 'notExist');
|
181
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ariaLabelInputField(), 'notExist');
|
182
|
+
});
|
183
|
+
|
184
|
+
it('When the user adds text containers, then the "ARIA label for text containers" section should be displayed in the additional settings panel', () => {
|
185
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
186
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
187
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ariaLabelSectionLabel(), 'visible');
|
188
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ariaLabelInputField(), 'visible');
|
189
|
+
});
|
190
|
+
|
191
|
+
fillInTheGapsOverImageTextPage.tests.verifyAriaLabelSectionContents('text containers');
|
192
|
+
|
193
|
+
it('When the users adds a new text container, the count of the aria label text input fields should update accordingly', () => {
|
194
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
|
195
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.ariaLabelInputField(), 3);
|
196
|
+
fillInTheGapsOverImageTextPage.steps.verifyAriaLabelTextInputFields(2);
|
197
|
+
});
|
198
|
+
|
199
|
+
it('When the user deletes any text container, the count of the aria label texts input fields should update accordingly', () => {
|
200
|
+
fillInTheGapsOverImageTextPage.steps.removeResponseArea(1);
|
201
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.ariaLabelInputField(), 2);
|
202
|
+
fillInTheGapsOverImageTextPage.steps.verifyAriaLabelTextInputFields(0);
|
203
|
+
fillInTheGapsOverImageTextPage.steps.verifyAriaLabelTextInputFields(1);
|
204
|
+
});
|
205
|
+
|
206
|
+
it('When the user sets aria label, then in the answer input fields of the specify correct answer section, the aria labels should not change', () => {
|
207
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAriaLabelInputField(0, 'Add answer for response 1');
|
208
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelSpecifyCorrectAnswerSection(0, 'Enter answer');
|
209
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelSpecifyCorrectAnswerSection(1, 'Enter answer');
|
210
|
+
});
|
211
|
+
});
|
212
|
+
|
213
|
+
describe('Additional settings: ARIA label for text containers - functionality in preview tab', () => {
|
214
|
+
abortEarlySetup();
|
215
|
+
before(() => {
|
216
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
217
|
+
cy.barsPreLoaderWait();
|
218
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
219
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
220
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
|
221
|
+
fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
|
222
|
+
fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
|
223
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
224
|
+
});
|
225
|
+
|
226
|
+
it('When the user has not set \'ARIA label\' input field, then default aria labels should be present for the answer input fields in the preview tab', () => {
|
227
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Add answer for response 1');
|
228
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
229
|
+
});
|
230
|
+
|
231
|
+
it('When the user has set \'ARIA label\', then it should be present for the answer input fields in the preview tab', () => {
|
232
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
233
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
|
234
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
235
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Correct response 1');
|
236
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
237
|
+
});
|
238
|
+
|
239
|
+
it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
|
240
|
+
cy.checkAccessibility(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
241
|
+
});
|
242
|
+
|
243
|
+
it('When the user clears the set value in the \'ARIA label\' input field, then the default aria labels should be present for the answer input fields in the preview tab', () => {
|
244
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
245
|
+
fillInTheGapsOverImageTextPage.steps.clearTextInAriaLabelInputField(0);
|
246
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
247
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Add answer for response 1');
|
248
|
+
fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
249
|
+
});
|
250
|
+
});
|
251
|
+
});
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create item page - Fill in the gaps over image with text: Supported file types', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Supported file types functionality: device popup', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
});
|
16
|
+
|
17
|
+
const supportedFormatFiles = {
|
18
|
+
'jpg': 'highlightImage.jpg',
|
19
|
+
'jpeg': 'sample.jpeg',
|
20
|
+
'png': 'image.png',
|
21
|
+
'gif': 'sample.gif',
|
22
|
+
'svg': 'sample.svg'
|
23
|
+
};
|
24
|
+
|
25
|
+
Object.keys(supportedFormatFiles).forEach((fileType) => {
|
26
|
+
it(`User should be able to upload ${fileType} file in the image section using link text \'device\' and it should be displayed in the \'Image\' section and \'Preview tab\'`, () => {
|
27
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile(supportedFormatFiles[fileType]);
|
28
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
|
29
|
+
fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInBackgroundImageSection(fileType);
|
30
|
+
cy.log('Checking in preview tab')
|
31
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
32
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.canvasImageInPreviewTab(), 'visible');
|
33
|
+
fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInPreviewTab(fileType);
|
34
|
+
cy.log('Post step: Delete the image')
|
35
|
+
fillInTheGapsOverImageTextPage.steps.switchToEditTab();
|
36
|
+
fillInTheGapsOverImageTextPage.steps.deleteImage();
|
37
|
+
fillInTheGapsOverImageTextPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should be displayed', () => {
|
42
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('sample.heic');
|
43
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.');
|
44
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
|
45
|
+
});
|
46
|
+
|
47
|
+
fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
|
48
|
+
});;
|
49
|
+
});
|