itemengine-cypress-automation 1.0.83 → 1.0.85
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +3 -3
- package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +30 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/allOrNothingGroupedScoring.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +510 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +678 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +82 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/minimumScoringPenaltyPointsAndRoundingDropdown.js +198 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +263 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +80 -0
- package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +177 -171
- package/cypress/pages/components/backgroundImageUploadComponent.js +19 -3
- package/cypress/pages/components/draggableOptionContainer.js +13 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +175 -25
- package/cypress/pages/components/figOverImageCanvasComponent.js +257 -0
- package/cypress/pages/components/imageActionsComponent.js +30 -0
- package/cypress/pages/components/index.js +5 -5
- package/cypress/pages/components/measuringToolComponent.js +0 -54
- package/cypress/pages/components/opacityComponent.js +64 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +16 -1
- package/cypress/pages/essayResponsePage.js +5 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +152 -11
- package/cypress/pages/protractorPage.js +3 -1
- package/cypress/pages/rulerPage.js +5 -24
- package/cypress/pages/selectQuestionResourceToolPage.js +1 -1
- package/{deploy.yaml → deploy/e2e/deploy.yaml} +1 -1
- package/deploy/smoke/deploy.yaml +29 -0
- package/deploy/smoke/run.sh +6 -0
- package/package.json +1 -1
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/manuallyAndNonScoredScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/allOrNothingBasicForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/clickAndDrop.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/draggableOptions.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabBasicSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/headerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/manuallyAndNonScoredScoringEditTab.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/specifyCorrectAnswerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettings.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettingsForGroupedLayout.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/switchingCasesBetweenOptionsLayout.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/manuallyAndNonScored.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/allOrNothingForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/editTabScoringSection.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/specifyCorrectAnswerSection.js +0 -0
- /package/{run.sh → deploy/e2e/run.sh} +0 -0
@@ -0,0 +1,678 @@
|
|
1
|
+
import { fillInTheGapsOverImageDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const groupedOptions = [['Petals', 'Flower', 'Stem', 'Seed'], ['Rose', 'Lily', 'Tulip', 'Orchid']];
|
7
|
+
|
8
|
+
describe('Create Item Page: Fill in the gaps over image - drag and drop: Click and drop cases for \'Standard\' and \'Grouped\' response options layouts in \'Specify correct answer\' section and \'Preview tab\'', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Click and drop cases for \'Standard\' response options layout in \'Specify correct answer\' section', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigate to fill in the gaps over image - drag and drop question type, add input to option input fields');
|
17
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
20
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
21
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
22
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
23
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
|
24
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
|
25
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(groupedOptions[0]);
|
26
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
27
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
28
|
+
});
|
29
|
+
|
30
|
+
it('When the user has not selected any option, the options and dropzone should be in inactive state', () => {
|
31
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
32
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
33
|
+
});
|
34
|
+
|
35
|
+
it('CSS of inactive state of options and dropzone', { tags: 'css' }, () => {
|
36
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
37
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
38
|
+
'background-color': css.color.defaultBackground,
|
39
|
+
});
|
40
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
41
|
+
'color': css.color.text,
|
42
|
+
'font-size': css.fontSize.default,
|
43
|
+
'font-weight': css.fontWeight.regular,
|
44
|
+
});
|
45
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
46
|
+
'fill': css.color.secondaryBtn
|
47
|
+
});
|
48
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection().eq(0), {
|
49
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
it('Accessibility of inactive state of options and dropzone', { tags: 'a11y' }, () => {
|
54
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
55
|
+
});
|
56
|
+
|
57
|
+
it('When the user selects an option, it should get in selected state and all the other dropzone should be displayed in inactive state', () => {
|
58
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInSpecifyCorrectAnswerSection('Petals');
|
59
|
+
cy.log('checking active state of selected option')
|
60
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyActiveStateOfDraggableOptionInSpecifyCorrectAnswerSection(0);
|
61
|
+
cy.log('checking default state of unselected option(s)')
|
62
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfUnselectedDraggableOptionsInSpecifyCorrectAnswerSection([1, 2, 3]);
|
63
|
+
cy.log('checking active state of all category cells');
|
64
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
65
|
+
});
|
66
|
+
|
67
|
+
it('CSS of active state of options and inactive state of dropzone', { tags: 'css' }, () => {
|
68
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
69
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
70
|
+
'background-color': css.color.defaultBackground
|
71
|
+
});
|
72
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
73
|
+
'fill': css.color.activeButtons
|
74
|
+
});
|
75
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection(), 0), {
|
76
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
77
|
+
});
|
78
|
+
});
|
79
|
+
|
80
|
+
it('Accessibility of active state of options and dropzone', { tags: 'a11y' }, () => {
|
81
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When the user deselects the option, it should get in deselected state and the dropzone should remain in the inactive state', () => {
|
85
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInSpecifyCorrectAnswerSection('Petals');
|
86
|
+
cy.log('Checking default state of deselected option')
|
87
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
88
|
+
cy.log('Checking default inactive state of category cells')
|
89
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
90
|
+
});
|
91
|
+
|
92
|
+
it('When the user drops an option in one of the dropzone, the option should get removed from the response container, the dropzone should get filled with that option and the other dropzone should remain in inactive state', () => {
|
93
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
94
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(0, ['Petals']);
|
95
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['Flower', 'Stem', 'Seed']);
|
96
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
97
|
+
});
|
98
|
+
|
99
|
+
it('When the user has dropped an option inside a dropzone, drag handle should not be displayed in the dropzone', () => {
|
100
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDragHandleNotVisibleInFilledDropzoneOfSpecifyCorrectAnswerSection(0);
|
101
|
+
});
|
102
|
+
|
103
|
+
it('CSS of filled dropzone', { tags: 'css' }, () => {
|
104
|
+
fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
105
|
+
.eq(0)
|
106
|
+
.within(() => {
|
107
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
108
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
109
|
+
'background-color': css.color.defaultBackground
|
110
|
+
});
|
111
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
112
|
+
'color': css.color.text,
|
113
|
+
'font-size': css.fontSize.default,
|
114
|
+
'font-weight': css.fontWeight.regular,
|
115
|
+
});
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
it('Accessibility of filled dropzone', { tags: 'a11y' }, () => {
|
120
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
121
|
+
});
|
122
|
+
|
123
|
+
it('When the user drops an option on a filled dropzone, the existing option should persist in the dropzone', () => {
|
124
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Flower': 0 });
|
125
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(0, ['Petals', 'Flower']);
|
126
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
127
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['Stem', 'Seed']);
|
128
|
+
});
|
129
|
+
|
130
|
+
it('When the user selects an option from the filled dropzone, dropzone should remain inactive', () => {
|
131
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
132
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
133
|
+
});
|
134
|
+
|
135
|
+
it('CSS of option from the filled dropzone in selected state', { tags: 'css' }, () => {
|
136
|
+
fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
137
|
+
.eq(0)
|
138
|
+
.within(() => {
|
139
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
140
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
141
|
+
'background-color': css.color.defaultBackground
|
142
|
+
});
|
143
|
+
});
|
144
|
+
});
|
145
|
+
|
146
|
+
it('Accessibility of option from the filled dropzone in selected state', { tags: 'a11y' }, () => {
|
147
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
148
|
+
});
|
149
|
+
|
150
|
+
it('When the user deselects an option from the filled dropzone, the option should return to the inactive state', () => {
|
151
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
152
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
153
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
154
|
+
});
|
155
|
+
|
156
|
+
it('When the user selects a filled option and clicks in the response container, the selected option should get back in the response container and \'Error: Please set a correct answer\' error message should be displayed', () => {
|
157
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
|
158
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Flower');
|
159
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection(['Petals', 'Flower', 'Stem', 'Seed']);
|
160
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'Error: Please set a correct answer.');
|
161
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'visible');
|
162
|
+
});
|
163
|
+
|
164
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyErrorMessageCSSAndA11y();
|
165
|
+
|
166
|
+
it('When the user fills a dropzone, the dropzone should get filled with the option and the \'Error: Please set a correct answer\' error message should disappear', () => {
|
167
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
168
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyErrorMessageIsNotDisplayed();
|
169
|
+
});
|
170
|
+
|
171
|
+
it('The user should be able to move an option from one dropzone to another dropzone', () => {
|
172
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
173
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDropzoneOfSpecifyCorrectAnswerSection(1);
|
174
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDropzoneTextSpecifyCorrectAnswerSection(0, '');
|
175
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(1, ['Petals']);
|
176
|
+
});
|
177
|
+
});
|
178
|
+
|
179
|
+
describe('Click and drop cases for \'Standard\' response options layout in \'Preview tab\'', () => {
|
180
|
+
abortEarlySetup();
|
181
|
+
before(() => {
|
182
|
+
cy.log('Navigate to fill in the gaps over image - drag and drop question type, add input to option input fields');
|
183
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
184
|
+
cy.barsPreLoaderWait();
|
185
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
186
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
187
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
188
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
189
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
|
190
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
|
191
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(groupedOptions[0]);
|
192
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
193
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
194
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
195
|
+
});
|
196
|
+
|
197
|
+
it('When the user has not selected any option, the options and dropzone should be in inactive state', () => {
|
198
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
199
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
200
|
+
});
|
201
|
+
|
202
|
+
it('CSS of inactive state of options and dropzone', { tags: 'css' }, () => {
|
203
|
+
fillInTheGapsOverImageDragAndDropPage.optionsContainerPreviewTab()
|
204
|
+
.within(() => {
|
205
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
206
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
207
|
+
'background-color': css.color.defaultBackground,
|
208
|
+
});
|
209
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
210
|
+
'color': css.color.text,
|
211
|
+
'font-size': css.fontSize.default,
|
212
|
+
'font-weight': css.fontWeight.regular,
|
213
|
+
});
|
214
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
215
|
+
'fill': css.color.secondaryBtn
|
216
|
+
});
|
217
|
+
});
|
218
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperPreviewTab().eq(0), {
|
219
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
220
|
+
});
|
221
|
+
});
|
222
|
+
|
223
|
+
it('Accessibility of inactive state of options and dropzone', { tags: 'a11y' }, () => {
|
224
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
225
|
+
});
|
226
|
+
|
227
|
+
it('When the user selects an option, it should get in selected state and all the dropzone should remain in inactive state', () => {
|
228
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInPreviewTab('Petals');
|
229
|
+
cy.log('checking active state of selected option')
|
230
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyActiveStateOfDraggableOptionInPreviewTab(0);
|
231
|
+
cy.log('checking default state of unselected option(s)')
|
232
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfUnselectedDraggableOptionsInPreviewTab([1, 2, 3]);
|
233
|
+
cy.log('checking active state of all category cells');
|
234
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
235
|
+
});
|
236
|
+
|
237
|
+
it('CSS of active state of options and dropzone', { tags: 'css' }, () => {
|
238
|
+
fillInTheGapsOverImageDragAndDropPage.optionsContainerPreviewTab()
|
239
|
+
.within(() => {
|
240
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
241
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
242
|
+
'background-color': css.color.defaultBackground
|
243
|
+
});
|
244
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
245
|
+
'fill': css.color.activeButtons
|
246
|
+
});
|
247
|
+
});
|
248
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperPreviewTab().eq(0), {
|
249
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
250
|
+
});
|
251
|
+
});
|
252
|
+
|
253
|
+
it('Accessibility of active state of options and dropzone', { tags: 'a11y' }, () => {
|
254
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
255
|
+
});
|
256
|
+
|
257
|
+
it('When the user deselects the option, it should get in deselected state and the dropzone should remain in the inactive state', () => {
|
258
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInPreviewTab('Petals');
|
259
|
+
cy.log('Checking default state of deselected option')
|
260
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
261
|
+
cy.log('Checking default inactive state of category cells')
|
262
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
263
|
+
});
|
264
|
+
|
265
|
+
it('When the user drops an option in one of the dropzone, the option should get removed from the response container, the dropzone should get filled with that option and the other dropzone should return to inactive state', () => {
|
266
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0 });
|
267
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Petals']);
|
268
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(['Flower', 'Stem', 'Seed']);
|
269
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
270
|
+
});
|
271
|
+
|
272
|
+
it('When the user has dropped an option inside a dropzone, drag handle should not be displayed in the dropzone', () => {
|
273
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDragHandleNotVisibleInFilledDropzoneOfPreviewTab(0);
|
274
|
+
});
|
275
|
+
|
276
|
+
it('CSS of filled dropzone', { tags: 'css' }, () => {
|
277
|
+
fillInTheGapsOverImageDragAndDropPage.dropzonePreviewTab()
|
278
|
+
.eq(0)
|
279
|
+
.within(() => {
|
280
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
281
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
282
|
+
'background-color': css.color.defaultBackground
|
283
|
+
});
|
284
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
285
|
+
'color': css.color.text,
|
286
|
+
'font-size': css.fontSize.default,
|
287
|
+
'font-weight': css.fontWeight.regular,
|
288
|
+
});
|
289
|
+
});
|
290
|
+
});
|
291
|
+
|
292
|
+
it('Accessibility of filled dropzone', { tags: 'a11y' }, () => {
|
293
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
294
|
+
});
|
295
|
+
|
296
|
+
it('When the user drops an option on a filled dropzone, the existing option should persist in the dropzone', () => {
|
297
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Flower': 0 });
|
298
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Petals', 'Flower']);
|
299
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
300
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(['Stem', 'Seed']);
|
301
|
+
});
|
302
|
+
|
303
|
+
it('When the user selects an option from the filled dropzone, the dropzone should remain inactive', () => {
|
304
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
305
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
306
|
+
});
|
307
|
+
|
308
|
+
it('CSS of option from the filled dropzone in selected state', { tags: 'css' }, () => {
|
309
|
+
fillInTheGapsOverImageDragAndDropPage.dropzonePreviewTab()
|
310
|
+
.eq(0)
|
311
|
+
.within(() => {
|
312
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
313
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
314
|
+
'background-color': css.color.defaultBackground
|
315
|
+
});
|
316
|
+
});
|
317
|
+
});
|
318
|
+
|
319
|
+
it('Accessibility of option from the filled dropzone in selected state', { tags: 'a11y' }, () => {
|
320
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
321
|
+
});
|
322
|
+
|
323
|
+
it('When the user deselects an option from the filled dropzone, the option should return to the inactive state', () => {
|
324
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
325
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
326
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
327
|
+
});
|
328
|
+
|
329
|
+
it('The user should be able to move an option from one dropzone to another dropzone', () => {
|
330
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
331
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDropzoneOfPreviewTab(1);
|
332
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Flower']);
|
333
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(1, ['Petals']);
|
334
|
+
});
|
335
|
+
});
|
336
|
+
|
337
|
+
describe('Click and drop cases for \'Grouped\' response options layout in \'Specify correct answer\' section', () => {
|
338
|
+
abortEarlySetup();
|
339
|
+
before(() => {
|
340
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
341
|
+
cy.barsPreLoaderWait();
|
342
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
343
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
344
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
345
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
346
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
|
347
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
|
348
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
|
349
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addGroupTitle('Group A');
|
350
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
|
351
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(groupedOptions[0]);
|
352
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection('Group A', groupedOptions[1]);
|
353
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
354
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
355
|
+
});
|
356
|
+
|
357
|
+
it('When the user has not selected any option, the options and dropzone should be in inactive state', () => {
|
358
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
359
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
360
|
+
});
|
361
|
+
|
362
|
+
it('CSS of inactive state of options and dropzone', { tags: 'css' }, () => {
|
363
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
364
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
365
|
+
'background-color': css.color.defaultBackground,
|
366
|
+
});
|
367
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
368
|
+
'color': css.color.text,
|
369
|
+
'font-size': css.fontSize.default,
|
370
|
+
'font-weight': css.fontWeight.regular
|
371
|
+
});
|
372
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
373
|
+
'fill': css.color.secondaryBtn
|
374
|
+
});
|
375
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection().eq(0), {
|
376
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
377
|
+
});
|
378
|
+
});
|
379
|
+
|
380
|
+
it('Accessibility of inactive state of options and dropzone', { tags: 'a11y' }, () => {
|
381
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
382
|
+
});
|
383
|
+
|
384
|
+
it('When the user selects an option, it should get in selected state and all the dropzone remain in inactive state', () => {
|
385
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInSpecifyCorrectAnswerSection('Petals');
|
386
|
+
cy.log('checking active state of selected option')
|
387
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyActiveStateOfDraggableOptionInSpecifyCorrectAnswerSection(0);
|
388
|
+
cy.log('checking default state of unselected option(s)')
|
389
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfUnselectedDraggableOptionsInSpecifyCorrectAnswerSection([1, 2, 3]);
|
390
|
+
cy.log('checking inactive state of all category cells');
|
391
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
392
|
+
});
|
393
|
+
|
394
|
+
it('CSS of active state of options and dropzone', { tags: 'css' }, () => {
|
395
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
396
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
397
|
+
'background-color': css.color.defaultBackground
|
398
|
+
});
|
399
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
400
|
+
'fill': css.color.activeButtons
|
401
|
+
});
|
402
|
+
});
|
403
|
+
|
404
|
+
it('Accessibility of active state of options and dropzone', { tags: 'a11y' }, () => {
|
405
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
406
|
+
});
|
407
|
+
|
408
|
+
it('When the user deselects the option, it should get in deselected state and the dropzone should return to the inactive state', () => {
|
409
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInSpecifyCorrectAnswerSection('Petals');
|
410
|
+
cy.log('Checking default state of deselected option')
|
411
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
412
|
+
cy.log('Checking default inactive state of category cells')
|
413
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
414
|
+
});
|
415
|
+
|
416
|
+
it('When the user drops an option in one of the dropzone, the option should get removed from the respective group of the response container, the dropzone should get filled with that option and the other dropzone should return to inactive state', () => {
|
417
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
418
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(0, ['Petals']);
|
419
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['Flower', 'Stem', 'Seed']);
|
420
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(1, groupedOptions[1]);
|
421
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
422
|
+
});
|
423
|
+
|
424
|
+
it('When the user has dropped an option inside a dropzone, drag handle should not be displayed in the dropzone', () => {
|
425
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDragHandleNotVisibleInFilledDropzoneOfSpecifyCorrectAnswerSection(0);
|
426
|
+
});
|
427
|
+
|
428
|
+
it('CSS of filled dropzone', { tags: 'css' }, () => {
|
429
|
+
fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
430
|
+
.eq(0)
|
431
|
+
.within(() => {
|
432
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
433
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
434
|
+
'background-color': css.color.defaultBackground
|
435
|
+
});
|
436
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
437
|
+
'color': css.color.text,
|
438
|
+
'font-size': css.fontSize.default,
|
439
|
+
'font-weight': css.fontWeight.regular,
|
440
|
+
});
|
441
|
+
});
|
442
|
+
});
|
443
|
+
|
444
|
+
it('Accessibility of filled dropzone', { tags: 'a11y' }, () => {
|
445
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
446
|
+
});
|
447
|
+
|
448
|
+
it('When the user drops an option on a filled dropzone, the existing option should persist in the dropzone', () => {
|
449
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Flower': 0 });
|
450
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(0, ['Petals', 'Flower']);
|
451
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
452
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, ['Stem', 'Seed']);
|
453
|
+
});
|
454
|
+
|
455
|
+
it('When the user selects an option from the filled dropzone, the dropzone should be in inactive state', () => {
|
456
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
457
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
458
|
+
});
|
459
|
+
|
460
|
+
it('CSS of option from the filled dropzone in selected state', { tags: 'css' }, () => {
|
461
|
+
fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
462
|
+
.eq(0)
|
463
|
+
.within(() => {
|
464
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
465
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
466
|
+
'background-color': css.color.defaultBackground
|
467
|
+
});
|
468
|
+
});
|
469
|
+
});
|
470
|
+
|
471
|
+
it('Accessibility of option from the filled dropzone in selected state', { tags: 'a11y' }, () => {
|
472
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.pointsWrapper().parents('.label-image-dnd-align-bottom'));
|
473
|
+
});
|
474
|
+
|
475
|
+
it('When the user deselects an option from the filled dropzone, the option should return to the inactive state', () => {
|
476
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
477
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInSpecifyCorrectAnswerSection();
|
478
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection();
|
479
|
+
});
|
480
|
+
|
481
|
+
it('When the user selects a filled option and clicks in the response container, the selected option should get back in the response container and \'Error: Please set a correct answer\' error message should be displayed', () => {
|
482
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
|
483
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Flower');
|
484
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(0, groupedOptions[0]);
|
485
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInSpecifyCorrectAnswerSection(1, groupedOptions[1]);
|
486
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'Error: Please set a correct answer.');
|
487
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.errorMessage(), 'visible');
|
488
|
+
});
|
489
|
+
|
490
|
+
fillInTheGapsOverImageDragAndDropPage.tests.verifyErrorMessageCSSAndA11y();
|
491
|
+
|
492
|
+
it('When the user fills a dropzone, the dropzone should get filled with the option and the \'Error: Please set a correct answer\' error message should disappear', () => {
|
493
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
494
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyErrorMessageIsNotDisplayed();
|
495
|
+
});
|
496
|
+
|
497
|
+
it('The user should be able to move an option from one dropzone to another dropzone', () => {
|
498
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection('Petals', 0);
|
499
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDropzoneOfSpecifyCorrectAnswerSection(1);
|
500
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDropzoneTextSpecifyCorrectAnswerSection(0, '');
|
501
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection(1, ['Petals']);
|
502
|
+
});
|
503
|
+
|
504
|
+
it('When user has dropped all the options from a group in the response areas, then empty group should be displayed in the options container', () => {
|
505
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Flower': 0, 'Stem': 0, 'Seed': 2 });
|
506
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedOptionsTitleSpecifyCorrectAnswerSection(0, 'Group A')
|
507
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyEmptyGroupInSpecifyCorrectAnswerSection(0);
|
508
|
+
});
|
509
|
+
});
|
510
|
+
|
511
|
+
describe('Click and drop cases for \'Grouped\' response options layout in \'Preview tab\'', () => {
|
512
|
+
abortEarlySetup();
|
513
|
+
before(() => {
|
514
|
+
fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
|
515
|
+
cy.barsPreLoaderWait();
|
516
|
+
fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
|
517
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
|
518
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
|
519
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
|
520
|
+
fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
|
521
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandDraggableOptionsLayoutDropdown();
|
522
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
|
523
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addGroupTitle('Group A');
|
524
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(2);
|
525
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(groupedOptions[0]);
|
526
|
+
fillInTheGapsOverImageDragAndDropPage.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection('Group A', groupedOptions[1]);
|
527
|
+
fillInTheGapsOverImageDragAndDropPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
528
|
+
fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
|
529
|
+
fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
|
530
|
+
});
|
531
|
+
|
532
|
+
it('When the user has not selected any option, the options and dropzone should be in inactive state', () => {
|
533
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
534
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
535
|
+
});
|
536
|
+
|
537
|
+
it('CSS of inactive state of options and dropzone', { tags: 'css' }, () => {
|
538
|
+
fillInTheGapsOverImageDragAndDropPage.optionsContainerPreviewTab()
|
539
|
+
.within(() => {
|
540
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
541
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
542
|
+
'background-color': css.color.defaultBackground,
|
543
|
+
});
|
544
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
545
|
+
'color': css.color.text,
|
546
|
+
'font-size': css.fontSize.default,
|
547
|
+
'font-weight': css.fontWeight.regular,
|
548
|
+
});
|
549
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
550
|
+
'fill': css.color.secondaryBtn
|
551
|
+
});
|
552
|
+
});
|
553
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperPreviewTab().eq(0), {
|
554
|
+
'border-left': `2px dashed ${css.color.activeComponentBorder}`
|
555
|
+
});
|
556
|
+
});
|
557
|
+
|
558
|
+
it('Accessibility of inactive state of options and dropzone', { tags: 'a11y' }, () => {
|
559
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
560
|
+
});
|
561
|
+
|
562
|
+
it('When the user selects an option, it should get in selected state and all the dropzone should get in inactive state', () => {
|
563
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInPreviewTab('Petals');
|
564
|
+
cy.log('checking active state of selected option')
|
565
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyActiveStateOfDraggableOptionInPreviewTab(0);
|
566
|
+
cy.log('checking default state of unselected option(s)')
|
567
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfUnselectedDraggableOptionsInPreviewTab([1, 2, 3]);
|
568
|
+
cy.log('checking inactive state of all category cells');
|
569
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
570
|
+
});
|
571
|
+
|
572
|
+
it('CSS of active state of options and dropzone', { tags: 'css' }, () => {
|
573
|
+
fillInTheGapsOverImageDragAndDropPage.optionsContainerPreviewTab()
|
574
|
+
.within(() => {
|
575
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
576
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
577
|
+
'background-color': css.color.defaultBackground
|
578
|
+
});
|
579
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOptionDragIcon().find('g path').eq(1), {
|
580
|
+
'fill': css.color.activeButtons
|
581
|
+
});
|
582
|
+
});
|
583
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperPreviewTab().eq(0), {
|
584
|
+
'border': `2px dashed ${css.color.activeComponentBorder}`
|
585
|
+
});
|
586
|
+
});
|
587
|
+
|
588
|
+
it('Accessibility of active state of options and dropzone', { tags: 'a11y' }, () => {
|
589
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
590
|
+
});
|
591
|
+
|
592
|
+
it('When the user deselects the option, it should get in deselected state and the dropzone should return to the inactive state', () => {
|
593
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInPreviewTab('Petals');
|
594
|
+
cy.log('Checking default state of deselected option')
|
595
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
596
|
+
cy.log('Checking default inactive state of category cells')
|
597
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
598
|
+
});
|
599
|
+
|
600
|
+
it('When the user drops an option in one of the dropzone, the option should get removed from the respective group of the response container, the dropzone should get filled with that option and the other dropzone should return to inactive state', () => {
|
601
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0 });
|
602
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Petals']);
|
603
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInPreviewTab(0, ['Flower', 'Stem', 'Seed']);
|
604
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInPreviewTab(1, groupedOptions[1]);
|
605
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
606
|
+
});
|
607
|
+
|
608
|
+
it('When the user has dropped an option inside a dropzone, drag handle should not be displayed in the dropzone', () => {
|
609
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDragHandleNotVisibleInFilledDropzoneOfPreviewTab(0);
|
610
|
+
});
|
611
|
+
|
612
|
+
it('CSS of filled dropzone', { tags: 'css' }, () => {
|
613
|
+
fillInTheGapsOverImageDragAndDropPage.dropzonePreviewTab()
|
614
|
+
.eq(0)
|
615
|
+
.within(() => {
|
616
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption(), {
|
617
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
618
|
+
'background-color': css.color.defaultBackground
|
619
|
+
});
|
620
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().find('.question-text-wrapper'), {
|
621
|
+
'color': css.color.text,
|
622
|
+
'font-size': css.fontSize.default,
|
623
|
+
'font-weight': css.fontWeight.regular,
|
624
|
+
});
|
625
|
+
});
|
626
|
+
});
|
627
|
+
|
628
|
+
it('Accessibility of filled dropzone', { tags: 'a11y' }, () => {
|
629
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
630
|
+
});
|
631
|
+
|
632
|
+
it('When the user drops an option on a filled dropzone, the existing option should persist in the dropzone', () => {
|
633
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Flower': 0 });
|
634
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Petals', 'Flower']);
|
635
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
636
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedContainerContentsInPreviewTab(0, ['Stem', 'Seed']);
|
637
|
+
});
|
638
|
+
|
639
|
+
it('When the user selects an option from the filled dropzone, the dropzone should remain inactive', () => {
|
640
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
641
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab(1);
|
642
|
+
});
|
643
|
+
|
644
|
+
it('CSS of option from the filled dropzone in selected state', { tags: 'css' }, () => {
|
645
|
+
fillInTheGapsOverImageDragAndDropPage.dropzonePreviewTab()
|
646
|
+
.eq(0)
|
647
|
+
.within(() => {
|
648
|
+
utilities.verifyCSS(fillInTheGapsOverImageDragAndDropPage.draggableOption().eq(0), {
|
649
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
650
|
+
'background-color': css.color.defaultBackground
|
651
|
+
});
|
652
|
+
});
|
653
|
+
});
|
654
|
+
|
655
|
+
it('Accessibility of option from the filled dropzone in selected state', { tags: 'a11y' }, () => {
|
656
|
+
cy.checkAccessibility(fillInTheGapsOverImageDragAndDropPage.imageInPreviewTab());
|
657
|
+
});
|
658
|
+
|
659
|
+
it('When the user deselects an option from the filled dropzone, the option should return to the inactive state', () => {
|
660
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
661
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDraggableOptionsInPreviewTab();
|
662
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyInactiveStateOfAllDropzoneInPreviewTab();
|
663
|
+
});
|
664
|
+
|
665
|
+
it('The user should be able to move an option from one dropzone to another dropzone', () => {
|
666
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDraggableOptionInDropzoneOfPreviewTab('Petals', 0);
|
667
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickOnDropzoneOfPreviewTab(1);
|
668
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(0, ['Flower']);
|
669
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyDraggableOptionInDropzoneOfPreviewTab(1, ['Petals']);
|
670
|
+
});
|
671
|
+
|
672
|
+
it('When user has dropped all the options from a group in the response areas, then empty group should be displayed in the options container', () => {
|
673
|
+
fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Stem': 0, 'Seed': 0 });
|
674
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyGroupedOptionsTitlePreviewTab(0, 'Group A')
|
675
|
+
fillInTheGapsOverImageDragAndDropPage.steps.verifyEmptyGroupInPreviewTab(0);
|
676
|
+
});
|
677
|
+
});
|
678
|
+
});
|