itemengine-cypress-automation 1.0.142 → 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 +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +0 -43
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -642
@@ -0,0 +1,132 @@
|
|
1
|
+
import { fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
|
7
|
+
const options = ['Bat', 'Eagle'];
|
8
|
+
|
9
|
+
describe('Create Item page - Fill in the gaps over image - drag and drop: Additional settings', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional Settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyAdditionalSettingsAccordionProperties();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Additional settings: Font size contents', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandAdditionalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyFontSizeSectionContents();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional settings: Font size - functionality in edit tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
41
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
42
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
43
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
44
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(options);
|
45
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandAdditionalSettings();
|
46
|
+
});
|
47
|
+
|
48
|
+
Object.keys(fontSizes).forEach((option) => {
|
49
|
+
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`, () => {
|
50
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
51
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.fontSizeDropdown(), `${option}`);
|
52
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection(), {
|
53
|
+
'font-size': css.fontSize.default
|
54
|
+
});
|
55
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionText(), {
|
56
|
+
'font-size': fontSizes[option]
|
57
|
+
});
|
58
|
+
});
|
59
|
+
});
|
60
|
+
});
|
61
|
+
|
62
|
+
describe('Additional settings: Font size - functionality in preview tab', () => {
|
63
|
+
abortEarlySetup();
|
64
|
+
before(() => {
|
65
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
66
|
+
cy.barsPreLoaderWait();
|
67
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop into categories');
|
68
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
69
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
70
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
71
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
72
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(options);
|
73
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Bat': 0, 'Eagle': 1 });
|
74
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandAdditionalSettings();
|
75
|
+
});
|
76
|
+
|
77
|
+
Object.keys(fontSizes).forEach((option) => {
|
78
|
+
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`, () => {
|
79
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
80
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.fontSizeDropdown(), `${option}`);
|
81
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
82
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.questionInstructionsText(), {
|
83
|
+
'font-size': fontSizes[option]
|
84
|
+
});
|
85
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionText(), {
|
86
|
+
'font-size': fontSizes[option]
|
87
|
+
});
|
88
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0 });
|
89
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToGradingView();
|
90
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneNumeration(), {
|
91
|
+
'font-size': fontSizes[option]
|
92
|
+
});
|
93
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.correctAnswersNumeration(), {
|
94
|
+
'font-size': fontSizes[option]
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.correctAnswersLabel(), {
|
97
|
+
'font-size': fontSizes[option]
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.correctAnswersOptions(), {
|
100
|
+
'font-size': fontSizes[option]
|
101
|
+
});
|
102
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.correctIncorrectStatusMessageText(), {
|
103
|
+
'font-size': fontSizes[option]
|
104
|
+
});
|
105
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToStudentView();
|
106
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
|
107
|
+
});
|
108
|
+
});
|
109
|
+
});
|
110
|
+
|
111
|
+
describe('Additional settings: Accessibility section', () => {
|
112
|
+
abortEarlySetup();
|
113
|
+
before(() => {
|
114
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
115
|
+
cy.barsPreLoaderWait();
|
116
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandAdditionalSettings();
|
117
|
+
});
|
118
|
+
|
119
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
120
|
+
});
|
121
|
+
|
122
|
+
describe('Additional Settings: Details section', () => {
|
123
|
+
abortEarlySetup();
|
124
|
+
before(() => {
|
125
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
126
|
+
cy.barsPreLoaderWait();
|
127
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandAdditionalSettings();
|
128
|
+
});
|
129
|
+
|
130
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyDetailsSection();
|
131
|
+
});
|
132
|
+
});
|
@@ -0,0 +1,143 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
|
5
|
+
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
6
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
7
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
8
|
+
|
9
|
+
describe('fill in the gaps over image - dropdown - Additional settings', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyAdditionalSettingsAccordionProperties();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Additional settings: Font size - Contents in edit tab', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyFontSizeSectionContents();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional settings: Font size - functionality in edit tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
41
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
42
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
43
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
44
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
45
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
46
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
47
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
48
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
49
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
50
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
51
|
+
});
|
52
|
+
|
53
|
+
Object.keys(fontSizes).forEach((option) => {
|
54
|
+
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`, () => {
|
55
|
+
fillInTheGapsOverImageDropdownPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
56
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.fontSizeDropdown(), `${option}`);
|
57
|
+
fillInTheGapsOverImageDropdownPage.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
|
58
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownTextLabel(), {
|
59
|
+
'font-size': fontSizes[option]
|
60
|
+
});
|
61
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(correctAnswerArray[0]);
|
62
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownTextLabel(), {
|
63
|
+
'font-size': fontSizes[option]
|
64
|
+
});
|
65
|
+
});
|
66
|
+
});
|
67
|
+
});
|
68
|
+
|
69
|
+
describe('Additional settings: Font size - functionality in preview tab', () => {
|
70
|
+
abortEarlySetup();
|
71
|
+
before(() => {
|
72
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
73
|
+
cy.barsPreLoaderWait();
|
74
|
+
fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
75
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
76
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
77
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
78
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
79
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
80
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
81
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
82
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
83
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
84
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
85
|
+
});
|
86
|
+
|
87
|
+
Object.keys(fontSizes).forEach((option) => {
|
88
|
+
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`, () => {
|
89
|
+
fillInTheGapsOverImageDropdownPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
90
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.fontSizeDropdown(), `${option}`);
|
91
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
92
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.questionInstructionsText(), {
|
93
|
+
'font-size': fontSizes[option]
|
94
|
+
});
|
95
|
+
fillInTheGapsOverImageDropdownPage.steps.expandDropdownInPreviewTab(0);
|
96
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownTextLabel(), {
|
97
|
+
'font-size': fontSizes[option]
|
98
|
+
});
|
99
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(correctAnswerArray[0]);
|
100
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownTextLabel(), {
|
101
|
+
'font-size': fontSizes[option]
|
102
|
+
});
|
103
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
104
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), {
|
105
|
+
'font-size': fontSizes[option]
|
106
|
+
});
|
107
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.correctAnswerResponseNumeration(), {
|
108
|
+
'font-size': fontSizes[option]
|
109
|
+
});
|
110
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.correctAnswerResponse(), {
|
111
|
+
'font-size': fontSizes[option]
|
112
|
+
});
|
113
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.correctIncorrectStatusMessageText(), {
|
114
|
+
'font-size': fontSizes[option]
|
115
|
+
});
|
116
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToStudentView();
|
117
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
118
|
+
});
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
describe('Additional settings: Accessibility section', () => {
|
123
|
+
abortEarlySetup();
|
124
|
+
before(() => {
|
125
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
126
|
+
cy.barsPreLoaderWait();
|
127
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
128
|
+
});
|
129
|
+
|
130
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
131
|
+
});
|
132
|
+
|
133
|
+
describe('Additional Settings: Details section', () => {
|
134
|
+
abortEarlySetup();
|
135
|
+
before(() => {
|
136
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
137
|
+
cy.barsPreLoaderWait();
|
138
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
139
|
+
});
|
140
|
+
|
141
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyDetailsSection();
|
142
|
+
});
|
143
|
+
});
|
@@ -0,0 +1,345 @@
|
|
1
|
+
import { fillInTheGapsOverImageDropdownPage } 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 optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
12
|
+
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
13
|
+
const correctAnswerArray = ['Flower', 'Leaf'];
|
14
|
+
const css = Cypress.env('css');
|
15
|
+
|
16
|
+
describe('Fill In the gaps over image - dropdown - Additional settings : Placeholder text, Grading view, ARIA label for dropdowns', () => {
|
17
|
+
before(() => {
|
18
|
+
cy.loginAs('admin');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Additional settings: Placeholder text - Contents in edit tab', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
27
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
28
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
29
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
30
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
31
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
32
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
33
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
34
|
+
});
|
35
|
+
|
36
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPlaceholderTextSectionContents('dropdown');
|
37
|
+
|
38
|
+
it('When the user checks the "Customize placeholder text for individual dropdowns" checkbox, "Placeholder text for dropdowns" label and two input fields for individual dropdowns should be displayed', () => {
|
39
|
+
fillInTheGapsOverImageDropdownPage.steps.checkCustomizePlaceholderTextCheckbox();
|
40
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.individualPlaceholderTextInputField(), 2);
|
41
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
42
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
43
|
+
});
|
44
|
+
|
45
|
+
it('When the users adds a new dropdown, the count of the placeholder text input fields should update accordingly', () => {
|
46
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea();
|
47
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.individualPlaceholderTextInputField(), 3);
|
48
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(2);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('When the user deletes any dropdown, the count of the placeholder text input fields should update accordingly', () => {
|
52
|
+
fillInTheGapsOverImageDropdownPage.steps.removeResponseArea(2);
|
53
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.individualPlaceholderTextInputField(), 2);
|
54
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
55
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
56
|
+
});
|
57
|
+
});
|
58
|
+
|
59
|
+
describe('Additional settings: Placeholder text - functionality in edit tab', () => {
|
60
|
+
abortEarlySetup();
|
61
|
+
before(() => {
|
62
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
63
|
+
cy.barsPreLoaderWait();
|
64
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
65
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
66
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
67
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
68
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
69
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
70
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
71
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the specify correct answer section dropdown', () => {
|
75
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
76
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
77
|
+
});
|
78
|
+
|
79
|
+
it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the specify correct answer section dropdown', () => {
|
80
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToPlaceholderTextInputField('Add answer');
|
81
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Add answer');
|
82
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
83
|
+
});
|
84
|
+
|
85
|
+
//Comment: not possible to check css of placeholder since it is added as an attribute, properties of placeholder is not visible in dev tools
|
86
|
+
|
87
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
88
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection());
|
89
|
+
});
|
90
|
+
|
91
|
+
it('When the user selects an option in the dropdown, then the placeholder text should disappear, when the user deletes the option set as correct answer, then the placeholder text should re-appear for the dropdown', () => {
|
92
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, 'Flower');
|
93
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
94
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
95
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToDropdownOptionsTab(0);
|
96
|
+
fillInTheGapsOverImageDropdownPage.steps.deleteOption(0);
|
97
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Add answer');
|
98
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
99
|
+
});
|
100
|
+
|
101
|
+
it('When the user removes the placeholder text input field, then placeholder text should get updated accordingly for both the dropdowns', () => {
|
102
|
+
fillInTheGapsOverImageDropdownPage.steps.clearPlaceholderTextInputField();
|
103
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
104
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When "Customize placeholder text for individual dropdowns" checkbox is checked and \'Placeholder text\' input fields for individual dropdowns are kept empty, then no \'Placeholder text\' should be displayed in the specify correct answer section dropdowns', () => {
|
108
|
+
fillInTheGapsOverImageDropdownPage.steps.checkCustomizePlaceholderTextCheckbox();
|
109
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
110
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When the user has set a placeholder text in either individual placeholder text input field, then placeholder text should be displayed for the respective specify correct answer section dropdown', () => {
|
114
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToIndividualPlaceholderTextInputField(0, 'Response a');
|
115
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response a');
|
116
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
117
|
+
});
|
118
|
+
|
119
|
+
it('When the user removes the placeholder text from individual placeholder text input field, then placeholder text should get updated accordingly for both the specify correct answer section dropdowns', () => {
|
120
|
+
fillInTheGapsOverImageDropdownPage.steps.clearIndividualPlaceholderTextInputField(0);
|
121
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
122
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When the user has set placeholder text in individual placeholder text input field, then it should override the placeholder text set in the global placeholder text input field', () => {
|
126
|
+
cy.log('Pre step: Adding global placeholder text and individual placeholder text')
|
127
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToPlaceholderTextInputField('Global placeholder');
|
128
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToIndividualPlaceholderTextInputField(0, 'Response 1');
|
129
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response 1');
|
130
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Global placeholder');
|
131
|
+
});
|
132
|
+
|
133
|
+
it('Accessibility of \'Placeholder text\' in preview tab', { tags: 'a11y' }, () => {
|
134
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection());
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user selects an option from the dropdown, then the placeholder text should disappear and on switching from edit tab to preview tab, the placeholder text should re-appear in the preview tab', () => {
|
138
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, 'Petal');
|
139
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
140
|
+
fillInTheGapsOverImageDropdownPage.steps.deleteOption(0);
|
141
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response 1');
|
142
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Global placeholder');
|
143
|
+
});
|
144
|
+
});
|
145
|
+
|
146
|
+
describe('Additional settings: Placeholder text - functionality in preview tab', () => {
|
147
|
+
abortEarlySetup();
|
148
|
+
before(() => {
|
149
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
150
|
+
cy.barsPreLoaderWait();
|
151
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
152
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
153
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
154
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
155
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
156
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
157
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
158
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
159
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
160
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
161
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
162
|
+
});
|
163
|
+
|
164
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyPlaceholderTextPreviewTabFunctionality();
|
165
|
+
|
166
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyIndividualPlaceholderTextPreviewTabFunctionality();
|
167
|
+
});
|
168
|
+
|
169
|
+
describe('Additional settings: Grading view - Contents in edit tab', () => {
|
170
|
+
abortEarlySetup();
|
171
|
+
before(() => {
|
172
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
173
|
+
cy.barsPreLoaderWait();
|
174
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
175
|
+
});
|
176
|
+
|
177
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyGradingViewEnumerationSectionContents('Dropdown');
|
178
|
+
|
179
|
+
it('When the user selects "Without enumeration" radio button, the identifiers section should disappear', () => {
|
180
|
+
fillInTheGapsOverImageDropdownPage.steps.selectEnumerationType('without enumeration');
|
181
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.identifiersLabel(), 'notExist');
|
182
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.numericalToggleButton(), 'notExist');
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When the user selects "With enumeration" radio button again, the identifiers section should appear again', () => {
|
186
|
+
fillInTheGapsOverImageDropdownPage.steps.selectEnumerationType('with enumeration');
|
187
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.identifiersLabel(), 'visible');
|
188
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.numericalToggleButton(), 'visible');
|
189
|
+
})
|
190
|
+
});
|
191
|
+
|
192
|
+
describe('Additional settings: Grading view - functionality in preview tab', () => {
|
193
|
+
abortEarlySetup();
|
194
|
+
before(() => {
|
195
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
196
|
+
cy.barsPreLoaderWait();
|
197
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
198
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
199
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
200
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
201
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
202
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
203
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
204
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
205
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
206
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
207
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
208
|
+
});
|
209
|
+
|
210
|
+
Object.keys(enumerationOptions).forEach(option => {
|
211
|
+
it(`When "${option}" toggle button is selected in the dropdown identifiers section, then on switching to the preview tab dropdown numeration should not be displayed`, () => {
|
212
|
+
fillInTheGapsOverImageDropdownPage.steps.selectIdentifierToggleButton(option);
|
213
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
214
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
215
|
+
});
|
216
|
+
|
217
|
+
it('When user clicks on \'Check answer\' button then the numeration should not be displayed in the dropdowns', () => {
|
218
|
+
fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
|
219
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
220
|
+
});
|
221
|
+
|
222
|
+
it(`When the user switches to the "Grading view", then the "${option}" numeration should be displayed in the dropdowns as well as correct answer options in the correct answer section`, () => {
|
223
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
224
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownEnumeration(enumerationOptions[option]);
|
225
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerDropdownEnumeration(enumerationOptions[option]);
|
226
|
+
cy.log('Post step: Switch to Edit tab')
|
227
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
228
|
+
});
|
229
|
+
});
|
230
|
+
|
231
|
+
it('When the user selects "without enumeration" radio button, then in the "Grading view", numeration should not be displayed for dropdowns and in the correct answer section, the entire question preview should be displayed with correct answers', () => {
|
232
|
+
fillInTheGapsOverImageDropdownPage.steps.selectEnumerationType('without enumeration');
|
233
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
234
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
|
235
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab(), 1), 'visible');
|
236
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesWithoutEnumeration(['Flower', 'Leaf']);
|
237
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
238
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.correctAnswerResponseNumeration(), 'notExist');
|
239
|
+
});
|
240
|
+
|
241
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
242
|
+
fillInTheGapsOverImageDropdownPage.correctAnswerSectionWrapper()
|
243
|
+
.within(() => {
|
244
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownTextLabel(), {
|
245
|
+
'color': css.color.text,
|
246
|
+
'font-size': css.fontSize.default,
|
247
|
+
'font-weight': css.fontWeight.regular
|
248
|
+
});
|
249
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapperWithoutEnumeration().parent().find('[role="combobox"]'), {
|
250
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
251
|
+
});
|
252
|
+
});
|
253
|
+
});
|
254
|
+
|
255
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
256
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapperWithoutEnumeration().parents('[class*="question-preview-wrapper"]'));
|
257
|
+
});
|
258
|
+
});
|
259
|
+
|
260
|
+
describe('Additional settings: ARIA label for dropdowns - Contents in edit tab', () => {
|
261
|
+
abortEarlySetup();
|
262
|
+
before(() => {
|
263
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
264
|
+
cy.barsPreLoaderWait();
|
265
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
266
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
267
|
+
fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
268
|
+
});
|
269
|
+
|
270
|
+
it('When the user has not added any dropdowns, then the "ARIA label for dropdowns" section should be displayed in the additional settings panel', () => {
|
271
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.ariaLabelSectionLabel(), 'notExist');
|
272
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.ariaLabelInputField(), 'notExist');
|
273
|
+
});
|
274
|
+
|
275
|
+
it('When the user adds dropdowns, then the "ARIA label for dropdowns" section should be displayed in the additional settings panel', () => {
|
276
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
277
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(80);
|
278
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.ariaLabelSectionLabel(), 'visible');
|
279
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.ariaLabelInputField(), 'visible');
|
280
|
+
});
|
281
|
+
|
282
|
+
fillInTheGapsOverImageDropdownPage.tests.verifyAriaLabelSectionContents('dropdown');
|
283
|
+
|
284
|
+
it('When the users adds a new dropdown, the count of the aria label text input fields should update accordingly', () => {
|
285
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea();
|
286
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.ariaLabelInputField(), 3);
|
287
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAriaLabelTextInputFields(2);
|
288
|
+
});
|
289
|
+
|
290
|
+
it('When the user deletes any dropdown, the count of the aria label texts input fields should update accordingly', () => {
|
291
|
+
fillInTheGapsOverImageDropdownPage.steps.removeResponseArea(1);
|
292
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.ariaLabelInputField(), 2);
|
293
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAriaLabelTextInputFields(0);
|
294
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyAriaLabelTextInputFields(1);
|
295
|
+
});
|
296
|
+
|
297
|
+
it('When the user sets aria label, then in the dropdowns of the specify correct answer section, the aria labels should get updated accordingly', () => {
|
298
|
+
fillInTheGapsOverImageDropdownPage.steps.enterTextInAriaLabelInputField(0, 'Select correct option');
|
299
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelSpecifyCorrectAnswerSection(0, 'Select correct option');
|
300
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelSpecifyCorrectAnswerSection(1, 'Add answer for response 2');
|
301
|
+
});
|
302
|
+
});
|
303
|
+
|
304
|
+
describe('Additional settings: ARIA label for dropdowns - functionality in preview tab', () => {
|
305
|
+
abortEarlySetup();
|
306
|
+
before(() => {
|
307
|
+
fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
|
308
|
+
fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
|
309
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
|
310
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
|
311
|
+
fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
|
312
|
+
fillInTheGapsOverImageDropdownPage.steps.allotPoints(20);
|
313
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
314
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
315
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
316
|
+
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]); fillInTheGapsOverImageDropdownPage.steps.expandAdditionalSettings();
|
317
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
318
|
+
});
|
319
|
+
|
320
|
+
it('When the user has not set \'ARIA label\' input field, then default aria labels should be present for the dropdowns in the preview tab', () => {
|
321
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Add answer for response 1');
|
322
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
323
|
+
});
|
324
|
+
|
325
|
+
it('When the user has set \'ARIA label\', then it should be present for the dropdowns in the preview tab', () => {
|
326
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
327
|
+
fillInTheGapsOverImageDropdownPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
|
328
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
329
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Correct response 1');
|
330
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
331
|
+
});
|
332
|
+
|
333
|
+
it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
|
334
|
+
cy.checkAccessibility(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
335
|
+
});
|
336
|
+
|
337
|
+
it('When the user clears the set value in the \'ARIA label\' input field, then the default aria labels should be present for the dropdowns in the preview tab', () => {
|
338
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
339
|
+
fillInTheGapsOverImageDropdownPage.steps.clearTextInAriaLabelInputField(0);
|
340
|
+
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
341
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Add answer for response 1');
|
342
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
343
|
+
});
|
344
|
+
});
|
345
|
+
});
|