itemengine-cypress-automation 1.0.83 → 1.0.84
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/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
@@ -1,16 +1,24 @@
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
2
|
+
import { commonComponents } from "./commonComponents";
|
2
3
|
|
3
4
|
const selectors = {
|
4
5
|
//Basic section
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
setLimitLabel: () => cy.get('[class*="SetLimitWrapper"] .essay-response-word-limit-label'),
|
7
|
+
minimumLimitLabel: () => cy.get('.min-max-input-wrapper .essay-response-word-limit-label').eq(0),
|
8
|
+
maximumLimitLabel: () => cy.get('.min-max-input-wrapper .essay-response-word-limit-label').eq(1),
|
9
|
+
minMaxLabelAndInputFieldWrapper: () => cy.get('min-max-input-wrapper'),
|
10
|
+
minimumLimitInputField: () => cy.get('.min-max-input-wrapper input').eq(0),
|
11
|
+
maximumLimitInputField: () => cy.get('.min-max-input-wrapper input').eq(1),
|
12
|
+
wordRadioButton: () => cy.get('input[aria-label="Word"]'),
|
13
|
+
wordLabel: () => cy.get('[aria-label="Word"].ngie-radio-label'),
|
14
|
+
characterRadioButton: () => cy.get('input[aria-label="Character"]'),
|
15
|
+
characterLabel: () => cy.get('[aria-label="Character"].ngie-radio-label'),
|
16
|
+
noneRadioButton: () => cy.get('input[aria-label="None"]'),
|
17
|
+
noneLabel: () => cy.get('[aria-label="None"].ngie-radio-label'),
|
18
|
+
alwaysShowMaxLimitLabel: () => cy.get('[data-ngie-testid="always-show-maximum-limit-checkbox"] .MuiFormControlLabel-label'),
|
19
|
+
alwaysShowMaxLimitCheckbox: () => cy.get('[data-ngie-testid="always-show-maximum-limit-checkbox"] input'),
|
20
|
+
alwaysShowMinLimitLabel: () => cy.get('[data-ngie-testid="always-show-minimum-limit-checkbox"] .MuiFormControlLabel-label'),
|
21
|
+
alwaysShowMinLimitCheckBox: () => cy.get('[data-ngie-testid="always-show-minimum-limit-checkbox"] input'),
|
14
22
|
previewTabToolbarWrapper: () => cy.get('.toolbar-overlay'),
|
15
23
|
previewTabToolbarOption: (formattingOption = null) => {
|
16
24
|
if (formattingOption) {
|
@@ -35,13 +43,118 @@ const selectors = {
|
|
35
43
|
spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input'),
|
36
44
|
customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
|
37
45
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
38
|
-
|
46
|
+
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
47
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
39
48
|
//Preview tab
|
40
49
|
responseField: () => cy.get('[title="Enter your response to the question here."]'),
|
41
50
|
responseFieldWordCount: () => cy.get('[class*="InputLimitLabelWrapper"]'),
|
42
51
|
}
|
43
52
|
|
44
53
|
const steps = {
|
54
|
+
/**
|
55
|
+
* @param {number} maxLimit value to be entered in maximum limit input field
|
56
|
+
* @description this function enters and verifies the value in maximum limit input field
|
57
|
+
*/
|
58
|
+
setMaximumLimit: (maxLimit) => {
|
59
|
+
essayResponseCommonComponents.maximumLimitInputField()
|
60
|
+
.clear()
|
61
|
+
.type(maxLimit)
|
62
|
+
.blur()
|
63
|
+
.should('have.value', maxLimit);
|
64
|
+
|
65
|
+
},
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @param {number} minLimit value to be entered in minimum limit input field
|
69
|
+
* @description this function enters and verifies the value in minimum limit input field
|
70
|
+
*/
|
71
|
+
setMinimumLimit: (minLimit) => {
|
72
|
+
essayResponseCommonComponents.minimumLimitInputField()
|
73
|
+
.clear()
|
74
|
+
.type(minLimit)
|
75
|
+
.blur()
|
76
|
+
.should('have.value', minLimit)
|
77
|
+
},
|
78
|
+
|
79
|
+
clearAndFocusOutOfMaximumLimitInputField: () => {
|
80
|
+
essayResponseCommonComponents.maximumLimitInputField()
|
81
|
+
.clear()
|
82
|
+
.blur();
|
83
|
+
},
|
84
|
+
|
85
|
+
clearAndFocusOutOfMinimumLimitInputField: () => {
|
86
|
+
essayResponseCommonComponents.minimumLimitInputField()
|
87
|
+
.clear()
|
88
|
+
.blur();
|
89
|
+
},
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @param {number} maxLimit value of maximum input field
|
93
|
+
* @description this function verifies the value in maximum limit input field
|
94
|
+
*/
|
95
|
+
verifyMaximumLimitInputField: (maxLimit) => {
|
96
|
+
essayResponseCommonComponents.maximumLimitInputField()
|
97
|
+
.should('have.value', maxLimit)
|
98
|
+
},
|
99
|
+
|
100
|
+
|
101
|
+
verifyMaximumLimitErrorMessage: () => {
|
102
|
+
utilities.verifyInnerText(commonComponents.errorMessage().eq(1), 'Error: Maximum limit must be greater than or equal to Minimum limit.');
|
103
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage().eq(1), 'visible');
|
104
|
+
},
|
105
|
+
|
106
|
+
verifyMinimumLimitErrorMessage: () => {
|
107
|
+
utilities.verifyInnerText(commonComponents.errorMessage().eq(0), 'Error: Minimum limit must be less than or equal to Maximum limit.');
|
108
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage().eq(0), 'visible');
|
109
|
+
},
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @param {number} minLimit value of minimum input field
|
113
|
+
* @description this function verifies the value in minimum limit input field
|
114
|
+
*/
|
115
|
+
verifyMinimumLimitInputField: (minLimit) => {
|
116
|
+
essayResponseCommonComponents.minimumLimitInputField()
|
117
|
+
.should('have.value', minLimit)
|
118
|
+
},
|
119
|
+
|
120
|
+
verifyWordRadioButtonChecked: () => {
|
121
|
+
essayResponseCommonComponents.wordRadioButton()
|
122
|
+
.should('be.checked');
|
123
|
+
},
|
124
|
+
|
125
|
+
verifyCharacterRadioButtonUnchecked: () => {
|
126
|
+
essayResponseCommonComponents.characterRadioButton()
|
127
|
+
.should('not.be.checked');
|
128
|
+
},
|
129
|
+
|
130
|
+
verifyNoneRadioButtonUnchecked: () => {
|
131
|
+
essayResponseCommonComponents.noneRadioButton()
|
132
|
+
.should('not.be.checked');
|
133
|
+
},
|
134
|
+
|
135
|
+
checkCharacterRadioButton: () => {
|
136
|
+
essayResponseCommonComponents.characterRadioButton()
|
137
|
+
.click()
|
138
|
+
.should('be.checked');
|
139
|
+
},
|
140
|
+
|
141
|
+
checkNoneRadioButton: () => {
|
142
|
+
essayResponseCommonComponents.noneRadioButton()
|
143
|
+
.click()
|
144
|
+
.should('be.checked');
|
145
|
+
},
|
146
|
+
|
147
|
+
verifyAlwaysShowMaximumLimitCheckboxIsChecked: () => {
|
148
|
+
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
149
|
+
.should('be.checked');
|
150
|
+
},
|
151
|
+
|
152
|
+
checkAlwaysShowMinimumLimitCheckbox: () => {
|
153
|
+
essayResponseCommonComponents.alwaysShowMinLimitCheckBox()
|
154
|
+
.click()
|
155
|
+
.should('be.checked');
|
156
|
+
},
|
157
|
+
|
45
158
|
//TODO: need to improve this, we are passing two parameters here, only one should suffice
|
46
159
|
openAndSelectOptionFromDisplayWordLimitDropdown: (optionIndex, optionName) => {
|
47
160
|
essayResponseCommonComponents.displayWordLimitDropdown()
|
@@ -52,14 +165,6 @@ const steps = {
|
|
52
165
|
.should('have.text', optionName);
|
53
166
|
},
|
54
167
|
|
55
|
-
setWordLimit: (wordLimit) => {
|
56
|
-
essayResponseCommonComponents.setWordLimitInputField()
|
57
|
-
.clear()
|
58
|
-
.type(wordLimit)
|
59
|
-
.blur()
|
60
|
-
.should('have.value', wordLimit);
|
61
|
-
},
|
62
|
-
|
63
168
|
enterTextInResponseField: (textContent) => {
|
64
169
|
essayResponseCommonComponents.steps.enterInputInResponseField(textContent);
|
65
170
|
essayResponseCommonComponents.steps.verifyResponseFieldInput(textContent);
|
@@ -70,6 +175,16 @@ const steps = {
|
|
70
175
|
.type(textContent);
|
71
176
|
},
|
72
177
|
|
178
|
+
clearResponseField: () => {
|
179
|
+
essayResponseCommonComponents.responseField()
|
180
|
+
.clear();
|
181
|
+
},
|
182
|
+
|
183
|
+
focusOutOfResponseField: () => {
|
184
|
+
essayResponseCommonComponents.responseField()
|
185
|
+
.blur();
|
186
|
+
},
|
187
|
+
|
73
188
|
verifyResponseFieldInput: (textContent) => {
|
74
189
|
essayResponseCommonComponents.responseField()
|
75
190
|
.find('p')
|
@@ -78,16 +193,38 @@ const steps = {
|
|
78
193
|
|
79
194
|
/**
|
80
195
|
* @description this function verifies word limit in the preview tab
|
81
|
-
* @param {
|
196
|
+
* @param {string} wordLimit as set in the set limit section
|
82
197
|
*/
|
83
198
|
verifyResponseFieldWordCount: (wordLimit) => {
|
84
|
-
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(),
|
199
|
+
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(), wordLimit);
|
200
|
+
},
|
201
|
+
|
202
|
+
/**
|
203
|
+
* @description this function verifies word maximum/minimum limit in the preview tab
|
204
|
+
* @param {string} maxLimit as set in the set limit section
|
205
|
+
* @param {string} minLimit as set in the set limit section
|
206
|
+
*/
|
207
|
+
verifyWordLimitInPreviewTab: (maxLimit, minLimit = null) => {
|
208
|
+
if (minLimit !== null) {
|
209
|
+
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(), `${minLimit}-${maxLimit} words required`);
|
210
|
+
}
|
211
|
+
else {
|
212
|
+
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(), `Maximum ${maxLimit} words`);
|
213
|
+
};
|
85
214
|
},
|
86
215
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
216
|
+
/**
|
217
|
+
* @description this function verifies word maximum/minimum limit in the preview tab
|
218
|
+
* @param {string} maxLimit as set in the set limit section
|
219
|
+
* @param {string} minLimit as set in the set limit section
|
220
|
+
*/
|
221
|
+
verifyCharacterLimitInPreviewTab: (maxLimit, minLimit = null) => {
|
222
|
+
if (minLimit !== null) {
|
223
|
+
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(), `${minLimit}-${maxLimit} characters required`);
|
224
|
+
}
|
225
|
+
else {
|
226
|
+
utilities.verifyInnerText(essayResponseCommonComponents.responseFieldWordCount(), `Maximum ${maxLimit} characters`);
|
227
|
+
};
|
91
228
|
},
|
92
229
|
|
93
230
|
resetPreviewTabResponseField: () => {
|
@@ -116,7 +253,7 @@ const steps = {
|
|
116
253
|
.should('have.attr', 'title', defaultFormattingOptions[count])
|
117
254
|
.and('be.visible');
|
118
255
|
});
|
119
|
-
essayResponseCommonComponents.previewTabToolbarOption(
|
256
|
+
essayResponseCommonComponents.previewTabToolbarOption('Decrease Indent')
|
120
257
|
.next()
|
121
258
|
.should('have.attr', 'role', 'separator')
|
122
259
|
.should('be.visible');
|
@@ -136,6 +273,19 @@ const steps = {
|
|
136
273
|
.click()
|
137
274
|
.should('have.attr', 'aria-pressed', 'true');
|
138
275
|
}
|
276
|
+
},
|
277
|
+
|
278
|
+
verifyLimitReachedWarningMessageNotExist: () => {
|
279
|
+
utilities.verifyElementVisibilityState(essayResponseCommonComponents.limitReachedWarningMessage(), 'notExist');
|
280
|
+
},
|
281
|
+
|
282
|
+
/**
|
283
|
+
* @description this function verifies warning text for limit reached
|
284
|
+
* @param {string} warningText warning message displayed
|
285
|
+
*/
|
286
|
+
verifyLimitReachedWarningMessage: (warningText) => {
|
287
|
+
utilities.verifyElementVisibilityState(essayResponseCommonComponents.limitReachedWarningMessage(), 'visible');
|
288
|
+
utilities.verifyInnerText(essayResponseCommonComponents.limitReachedWarningMessage(), warningText);
|
139
289
|
}
|
140
290
|
}
|
141
291
|
|
@@ -1,10 +1,27 @@
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
2
2
|
import { backgroundImageUploadComponent } from "./backgroundImageUploadComponent";
|
3
|
+
import { createQuestionBasePage } from "./createQuestionBasePage";
|
3
4
|
|
4
5
|
const selectors = {
|
5
6
|
insertResponseAreaButton: () => cy.get('button[aria-label*="insert"]').eq(0),
|
6
7
|
selectResponseAreaButton: () => cy.get('button[aria-label*="select"]').eq(0),
|
8
|
+
canvas: () => cy.get('[class*="Canvasstyle__DragAndDropCanvas"]'),
|
9
|
+
canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] [class*="Canvasstyle__DragAndDropCanvas"]'),
|
7
10
|
canvasImage: () => cy.get('.canvas-image'),
|
11
|
+
canvasImageInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] .canvas-image'),
|
12
|
+
imagePropertiesLabel: () => cy.get('[class*="ImagePropertiesstyles__SectionLabel"]'),
|
13
|
+
fillImageToCanvasLabel: () => cy.get('[data-ngie-testid="fill-image-to-canvas-checkbox"] .MuiFormControlLabel-label'),
|
14
|
+
fillImageToCanvasCheckbox: () => cy.get('[data-ngie-testid="fill-image-to-canvas-checkbox"] input'),
|
15
|
+
imageAlignmentLabel: () => cy.get('.image-alignment-wrapper [class*="OptionsContainerstyles__LabelWrapper"]'),
|
16
|
+
topLeftAlignmentButton: () => cy.get('[data-ngie-testid="top-left-toggle-button"]'),
|
17
|
+
centerAlignmentButton: () => cy.get('.image-alignment-wrapper [data-ngie-testid="center-toggle-button"]'),
|
18
|
+
topRightAlignmentButton: () => cy.get('[data-ngie-testid="top-right-toggle-button"]'),
|
19
|
+
canvasWidthLabel: () => cy.get('.common-text-wrapper .additional-settings-label').eq(0),
|
20
|
+
canvasWidthInputField: () => cy.get('.common-text-wrapper .text-field').eq(0),
|
21
|
+
canvasHeightLabel: () => cy.get('.common-text-wrapper .additional-settings-label').eq(1),
|
22
|
+
canvasHeightInputField: () => cy.get('.common-text-wrapper .text-field').eq(1),
|
23
|
+
imageAlternativeTextLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
|
24
|
+
imageAlternativeTextInputField: () => cy.get('[class*="ImagePropertiesstyles__AltTextWrapper"] input'),
|
8
25
|
canvasImagePreviewTab: () => cy.get('.background-image'),
|
9
26
|
removeDropzoneButton: () => cy.get('.remove-button')
|
10
27
|
}
|
@@ -36,6 +53,246 @@ const steps = {
|
|
36
53
|
cy.wait(2000);
|
37
54
|
},
|
38
55
|
|
56
|
+
verifyImageIsUploadedInPreviewTab: () => {
|
57
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImageInPreviewTab(), 'visible')
|
58
|
+
},
|
59
|
+
|
60
|
+
verifyCanvasImageNotExist: () => {
|
61
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImage(), 'notExist');
|
62
|
+
},
|
63
|
+
|
64
|
+
verifyFillImageToCanvasCheckboxUnchecked: () => {
|
65
|
+
figOverImageCanvasComponent.fillImageToCanvasCheckbox()
|
66
|
+
.should('not.be.checked');
|
67
|
+
},
|
68
|
+
|
69
|
+
verifyFillImageToCanvasCheckboxChecked: () => {
|
70
|
+
figOverImageCanvasComponent.fillImageToCanvasCheckbox()
|
71
|
+
.should('be.checked');
|
72
|
+
},
|
73
|
+
|
74
|
+
checkFillImageToCanvasCheckbox: () => {
|
75
|
+
figOverImageCanvasComponent.fillImageToCanvasCheckbox()
|
76
|
+
.click();
|
77
|
+
steps.verifyFillImageToCanvasCheckboxChecked();
|
78
|
+
},
|
79
|
+
|
80
|
+
uncheckFillImageToCanvasCheckbox: () => {
|
81
|
+
figOverImageCanvasComponent.fillImageToCanvasCheckbox()
|
82
|
+
.click();
|
83
|
+
steps.verifyFillImageToCanvasCheckboxUnchecked();
|
84
|
+
},
|
85
|
+
|
86
|
+
verifyCanvasImageTopLeftAligned: () => {
|
87
|
+
figOverImageCanvasComponent.canvasImage()
|
88
|
+
.should('have.css', 'top', '0px')
|
89
|
+
.and('have.css', 'left', '0px');
|
90
|
+
},
|
91
|
+
|
92
|
+
verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
|
93
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
94
|
+
.should('have.css', 'top', '0px')
|
95
|
+
.and('have.css', 'left', '0px');
|
96
|
+
},
|
97
|
+
|
98
|
+
verifyCanvasImageTopRightAligned: () => {
|
99
|
+
figOverImageCanvasComponent.canvasImage()
|
100
|
+
.should('have.css', 'top', '0px')
|
101
|
+
.and('not.have.css', 'left', '0px');
|
102
|
+
},
|
103
|
+
|
104
|
+
verifyCanvasImageTopRightAlignedInPreviewTab: () => {
|
105
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
106
|
+
.should('have.css', 'top', '0px')
|
107
|
+
.and('not.have.css', 'left', '0px');
|
108
|
+
},
|
109
|
+
|
110
|
+
verifyCanvasImageCenterAligned: () => {
|
111
|
+
figOverImageCanvasComponent.canvasImage()
|
112
|
+
.should('not.have.css', 'top', '0px')
|
113
|
+
.and('not.have.css', 'left', '0px');
|
114
|
+
},
|
115
|
+
|
116
|
+
verifyCanvasImageCenterAlignedInPreviewTab: () => {
|
117
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
118
|
+
.should('not.have.css', 'top', '0px')
|
119
|
+
.and('not.have.css', 'left', '0px');
|
120
|
+
},
|
121
|
+
|
122
|
+
selectTopLeftImageAlignment: () => {
|
123
|
+
figOverImageCanvasComponent.topLeftAlignmentButton()
|
124
|
+
.click();
|
125
|
+
figOverImageCanvasComponent.topLeftAlignmentButton()
|
126
|
+
.should('have.attr', 'aria-pressed', 'true');
|
127
|
+
},
|
128
|
+
|
129
|
+
selectTopRightImageAlignment: () => {
|
130
|
+
figOverImageCanvasComponent.topRightAlignmentButton()
|
131
|
+
.click();
|
132
|
+
figOverImageCanvasComponent.topRightAlignmentButton()
|
133
|
+
.should('have.attr', 'aria-pressed', 'true');
|
134
|
+
},
|
135
|
+
|
136
|
+
selectCenterImageAlignment: () => {
|
137
|
+
figOverImageCanvasComponent.centerAlignmentButton()
|
138
|
+
.click();
|
139
|
+
figOverImageCanvasComponent.centerAlignmentButton()
|
140
|
+
.should('have.attr', 'aria-pressed', 'true');
|
141
|
+
},
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @param {number} value holds opacity value for image
|
145
|
+
* @description function verifies opacity value for image
|
146
|
+
*/
|
147
|
+
verifyOpacityValueForCanvasImage: (value) => {
|
148
|
+
figOverImageCanvasComponent.canvasImage()
|
149
|
+
.should('have.attr', 'opacity', value);
|
150
|
+
},
|
151
|
+
|
152
|
+
/**
|
153
|
+
* @param {number} value holds opacity value for image
|
154
|
+
* @description function verifies opacity value for image
|
155
|
+
*/
|
156
|
+
verifyOpacityValueForCanvasImageInPreviewTab: (value) => {
|
157
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
158
|
+
.should('have.attr', 'opacity', value);
|
159
|
+
},
|
160
|
+
|
161
|
+
/**
|
162
|
+
* @param {string} text text to be added in input field
|
163
|
+
* @description this function adds text in input field and then verifies it
|
164
|
+
*/
|
165
|
+
enterAndVerifyImageAlternativeTextInInputField: (text) => {
|
166
|
+
figOverImageCanvasComponent.imageAlternativeTextInputField()
|
167
|
+
.type(text);
|
168
|
+
figOverImageCanvasComponent.imageAlternativeTextInputField()
|
169
|
+
.should('have.value', text);
|
170
|
+
},
|
171
|
+
|
172
|
+
/**
|
173
|
+
* @param {string} text alternative text for canvas image
|
174
|
+
* @description this function verifies text for canvas image
|
175
|
+
*/
|
176
|
+
verifyImageAlternativeTextInPreviewTab: (text) => {
|
177
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
178
|
+
.should('have.attr', 'alt', text);
|
179
|
+
},
|
180
|
+
|
181
|
+
/**
|
182
|
+
* @param {string} text alternative text for canvas image
|
183
|
+
* @description this function verifies text for canvas image
|
184
|
+
*/
|
185
|
+
verifyImageAlternativeTextPresentInEditTab: (text) => {
|
186
|
+
figOverImageCanvasComponent.canvasImage()
|
187
|
+
.should('have.attr', 'alt', text);
|
188
|
+
},
|
189
|
+
|
190
|
+
clearImageAlternativeTextInputFieldText: () => {
|
191
|
+
figOverImageCanvasComponent.imageAlternativeTextInputField()
|
192
|
+
.clear();
|
193
|
+
},
|
194
|
+
|
195
|
+
verifyNoImageAlternativeTextPresentInPreviewTab: () => {
|
196
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab()
|
197
|
+
.should('have.attr', 'alt', '');
|
198
|
+
},
|
199
|
+
|
200
|
+
verifyNoImageAlternativeTextPresentInEditTab: () => {
|
201
|
+
figOverImageCanvasComponent.canvasImage()
|
202
|
+
.should('have.attr', 'alt', '');
|
203
|
+
},
|
204
|
+
|
205
|
+
verifyImageFitsToCanvas: () => {
|
206
|
+
figOverImageCanvasComponent.canvasWidthInputField()
|
207
|
+
.invoke('attr', 'value')
|
208
|
+
.then((value) => {
|
209
|
+
figOverImageCanvasComponent.canvasImage().should('have.css', 'width', `${value}px`);
|
210
|
+
});
|
211
|
+
},
|
212
|
+
|
213
|
+
verifyImageDoesNotFitToCanvas: () => {
|
214
|
+
figOverImageCanvasComponent.canvasHeightInputField()
|
215
|
+
.invoke('attr', 'value')
|
216
|
+
.then((value) => {
|
217
|
+
figOverImageCanvasComponent.canvasImage().should('have.css', 'height', `${value}px`);
|
218
|
+
});
|
219
|
+
},
|
220
|
+
|
221
|
+
verifyImageFitsToCanvasInPreviewTab: () => {
|
222
|
+
createQuestionBasePage.steps.switchToEditTab();
|
223
|
+
figOverImageCanvasComponent.canvasWidthInputField()
|
224
|
+
.invoke('attr', 'value')
|
225
|
+
.then((value) => {
|
226
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
227
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'width', `${value}px`);
|
228
|
+
});
|
229
|
+
},
|
230
|
+
|
231
|
+
verifyImageDoesNotFitToCanvasInPreviewTab: () => {
|
232
|
+
createQuestionBasePage.steps.switchToEditTab();
|
233
|
+
figOverImageCanvasComponent.canvasHeightInputField()
|
234
|
+
.invoke('attr', 'value')
|
235
|
+
.then((value) => {
|
236
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
237
|
+
figOverImageCanvasComponent.canvasImageInPreviewTab().should('have.css', 'height', `${value}px`);
|
238
|
+
});
|
239
|
+
},
|
240
|
+
|
241
|
+
/**
|
242
|
+
* @param {number} width holds value of width attribute
|
243
|
+
* @description function updates canvas width in input field
|
244
|
+
*/
|
245
|
+
updateCanvasWidth: (width) => {
|
246
|
+
figOverImageCanvasComponent.canvasWidthInputField()
|
247
|
+
.clear()
|
248
|
+
.type(width);
|
249
|
+
},
|
250
|
+
|
251
|
+
/**
|
252
|
+
* @param {number} height holds value of height attribute
|
253
|
+
* @description function updates canvas height in input field
|
254
|
+
*/
|
255
|
+
updateCanvasHeight: (height) => {
|
256
|
+
figOverImageCanvasComponent.canvasHeightInputField()
|
257
|
+
.clear()
|
258
|
+
.type(height);
|
259
|
+
},
|
260
|
+
|
261
|
+
/**
|
262
|
+
* @param {*} width width of canvas
|
263
|
+
* @description this function verifies width of canvas
|
264
|
+
*/
|
265
|
+
verifyCanvasWidth: (width) => {
|
266
|
+
figOverImageCanvasComponent.canvas()
|
267
|
+
.should('have.attr', 'width', width);
|
268
|
+
},
|
269
|
+
|
270
|
+
/**
|
271
|
+
* @param {*} height height of canvas
|
272
|
+
* @description this function verifies height of canvas
|
273
|
+
*/
|
274
|
+
verifyCanvasHeight: (height) => {
|
275
|
+
figOverImageCanvasComponent.canvas()
|
276
|
+
.should('have.css', 'height', `${height}px`);
|
277
|
+
},
|
278
|
+
|
279
|
+
/**
|
280
|
+
* @param {*} width width of canvas
|
281
|
+
* @description this function verifies width of canvas
|
282
|
+
*/
|
283
|
+
verifyCanvasWidthInPreviewTab: (width) => {
|
284
|
+
figOverImageCanvasComponent.canvasInPreviewTab()
|
285
|
+
.should('have.attr', 'width', width);
|
286
|
+
},
|
287
|
+
|
288
|
+
/**
|
289
|
+
* @param {*} height height of canvas
|
290
|
+
* @description this function verifies height of canvas
|
291
|
+
*/
|
292
|
+
verifyCanvasHeightInPreviewTab: (height) => {
|
293
|
+
figOverImageCanvasComponent.canvasInPreviewTab()
|
294
|
+
.should('have.css', 'height', `${height}px`);
|
295
|
+
},
|
39
296
|
/**
|
40
297
|
* @description this function removes a dropzone from the canvas
|
41
298
|
* @param {number} index of the dropzone to be removed
|
@@ -0,0 +1,30 @@
|
|
1
|
+
const selectors = {
|
2
|
+
lockAspectRatioButton: () => cy.get('[class*="lock-reset"] button').eq(0),
|
3
|
+
resetDimensionsButton: () => cy.get('[class*="lock-reset"] button').eq(1),
|
4
|
+
}
|
5
|
+
|
6
|
+
const steps = {
|
7
|
+
unlockAspectRatio: () => {
|
8
|
+
imageActionsComponent.lockAspectRatioButton()
|
9
|
+
.click();
|
10
|
+
imageActionsComponent.lockAspectRatioButton()
|
11
|
+
.should('have.attr', 'aria-label', 'Unlocked aspect ratio');
|
12
|
+
},
|
13
|
+
|
14
|
+
lockAspectRatio: () => {
|
15
|
+
imageActionsComponent.lockAspectRatioButton()
|
16
|
+
.click();
|
17
|
+
imageActionsComponent.lockAspectRatioButton()
|
18
|
+
.should('have.attr', 'aria-label', 'Locked aspect ratio');
|
19
|
+
},
|
20
|
+
|
21
|
+
resetDimensions: () => {
|
22
|
+
imageActionsComponent.resetDimensionsButton()
|
23
|
+
.click();
|
24
|
+
},
|
25
|
+
}
|
26
|
+
|
27
|
+
export const imageActionsComponent = {
|
28
|
+
...selectors,
|
29
|
+
steps
|
30
|
+
}
|
@@ -37,17 +37,17 @@ export * from './measuringToolComponent';
|
|
37
37
|
export * from './toolVisibilityComponent';
|
38
38
|
export * from './randomizeOptionsComponent';
|
39
39
|
export * from './lockUnlockOptionsComponent';
|
40
|
-
export * from './toolSettingsComponent';
|
41
40
|
export * from './maximumCapacityPerDropzoneComponent';
|
42
|
-
export * from './measuringToolComponent';
|
43
41
|
export * from './toolSettingsComponent';
|
44
42
|
export * from './draggableOptionContainer';
|
45
43
|
export * from './allowMultipleInstancesOfSameDraggableOptionComponent';
|
44
|
+
export * from './questionInputFieldComponent';
|
45
|
+
export * from './studentViewSettingsLabelComponent';
|
46
46
|
export * from './backgroundImageUploadComponent';
|
47
47
|
export * from './figOverImageCanvasComponent';
|
48
48
|
export * from './correctIncorrectAnswerLabelComponent';
|
49
49
|
export * from './acceptedStudentInputComponent';
|
50
|
-
export * from './questionInputFieldComponent';
|
51
|
-
export * from './studentViewSettingsLabelComponent';
|
52
50
|
export * from './draggableOptionsSectionComponent';
|
53
|
-
export * from './enableOuterBorderComponent';
|
51
|
+
export * from './enableOuterBorderComponent';
|
52
|
+
export * from './opacityComponent';
|
53
|
+
export * from './imageActionsComponent';
|
@@ -17,9 +17,6 @@ const selectors = {
|
|
17
17
|
}
|
18
18
|
},
|
19
19
|
rotationButtonInPreviewTab: () => cy.get('.icon-rotate'),
|
20
|
-
opacityLabel: () => cy.get('.MuiGrid-align-items-xs-center [class*="PropertyLabel"]'),
|
21
|
-
opacityInputField: () => cy.get('.MuiGrid-align-items-xs-center .text-input-field input'),
|
22
|
-
opacitySlider: () => cy.get('.MuiGrid-align-items-xs-center .opacity-slider'),
|
23
20
|
toolColorBlock: () => cy.get('[class*="ColorBlockWrapper"] .MuiToggleButton-root')
|
24
21
|
}
|
25
22
|
|
@@ -107,57 +104,6 @@ const steps = {
|
|
107
104
|
utilities.verifyElementVisibilityState(measuringToolComponent.rotationButtonInPreviewTab(), 'exist');
|
108
105
|
},
|
109
106
|
|
110
|
-
verifyDefaultOpacityLabelSliderAndInputField: () => {
|
111
|
-
utilities.verifyInnerText(measuringToolComponent.opacityLabel(), 'Opacity');
|
112
|
-
utilities.verifyElementVisibilityState(measuringToolComponent.opacityLabel(), 'visible');
|
113
|
-
utilities.verifyElementVisibilityState(measuringToolComponent.opacitySlider(), 'visible')
|
114
|
-
measuringToolComponent.steps.verifyOpacitySliderValue(40);
|
115
|
-
measuringToolComponent.steps.verifyOpacityInputFieldValue(40);
|
116
|
-
utilities.verifyElementVisibilityState(measuringToolComponent.opacityInputField(), 'visible');
|
117
|
-
},
|
118
|
-
|
119
|
-
/**
|
120
|
-
* @param {number} value holds value of input field
|
121
|
-
* @description function verifies value in input field
|
122
|
-
*/
|
123
|
-
verifyOpacityInputFieldValue: (value) => {
|
124
|
-
measuringToolComponent.opacityInputField()
|
125
|
-
.should('have.value', value);
|
126
|
-
},
|
127
|
-
|
128
|
-
verifyMaxOpacitySliderValue: () => {
|
129
|
-
measuringToolComponent.opacitySlider()
|
130
|
-
.find('[role="slider"]')
|
131
|
-
.should('have.attr', 'aria-valuemax', 100);
|
132
|
-
},
|
133
|
-
|
134
|
-
/**
|
135
|
-
* @param {number} value holds value of slider
|
136
|
-
* @description function verifies value in slider
|
137
|
-
*/
|
138
|
-
verifyOpacitySliderValue: (value) => {
|
139
|
-
measuringToolComponent.opacitySlider()
|
140
|
-
.find('input')
|
141
|
-
.should('have.value', value);
|
142
|
-
},
|
143
|
-
|
144
|
-
/**
|
145
|
-
* @param {number} value holds value to be added in input field
|
146
|
-
* @description function adds value in input field
|
147
|
-
*/
|
148
|
-
enterInputToOpacityInputField: (value) => {
|
149
|
-
measuringToolComponent.opacityInputField()
|
150
|
-
.clear()
|
151
|
-
.type(value);
|
152
|
-
measuringToolComponent.opacityInputField()
|
153
|
-
.should('have.value', value);
|
154
|
-
},
|
155
|
-
|
156
|
-
clickOnOpacitySlider: () => {
|
157
|
-
measuringToolComponent.opacitySlider()
|
158
|
-
.click();
|
159
|
-
},
|
160
|
-
|
161
107
|
/**
|
162
108
|
* @param {number} colorIndex index for color block
|
163
109
|
* @description function verifies selected state of color block
|