itemengine-cypress-automation 1.0.154 → 1.0.155
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/DesmosGraphing/additionalSettings.js +5 -5
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +4 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionMinimumAndPenaltyScoring.js +1 -1
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +6 -6
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -3
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +34 -29
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +4 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsForDropdowns.js +7 -7
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +20 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +5 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +4 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +0 -8
- package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +39 -35
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +1 -1
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +8 -6
- package/cypress/e2e/ILC/GridFill/customizeLayoutFillColor.js +475 -0
- package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +669 -0
- package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +1 -1
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +0 -11
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +204 -0
- package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +229 -0
- package/cypress/e2e/ILC/GridFill/gridLayoutPreviewTabFunctionality.js +219 -0
- package/cypress/e2e/ILC/GridFill/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -0
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +0 -2
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/Matching/draggableOptions.js +1 -1
- package/cypress/e2e/ILC/Matching/headerSection.js +82 -0
- package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +93 -0
- package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/editTabScoringSection.js +3 -0
- package/cypress/e2e/ILC/MultipleSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/multipleSelectionBasicAccessibility.js +8 -10
- package/cypress/e2e/ILC/MultipleSelection/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +16 -25
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +140 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +403 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +363 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +393 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +377 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +341 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +373 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +0 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +27 -8
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +15 -34
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +13 -15
- package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +4 -4
- package/cypress/e2e/ILC/SimpleCalculator/editTabFunctionality.js +4 -2
- package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
- package/cypress/e2e/ILC/SingleSelection/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +183 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +185 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +263 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/manuallyAndNonScored.js +140 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +233 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +205 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +233 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +214 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +183 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +213 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +21 -17
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +25 -25
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +20 -17
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +2 -3
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +3 -3
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +2 -2
- package/cypress/fixtures/fillColorDefaultProperties.js +35 -0
- package/cypress/fixtures/theme/ilc.json +2 -1
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +4 -1
- package/cypress/pages/components/colorPopupComponent.js +6 -3
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -3
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +47 -12
- package/cypress/pages/components/gridQuestionCommonComponent.js +0 -81
- package/cypress/pages/components/imageCanvasComponent.js +10 -8
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +1 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
- package/cypress/pages/essayResponsePage.js +4 -4
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +34 -23
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +0 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +26 -4
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +0 -29
- package/cypress/pages/graphingPage.js +26 -16
- package/cypress/pages/gridFillPage.js +1610 -90
- package/cypress/pages/matchingPage.js +164 -20
- package/cypress/pages/multipleSelectionGridPage.js +82 -2
- package/cypress/pages/multipleSelectionPage.js +7 -2
- package/cypress/pages/rulerPage.js +3 -8
- package/cypress/pages/shortTextResponsePage.js +13 -0
- package/cypress/pages/simpleCalculatorPage.js +8 -0
- package/cypress/pages/singleSelectionGridPage.js +58 -2
- package/cypress/pages/textEntryMathPage.js +58 -11
- package/cypress/pages/uploadResponsePage.js +4 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/MultipleSelection/multipleSelectionAdditionalSettings.js +0 -835
- package/cypress/e2e/ILC/SingleSelection/singleSelectionAdditionalSettings.js +0 -469
@@ -0,0 +1,669 @@
|
|
1
|
+
import { gridFillPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
import { gridFillColorProperties } from "../../../fixtures/fillColorDefaultProperties";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
describe('Create item page - Grid fill: Customize layout section - \'Fill Image\' and \'Background image\'', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('\'Fill Image\' - Contents and edit tab functionality', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('User should be able to select \'Image\' radio button', () => {
|
21
|
+
gridFillPage.steps.selectImageRadioButton();
|
22
|
+
});
|
23
|
+
|
24
|
+
it(`\'Customize highlight properties\' accordion should have \'Default\' section with ${gridFillColorProperties['default'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
|
25
|
+
utilities.verifyInnerText(gridFillPage.defaultLabel(), gridFillColorProperties['default'].displayName);
|
26
|
+
utilities.verifyInnerText(gridFillPage.defaultFillColorLabel(), 'Fill color');
|
27
|
+
utilities.verifyInnerText(gridFillPage.defaultBorderColorLabel(), 'Border color');
|
28
|
+
utilities.verifyInnerText(gridFillPage.defaultFillColorHexCodeLabel(), gridFillColorProperties.default.colorProperties.fillColorHexValue);
|
29
|
+
utilities.verifyInnerText(gridFillPage.defaultBorderColorHexCodeLabel(), gridFillColorProperties.default.colorProperties.borderColorHexValue);
|
30
|
+
utilities.verifyInnerText(gridFillPage.defaultFillColorOpacityLabel(), `${gridFillColorProperties.default.colorProperties.fillColorOpacity}%`);
|
31
|
+
utilities.verifyInnerText(gridFillPage.defaultBorderColorOpacityLabel(), `${gridFillColorProperties.default.colorProperties.borderColorOpacity}%`);
|
32
|
+
utilities.verifyElementVisibilityState(gridFillPage.defaultFillColorBlock(), 'visible');
|
33
|
+
gridFillPage.steps.verifyDefaultFillColorBlockColor(gridFillColorProperties.default.colorProperties.fillColorRgbaValue);
|
34
|
+
utilities.verifyElementVisibilityState(gridFillPage.defaultBorderColorBlock(), 'visible');
|
35
|
+
gridFillPage.steps.verifyDefaultBorderColorBlockColor(gridFillColorProperties.default.colorProperties.borderColorRgbValue);
|
36
|
+
});
|
37
|
+
|
38
|
+
it(`\'Customize highlight properties\' accordion should have \'Hover\' section with ${gridFillColorProperties['hover'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
|
39
|
+
utilities.verifyInnerText(gridFillPage.hoverLabel(), gridFillColorProperties['hover'].displayName);
|
40
|
+
utilities.verifyInnerText(gridFillPage.hoverFillColorLabel(), 'Fill color');
|
41
|
+
utilities.verifyInnerText(gridFillPage.hoverBorderColorLabel(), 'Border color');
|
42
|
+
utilities.verifyInnerText(gridFillPage.hoverFillColorHexCodeLabel(), gridFillColorProperties.hover.colorProperties.fillColorHexValue);
|
43
|
+
utilities.verifyInnerText(gridFillPage.hoverBorderColorHexCodeLabel(), gridFillColorProperties.hover.colorProperties.borderColorHexValue);
|
44
|
+
utilities.verifyInnerText(gridFillPage.hoverFillColorOpacityLabel(), `${gridFillColorProperties.hover.colorProperties.fillColorOpacity}%`);
|
45
|
+
utilities.verifyInnerText(gridFillPage.hoverBorderColorOpacityLabel(), `${gridFillColorProperties.hover.colorProperties.borderColorOpacity}%`);
|
46
|
+
utilities.verifyElementVisibilityState(gridFillPage.hoverFillColorBlock(), 'visible');
|
47
|
+
gridFillPage.steps.verifyHoverFillColorBlockColor(gridFillColorProperties.hover.colorProperties.fillColorRgbaValue);
|
48
|
+
utilities.verifyElementVisibilityState(gridFillPage.hoverBorderColorBlock(), 'visible');
|
49
|
+
gridFillPage.steps.verifyHoverBorderColorBlockColor(gridFillColorProperties.hover.colorProperties.borderColorRgbValue);
|
50
|
+
});
|
51
|
+
|
52
|
+
it(`\'Customize highlight properties\' accordion should have \'Filled\' section with ${gridFillColorProperties['filled'].displayName} label, border color label, hex colors and opacity with color blocks`, () => {
|
53
|
+
utilities.verifyInnerText(gridFillPage.filledLabel(), gridFillColorProperties['filled'].displayName);
|
54
|
+
utilities.verifyInnerText(gridFillPage.filledBorderColorLabel(), 'Border color');
|
55
|
+
utilities.verifyInnerText(gridFillPage.filledBorderColorHexCodeLabel(), gridFillColorProperties.filled.colorProperties.borderColorHexValue);
|
56
|
+
utilities.verifyInnerText(gridFillPage.filledBorderColorOpacityLabel(), `${gridFillColorProperties.filled.colorProperties.borderColorOpacity}%`);
|
57
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledBorderColorBlock(), 'visible');
|
58
|
+
gridFillPage.steps.verifyFilledBorderColorBlockColor(gridFillColorProperties.filled.colorProperties.borderColorRgbValue);
|
59
|
+
utilities.verifyElementCount(gridFillPage.colorBlock(), 5);
|
60
|
+
});
|
61
|
+
|
62
|
+
it('\'Filled image\' label should be visible', () => {
|
63
|
+
utilities.verifyInnerText(gridFillPage.filledImageLabel(), 'Filled image');
|
64
|
+
});
|
65
|
+
|
66
|
+
it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
|
67
|
+
utilities.verifyInnerText(gridFillPage.filledImageUploadLabel(), 'Upload');
|
68
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageUploadLabel(), 'visible');
|
69
|
+
utilities.verifyInnerText(gridFillPage.filledImageChooseFileButton(), 'Choose file');
|
70
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageChooseFileButton(), 'visible');
|
71
|
+
});
|
72
|
+
|
73
|
+
it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
74
|
+
utilities.verifyInnerText(gridFillPage.filledImageFileNameLabel(), 'File name');
|
75
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageFileNameLabel(), 'visible');
|
76
|
+
utilities.verifyInnerText(gridFillPage.filledImageNoFileChosenLabel(), 'No file chosen');
|
77
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageNoFileChosenLabel(), 'visible');
|
78
|
+
});
|
79
|
+
|
80
|
+
it('CSS of upload section', { tags: 'css' }, () => {
|
81
|
+
utilities.verifyCSS(gridFillPage.filledImageUploadLabel(), {
|
82
|
+
'color': css.color.labels,
|
83
|
+
'font-size': css.fontSize.normal,
|
84
|
+
'font-weight': css.fontWeight.semibold
|
85
|
+
});
|
86
|
+
utilities.verifyCSS(gridFillPage.filledImageChooseFileButton(), {
|
87
|
+
'color': css.color.secondaryBtn,
|
88
|
+
'font-size': css.fontSize.default,
|
89
|
+
'font-weight': css.fontWeight.regular,
|
90
|
+
'border-bottom-color': css.color.titleContainerBorder
|
91
|
+
});
|
92
|
+
utilities.verifyCSS(gridFillPage.filledImageFileNameLabel(), {
|
93
|
+
'color': css.color.labels,
|
94
|
+
'font-size': css.fontSize.normal,
|
95
|
+
'font-weight': css.fontWeight.semibold
|
96
|
+
});
|
97
|
+
utilities.verifyCSS(gridFillPage.filledImageNoFileChosenLabel(), {
|
98
|
+
'color': css.color.panelLabel,
|
99
|
+
'font-size': css.fontSize.default,
|
100
|
+
'font-weight': css.fontWeight.regular
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
it('Accessibility of Upload section before uploading image', { tags: 'a11y' }, () => {
|
105
|
+
cy.checkAccessibility(gridFillPage.filledImageUploadLabel().parents('.edit-question-edit-tab-wrapper'));
|
106
|
+
});
|
107
|
+
|
108
|
+
it('When the user adds the image file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded and uploaded image should be displayed', () => {
|
109
|
+
gridFillPage.steps.uploadFilledImageFile('highlightImage.jpg');
|
110
|
+
utilities.verifyElementVisibilityState(gridFillPage.uploadImageProgressBar(), 'visible');
|
111
|
+
gridFillPage.steps.verifyFilledImageFileNameLabel('highlightImage.jpg');
|
112
|
+
});
|
113
|
+
|
114
|
+
it('Delete button should appear beside uploaded file\'s name', () => {
|
115
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageDeleteImageButton(), 'visible');
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When user clicks on \'Choose file\' button again and upload another image file, previously uploaded image file should get replaced with new image file', () => {
|
119
|
+
gridFillPage.steps.uploadFilledImageFile('sample1.jpg');
|
120
|
+
gridFillPage.steps.verifyFilledImageFileNameLabel('sample1.jpg');
|
121
|
+
});
|
122
|
+
|
123
|
+
it('\'Alt text\' label and empty input field should be displayed besides the uploaded image and user should be able to give a text input in it', () => {
|
124
|
+
utilities.verifyInnerText(gridFillPage.filledImageAltTextLabel(), 'Alt text');
|
125
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageAltTextLabel(), 'visible');
|
126
|
+
utilities.verifyElementVisibilityState(gridFillPage.filledImageAltTextInputField(), 'visible');
|
127
|
+
utilities.verifyInputFieldValue(gridFillPage.filledImageAltTextInputField(), '');
|
128
|
+
gridFillPage.steps.addInputToFilledImageAltTextInputField('Filled image alternative text');
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When user has uploaded a filled image and then shades a cell in customize layout section, then the shaded cell should be filled with the provided image', () => {
|
132
|
+
gridFillPage.steps.shadeCell(0, 0);
|
133
|
+
gridFillPage.steps.verifyFilledImageInShadedCellInCustomizeLayoutGrid(0, 0);
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When user had added input in alt text input field for filled image, then the shaded cell\'s filled image should have the provided alternative text', () => {
|
137
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInCustomizeLayoutGrid(0, 0, 'Filled image alternative text');
|
138
|
+
});
|
139
|
+
|
140
|
+
it('When user has uploaded a filled image and then selects a cell in specify correct answer section, then the selected cell should be filled with the provided image', () => {
|
141
|
+
gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
|
142
|
+
gridFillPage.steps.verifyFilledImageInShadedCellInSpecifyCorrectAnswerGrid(0, 0);
|
143
|
+
});
|
144
|
+
|
145
|
+
it('When user had added input in alt text input field for filled image, then the selected cell\'s filled image should have the provided alternative text', () => {
|
146
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInSpecifyCorrectAnswerGrid(0, 0, 'Filled image alternative text');
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When user clears the filled image alt text input field, then the shaded cell\'s filled image should not have alternative text', () => {
|
150
|
+
gridFillPage.steps.clearFilledImageAltTextInputField();
|
151
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInCustomizeLayoutGrid(0, 0, '');
|
152
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInSpecifyCorrectAnswerGrid(0, 0, '');
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When the user hovers on \'Delete\' button, \'Delete image\' text should be displayed in tooltip', () => {
|
156
|
+
gridFillPage.filledImageDeleteImageButton()
|
157
|
+
.verifyTooltip('Delete image');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('CSS of tooltip', { tags: 'css' }, () => {
|
161
|
+
utilities.hoverOverElement(gridFillPage.filledImageDeleteImageButton());
|
162
|
+
utilities.verifyCSS(gridFillPage.tooltipText(), {
|
163
|
+
'color': css.color.whiteText,
|
164
|
+
'font-size': css.fontSize.normal,
|
165
|
+
'font-weight': css.fontWeight.regular,
|
166
|
+
'background-color': css.color.tooltipBg
|
167
|
+
});
|
168
|
+
utilities.hoverAwayFromElement(gridFillPage.filledImageDeleteImageButton());
|
169
|
+
});
|
170
|
+
|
171
|
+
it('When user clicks on the \'Delete\' button, then \'Delete\' popup should be displayed', () => {
|
172
|
+
gridFillPage.steps.deleteFilledImage();
|
173
|
+
utilities.verifyElementVisibilityState(gridFillPage.dialogBox(), 'visible');
|
174
|
+
utilities.verifyInnerText(gridFillPage.dialogBoxTitle(), 'Delete');
|
175
|
+
});
|
176
|
+
|
177
|
+
it('The pop up should be displayed with the message \'Are you sure you want to delete the image?\'', () => {
|
178
|
+
utilities.verifyInnerText(gridFillPage.dialogBoxContent(), 'Are you sure you want to delete the image?');
|
179
|
+
utilities.verifyInnerText(gridFillPage.deleteImagePopupButtonDelete(), 'Delete image');
|
180
|
+
utilities.verifyInnerText(gridFillPage.deleteImagePopupButtonCancel(), 'Cancel');
|
181
|
+
});
|
182
|
+
|
183
|
+
it('CSS of popup', { tags: 'css' }, () => {
|
184
|
+
utilities.verifyCSS(gridFillPage.dialogBox(), {
|
185
|
+
'background-color': css.color.defaultBackground,
|
186
|
+
});
|
187
|
+
utilities.verifyCSS(gridFillPage.dialogBoxContent().find('[class*="DeletePopupWrapper"]'), {
|
188
|
+
'color': css.color.sectionHeading,
|
189
|
+
'font-size': css.fontSize.default,
|
190
|
+
'font-weight': css.fontWeight.regular
|
191
|
+
});
|
192
|
+
utilities.verifyCSS(gridFillPage.deleteImagePopupButtonDelete(), {
|
193
|
+
'color': css.color.primaryBtn,
|
194
|
+
'font-size': css.fontSize.default,
|
195
|
+
'font-weight': css.fontWeight.semibold
|
196
|
+
});
|
197
|
+
utilities.verifyCSS(gridFillPage.deleteImagePopupButtonCancel(), {
|
198
|
+
'color': css.color.secondaryBtn,
|
199
|
+
'font-size': css.fontSize.default,
|
200
|
+
'font-weight': css.fontWeight.semibold,
|
201
|
+
'background-color': css.color.defaultBackground
|
202
|
+
});
|
203
|
+
});
|
204
|
+
|
205
|
+
it('Accessibility of the popup', { tags: 'a11y' }, () => {
|
206
|
+
cy.checkAccessibility(gridFillPage.dialogBox());
|
207
|
+
});
|
208
|
+
|
209
|
+
it('When user clicks on \'Cancel\' button, then popup should close and user should remain on the edit interface of the question', () => {
|
210
|
+
gridFillPage.steps.clickOnCancelButtonInDeleteImagePopup();
|
211
|
+
utilities.verifyElementVisibilityState(gridFillPage.dialogBox(), 'notExist');
|
212
|
+
utilities.verifyInnerText(gridFillPage.uploadedFileNameLabel(), 'sample1.jpg');
|
213
|
+
});
|
214
|
+
|
215
|
+
it('When user clicks on \'Delete image\' button, then popup should close and image should be deleted', () => {
|
216
|
+
gridFillPage.steps.deleteFilledImage();
|
217
|
+
gridFillPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
218
|
+
utilities.verifyElementVisibilityState(gridFillPage.dialogBox(), 'notExist');
|
219
|
+
utilities.verifyInnerText(gridFillPage.filledImageNoFileChosenLabel(), 'No file chosen');
|
220
|
+
});
|
221
|
+
|
222
|
+
it('When user has deleted the uploaded filled image, then the shaded/selected cells in edit tab grids should not have a filled image', () => {
|
223
|
+
gridFillPage.steps.verifyFilledImageNotDisplayedInCellInCustomizeLayoutGrid(0, 0);
|
224
|
+
gridFillPage.steps.verifyFilledImageNotDisplayedInCellInSpecifyCorrectAnswerGrid(0, 0);
|
225
|
+
});
|
226
|
+
|
227
|
+
it('CSS of uploaded file name and Alt text section', { tags: 'css' }, () => {
|
228
|
+
utilities.verifyCSS(gridFillPage.uploadedFileNameLabel().find('[class*="UploadImagestyles__SelectedFile"]'), {
|
229
|
+
'color': css.color.uploadedFileName,
|
230
|
+
'font-size': css.fontSize.default,
|
231
|
+
'font-weight': css.fontWeight.regular
|
232
|
+
});
|
233
|
+
utilities.verifyCSS(gridFillPage.filledImageAltTextLabel(), {
|
234
|
+
'color': css.color.labels,
|
235
|
+
'font-size': css.fontSize.normal,
|
236
|
+
'font-weight': css.fontWeight.semibold
|
237
|
+
});
|
238
|
+
utilities.verifyCSS(gridFillPage.filledImageAltTextInputField(), {
|
239
|
+
'color': css.color.text,
|
240
|
+
'font-size': css.fontSize.default,
|
241
|
+
'font-weight': css.fontWeight.regular,
|
242
|
+
'background-color': css.color.defaultBackground
|
243
|
+
});
|
244
|
+
});
|
245
|
+
|
246
|
+
it('Accessibility of Upload section before uploading image', { tags: 'a11y' }, () => {
|
247
|
+
cy.checkAccessibility(gridFillPage.filledImageUploadLabel().parents('.edit-question-edit-tab-wrapper'));
|
248
|
+
});
|
249
|
+
});
|
250
|
+
|
251
|
+
describe('\'Fill Image\' - preview tab functionality', () => {
|
252
|
+
abortEarlySetup();
|
253
|
+
before(() => {
|
254
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
255
|
+
cy.barsPreLoaderWait();
|
256
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
257
|
+
gridFillPage.steps.selectImageRadioButton();
|
258
|
+
gridFillPage.steps.uploadFilledImageFile('highlightImage.jpg');
|
259
|
+
gridFillPage.steps.switchToPreviewTab();
|
260
|
+
});
|
261
|
+
|
262
|
+
it('When user has uploaded a filled image and selects a cell in preview tab, then the selected cell in preview tab should be filled with the provided image', () => {
|
263
|
+
gridFillPage.steps.selectCellPreviewTab(0, 0);
|
264
|
+
gridFillPage.steps.verifyFilledImageInSelectedCellInPreviewTabGrid(0, 0);
|
265
|
+
});
|
266
|
+
|
267
|
+
it('When user has added input in alt text input field for filled image, then the filled image in selected cell in preview tab should have the provided alternative text', () => {
|
268
|
+
gridFillPage.steps.switchToEditTab();
|
269
|
+
gridFillPage.steps.addInputToFilledImageAltTextInputField('Filled image alternative text');
|
270
|
+
gridFillPage.steps.switchToPreviewTab();
|
271
|
+
gridFillPage.steps.selectCellPreviewTab(0, 0);
|
272
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInPreviewTabGrid(0, 0, 'Filled image alternative text');
|
273
|
+
});
|
274
|
+
|
275
|
+
it('When user clears the filled image alt text input field, then the filled image in selected cell in preview tab should not have alternative text', () => {
|
276
|
+
gridFillPage.steps.switchToEditTab();
|
277
|
+
gridFillPage.steps.clearFilledImageAltTextInputField();
|
278
|
+
gridFillPage.steps.switchToPreviewTab();
|
279
|
+
gridFillPage.steps.selectCellPreviewTab(0, 0);
|
280
|
+
gridFillPage.steps.verifyFilledImageAltTextInShadedCellInPreviewTabGrid(0, 0, '');
|
281
|
+
});
|
282
|
+
|
283
|
+
it('When user has deleted the uploaded filled image, then the selected cell in preview tab grid should not have a filled image', () => {
|
284
|
+
gridFillPage.steps.switchToEditTab();
|
285
|
+
gridFillPage.steps.deleteFilledImage();
|
286
|
+
gridFillPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
287
|
+
gridFillPage.steps.switchToPreviewTab();
|
288
|
+
gridFillPage.steps.selectCellPreviewTab(0, 0);
|
289
|
+
gridFillPage.steps.verifyFilledImageNotDisplayedInCellInPreviewTabGrid(0, 0);
|
290
|
+
});
|
291
|
+
});
|
292
|
+
|
293
|
+
describe('\'Background image\' - Contents', () => {
|
294
|
+
abortEarlySetup();
|
295
|
+
before(() => {
|
296
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
297
|
+
cy.barsPreLoaderWait();
|
298
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
299
|
+
});
|
300
|
+
|
301
|
+
gridFillPage.tests.verifyBackgroundImageSectionContentWithCSSAndA11y('grid fill');
|
302
|
+
|
303
|
+
it('When user has uploaded an image as background, then the image should be displayed as background in grids in edit tab', () => {
|
304
|
+
gridFillPage.steps.verifyBackgroundImageIsDisplayedInEditTabGrids();
|
305
|
+
});
|
306
|
+
|
307
|
+
gridFillPage.tests.verifyDeleteImagePopupContentAndFunctionality();
|
308
|
+
|
309
|
+
it('When user has deleted the uploaded background image, then the image should not be displayed as background in grids in edit tab', () => {
|
310
|
+
gridFillPage.steps.verifyBackgroundImageIsNotDisplayedInEditTabGrids();
|
311
|
+
});
|
312
|
+
});
|
313
|
+
|
314
|
+
describe('\'Background image\' - Image properties section edit tab', () => {
|
315
|
+
abortEarlySetup();
|
316
|
+
before(() => {
|
317
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
318
|
+
cy.barsPreLoaderWait();
|
319
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
320
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
321
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
322
|
+
});
|
323
|
+
|
324
|
+
it('\'Image properties\' label should be displayed.', () => {
|
325
|
+
utilities.verifyInnerText(gridFillPage.imagePropertiesLabel(), 'Image properties');
|
326
|
+
utilities.verifyElementVisibilityState(gridFillPage.imagePropertiesLabel(), 'visible');
|
327
|
+
});
|
328
|
+
|
329
|
+
it('\'Fill image to grid\' label and checkbox should be displayed and checkbox should be checked by default', () => {
|
330
|
+
utilities.verifyElementVisibilityState(gridFillPage.fillImageToGridCheckboxLabel(), 'visible');
|
331
|
+
utilities.verifyInnerText(gridFillPage.fillImageToGridCheckboxLabel(), 'Fill image to grid');
|
332
|
+
utilities.verifyElementVisibilityState(gridFillPage.fillImageToGridCheckbox(), 'exist');
|
333
|
+
gridFillPage.steps.verifyFillImageToGridCheckboxIsChecked();
|
334
|
+
});
|
335
|
+
|
336
|
+
it('User should be able to uncheck \'Fill image to grid\' checkbox', () => {
|
337
|
+
gridFillPage.steps.uncheckFillImageToGridCheckbox();
|
338
|
+
});
|
339
|
+
|
340
|
+
it('\'Lock aspect ratio\' and \'Reset dimensions\' buttons should be displayed and by default \'Lock aspect ratio\' button should be locked', () => {
|
341
|
+
utilities.verifyElementVisibilityState(gridFillPage.lockAspectRatioButton(), 'visible');
|
342
|
+
utilities.verifyElementVisibilityState(gridFillPage.resetDimensionsButton(), 'visible');
|
343
|
+
});
|
344
|
+
|
345
|
+
it('\'Image alignment\' label should be displayed. ', () => {
|
346
|
+
utilities.verifyInnerText(gridFillPage.imageAlignmentLabel(), 'Image alignment');
|
347
|
+
utilities.verifyElementVisibilityState(gridFillPage.imageAlignmentLabel(), 'visible');
|
348
|
+
});
|
349
|
+
|
350
|
+
it(`\'Image alignment\' section should have three options 'Top left', 'Center', 'Top right' and 'Top left' should be active selection by default`, () => {
|
351
|
+
utilities.verifyInnerText(gridFillPage.topLeftAlignmentButton(), 'Top left');
|
352
|
+
utilities.verifyElementVisibilityState(gridFillPage.topLeftAlignmentButton(), 'visible');
|
353
|
+
utilities.verifyInnerText(gridFillPage.centerAlignmentButton(), 'Center');
|
354
|
+
utilities.verifyElementVisibilityState(gridFillPage.centerAlignmentButton(), 'visible');
|
355
|
+
utilities.verifyInnerText(gridFillPage.topRightAlignmentButton(), 'Top right');
|
356
|
+
utilities.verifyElementVisibilityState(gridFillPage.topRightAlignmentButton(), 'visible');
|
357
|
+
});
|
358
|
+
|
359
|
+
it('\'Image alternative text\' label and input field should be displayed. By default input field should be empty', () => {
|
360
|
+
utilities.verifyInnerText(gridFillPage.backgroundImageAlternativeTextLabel(), 'Alt text');
|
361
|
+
utilities.verifyElementVisibilityState(gridFillPage.backgroundImageAlternativeTextLabel(), 'visible');
|
362
|
+
utilities.verifyInnerText(gridFillPage.backgroundImageAlternativeTextInputField(), '');
|
363
|
+
utilities.verifyElementVisibilityState(gridFillPage.backgroundImageAlternativeTextInputField(), 'exist');
|
364
|
+
});
|
365
|
+
|
366
|
+
it('User should be able to enter text in \'Image alternative text\' input field', () => {
|
367
|
+
gridFillPage.steps.addInputToBackgroundImageAltTextInputField('Background image description');
|
368
|
+
});
|
369
|
+
});
|
370
|
+
|
371
|
+
describe('Image alignment, Opacity section and \'Fill image to grid\' checkbox - edit tab functionality', () => {
|
372
|
+
abortEarlySetup();
|
373
|
+
before(() => {
|
374
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
375
|
+
cy.barsPreLoaderWait();
|
376
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
377
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
378
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
379
|
+
});
|
380
|
+
|
381
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left inside the edit tab grids', () => {
|
382
|
+
gridFillPage.steps.verifyImageIsTopLeftAlignedInEditTabGrids();
|
383
|
+
});
|
384
|
+
|
385
|
+
it('When user selects \'Center\' image alignment, then image should be aligned to center inside the the edit tab grids', () => {
|
386
|
+
gridFillPage.steps.selectCenterImageAlignment();
|
387
|
+
gridFillPage.steps.verifyImageIsCenterAlignedInEditTabGrids();
|
388
|
+
});
|
389
|
+
|
390
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right inside the the edit tab grids', () => {
|
391
|
+
gridFillPage.steps.selectTopRightImageAlignment();
|
392
|
+
gridFillPage.steps.verifyImageIsTopRightAlignedInEditTabGrids();
|
393
|
+
});
|
394
|
+
|
395
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the the edit tab grids', () => {
|
396
|
+
gridFillPage.steps.selectTopLeftImageAlignment();
|
397
|
+
gridFillPage.steps.verifyImageIsTopLeftAlignedInEditTabGrids();
|
398
|
+
});
|
399
|
+
|
400
|
+
it('When opacity value is set to 100 percent by default, then opacity for image should be100 percent inside edit tab grids', () => {
|
401
|
+
gridFillPage.steps.verifyOpacityValueForGridImagesInEditTab('1');
|
402
|
+
});
|
403
|
+
|
404
|
+
it('When user changes opacity slider value , then opacity for image should be updated accordingly', () => {
|
405
|
+
gridFillPage.steps.clickActionOnOpacitySlider();
|
406
|
+
gridFillPage.steps.verifyOpacityValueForGridImagesInEditTab('0.5');
|
407
|
+
});
|
408
|
+
|
409
|
+
it('When user changes opacity value in input field, then opacity for image should be updated accordingly', () => {
|
410
|
+
gridFillPage.steps.enterInputToOpacityInputField(40);
|
411
|
+
gridFillPage.steps.verifyOpacityValueForGridImagesInEditTab('0.4');
|
412
|
+
});
|
413
|
+
|
414
|
+
it('When \'Fill image to grid\' checkbox is checked, then image should be adjusted to fit inside the grid', () => {
|
415
|
+
gridFillPage.steps.verifyImageFitsToGridInEditTab();
|
416
|
+
});
|
417
|
+
|
418
|
+
it('When user unchecks \'Fill image to grid\' checkbox, then image dimensions should set to default state', () => {
|
419
|
+
gridFillPage.steps.uncheckFillImageToGridCheckbox();
|
420
|
+
gridFillPage.steps.verifyDefaultImageInGridInEditTab();
|
421
|
+
});
|
422
|
+
});
|
423
|
+
|
424
|
+
describe('Image width, Image height, Image alternative text - Edit tab functionality', () => {
|
425
|
+
abortEarlySetup();
|
426
|
+
before(() => {
|
427
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
428
|
+
cy.barsPreLoaderWait();
|
429
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
430
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
431
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
432
|
+
gridFillPage.steps.uncheckFillImageToGridCheckbox();
|
433
|
+
});
|
434
|
+
|
435
|
+
it('When aspect ratio is unlocked and user changes the value in width input field, the height input field should remain unchanged and the dimensions should be updated in the grid', () => {
|
436
|
+
gridFillPage.steps.unlockAspectRatio();
|
437
|
+
gridFillPage.steps.updateCanvasWidth(100);
|
438
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInEditTab('100px', '500px');
|
439
|
+
});
|
440
|
+
|
441
|
+
it('When aspect ratio is unlocked and user changes the value in height input field, then width input field should remain unchanged and the dimensions should be updated in the grid', () => {
|
442
|
+
gridFillPage.steps.updateCanvasHeight(120);
|
443
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInEditTab('100px', '120px');
|
444
|
+
});
|
445
|
+
|
446
|
+
it('When user locks the aspect ratio button and changes the value in the width input field, the height input field should be updated accordingly to maintain the updated aspect ratio', () => {
|
447
|
+
gridFillPage.steps.lockAspectRatio();
|
448
|
+
gridFillPage.steps.updateCanvasWidth(150);
|
449
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInEditTab('120px', '150px');
|
450
|
+
});
|
451
|
+
|
452
|
+
it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
|
453
|
+
gridFillPage.steps.resetDimensions();
|
454
|
+
gridFillPage.steps.verifyDefaultImageInGridInEditTab();
|
455
|
+
utilities.verifyInputFieldValue(gridFillPage.canvasWidthInputField(), 500);
|
456
|
+
utilities.verifyInputFieldValue(gridFillPage.canvasHeightInputField(), 500);
|
457
|
+
});
|
458
|
+
|
459
|
+
it('When user adds input in alt text input field for background image, then the grid background image in edit tab should have the provided alternative text', () => {
|
460
|
+
gridFillPage.steps.addInputToBackgroundImageAltTextInputField('Background image alternative text');
|
461
|
+
gridFillPage.steps.verifyBackgroundImageAltTextInEditTabGrids('Background image alternative text');
|
462
|
+
});
|
463
|
+
|
464
|
+
it('When user clears the background image alt text input field, then the grid background image in edit tab should not have alternative text', () => {
|
465
|
+
gridFillPage.steps.clearBackgroundImageAltTextInputField();
|
466
|
+
gridFillPage.steps.verifyBackgroundImageAltTextNotPresentInEditTabGrids('');
|
467
|
+
});
|
468
|
+
});
|
469
|
+
|
470
|
+
describe('\'Background image\' - preview tab functionality', () => {
|
471
|
+
abortEarlySetup();
|
472
|
+
before(() => {
|
473
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
474
|
+
cy.barsPreLoaderWait();
|
475
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
476
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
477
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
478
|
+
gridFillPage.steps.switchToPreviewTab();
|
479
|
+
});
|
480
|
+
|
481
|
+
it('When user has uploaded an image as background, then the image should be displayed as background in grids in preview tab', () => {
|
482
|
+
gridFillPage.steps.verifyBackgroundImageIsDisplayedInPreviewTabGrid();
|
483
|
+
});
|
484
|
+
|
485
|
+
it('When user has deleted the uploaded background image, then the image should not be displayed as background in grid in preview tab', () => {
|
486
|
+
gridFillPage.steps.switchToEditTab();
|
487
|
+
gridFillPage.steps.deleteImage();
|
488
|
+
gridFillPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
489
|
+
utilities.verifyElementVisibilityState(gridFillPage.dialogBox(), 'notExist');
|
490
|
+
gridFillPage.steps.switchToPreviewTab();
|
491
|
+
gridFillPage.steps.verifyBackgroundImageIsNotDisplayedInPreviewTabGrid();
|
492
|
+
});
|
493
|
+
});
|
494
|
+
|
495
|
+
describe('Image alignment, Opacity section and \'Fill image to grid\' checkbox - preview tab functionality', () => {
|
496
|
+
abortEarlySetup();
|
497
|
+
before(() => {
|
498
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
499
|
+
cy.barsPreLoaderWait();
|
500
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
501
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
502
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
503
|
+
gridFillPage.steps.switchToPreviewTab();
|
504
|
+
});
|
505
|
+
|
506
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left inside the preview tab grid', () => {
|
507
|
+
gridFillPage.steps.verifyImageIsTopLeftAlignedInPreviewTabGrid();
|
508
|
+
});
|
509
|
+
|
510
|
+
it('When user selects \'Center\' image alignment, then image should be aligned to center inside the the preview tab grid', () => {
|
511
|
+
gridFillPage.steps.switchToEditTab();
|
512
|
+
gridFillPage.steps.selectCenterImageAlignment();
|
513
|
+
gridFillPage.steps.switchToPreviewTab();
|
514
|
+
gridFillPage.steps.verifyImageIsCenterAlignedInPreviewTabGrid();
|
515
|
+
});
|
516
|
+
|
517
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right inside the the preview tab grid', () => {
|
518
|
+
gridFillPage.steps.switchToEditTab();
|
519
|
+
gridFillPage.steps.selectTopRightImageAlignment();
|
520
|
+
gridFillPage.steps.switchToPreviewTab();
|
521
|
+
gridFillPage.steps.verifyImageIsTopRightAlignedInPreviewTabGrid();
|
522
|
+
});
|
523
|
+
|
524
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the the edit tab grids', () => {
|
525
|
+
gridFillPage.steps.switchToEditTab();
|
526
|
+
gridFillPage.steps.selectTopLeftImageAlignment();
|
527
|
+
gridFillPage.steps.switchToPreviewTab();
|
528
|
+
gridFillPage.steps.verifyImageIsTopLeftAlignedInPreviewTabGrid();
|
529
|
+
});
|
530
|
+
|
531
|
+
it('When opacity value is set to 100 percent by default, then opacity for image should be 100 percent inside preview tab grid', () => {
|
532
|
+
gridFillPage.steps.verifyOpacityValueForGridImageInPreviewTab('1');
|
533
|
+
});
|
534
|
+
|
535
|
+
it('When user changes opacity slider value, then opacity for image should be updated accordingly', () => {
|
536
|
+
gridFillPage.steps.switchToEditTab();
|
537
|
+
gridFillPage.steps.clickActionOnOpacitySlider();
|
538
|
+
gridFillPage.steps.switchToPreviewTab();
|
539
|
+
gridFillPage.steps.verifyOpacityValueForGridImageInPreviewTab('0.5');
|
540
|
+
});
|
541
|
+
|
542
|
+
it('When user changes opacity value in input field, then opacity for image should be updated accordingly', () => {
|
543
|
+
gridFillPage.steps.switchToEditTab();
|
544
|
+
gridFillPage.steps.enterInputToOpacityInputField(40);
|
545
|
+
gridFillPage.steps.switchToPreviewTab();
|
546
|
+
gridFillPage.steps.verifyOpacityValueForGridImageInPreviewTab('0.4');
|
547
|
+
});
|
548
|
+
|
549
|
+
it('When \'Fill image to grid\' checkbox is checked, then image should be adjusted to fit inside the preview tab grid', () => {
|
550
|
+
gridFillPage.steps.verifyImageFitsToGridInPreviewTab();
|
551
|
+
});
|
552
|
+
|
553
|
+
it('When user unchecks \'Fill image to grid\' checkbox, then image dimensions should set to default state', () => {
|
554
|
+
gridFillPage.steps.switchToEditTab();
|
555
|
+
gridFillPage.steps.uncheckFillImageToGridCheckbox();
|
556
|
+
gridFillPage.steps.switchToPreviewTab();
|
557
|
+
gridFillPage.steps.verifyDefaultImageInGridInPreviewTab();
|
558
|
+
});
|
559
|
+
});
|
560
|
+
|
561
|
+
describe('Image width, Image height, Image alternative text - preview tab functionality', () => {
|
562
|
+
abortEarlySetup();
|
563
|
+
before(() => {
|
564
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
565
|
+
cy.barsPreLoaderWait();
|
566
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
567
|
+
gridFillPage.steps.uploadFile('highlightImage.jpg');
|
568
|
+
gridFillPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
569
|
+
gridFillPage.steps.uncheckFillImageToGridCheckbox();
|
570
|
+
});
|
571
|
+
|
572
|
+
it('When aspect ratio is unlocked and user changes the value in width input field, the height input field should remain unchanged and the dimensions should be updated in the grid', () => {
|
573
|
+
gridFillPage.steps.unlockAspectRatio();
|
574
|
+
gridFillPage.steps.updateCanvasWidth(100);
|
575
|
+
gridFillPage.steps.switchToPreviewTab();
|
576
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInPreviewTab('100px', '500px');
|
577
|
+
});
|
578
|
+
|
579
|
+
it('When aspect ratio is unlocked and user changes the value in height input field, then width input field should remain unchanged and the dimensions should be updated in the grid', () => {
|
580
|
+
gridFillPage.steps.switchToEditTab();
|
581
|
+
gridFillPage.steps.updateCanvasHeight(120);
|
582
|
+
gridFillPage.steps.switchToPreviewTab();
|
583
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInPreviewTab('100px', '120px');
|
584
|
+
});
|
585
|
+
|
586
|
+
it('When user locks the aspect ratio button and changes the value in the width input field, the height input field should be updated accordingly to maintain the updated aspect ratio', () => {
|
587
|
+
gridFillPage.steps.switchToEditTab();
|
588
|
+
gridFillPage.steps.lockAspectRatio();
|
589
|
+
gridFillPage.steps.updateCanvasWidth(150);
|
590
|
+
gridFillPage.steps.switchToPreviewTab();
|
591
|
+
gridFillPage.steps.verifyGridBackgroundImageDimensionsInPreviewTab('120px', '150px');
|
592
|
+
});
|
593
|
+
|
594
|
+
it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
|
595
|
+
gridFillPage.steps.switchToEditTab();
|
596
|
+
gridFillPage.steps.resetDimensions();
|
597
|
+
gridFillPage.steps.switchToPreviewTab();
|
598
|
+
gridFillPage.steps.verifyDefaultImageInGridInPreviewTab();
|
599
|
+
});
|
600
|
+
|
601
|
+
it('When user adds input in alt text input field for background image, then the grid background image in preview tab should have the provided alternative text', () => {
|
602
|
+
gridFillPage.steps.switchToEditTab();
|
603
|
+
gridFillPage.steps.addInputToBackgroundImageAltTextInputField('Background image alternative text');
|
604
|
+
gridFillPage.steps.switchToPreviewTab();
|
605
|
+
gridFillPage.steps.verifyBackgroundImageAltTextInPreviewTabGrids('Background image alternative text');
|
606
|
+
});
|
607
|
+
|
608
|
+
it('When user clears the background image alt text input field, then the grid background image in preview tab should not have alternative text', () => {
|
609
|
+
gridFillPage.steps.switchToEditTab();
|
610
|
+
gridFillPage.steps.clearBackgroundImageAltTextInputField();
|
611
|
+
gridFillPage.steps.switchToPreviewTab();
|
612
|
+
gridFillPage.steps.verifyBackgroundImageAltTextNotPresentInEditTabGrids();
|
613
|
+
});
|
614
|
+
});
|
615
|
+
|
616
|
+
describe('Uploading both filled and background image - edit tab functionality', () => {
|
617
|
+
abortEarlySetup();
|
618
|
+
before(() => {
|
619
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
620
|
+
cy.barsPreLoaderWait();
|
621
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
622
|
+
gridFillPage.steps.uploadFile('image.png');
|
623
|
+
gridFillPage.steps.verifyFileNameLabel('image.png');
|
624
|
+
gridFillPage.steps.selectImageRadioButton();
|
625
|
+
gridFillPage.steps.uploadFilledImageFile('highlightImage.jpg');
|
626
|
+
gridFillPage.steps.verifyFilledImageFileNameLabel('highlightImage.jpg');
|
627
|
+
utilities.verifyElementNotDisabled(gridFillPage.deleteImageIcon());
|
628
|
+
});
|
629
|
+
|
630
|
+
it('Uploaded background image should be displayed in the edit tab grids', () => {
|
631
|
+
gridFillPage.steps.verifyBackgroundImageIsDisplayedInEditTabGrids();
|
632
|
+
});
|
633
|
+
|
634
|
+
it('When user shades a cell in customize layout section grid, then the uploaded filled image should be displayed in that cell', () => {
|
635
|
+
gridFillPage.steps.shadeCell(0, 0);
|
636
|
+
gridFillPage.steps.verifyFilledImageInShadedCellInCustomizeLayoutGrid(0, 0);
|
637
|
+
});
|
638
|
+
|
639
|
+
it('When user selects a cell in specify correct answer section grid, then the uploaded filled image should be displayed in that cell', () => {
|
640
|
+
gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
|
641
|
+
gridFillPage.steps.verifyFilledImageInShadedCellInSpecifyCorrectAnswerGrid(0, 0);
|
642
|
+
});
|
643
|
+
});
|
644
|
+
|
645
|
+
describe('Uploading both filled and background image - preview tab functionality', () => {
|
646
|
+
abortEarlySetup();
|
647
|
+
before(() => {
|
648
|
+
gridFillPage.steps.navigateToCreateQuestion('grid fill');
|
649
|
+
cy.barsPreLoaderWait();
|
650
|
+
gridFillPage.steps.clickOnCustomizeLayoutAccordionButton();
|
651
|
+
gridFillPage.steps.uploadFile('image.png');
|
652
|
+
gridFillPage.steps.verifyFileNameLabel('image.png');
|
653
|
+
gridFillPage.steps.selectImageRadioButton();
|
654
|
+
gridFillPage.steps.uploadFilledImageFile('highlightImage.jpg');
|
655
|
+
gridFillPage.steps.verifyFilledImageFileNameLabel('highlightImage.jpg');
|
656
|
+
utilities.verifyElementNotDisabled(gridFillPage.deleteImageIcon());
|
657
|
+
gridFillPage.steps.switchToPreviewTab();
|
658
|
+
});
|
659
|
+
|
660
|
+
it('Uploaded background image should be displayed in the preview tab grid', () => {
|
661
|
+
gridFillPage.steps.verifyBackgroundImageIsDisplayedInPreviewTabGrid();
|
662
|
+
});
|
663
|
+
|
664
|
+
it('When user selects a cell in preview tab grid, then the uploaded filled image should be displayed in that cell', () => {
|
665
|
+
gridFillPage.steps.selectCellPreviewTab(0, 0);
|
666
|
+
gridFillPage.steps.verifyFilledImageInSelectedCellInPreviewTabGrid(0, 0);
|
667
|
+
});
|
668
|
+
});
|
669
|
+
});
|