itemengine-cypress-automation 1.0.573-IEI-7080-f70315e.0 → 1.0.574-IEI-7080-e6d1871.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 +86 -0
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +284 -17
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +397 -25
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +320 -20
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +97 -10
- package/cypress/e2e/ILC/dataApi/saveItems.js +1 -1
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +7 -7
- package/cypress/e2e/ILC/dataApi/saveQuestionsMCQAlternateAnswers.js +6 -6
- 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 +15 -2
- 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/components/showAlternativeAnswersComponent.js +41 -65
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +21 -1
- package/cypress/pages/imageHighlightPage.js +184 -7
- package/cypress/pages/itemPreviewPage.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +32 -0
- package/cypress/pages/singleSelectionPage.js +17 -0
- package/cypress/support/helpers/utilities.js +16 -0
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +47 -53
- package/service.yaml +2 -2
|
@@ -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
|
});
|
|
@@ -191,7 +191,7 @@ const steps = {
|
|
|
191
191
|
*
|
|
192
192
|
* @param {Object[]} correctAnswerArray - An array of objects representing the expected correct answers and their corresponding points.
|
|
193
193
|
* @param {string[][]} correctAnswerArray[].correctAnswers - A nested array of correct answer text values.
|
|
194
|
-
* Each inner array represents a group of alternate correct answers for a particular text
|
|
194
|
+
* Each inner array represents a group of alternate correct answers for a particular text container.
|
|
195
195
|
* @param {string[]} correctAnswerArray[].points - An array of point label strings associated with each correct answer group.
|
|
196
196
|
*
|
|
197
197
|
*/
|
|
@@ -335,7 +335,7 @@ const steps = {
|
|
|
335
335
|
*/
|
|
336
336
|
verifyMaximumCharacterLimitInPreviewTab: (responseIndex, maxlen) => {
|
|
337
337
|
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
|
338
|
-
.should('have.attr', '
|
|
338
|
+
.should('have.attr', 'maxLength', maxlen);
|
|
339
339
|
},
|
|
340
340
|
|
|
341
341
|
/**
|
|
@@ -933,6 +933,19 @@ const steps = {
|
|
|
933
933
|
});
|
|
934
934
|
},
|
|
935
935
|
|
|
936
|
+
/**
|
|
937
|
+
* Verifies the height and width of the answer input field at the specified index.
|
|
938
|
+
* @param {number} responseAreaIndex - The index of the response area to verify.
|
|
939
|
+
* @param {string} Height - The expected height value in CSS format.
|
|
940
|
+
* @param {string} Width - The expected width value in CSS format.
|
|
941
|
+
*/
|
|
942
|
+
verifyAnswerInputFieldHeightAndWidthInAllViews: (responseAreaIndex, Height, Width) => {
|
|
943
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab().parent('.response-input-field'), responseAreaIndex), {
|
|
944
|
+
'height': Height,
|
|
945
|
+
'width': Width,
|
|
946
|
+
});
|
|
947
|
+
},
|
|
948
|
+
|
|
936
949
|
/**
|
|
937
950
|
* Verifies the border color of the answer input field at the specified index.
|
|
938
951
|
* @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,
|
|
@@ -10,22 +10,21 @@ const showAlternativeAnswersComponent = {
|
|
|
10
10
|
showAlternativeAnswersToggleInput: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] input[type="checkbox"]'),
|
|
11
11
|
showAlternativeAnswersToggleLabel: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] [class*="SwitchLabelWrapper"]'),
|
|
12
12
|
showAlternativeAnswersToggleButton: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] .MuiButtonBase-root'),
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// Selectors for the alternative answers content section
|
|
15
|
-
alternativeAnswersSection: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').
|
|
16
|
-
alternativeAnswerLabelWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]:contains("Alternative answer")'),
|
|
15
|
+
alternativeAnswersSection: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(1), // Alternative answer is typically the second wrapper
|
|
17
16
|
alternativeAnswerGridWrapper: () => cy.get('[class*="CorrectAnswerGridWrapper"]'),
|
|
18
17
|
alternativeAnswerSelectionGrid: () => cy.get('.correct-ans-selection-grid'),
|
|
18
|
+
correctAnswerLabelWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(0), // Correct answer is typically the first wrapper
|
|
19
19
|
|
|
20
20
|
steps: {
|
|
21
21
|
/**
|
|
22
22
|
* Verifies that the "Show alternative answers" toggle is present and visible
|
|
23
23
|
*/
|
|
24
24
|
verifyShowAlternativeAnswersToggleExists: () => {
|
|
25
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper()
|
|
26
|
-
.should('be.visible');
|
|
25
|
+
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper().should('be.visible');
|
|
27
26
|
showAlternativeAnswersComponent.showAlternativeAnswersToggleLabel()
|
|
28
|
-
.should('
|
|
27
|
+
.should('have.text', 'Show alternative answers');
|
|
29
28
|
},
|
|
30
29
|
|
|
31
30
|
/**
|
|
@@ -76,10 +75,10 @@ const showAlternativeAnswersComponent = {
|
|
|
76
75
|
enableShowAlternativeAnswersToggle: () => {
|
|
77
76
|
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
78
77
|
.then(($input) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
if (!$input.prop('checked')) {
|
|
79
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
83
82
|
},
|
|
84
83
|
|
|
85
84
|
/**
|
|
@@ -88,81 +87,58 @@ const showAlternativeAnswersComponent = {
|
|
|
88
87
|
disableShowAlternativeAnswersToggle: () => {
|
|
89
88
|
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
90
89
|
.then(($input) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
if ($input.prop('checked')) {
|
|
91
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
95
94
|
},
|
|
96
95
|
|
|
97
96
|
/**
|
|
98
97
|
* Verifies that the alternative answers section is visible
|
|
99
98
|
* @param {number} index - The index of the alternative answer (e.g., 1 for "Alternative answer 1")
|
|
100
|
-
* @param {
|
|
99
|
+
* @param {string} points - The expected points for the alternative answer
|
|
101
100
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
|
|
102
|
+
verifyAlternativeAnswersLabelAndPointVisible: (index, points) => {
|
|
103
|
+
showAlternativeAnswersComponent.alternativeAnswersSection().should('be.visible');
|
|
104
|
+
|
|
107
105
|
if (points) {
|
|
108
|
-
|
|
109
|
-
.contains(`Alternative answer ${index}`)
|
|
106
|
+
showAlternativeAnswersComponent.alternativeAnswersSection()
|
|
110
107
|
.parent()
|
|
111
108
|
.find('p')
|
|
112
|
-
.
|
|
109
|
+
.invoke('text')
|
|
110
|
+
.then((text) => {
|
|
111
|
+
expect(text.trim()).to.equal(points);
|
|
112
|
+
});
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Verifies that the
|
|
118
|
-
*/
|
|
119
|
-
verifyAlternativeAnswersSectionNotExist: () => {
|
|
120
|
-
cy.get('[class*="CorrectAnswerLabelWrapper"]')
|
|
121
|
-
.contains('Alternative answer')
|
|
122
|
-
.should('not.exist');
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Verifies the complete alternative answers section including content and grid
|
|
127
|
-
* @param {number} index - The index of the alternative answer (e.g., 1 for "Alternative answer 1")
|
|
117
|
+
* Verifies that the correct answers section is visible
|
|
128
118
|
* @param {number} points - The expected points for the alternative answer
|
|
129
119
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
showAlternativeAnswersComponent.
|
|
133
|
-
|
|
134
|
-
// Verify the selection grid is visible
|
|
135
|
-
showAlternativeAnswersComponent.alternativeAnswerSelectionGrid()
|
|
120
|
+
|
|
121
|
+
verifyCorrectAnswersLabelAndPointVisible: (points) => {
|
|
122
|
+
showAlternativeAnswersComponent.correctAnswerLabelWrapper()
|
|
136
123
|
.should('be.visible');
|
|
124
|
+
|
|
125
|
+
if (points) {
|
|
126
|
+
showAlternativeAnswersComponent.correctAnswerLabelWrapper()
|
|
127
|
+
.parent()
|
|
128
|
+
.find('p')
|
|
129
|
+
.invoke('text')
|
|
130
|
+
.then((text) => {
|
|
131
|
+
expect(text.trim()).to.equal(points);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
137
134
|
},
|
|
138
135
|
|
|
139
136
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param {number} index - The index of the alternative answer to verify
|
|
142
|
-
* @param {number} points - The expected points for the alternative answer
|
|
137
|
+
* Verifies that the alternative answers section does not exist
|
|
143
138
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// Test unchecked state
|
|
149
|
-
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
150
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
151
|
-
|
|
152
|
-
// Verify the alternative answers section does not exist
|
|
153
|
-
showAlternativeAnswersComponent.steps.verifyAlternativeAnswersSectionNotExist();
|
|
154
|
-
|
|
155
|
-
// Test checked state
|
|
156
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
157
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
158
|
-
|
|
159
|
-
// Verify the alternative answers section is visible
|
|
160
|
-
showAlternativeAnswersComponent.steps.verifyAlternativeAnswersSectionVisible(index, points);
|
|
161
|
-
|
|
162
|
-
// Test toggle back to unchecked
|
|
163
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
164
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
165
|
-
}
|
|
139
|
+
verifyAlternativeAnswersSectionNotExist: () => {
|
|
140
|
+
showAlternativeAnswersComponent.alternativeAnswersSection().should('not.exist');
|
|
141
|
+
},
|
|
166
142
|
},
|
|
167
143
|
};
|
|
168
144
|
|
|
@@ -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,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
let imageWidth = 768;
|
|
6
7
|
let imageHeight = 432;
|
|
@@ -18,6 +19,7 @@ const selectors = {
|
|
|
18
19
|
...imageActionsComponent,
|
|
19
20
|
...additionalSettingsPanel,
|
|
20
21
|
...gradingViewEnumerationComponent,
|
|
22
|
+
...itemPreviewPage,
|
|
21
23
|
|
|
22
24
|
//Image selection style section.
|
|
23
25
|
imageSelectionStyleLabel: () => cy.get('.options-label'),
|
|
@@ -110,6 +112,12 @@ const selectors = {
|
|
|
110
112
|
saturationPointer: () => cy.get('.react-colorful__pointer.react-colorful__saturation-pointer'),
|
|
111
113
|
huePointer: () => cy.get('.react-colorful__pointer.react-colorful__hue-pointer'),
|
|
112
114
|
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'),
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
const steps = {
|
|
@@ -312,7 +320,7 @@ const steps = {
|
|
|
312
320
|
* @description this function verifies height of canvas
|
|
313
321
|
*/
|
|
314
322
|
verifyCanvasHeight: (height) => {
|
|
315
|
-
const tolerance =
|
|
323
|
+
const tolerance = 10
|
|
316
324
|
imageHighlightPage.specifyPossibleOptionsImageCanvas()
|
|
317
325
|
.should('have.css', 'height')
|
|
318
326
|
.then(($cssHeight) => {
|
|
@@ -659,20 +667,20 @@ const steps = {
|
|
|
659
667
|
|
|
660
668
|
verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
|
|
661
669
|
imageHighlightPage.imagePreviewTab()
|
|
662
|
-
.should('have.
|
|
663
|
-
.and('have.
|
|
670
|
+
.should('have.attr', 'x', '0')
|
|
671
|
+
.and('have.attr', 'y', '0');
|
|
664
672
|
},
|
|
665
673
|
|
|
666
674
|
verifyCanvasImageCenterAlignedInPreviewTab: () => {
|
|
667
675
|
imageHighlightPage.imagePreviewTab()
|
|
668
|
-
.should('
|
|
669
|
-
.and('
|
|
676
|
+
.should('have.attr', 'x', '100')
|
|
677
|
+
.and('have.attr', 'y', '100');
|
|
670
678
|
},
|
|
671
679
|
|
|
672
680
|
verifyCanvasImageTopRightAlignedInPreviewTab: () => {
|
|
673
681
|
imageHighlightPage.imagePreviewTab()
|
|
674
|
-
.should('have.
|
|
675
|
-
.and('not.have.
|
|
682
|
+
.should('have.attr', 'x', '100')
|
|
683
|
+
.and('not.have.attr', 'y', '200');
|
|
676
684
|
},
|
|
677
685
|
|
|
678
686
|
/**
|
|
@@ -1144,6 +1152,20 @@ const steps = {
|
|
|
1144
1152
|
});
|
|
1145
1153
|
},
|
|
1146
1154
|
|
|
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
|
+
|
|
1147
1169
|
/**
|
|
1148
1170
|
* @param {number} index of highlight region
|
|
1149
1171
|
* @description this function verifies the patternHighlight of selected highlight in preview tab.
|
|
@@ -1705,6 +1727,161 @@ const steps = {
|
|
|
1705
1727
|
Math.abs(ag - eg) <= tolerance &&
|
|
1706
1728
|
Math.abs(ab - eb) <= tolerance
|
|
1707
1729
|
);
|
|
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
|
+
}
|
|
1708
1885
|
}
|
|
1709
1886
|
}
|
|
1710
1887
|
|
|
@@ -2,6 +2,7 @@ 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'),
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
const steps = {
|