itemengine-cypress-automation 1.0.563-IEI-6998-Add-coverage-for-image-hightlight-question-type-238d7b4.0 → 1.0.563-IEI-7072-main-321f4b3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +181 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +37 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +72 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +19 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +56 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +57 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +15 -18
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +54 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +12 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomizationAllViews.js +156 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +0 -2
- package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +0 -87
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +11 -62
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +12 -14
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +3 -12
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +3 -66
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +2 -16
- package/cypress/pages/components/additionalSettingsPanel.js +9 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
- package/cypress/pages/components/colorPopupComponent.js +1 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +4 -10
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +14 -1
- package/cypress/pages/components/gradingViewEnumerationComponent.js +5 -0
- package/cypress/pages/components/imageCanvasComponent.js +0 -3
- package/cypress/pages/components/placeholderTextSectionComponent.js +10 -0
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +21 -1
- package/cypress/pages/imageHighlightPage.js +7 -184
- package/cypress/pages/itemPreviewPage.js +0 -1
- package/cypress/support/helpers/utilities.js +0 -16
- package/package.json +1 -1
|
@@ -191,80 +191,17 @@ describe('Create item page - Image highlight: Minimum scoring, Penalty scoring,
|
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
-
describe
|
|
194
|
+
describe('Scoring section: Rounding - Edit tab', () => {
|
|
195
195
|
abortEarlySetup();
|
|
196
196
|
before(() => {
|
|
197
197
|
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
|
198
198
|
cy.barsPreLoaderWait();
|
|
199
|
-
imageHighlightPage.steps.
|
|
200
|
-
imageHighlightPage.steps.
|
|
201
|
-
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
|
202
|
-
imageHighlightPage.steps.allotPoints(4);
|
|
203
|
-
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
|
204
|
-
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
|
205
|
-
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
|
206
|
-
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
|
207
|
-
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
|
208
|
-
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
|
|
209
|
-
imageHighlightPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
|
199
|
+
imageHighlightPage.steps.allotPoints(10);
|
|
200
|
+
imageHighlightPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
|
|
210
201
|
});
|
|
211
202
|
|
|
212
203
|
imageHighlightPage.tests.verifyRoundingDropdown();
|
|
213
204
|
|
|
214
205
|
imageHighlightPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
|
|
215
|
-
|
|
216
|
-
it("When the user selects rounding to 'Round down if <= 0.99' then the score '<=0.99' should be rounded down to nearest whole number", () => {
|
|
217
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
218
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
|
219
|
-
imageHighlightPage.steps.verifyPreviewScore(1,4);
|
|
220
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
|
221
|
-
imageHighlightPage.steps.verifyPreviewScore(2,4);
|
|
222
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
|
223
|
-
imageHighlightPage.steps.verifyPreviewScore(4,4);
|
|
224
|
-
imageHighlightPage.steps.switchToGradingView();
|
|
225
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
|
226
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
|
227
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
|
228
|
-
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
229
|
-
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it("When the user selects rounding to 'Round down if <= 0.50' then the score '<=0.50' should be rounded down to nearest whole number", () => {
|
|
233
|
-
imageHighlightPage.steps.switchToEditTab();
|
|
234
|
-
imageHighlightPage.steps.expandRoundingDropdown();
|
|
235
|
-
imageHighlightPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
|
|
236
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
237
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
|
238
|
-
imageHighlightPage.steps.verifyPreviewScore(1,4);
|
|
239
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
|
240
|
-
imageHighlightPage.steps.verifyPreviewScore(2.6667,4);
|
|
241
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
|
242
|
-
imageHighlightPage.steps.verifyPreviewScore(4,4);
|
|
243
|
-
imageHighlightPage.steps.switchToGradingView();
|
|
244
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
|
245
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
|
246
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
|
247
|
-
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
248
|
-
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
it('When the user selects rounding to \'Round down if <= 0.50; Round up if > 0.50\' then the score \'<=0.50\' should be rounded down to nearest whole number and the score \'>0.50\' should be rounded up to nearest whole number', () => {
|
|
252
|
-
imageHighlightPage.steps.switchToEditTab();
|
|
253
|
-
imageHighlightPage.steps.expandRoundingDropdown();
|
|
254
|
-
imageHighlightPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
|
|
255
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
256
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
|
257
|
-
imageHighlightPage.steps.verifyPreviewScore(1,4);
|
|
258
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
|
259
|
-
imageHighlightPage.steps.verifyPreviewScore(3,4);
|
|
260
|
-
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
|
261
|
-
imageHighlightPage.steps.verifyPreviewScore(4,4);
|
|
262
|
-
imageHighlightPage.steps.switchToGradingView();
|
|
263
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
|
264
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
|
265
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
|
266
|
-
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
267
|
-
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
268
|
-
});
|
|
269
206
|
});
|
|
270
207
|
});
|
|
@@ -154,7 +154,7 @@ describe('Image highlight - Student view settings', () => {
|
|
|
154
154
|
imageHighlightPage.tests.verifyShowAvailableOptionsToStudentsEditTab();
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
describe
|
|
157
|
+
describe('Show the available options to students: Preview tab', () => {
|
|
158
158
|
abortEarlySetup();
|
|
159
159
|
before(() => {
|
|
160
160
|
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
|
@@ -171,15 +171,7 @@ describe('Image highlight - Student view settings', () => {
|
|
|
171
171
|
imageHighlightPage.steps.switchToPreviewTab();
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background
|
|
175
|
-
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
|
176
|
-
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
|
177
|
-
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background in item preview', () => {
|
|
181
|
-
imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
|
|
182
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
174
|
+
it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background', () => {
|
|
183
175
|
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
|
184
176
|
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
|
185
177
|
imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
|
|
@@ -187,7 +179,6 @@ describe('Image highlight - Student view settings', () => {
|
|
|
187
179
|
|
|
188
180
|
it('When \'Show the available options to students\' checkbox is checked, then in preview tab the available options should be displayed with a highlighted background', () => {
|
|
189
181
|
imageHighlightPage.steps.switchToEditTab();
|
|
190
|
-
imageHighlightPage.steps.clickOnEditQuestionButton();
|
|
191
182
|
imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
|
192
183
|
imageHighlightPage.steps.switchToPreviewTab();
|
|
193
184
|
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
|
@@ -196,8 +187,6 @@ describe('Image highlight - Student view settings', () => {
|
|
|
196
187
|
});
|
|
197
188
|
|
|
198
189
|
it('When user selects an option in preview tab, then that option should be selected', () => {
|
|
199
|
-
imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
|
|
200
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
201
190
|
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
|
202
191
|
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
|
203
192
|
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(0);
|
|
@@ -210,9 +199,6 @@ describe('Image highlight - Student view settings', () => {
|
|
|
210
199
|
});
|
|
211
200
|
|
|
212
201
|
it('Accessibility of options with highlighted background', { tags: 'a11y' }, () => {
|
|
213
|
-
imageHighlightPage.steps.switchToEditTab();
|
|
214
|
-
imageHighlightPage.steps.clickOnEditQuestionButton();
|
|
215
|
-
imageHighlightPage.steps.switchToPreviewTab();
|
|
216
202
|
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
|
217
203
|
});
|
|
218
204
|
|
|
@@ -39,6 +39,15 @@ const steps = {
|
|
|
39
39
|
.should('have.attr', 'aria-expanded', 'true');
|
|
40
40
|
},
|
|
41
41
|
|
|
42
|
+
collapsedAdditionalSettings: () => {
|
|
43
|
+
additionalSettingsPanel.additionalSettingsPanel()
|
|
44
|
+
.click();
|
|
45
|
+
cy.log('Need this wait in order for the font size dropdown to render properly');
|
|
46
|
+
cy.wait(2000);
|
|
47
|
+
additionalSettingsPanel.additionalSettingsPanel()
|
|
48
|
+
.should('have.attr', 'aria-expanded', 'false');
|
|
49
|
+
},
|
|
50
|
+
|
|
42
51
|
//V3 - Need to be updated in all files
|
|
43
52
|
selectFontSizeOptionFromFontSizeDropdown: (dropdownOption) => {
|
|
44
53
|
additionalSettingsPanel.steps.expandFontSizeDropdown();
|
|
@@ -147,7 +147,7 @@ const tests = {
|
|
|
147
147
|
.trigger('mouseover');
|
|
148
148
|
utilities.verifyCSS(commonComponents.tooltipText(), {
|
|
149
149
|
'color': css.color.whiteText,
|
|
150
|
-
'font-size': css.fontSize.
|
|
150
|
+
'font-size': css.fontSize.small,
|
|
151
151
|
'font-weight': css.fontWeight.regular,
|
|
152
152
|
'background-color': css.color.tooltipBg
|
|
153
153
|
});
|
|
@@ -23,7 +23,7 @@ const selectors = {
|
|
|
23
23
|
opacityLabel: () => cy.get('[class*="ColorPickerstyles__SliderWrapper"]'),
|
|
24
24
|
//Need to update when feedback scale is available
|
|
25
25
|
opacitySlider: () => cy.get('[class*="ColorPickerstyles__SliderWrapper"] .color-slider'),
|
|
26
|
-
opacityInputField: () => cy.get('.opacity-wrapper [aria-label="Opacity"]'),
|
|
26
|
+
opacityInputField: () => cy.get('.opacity-wrapper [aria-label="Opacity"],.opacity-wrapper input[type*="Text"]'),
|
|
27
27
|
recommendedColorsLabel: () => cy.get('.color-picker-footer-wrapper'),
|
|
28
28
|
recommendedColorBlock: () => cy.get('[class*="ColorPickerstyles__ColorBlockWrapper"] .color-picker-block'),
|
|
29
29
|
recommendedColorBlockSelectedIcon: () => cy.get('.selected-button-icon'),
|
|
@@ -260,15 +260,9 @@ const tests = {
|
|
|
260
260
|
'font-weight': css.fontWeight.regular,
|
|
261
261
|
'border': `1px solid ${css.color.figDefaultComponentBorder}`
|
|
262
262
|
});
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
} else {
|
|
267
|
-
selectedToggleButton = figCommonStyleAndLayoutComponent.dashedBorderStyleToggleButton();
|
|
268
|
-
}
|
|
269
|
-
utilities.verifyCSS(selectedToggleButton, {
|
|
270
|
-
'color': css.color.defaultBackground,
|
|
271
|
-
'background-color': css.color.secondaryBtnBg,
|
|
263
|
+
utilities.verifyCSS(figCommonStyleAndLayoutComponent.solidBorderStyleToggleButton(), {
|
|
264
|
+
'color': css.color.primaryBtn,
|
|
265
|
+
'background-color': css.color.primaryBtn,
|
|
272
266
|
'font-size': css.fontSize.default,
|
|
273
267
|
'font-weight': css.fontWeight.regular,
|
|
274
268
|
'border': `2px solid ${css.color.secondaryBtnActive}`
|
|
@@ -304,7 +298,7 @@ const tests = {
|
|
|
304
298
|
'background-color': css.color.secondaryBtnBg,
|
|
305
299
|
'font-size': css.fontSize.default,
|
|
306
300
|
'font-weight': css.fontWeight.regular,
|
|
307
|
-
'border': `2px solid ${css.color.
|
|
301
|
+
'border': `2px solid ${css.color.figDefaultComponentBorder}`
|
|
308
302
|
});
|
|
309
303
|
utilities.hoverAwayFromElement();
|
|
310
304
|
});
|
|
@@ -299,7 +299,7 @@ const steps = {
|
|
|
299
299
|
*/
|
|
300
300
|
verifyMaximumCharacterLimitInPreviewTab: (responseIndex, maxlen) => {
|
|
301
301
|
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
|
302
|
-
.should('have.attr', '
|
|
302
|
+
.should('have.attr', 'maxLength', maxlen);
|
|
303
303
|
},
|
|
304
304
|
|
|
305
305
|
/**
|
|
@@ -897,6 +897,19 @@ const steps = {
|
|
|
897
897
|
});
|
|
898
898
|
},
|
|
899
899
|
|
|
900
|
+
/**
|
|
901
|
+
* Verifies the height and width of the answer input field at the specified index.
|
|
902
|
+
* @param {number} responseAreaIndex - The index of the response area to verify.
|
|
903
|
+
* @param {string} Height - The expected height value in CSS format.
|
|
904
|
+
* @param {string} Width - The expected width value in CSS format.
|
|
905
|
+
*/
|
|
906
|
+
verifyAnswerInputFieldHeightAndWidthInAllViews: (responseAreaIndex, Height, Width) => {
|
|
907
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab().parent('.response-input-field'), responseAreaIndex), {
|
|
908
|
+
'height': Height,
|
|
909
|
+
'width': Width,
|
|
910
|
+
});
|
|
911
|
+
},
|
|
912
|
+
|
|
900
913
|
/**
|
|
901
914
|
* Verifies the border color of the answer input field at the specified index.
|
|
902
915
|
* @param {number} responseAreaIndex - The index of the response area to verify.
|
|
@@ -20,6 +20,11 @@ const selectors = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const steps = {
|
|
23
|
+
verifyWithoutEnumerationRadioButtonCheckedState: () => {
|
|
24
|
+
gradingViewEnumerationComponent.withoutEnumerationRadioButton()
|
|
25
|
+
.should('be.checked');
|
|
26
|
+
},
|
|
27
|
+
|
|
23
28
|
verifyWithEnumerationRadioButtonCheckedState: () => {
|
|
24
29
|
gradingViewEnumerationComponent.withEnumerationRadioButton()
|
|
25
30
|
.should('be.checked');
|
|
@@ -653,8 +653,6 @@ const steps = {
|
|
|
653
653
|
},
|
|
654
654
|
|
|
655
655
|
verifyResponseAreaConnectorEndPointShapePreviewTab: (endPointShape) => {
|
|
656
|
-
commonComponents.previewTabQuestionWrapper()
|
|
657
|
-
.within(() => {
|
|
658
656
|
imageCanvasComponent.responseAreaPointer()
|
|
659
657
|
.each($element => {
|
|
660
658
|
switch (endPointShape) {
|
|
@@ -680,7 +678,6 @@ const steps = {
|
|
|
680
678
|
throw new Error('Invalid end point shape')
|
|
681
679
|
}
|
|
682
680
|
});
|
|
683
|
-
});
|
|
684
681
|
},
|
|
685
682
|
|
|
686
683
|
/**
|
|
@@ -53,6 +53,11 @@ const steps = {
|
|
|
53
53
|
.should('be.checked');
|
|
54
54
|
},
|
|
55
55
|
|
|
56
|
+
verifyCustomizePlaceholderTextCheckboxChecked: () => {
|
|
57
|
+
placeholderTextSectionComponent.customizePlaceholderTextCheckbox()
|
|
58
|
+
.should('be.checked');
|
|
59
|
+
},
|
|
60
|
+
|
|
56
61
|
|
|
57
62
|
verifyIndividualPlaceholderTextInputFields: (inputFieldIndex) => {
|
|
58
63
|
placeholderTextSectionComponent.individualPlaceholderTextInputField()
|
|
@@ -78,6 +83,11 @@ const tests = {
|
|
|
78
83
|
placeholderTextSectionComponent.steps.verifyCustomizePlaceholderTextCheckboxUnchecked();
|
|
79
84
|
});
|
|
80
85
|
|
|
86
|
+
it('Placeholder text input field should accept text,special characters and numeric values', () => {
|
|
87
|
+
placeholderTextSectionComponent.steps.addInputToPlaceholderTextInputField('Test 123 !@#');
|
|
88
|
+
placeholderTextSectionComponent.steps.verifyPlaceholderTextInputFieldValue('Test 123 !@#');
|
|
89
|
+
});
|
|
90
|
+
|
|
81
91
|
it('CSS of placeholder text section', { tags: 'css' }, () => {
|
|
82
92
|
utilities.verifyCSS(placeholderTextSectionComponent.placeholderTextSectionLabel(), {
|
|
83
93
|
'color': css.color.labels,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
|
-
import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, backgroundImageUploadComponent, optionsWrapperComponent, imageCanvasComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent, customizeSpecialCharacterComponent, fillInTheGapsTextCommonComponent, additionalSettingsPanel, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent } from "./components";
|
|
2
|
+
import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, backgroundImageUploadComponent, optionsWrapperComponent, imageCanvasComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent, customizeSpecialCharacterComponent, fillInTheGapsTextCommonComponent, additionalSettingsPanel, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent, printPreviewComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
|
5
5
|
const css = Cypress.env('css');
|
|
@@ -25,6 +25,7 @@ const selectors = {
|
|
|
25
25
|
...figCommonStyleAndLayoutComponent,
|
|
26
26
|
...connectorStyleStyleAndLayoutCustomizationComponent,
|
|
27
27
|
...dialogBoxBase,
|
|
28
|
+
...printPreviewComponent,
|
|
28
29
|
//TODO: Update below selectors after https://redmine.zeuslearning.com/issues/557945 is resolved
|
|
29
30
|
|
|
30
31
|
responseContainerInPreviewTab: () => cy.get('[class*="AddTextResponseOnImagestyles__DraggableInput"]'),
|
|
@@ -72,6 +73,7 @@ const steps = {
|
|
|
72
73
|
...figCommonStyleAndLayoutComponent.steps,
|
|
73
74
|
...connectorStyleStyleAndLayoutCustomizationComponent.steps,
|
|
74
75
|
...createItemPage.steps,
|
|
76
|
+
...printPreviewComponent.steps,
|
|
75
77
|
/**
|
|
76
78
|
* Verify that the incorrect option icon is displayed for a specific answer input field.
|
|
77
79
|
* @param {number} inputFieldIndex - The index of the answer input field to verify.
|
|
@@ -272,6 +274,8 @@ const steps = {
|
|
|
272
274
|
* @param {string} height - The height to set for the text container.
|
|
273
275
|
*/
|
|
274
276
|
setTextContainerHeight: (height) => {
|
|
277
|
+
fillInTheGapsOverImageTextPage.textContainerHeightInputField()
|
|
278
|
+
.clear()
|
|
275
279
|
fillInTheGapsOverImageTextPage.textContainerHeightInputField()
|
|
276
280
|
.type(height)
|
|
277
281
|
cy.wait(1000)
|
|
@@ -285,6 +289,8 @@ const steps = {
|
|
|
285
289
|
* @param {string} width - The width to set for the text container.
|
|
286
290
|
*/
|
|
287
291
|
setTextContainerWidth: (width) => {
|
|
292
|
+
fillInTheGapsOverImageTextPage.textContainerWidthInputField()
|
|
293
|
+
.clear()
|
|
288
294
|
fillInTheGapsOverImageTextPage.textContainerWidthInputField()
|
|
289
295
|
.type(width)
|
|
290
296
|
cy.wait(1000)
|
|
@@ -293,6 +299,19 @@ const steps = {
|
|
|
293
299
|
.blur();
|
|
294
300
|
},
|
|
295
301
|
|
|
302
|
+
/**
|
|
303
|
+
* Verifies the values in the text container width and height input fields.
|
|
304
|
+
* @param {string} width - The width of the text container.
|
|
305
|
+
* @param {string} height - The height of the text container.
|
|
306
|
+
*/
|
|
307
|
+
verifyValueInTextContainerWidthAndHeightInputField: (height, width) => {
|
|
308
|
+
fillInTheGapsOverImageTextPage.textContainerWidthInputField()
|
|
309
|
+
.should('have.value', width);
|
|
310
|
+
fillInTheGapsOverImageTextPage.textContainerHeightInputField()
|
|
311
|
+
.should('have.value', height);
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
|
|
296
315
|
verifySetHeightAndWidthForAllTextContainersCheckboxUncheckedState: () => {
|
|
297
316
|
fillInTheGapsOverImageTextPage.setHeightAndWidthForAllTextContainersCheckbox()
|
|
298
317
|
.should('not.be.checked');
|
|
@@ -371,6 +390,7 @@ const tests = {
|
|
|
371
390
|
...placeholderTextSectionComponent.tests,
|
|
372
391
|
...styleAndLayoutCustomizationAccordionComponent.tests,
|
|
373
392
|
...figCommonStyleAndLayoutComponent.tests,
|
|
393
|
+
...printPreviewComponent.tests,
|
|
374
394
|
}
|
|
375
395
|
|
|
376
396
|
export const fillInTheGapsOverImageTextPage = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
2
|
import { additionalSettingsAccessibilitySectionComponent, additionalSettingsPanel, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, backgroundImageUploadComponent, commonComponents, createQuestionBasePage, enableOuterBorderComponent, gradingViewEnumerationComponent, imageActionsComponent, imageCanvasComponent, questionInstructionsComponent, scoringSectionBaseEditTab, showAvailableOptionsToStudents, showStudentMaximumNumberOfPossibleSelections, singleMultipleSelectionModeComponent, colorPopupComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
|
-
import { itemPreviewPage } from "./itemPreviewPage";
|
|
5
4
|
const css = Cypress.env('css');
|
|
6
5
|
let imageWidth = 768;
|
|
7
6
|
let imageHeight = 432;
|
|
@@ -19,7 +18,6 @@ const selectors = {
|
|
|
19
18
|
...imageActionsComponent,
|
|
20
19
|
...additionalSettingsPanel,
|
|
21
20
|
...gradingViewEnumerationComponent,
|
|
22
|
-
...itemPreviewPage,
|
|
23
21
|
|
|
24
22
|
//Image selection style section.
|
|
25
23
|
imageSelectionStyleLabel: () => cy.get('.options-label'),
|
|
@@ -112,12 +110,6 @@ const selectors = {
|
|
|
112
110
|
saturationPointer: () => cy.get('.react-colorful__pointer.react-colorful__saturation-pointer'),
|
|
113
111
|
huePointer: () => cy.get('.react-colorful__pointer.react-colorful__hue-pointer'),
|
|
114
112
|
alphaPointer: () => cy.get('.react-colorful__pointer.react-colorful__alpha-pointer'),
|
|
115
|
-
enumerationPlacementLabel: () => cy.get('[class*="options-container-cls dropzone-identifiers-wrapper"] .options-label').eq(1),
|
|
116
|
-
enumerationToggleButtonContainer: () => cy.get('[aria-label="Enumeration placement"]'),
|
|
117
|
-
enumerationPlacementTopToggleButton: () => cy.get('[data-ngie-testid="top-toggle-button"]'),
|
|
118
|
-
enumerationPlacementCenterToggleButton: () => cy.get('[data-ngie-testid="center-toggle-button"]').eq(1),
|
|
119
|
-
enumerationPlacementBottomToggleButton: () => cy.get('[data-ngie-testid="bottom-toggle-button"]'),
|
|
120
|
-
enumerationForHighlightsPreviewTab: () => cy.get('[class*="highlight-svg-responseive"] circle'),
|
|
121
113
|
}
|
|
122
114
|
|
|
123
115
|
const steps = {
|
|
@@ -320,7 +312,7 @@ const steps = {
|
|
|
320
312
|
* @description this function verifies height of canvas
|
|
321
313
|
*/
|
|
322
314
|
verifyCanvasHeight: (height) => {
|
|
323
|
-
const tolerance =
|
|
315
|
+
const tolerance = 2
|
|
324
316
|
imageHighlightPage.specifyPossibleOptionsImageCanvas()
|
|
325
317
|
.should('have.css', 'height')
|
|
326
318
|
.then(($cssHeight) => {
|
|
@@ -667,20 +659,20 @@ const steps = {
|
|
|
667
659
|
|
|
668
660
|
verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
|
|
669
661
|
imageHighlightPage.imagePreviewTab()
|
|
670
|
-
.should('have.
|
|
671
|
-
.and('have.
|
|
662
|
+
.should('have.css', 'top', '0px')
|
|
663
|
+
.and('have.css', 'left', '0px');
|
|
672
664
|
},
|
|
673
665
|
|
|
674
666
|
verifyCanvasImageCenterAlignedInPreviewTab: () => {
|
|
675
667
|
imageHighlightPage.imagePreviewTab()
|
|
676
|
-
.should('have.
|
|
677
|
-
.and('have.
|
|
668
|
+
.should('not.have.css', 'top', '0px')
|
|
669
|
+
.and('not.have.css', 'left', '0px');
|
|
678
670
|
},
|
|
679
671
|
|
|
680
672
|
verifyCanvasImageTopRightAlignedInPreviewTab: () => {
|
|
681
673
|
imageHighlightPage.imagePreviewTab()
|
|
682
|
-
.should('have.
|
|
683
|
-
.and('not.have.
|
|
674
|
+
.should('have.css', 'top', '0px')
|
|
675
|
+
.and('not.have.css', 'left', '0px');
|
|
684
676
|
},
|
|
685
677
|
|
|
686
678
|
/**
|
|
@@ -1152,20 +1144,6 @@ const steps = {
|
|
|
1152
1144
|
});
|
|
1153
1145
|
},
|
|
1154
1146
|
|
|
1155
|
-
/**
|
|
1156
|
-
* @param {number} index of highlight region
|
|
1157
|
-
* @description this function verifies the outLineHighlight of selected highlight in item preview tab.
|
|
1158
|
-
*/
|
|
1159
|
-
verifyOutlineHighlightRegionItemPreviewTabSection: (index) => {
|
|
1160
|
-
imageHighlightPage.itemPreviewPageWrapper()
|
|
1161
|
-
.within(() => {
|
|
1162
|
-
utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon().eq(index), {
|
|
1163
|
-
'stroke-width': '2px',
|
|
1164
|
-
'stroke': css.color.activeHighlightBorder
|
|
1165
|
-
});
|
|
1166
|
-
});
|
|
1167
|
-
},
|
|
1168
|
-
|
|
1169
1147
|
/**
|
|
1170
1148
|
* @param {number} index of highlight region
|
|
1171
1149
|
* @description this function verifies the patternHighlight of selected highlight in preview tab.
|
|
@@ -1727,161 +1705,6 @@ const steps = {
|
|
|
1727
1705
|
Math.abs(ag - eg) <= tolerance &&
|
|
1728
1706
|
Math.abs(ab - eb) <= tolerance
|
|
1729
1707
|
);
|
|
1730
|
-
},
|
|
1731
|
-
|
|
1732
|
-
/**
|
|
1733
|
-
* @param {number} width index for the border style.
|
|
1734
|
-
* @param {number} height index for the border style.
|
|
1735
|
-
* @description Verifies the height and width of image in preview tab.
|
|
1736
|
-
*/
|
|
1737
|
-
verifyImageDimensionsPreviewTab: (width, height) => {
|
|
1738
|
-
imageHighlightPage.imagePreviewTab()
|
|
1739
|
-
.should('have.css', 'width', `${width}px`)
|
|
1740
|
-
.and('have.css', 'height', `${height}px`);
|
|
1741
|
-
},
|
|
1742
|
-
|
|
1743
|
-
/**
|
|
1744
|
-
* @description Clicks on the bottom enumeration placement button.
|
|
1745
|
-
*/
|
|
1746
|
-
selectBottomEnumerationPlacementToggle: () => {
|
|
1747
|
-
imageHighlightPage.enumerationPlacementBottomToggleButton()
|
|
1748
|
-
.click();
|
|
1749
|
-
},
|
|
1750
|
-
|
|
1751
|
-
/**
|
|
1752
|
-
* @description Clicks on the center enumeration placement button.
|
|
1753
|
-
*/
|
|
1754
|
-
selectCenterEnumerationPlacementToggle: () => {
|
|
1755
|
-
imageHighlightPage.enumerationPlacementCenterToggleButton()
|
|
1756
|
-
.click();
|
|
1757
|
-
},
|
|
1758
|
-
|
|
1759
|
-
/**
|
|
1760
|
-
* @param {string} enumerationPlacement placement of the enumeration.
|
|
1761
|
-
* @param {number} index index of highlight region
|
|
1762
|
-
* @description Verifies the enumeration placement for highlight regions in the preview tab.
|
|
1763
|
-
*/
|
|
1764
|
-
verifyNumerationPlacementForHighlightRegionInPreviewTab: (enumerationPlacement, index) => {
|
|
1765
|
-
const tolerance = 1
|
|
1766
|
-
switch (enumerationPlacement) {
|
|
1767
|
-
case 'Top':
|
|
1768
|
-
switch (index) {
|
|
1769
|
-
case 0:
|
|
1770
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1771
|
-
.invoke('attr', 'cx')
|
|
1772
|
-
.then(actualCx => {
|
|
1773
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1774
|
-
expect(roundedCx).to.equal('307.80');
|
|
1775
|
-
});
|
|
1776
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1777
|
-
.invoke('attr', 'cy')
|
|
1778
|
-
.then(actualCx => {
|
|
1779
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1780
|
-
expect(roundedCx).to.equal('59.03');
|
|
1781
|
-
});
|
|
1782
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1783
|
-
.should('have.attr', 'r', '12');
|
|
1784
|
-
break;
|
|
1785
|
-
case 1:
|
|
1786
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1787
|
-
.invoke('attr', 'cx')
|
|
1788
|
-
.then(actualCx => {
|
|
1789
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1790
|
-
expect(roundedCx).to.equal('200.52');
|
|
1791
|
-
});
|
|
1792
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1793
|
-
.invoke('attr', 'cy')
|
|
1794
|
-
.then(actualCx => {
|
|
1795
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1796
|
-
expect(roundedCx).to.equal('213.11');
|
|
1797
|
-
});
|
|
1798
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1799
|
-
.should('have.attr', 'r', '12');
|
|
1800
|
-
break;
|
|
1801
|
-
default:
|
|
1802
|
-
throw new Error(`Unsupported index ${index} for placement 'Top'`);
|
|
1803
|
-
}
|
|
1804
|
-
break;
|
|
1805
|
-
case 'Center':
|
|
1806
|
-
switch (index) {
|
|
1807
|
-
case 0:
|
|
1808
|
-
// Match cx only up to 2 decimal places to allow minor rendering variance.
|
|
1809
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1810
|
-
.invoke('attr', 'cx')
|
|
1811
|
-
.then(actualCx => {
|
|
1812
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1813
|
-
expect(roundedCx).to.equal('365.45');
|
|
1814
|
-
});
|
|
1815
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1816
|
-
.invoke('attr', 'cy')
|
|
1817
|
-
.then(actualCy => {
|
|
1818
|
-
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1819
|
-
expect(roundedCy).to.equal('100.06');
|
|
1820
|
-
});
|
|
1821
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1822
|
-
.should('have.attr', 'r', '12');
|
|
1823
|
-
break;
|
|
1824
|
-
case 1:
|
|
1825
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1826
|
-
.invoke('attr', 'cx')
|
|
1827
|
-
.then(actualCx => {
|
|
1828
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1829
|
-
expect(roundedCx).to.equal('284.74');
|
|
1830
|
-
});
|
|
1831
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1832
|
-
.invoke('attr', 'cy')
|
|
1833
|
-
.then(actualCy => {
|
|
1834
|
-
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1835
|
-
expect(roundedCy).to.equal('238.14');
|
|
1836
|
-
});
|
|
1837
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1838
|
-
.should('have.attr', 'r', '12');
|
|
1839
|
-
break;
|
|
1840
|
-
default:
|
|
1841
|
-
throw new Error(`Unsupported index ${index} for placement 'Center'`);
|
|
1842
|
-
}
|
|
1843
|
-
break;
|
|
1844
|
-
case 'Bottom':
|
|
1845
|
-
switch (index) {
|
|
1846
|
-
case 0:
|
|
1847
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1848
|
-
.invoke('attr', 'cx')
|
|
1849
|
-
.then(actualCx => {
|
|
1850
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1851
|
-
expect(roundedCx).to.equal('307.80');
|
|
1852
|
-
});
|
|
1853
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1854
|
-
.invoke('attr', 'cy')
|
|
1855
|
-
.then(actualCy => {
|
|
1856
|
-
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1857
|
-
expect(roundedCy).to.equal('167.09');
|
|
1858
|
-
});
|
|
1859
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1860
|
-
.should('have.attr', 'r', '12');
|
|
1861
|
-
break;
|
|
1862
|
-
case 1:
|
|
1863
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1864
|
-
.invoke('attr', 'cx')
|
|
1865
|
-
.then(actualCx => {
|
|
1866
|
-
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1867
|
-
expect(roundedCx).to.equal('200.52');
|
|
1868
|
-
});
|
|
1869
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1870
|
-
.invoke('attr', 'cy')
|
|
1871
|
-
.then(actualCy => {
|
|
1872
|
-
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1873
|
-
expect(roundedCy).to.equal('289.16');
|
|
1874
|
-
});
|
|
1875
|
-
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1876
|
-
.should('have.attr', 'r', '12');
|
|
1877
|
-
break;
|
|
1878
|
-
default:
|
|
1879
|
-
throw new Error(`Unsupported index ${index} for placement 'Bottom'`);
|
|
1880
|
-
}
|
|
1881
|
-
break;
|
|
1882
|
-
default:
|
|
1883
|
-
throw new Error(`Invalid enumeration placement '${enumerationPlacement}'`);
|
|
1884
|
-
}
|
|
1885
1708
|
}
|
|
1886
1709
|
}
|
|
1887
1710
|
|
|
@@ -2,7 +2,6 @@ import { createQuestionBasePage, autoScoredScoringPreviewTab } from "./component
|
|
|
2
2
|
|
|
3
3
|
const selectors = {
|
|
4
4
|
referenceID: () => cy.get('.edit-item-reference-id'),
|
|
5
|
-
itemPreviewPageWrapper: () => cy.get('.item-layout-columns-wrapper-without-scroll'),
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
const steps = {
|
|
@@ -295,22 +295,6 @@ const utilities = {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
},
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Verifies the selected/not selected state of an element.
|
|
301
|
-
* @param {Cypress.Chainable} element - The element containing the image
|
|
302
|
-
* @param {string} state - 'selected' | 'notSelected'
|
|
303
|
-
*/
|
|
304
|
-
verifiedElementSelectedNotSelectedState: (selector, state) => {
|
|
305
|
-
switch (state) {
|
|
306
|
-
case 'selected':
|
|
307
|
-
selector.should('have.attr', 'aria-pressed', 'true');
|
|
308
|
-
break;
|
|
309
|
-
case 'notSelected':
|
|
310
|
-
selector.should('have.attr', 'aria-pressed', 'false');
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
298
|
}
|
|
315
299
|
|
|
316
300
|
export default utilities
|
package/package.json
CHANGED