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,138 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } 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 with dropdown - Additional settings', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsDropdownPage.tests.verifyAdditionalSettingsAccordionProperties();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Additional settings: Font size - Contents in edit tab', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
fillInTheGapsDropdownPage.tests.verifyFontSizeSectionContents();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional settings: Font size - functionality in edit tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
41
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
42
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
43
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
44
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
45
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
46
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
47
|
+
});
|
48
|
+
|
49
|
+
Object.keys(fontSizes).forEach((option) => {
|
50
|
+
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`, () => {
|
51
|
+
fillInTheGapsDropdownPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
52
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.fontSizeDropdown(), `${option}`);
|
53
|
+
fillInTheGapsDropdownPage.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
|
54
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownTextLabel(), {
|
55
|
+
'font-size': fontSizes[option]
|
56
|
+
});
|
57
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(correctAnswerArray[0]);
|
58
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownTextLabel(), {
|
59
|
+
'font-size': fontSizes[option]
|
60
|
+
});
|
61
|
+
});
|
62
|
+
});
|
63
|
+
});
|
64
|
+
|
65
|
+
describe('Additional settings: Font size - functionality in preview tab', () => {
|
66
|
+
abortEarlySetup();
|
67
|
+
before(() => {
|
68
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
69
|
+
cy.barsPreLoaderWait();
|
70
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
71
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
72
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
73
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
74
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
75
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
76
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
77
|
+
});
|
78
|
+
|
79
|
+
Object.keys(fontSizes).forEach((option) => {
|
80
|
+
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`, () => {
|
81
|
+
fillInTheGapsDropdownPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
82
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.fontSizeDropdown(), `${option}`);
|
83
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
84
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.questionInstructionsText(), {
|
85
|
+
'font-size': fontSizes[option]
|
86
|
+
});
|
87
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.questionContainerPreviewTab(), {
|
88
|
+
'font-size': fontSizes[option]
|
89
|
+
});
|
90
|
+
fillInTheGapsDropdownPage.steps.expandDropdownInPreviewTab(0);
|
91
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownTextLabel(), {
|
92
|
+
'font-size': fontSizes[option]
|
93
|
+
});
|
94
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromDropdownList(correctAnswerArray[0]);
|
95
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownTextLabel(), {
|
96
|
+
'font-size': fontSizes[option]
|
97
|
+
});
|
98
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
99
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswersLabel(), {
|
100
|
+
'font-size': fontSizes[option]
|
101
|
+
});
|
102
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswerResponseNumeration(), {
|
103
|
+
'font-size': fontSizes[option]
|
104
|
+
});
|
105
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswerResponse(), {
|
106
|
+
'font-size': fontSizes[option]
|
107
|
+
});
|
108
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctIncorrectStatusMessageText(), {
|
109
|
+
'font-size': fontSizes[option]
|
110
|
+
});
|
111
|
+
fillInTheGapsDropdownPage.steps.switchToStudentView();
|
112
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
113
|
+
});
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
117
|
+
describe('Additional settings: Accessibility section', () => {
|
118
|
+
abortEarlySetup();
|
119
|
+
before(() => {
|
120
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
121
|
+
cy.barsPreLoaderWait();
|
122
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
123
|
+
});
|
124
|
+
|
125
|
+
fillInTheGapsDropdownPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
126
|
+
});
|
127
|
+
|
128
|
+
describe('Additional Settings: Details section', () => {
|
129
|
+
abortEarlySetup();
|
130
|
+
before(() => {
|
131
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
132
|
+
cy.barsPreLoaderWait();
|
133
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
134
|
+
});
|
135
|
+
|
136
|
+
fillInTheGapsDropdownPage.tests.verifyDetailsSection();
|
137
|
+
});
|
138
|
+
});
|
@@ -0,0 +1,309 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } 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 with 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
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
27
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
28
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
29
|
+
});
|
30
|
+
|
31
|
+
fillInTheGapsDropdownPage.tests.verifyPlaceholderTextSectionContents('dropdown');
|
32
|
+
|
33
|
+
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', () => {
|
34
|
+
fillInTheGapsDropdownPage.steps.checkCustomizePlaceholderTextCheckbox();
|
35
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.individualPlaceholderTextInputField(), 2);
|
36
|
+
fillInTheGapsDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
37
|
+
fillInTheGapsDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
38
|
+
});
|
39
|
+
|
40
|
+
it('When the users adds a new dropdown, the count of the placeholder text input fields should update accordingly', () => {
|
41
|
+
fillInTheGapsDropdownPage.steps.addResponseArea();
|
42
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.individualPlaceholderTextInputField(), 3);
|
43
|
+
fillInTheGapsDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(2);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user deletes any dropdown, the count of the placeholder text input fields should update accordingly', () => {
|
47
|
+
fillInTheGapsDropdownPage.steps.deleteAResponseArea(2);
|
48
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.individualPlaceholderTextInputField(), 2);
|
49
|
+
fillInTheGapsDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(0);
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyIndividualPlaceholderTextInputFields(1);
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
describe('Additional Settings: Placeholder text - functionality in edit tab', () => {
|
55
|
+
abortEarlySetup();
|
56
|
+
before(() => {
|
57
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
58
|
+
cy.barsPreLoaderWait();
|
59
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
60
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
61
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
62
|
+
});
|
63
|
+
|
64
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the specify correct answer section dropdown', () => {
|
65
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
66
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
67
|
+
});
|
68
|
+
|
69
|
+
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', () => {
|
70
|
+
fillInTheGapsDropdownPage.steps.addInputToPlaceholderTextInputField('Add answer');
|
71
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Add answer');
|
72
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
73
|
+
});
|
74
|
+
|
75
|
+
//Comment: not possible to check css of placeholder since it is added as an attribute, properties of placeholder is not visible in dev tools
|
76
|
+
|
77
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
78
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.dropdownSpecifyCorrectAnswerSection());
|
79
|
+
});
|
80
|
+
|
81
|
+
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', () => {
|
82
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, 'Flower');
|
83
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
84
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
85
|
+
fillInTheGapsDropdownPage.steps.navigateToDropdownOptionsTab(0);
|
86
|
+
fillInTheGapsDropdownPage.steps.deleteOption(0);
|
87
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Add answer');
|
88
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Add answer');
|
89
|
+
});
|
90
|
+
|
91
|
+
it('When the user removes the placeholder text input field, then placeholder text should get updated accordingly for both the dropdowns', () => {
|
92
|
+
fillInTheGapsDropdownPage.steps.clearPlaceholderTextInputField();
|
93
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
94
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
95
|
+
});
|
96
|
+
|
97
|
+
it('When "Customize placeholder text for individual text containers" checkbox is checked and \'Placeholder text\' input fields for individual text containers are kept empty, then no \'Placeholder text\' should be displayed in the specify correct answer section dropdowns', () => {
|
98
|
+
fillInTheGapsDropdownPage.steps.checkCustomizePlaceholderTextCheckbox();
|
99
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
100
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
101
|
+
});
|
102
|
+
|
103
|
+
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', () => {
|
104
|
+
fillInTheGapsDropdownPage.steps.addInputToIndividualPlaceholderTextInputField(0, 'Response a');
|
105
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response a');
|
106
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
107
|
+
});
|
108
|
+
|
109
|
+
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', () => {
|
110
|
+
fillInTheGapsDropdownPage.steps.clearIndividualPlaceholderTextInputField(0);
|
111
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
112
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(1);
|
113
|
+
});
|
114
|
+
|
115
|
+
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', () => {
|
116
|
+
cy.log('Pre step: Adding global placeholder text and individual placeholder text')
|
117
|
+
fillInTheGapsDropdownPage.steps.addInputToPlaceholderTextInputField('Global placeholder');
|
118
|
+
fillInTheGapsDropdownPage.steps.addInputToIndividualPlaceholderTextInputField(0, 'Response 1');
|
119
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response 1');
|
120
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Global placeholder');
|
121
|
+
});
|
122
|
+
|
123
|
+
it('Accessibility of \'Placeholder text\' in preview tab', { tags: 'a11y' }, () => {
|
124
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.dropdownSpecifyCorrectAnswerSection());
|
125
|
+
});
|
126
|
+
|
127
|
+
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', () => {
|
128
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, 'Petal');
|
129
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextNotExistsSpecifyCorrectAnswerSection(0);
|
130
|
+
fillInTheGapsDropdownPage.steps.deleteOption(0);
|
131
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(0, 'Response 1');
|
132
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownPlaceholderTextSpecifyCorrectAnswerSection(1, 'Global placeholder');
|
133
|
+
});
|
134
|
+
});
|
135
|
+
|
136
|
+
describe('Additional Settings: Placeholder text - functionality in preview tab', () => {
|
137
|
+
abortEarlySetup();
|
138
|
+
before(() => {
|
139
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
140
|
+
cy.barsPreLoaderWait();
|
141
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
142
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
143
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
144
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
145
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
146
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
147
|
+
});
|
148
|
+
|
149
|
+
fillInTheGapsDropdownPage.tests.verifyPlaceholderTextPreviewTabFunctionality();
|
150
|
+
|
151
|
+
fillInTheGapsDropdownPage.tests.verifyIndividualPlaceholderTextPreviewTabFunctionality();
|
152
|
+
});
|
153
|
+
|
154
|
+
describe('Additional Settings: Grading view - Contents in edit tab', () => {
|
155
|
+
abortEarlySetup();
|
156
|
+
before(() => {
|
157
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
158
|
+
cy.barsPreLoaderWait();
|
159
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
160
|
+
});
|
161
|
+
|
162
|
+
fillInTheGapsDropdownPage.tests.verifyGradingViewEnumerationSectionContents('Dropdown');
|
163
|
+
|
164
|
+
it('When the user selects "Without enumeration" radio button, the identifiers section should disappear', () => {
|
165
|
+
fillInTheGapsDropdownPage.steps.selectEnumerationType('without enumeration');
|
166
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.identifiersLabel(), 'notExist');
|
167
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.numericalToggleButton(), 'notExist');
|
168
|
+
});
|
169
|
+
|
170
|
+
it('When the user selects "With enumeration" radio button again, the identifiers section should appear again', () => {
|
171
|
+
fillInTheGapsDropdownPage.steps.selectEnumerationType('with enumeration');
|
172
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.identifiersLabel(), 'visible');
|
173
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.numericalToggleButton(), 'visible');
|
174
|
+
})
|
175
|
+
});
|
176
|
+
|
177
|
+
describe('Additional settings: Grading view - functionality in preview tab', () => {
|
178
|
+
abortEarlySetup();
|
179
|
+
before(() => {
|
180
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
181
|
+
cy.barsPreLoaderWait();
|
182
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
183
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
184
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
185
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
186
|
+
fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
187
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
188
|
+
});
|
189
|
+
|
190
|
+
Object.keys(enumerationOptions).forEach(option => {
|
191
|
+
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`, () => {
|
192
|
+
fillInTheGapsDropdownPage.steps.selectIdentifierToggleButton(option);
|
193
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
194
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
195
|
+
});
|
196
|
+
|
197
|
+
it('When user clicks on \'Check answer\' button then the numeration should not be displayed in the dropdowns', () => {
|
198
|
+
fillInTheGapsDropdownPage.steps.checkAnswer();
|
199
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
200
|
+
});
|
201
|
+
|
202
|
+
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`, () => {
|
203
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
204
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownEnumeration(enumerationOptions[option]);
|
205
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerDropdownEnumeration(enumerationOptions[option]);
|
206
|
+
cy.log('Post step: Switch to Edit tab')
|
207
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
208
|
+
});
|
209
|
+
});
|
210
|
+
|
211
|
+
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', () => {
|
212
|
+
fillInTheGapsDropdownPage.steps.selectEnumerationType('without enumeration');
|
213
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
214
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
215
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswerSectionWithoutEnumerationWrapper(), 'Lorem ipsum dolor sit amet, \nFlower\n\nonsectetur adipiscing elit. Ut pellentesque tinciduntornare. Integer porttitor est quis urna porttitor, eget tempus tellus dapibus \nLeaf\n');
|
216
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesWithoutEnumeration(['Flower', 'Leaf']);
|
217
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationNotExistsPreviewTab();
|
218
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.correctAnswerResponseNumeration(), 'notExist');
|
219
|
+
});
|
220
|
+
|
221
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
222
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswerSectionWithoutEnumerationWrapper(), {
|
223
|
+
'color': css.color.text,
|
224
|
+
'font-size': css.fontSize.default,
|
225
|
+
'font-weight': css.fontWeight.regular
|
226
|
+
});
|
227
|
+
fillInTheGapsDropdownPage.correctAnswerSectionWithoutEnumerationWrapper()
|
228
|
+
.within(() => {
|
229
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.dropdownTextLabel(), {
|
230
|
+
'color': css.color.text,
|
231
|
+
'font-size': css.fontSize.default,
|
232
|
+
'font-weight': css.fontWeight.regular
|
233
|
+
});
|
234
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.correctAnswerResponseWrapperWithoutEnumeration().parent().find('[role="combobox"]'), {
|
235
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
236
|
+
});
|
237
|
+
});
|
238
|
+
});
|
239
|
+
|
240
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
241
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.correctAnswerSectionWithoutEnumerationWrapper().parents('[class*="question-preview-wrapper"]'));
|
242
|
+
});
|
243
|
+
});
|
244
|
+
|
245
|
+
describe('Additional settings: ARIA label for dropdowns - Contents in edit tab', () => {
|
246
|
+
abortEarlySetup();
|
247
|
+
before(() => {
|
248
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
249
|
+
cy.barsPreLoaderWait();
|
250
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
251
|
+
});
|
252
|
+
|
253
|
+
fillInTheGapsDropdownPage.tests.verifyAriaLabelSectionContents('dropdown');
|
254
|
+
|
255
|
+
it('When the users adds a new dropdown, the count of the aria label text input fields should update accordingly', () => {
|
256
|
+
fillInTheGapsDropdownPage.steps.addResponseArea();
|
257
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.ariaLabelInputField(), 3);
|
258
|
+
fillInTheGapsDropdownPage.steps.verifyAriaLabelTextInputFields(2);
|
259
|
+
});
|
260
|
+
|
261
|
+
it('When the user deletes any dropdown, the count of the aria label texts input fields should update accordingly', () => {
|
262
|
+
fillInTheGapsDropdownPage.steps.deleteAResponseArea(1);
|
263
|
+
utilities.verifyElementCount(fillInTheGapsDropdownPage.ariaLabelInputField(), 2);
|
264
|
+
fillInTheGapsDropdownPage.steps.verifyAriaLabelTextInputFields(0);
|
265
|
+
fillInTheGapsDropdownPage.steps.verifyAriaLabelTextInputFields(1);
|
266
|
+
});
|
267
|
+
|
268
|
+
it('When the user sets aria label, then in the dropdowns of the specify correct answer section, the aria labels should get updated accordingly', () => {
|
269
|
+
fillInTheGapsDropdownPage.steps.enterTextInAriaLabelInputField(0, 'Select correct option');
|
270
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelSpecifyCorrectAnswerSection(0, 'Select correct option');
|
271
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelSpecifyCorrectAnswerSection(1, 'Add answer for response 2');
|
272
|
+
});
|
273
|
+
});
|
274
|
+
|
275
|
+
describe('Additional settings: ARIA label for dropdowns - functionality in preview tab', () => {
|
276
|
+
abortEarlySetup();
|
277
|
+
before(() => {
|
278
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
279
|
+
cy.barsPreLoaderWait();
|
280
|
+
fillInTheGapsDropdownPage.steps.expandAdditionalSettings();
|
281
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
282
|
+
});
|
283
|
+
|
284
|
+
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', () => {
|
285
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Add answer for response 1');
|
286
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
287
|
+
});
|
288
|
+
|
289
|
+
it('When the user has set \'ARIA label\', then it should be present for the dropdowns in the preview tab', () => {
|
290
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
291
|
+
fillInTheGapsDropdownPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
|
292
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
293
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Correct response 1');
|
294
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
295
|
+
});
|
296
|
+
|
297
|
+
it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
|
298
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.dropdownPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
299
|
+
});
|
300
|
+
|
301
|
+
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', () => {
|
302
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
303
|
+
fillInTheGapsDropdownPage.steps.clearTextInAriaLabelInputField(0);
|
304
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
305
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(0, 'Add answer for response 1');
|
306
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownAriaLabelPreviewTab(1, 'Add answer for response 2');
|
307
|
+
});
|
308
|
+
});
|
309
|
+
});
|
@@ -0,0 +1,181 @@
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsDropdownPage } from "../../../pages";
|
2
|
+
import utilities from "../../../support/helpers/utilities";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page - Fill in the gaps with dropdown: Dropdown settings', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Dropdown settings - Contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
it('When the user clicks on a Dropdown settings button, then Dropdown settings popup should be displayed with the title \'Dropdown settings\'', () => {
|
19
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
20
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
21
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBoxTitle(), 'visible');
|
22
|
+
utilities.verifyInnerText(dialogBoxBase.dialogBoxTitle(), 'Dropdown settings');
|
23
|
+
});
|
24
|
+
|
25
|
+
it('\'Width (px)\' label and input field with default value should be displayed. \'Height (px)\' label and input field should not be displayed', () => {
|
26
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.responseAreaSettingsWidthLabel(), 'Width (px)');
|
27
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.responseAreaSettingsWidthLabel(), 'visible');
|
28
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaSettingsWidthInputFieldValue(120);
|
29
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.responseAreaSettingsHeightLabel(), 'notExist');
|
30
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.responseAreaSettingsHeightInputField(), 'notExist');
|
31
|
+
});
|
32
|
+
|
33
|
+
it('The minimum allowed value for \'Width (px)\' input field should be \'120\'', () => {
|
34
|
+
fillInTheGapsDropdownPage.steps.verifyMinimumValueOfWidthInputField();
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When user gives an input lower than \'120\' in \'Width (px)\' input field, then the input field value should be automatically set to 120', () => {
|
38
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(50);
|
39
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaSettingsWidthInputFieldValue(120);
|
40
|
+
});
|
41
|
+
|
42
|
+
it('\'Set for all dropdowns\' label and checkbox should be displayed and by default the checkbox should be checked', () => {
|
43
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.setForAllDropdownsLabel(), 'Set for all dropdowns');
|
44
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.setForAllDropdownsLabel(), 'visible');
|
45
|
+
fillInTheGapsDropdownPage.steps.verifySetForAllDropdownsCheckboxChecked();
|
46
|
+
});
|
47
|
+
|
48
|
+
it('\'OK\' and \'Cancel\' button should be displayed in the popup', () => {
|
49
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.responseAreaSettingsCancelButton(), 'Cancel');
|
50
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.responseAreaSettingsCancelButton(), 'visible');
|
51
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.responseAreaSettingsOkButton(), 'OK');
|
52
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.responseAreaSettingsOkButton(), 'visible');
|
53
|
+
});
|
54
|
+
|
55
|
+
it('When user updates any value and clicks on \'Cancel\' button, then the Dropdown settings popup should close and the updated values should not be saved', () => {
|
56
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(150);
|
57
|
+
fillInTheGapsDropdownPage.steps.uncheckSetForAllDropdownsCheckbox();
|
58
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsCancelButton();
|
59
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
60
|
+
cy.log('Reopening Dropdown settings popup and verifying changes not retained');
|
61
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
62
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaSettingsWidthInputFieldValue(120);
|
63
|
+
fillInTheGapsDropdownPage.steps.verifySetForAllDropdownsCheckboxChecked();
|
64
|
+
});
|
65
|
+
|
66
|
+
it('When user updates any value and clicks on \'OK\' button, then the Dropdown settings popup should close and the updated values should be saved', () => {
|
67
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(150);
|
68
|
+
fillInTheGapsDropdownPage.steps.uncheckSetForAllDropdownsCheckbox();
|
69
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsOkButton();
|
70
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
71
|
+
cy.log('Reopening Dropdown settings popup and verifying changes are retained');
|
72
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
73
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaSettingsWidthInputFieldValue(150);
|
74
|
+
fillInTheGapsDropdownPage.steps.verifySetForAllDropdownsCheckboxUnchecked();
|
75
|
+
});
|
76
|
+
|
77
|
+
it('CSS of dropdown container settings popup', { tags: 'css' }, () => {
|
78
|
+
utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
|
79
|
+
'color': css.color.flyoutTitle,
|
80
|
+
'font-size': css.fontSize.heading,
|
81
|
+
'font-weight': css.fontWeight.semibold
|
82
|
+
});
|
83
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.responseAreaSettingsWidthLabel(), {
|
84
|
+
'color': css.color.labels,
|
85
|
+
'font-size': css.fontSize.normal,
|
86
|
+
'font-weight': css.fontWeight.semibold
|
87
|
+
});
|
88
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.responseAreaSettingsWidthInputField(), {
|
89
|
+
'color': css.color.text,
|
90
|
+
'font-size': css.fontSize.default,
|
91
|
+
'font-weight': css.fontWeight.regular
|
92
|
+
});
|
93
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.setForAllDropdownsLabel(), {
|
94
|
+
'color': css.color.labelText,
|
95
|
+
'font-size': css.fontSize.normal,
|
96
|
+
'font-weight': css.fontWeight.regular
|
97
|
+
});
|
98
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.responseAreaSettingsCancelButton(), {
|
99
|
+
'color': css.color.secondaryBtn,
|
100
|
+
'font-size': css.fontSize.default,
|
101
|
+
'font-weight': css.fontWeight.semibold,
|
102
|
+
'background-color': css.color.transparent
|
103
|
+
});
|
104
|
+
utilities.verifyCSS(fillInTheGapsDropdownPage.responseAreaSettingsOkButton(), {
|
105
|
+
'color': css.color.primaryBtn,
|
106
|
+
'font-size': css.fontSize.default,
|
107
|
+
'font-weight': css.fontWeight.semibold,
|
108
|
+
'background-color': css.color.primaryBtnBg
|
109
|
+
});
|
110
|
+
});
|
111
|
+
|
112
|
+
it('Accessibility of dropdown container settings popup', { tags: 'css' }, () => {
|
113
|
+
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
117
|
+
describe('Dropdown settings - Width input field functionality in Edit tab', () => {
|
118
|
+
abortEarlySetup();
|
119
|
+
before(() => {
|
120
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
121
|
+
cy.barsPreLoaderWait();
|
122
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When \'Set for all dropdowns\' checkbox is checked, user updates the width input field value and clicks on OK, then width of all response areas in question input field should be updated', () => {
|
126
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(180);
|
127
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsOkButton();
|
128
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaWidth(0, '180px');
|
129
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaWidth(1, '180px');
|
130
|
+
});
|
131
|
+
|
132
|
+
it('When \'Set for all dropdowns\' checkbox is checked, user updates the width input field value and clicks on OK, then width of all dropdowns in the specify correct answer section should be updated', () => {
|
133
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthSpecifyCorrectAnswerSection(0, '180px');
|
134
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthSpecifyCorrectAnswerSection(1, '180px');
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When \'Set for all dropdowns\' checkbox is unchecked, user updates the width input field value and clicks on OK, then width of that particular response area in question input field should be updated', () => {
|
138
|
+
cy.log('Pre-step: Uncheck \'Set for all dropdowns\' checkbox')
|
139
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
140
|
+
fillInTheGapsDropdownPage.steps.uncheckSetForAllDropdownsCheckbox();
|
141
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(150);
|
142
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsOkButton();
|
143
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaWidth(0, '150px');
|
144
|
+
fillInTheGapsDropdownPage.steps.verifyResponseAreaWidth(1, '180px');
|
145
|
+
});
|
146
|
+
|
147
|
+
it('When \'Set for all dropdowns\' checkbox is unchecked, user updates the width input field value and clicks on OK, then width of that dropdowns in the specify correct answer section should be updated', () => {
|
148
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthSpecifyCorrectAnswerSection(0, '150px');
|
149
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthSpecifyCorrectAnswerSection(1, '180px');
|
150
|
+
});
|
151
|
+
});
|
152
|
+
|
153
|
+
describe('Dropdown settings - Width input field functionality in Preview tab', () => {
|
154
|
+
abortEarlySetup();
|
155
|
+
before(() => {
|
156
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
157
|
+
cy.barsPreLoaderWait();
|
158
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
159
|
+
});
|
160
|
+
|
161
|
+
it('When \'Set for all dropdowns\' checkbox is checked, user updates the width input field value and clicks on OK, then dimensions of all answer input fields in preview tab should be updated', () => {
|
162
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(180);
|
163
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsOkButton();
|
164
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
165
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthPreviewTab(0, '180px');
|
166
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthPreviewTab(1, '180px');
|
167
|
+
});
|
168
|
+
|
169
|
+
it('When \'Set for all dropdowns\' checkbox is unchecked, user updates the width and height input field value and clicks on OK, then dimensions of that particular answer input field in in preview tab should be updated', () => {
|
170
|
+
cy.log('Pre-step: Uncheck \'Set for all dropdowns\' checkbox')
|
171
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
172
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsButton(0);
|
173
|
+
fillInTheGapsDropdownPage.steps.uncheckSetForAllDropdownsCheckbox();
|
174
|
+
fillInTheGapsDropdownPage.steps.addInputToWidthInputField(120);
|
175
|
+
fillInTheGapsDropdownPage.steps.clickOnResponseAreaSettingsOkButton();
|
176
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
177
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthPreviewTab(0, '120px');
|
178
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownWidthPreviewTab(1, '180px');
|
179
|
+
});
|
180
|
+
});
|
181
|
+
});
|