itemengine-cypress-automation 1.0.573-IEI-7080-f70315e.0 → 1.0.573-IEI-7065-Improve-test-coverage-for-essay-response-c25d1ee.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/EssayResponse/additionalSettings.js +8 -2
- package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +14 -1
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +116 -4
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +93 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +29 -2
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +75 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +13 -0
- package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
- 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/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +9 -124
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +6 -93
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +2 -23
- 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/equationEditorSectionCommonComponent.js +21 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +20 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +4 -10
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +14 -37
- 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/essayResponsePage.js +2 -0
- 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'),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
|
2
2
|
import { equationEditorCategoriesAndSymbols } from "../../fixtures/equationEditorCategoriesAndSymbols ";
|
|
3
3
|
import { equationEditorFlyout, commonComponents, essayResponseCommonComponents, createQuestionBasePage, autoScoredScoringPreviewTab } from "../components";
|
|
4
|
+
//import { essayResponsePage } from "../essayResponsePage";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
const allCategories = Object.values(equationEditorCategoriesAndSymbols)
|
|
6
7
|
const defaultSelectedCategories = ['Numpad', 'Keypad', 'Intermediate', 'Primary', 'General', 'Common', 'Algebra', 'Geo', 'Compare', 'Matrices'];
|
|
@@ -333,6 +334,26 @@ const tests = {
|
|
|
333
334
|
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
334
335
|
}
|
|
335
336
|
});
|
|
337
|
+
|
|
338
|
+
it('When user edits the added equation and clicks on Ok button, the edited equation should be displayed in the preview input field in item preview', () => {
|
|
339
|
+
if (questionType === 'essay response') {
|
|
340
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
|
341
|
+
essayResponsePage.steps.switchToPreviewTab();
|
|
342
|
+
equationEditorSectionCommonComponent.steps.openResponseFieldEquationContainerEquationEditor(0);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
equationEditorSectionCommonComponent.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
|
346
|
+
}
|
|
347
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('{backspace}{backspace}');
|
|
348
|
+
equationEditorFlyout.steps.enterEquation([{ categoryName: 'numPad', symbolName: ['multiply', 'zero'] }]);
|
|
349
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
|
350
|
+
if (questionType === 'essay response') {
|
|
351
|
+
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationText(0, 'x+5×0');
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
equationEditorSectionCommonComponent.steps.verifyResponseFieldEquationTextNew(0, 'x+5×0');
|
|
355
|
+
}
|
|
356
|
+
});
|
|
336
357
|
},
|
|
337
358
|
|
|
338
359
|
/**
|
|
@@ -96,7 +96,8 @@ const selectors = {
|
|
|
96
96
|
customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
|
|
97
97
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
|
98
98
|
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
|
99
|
-
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
|
99
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
|
100
|
+
wordCharacterLimitWrapper: () => cy.get('.essay-character-view-wrapper')
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
const steps = {
|
|
@@ -202,6 +203,24 @@ const steps = {
|
|
|
202
203
|
.should('be.checked');
|
|
203
204
|
},
|
|
204
205
|
|
|
206
|
+
unCheckAlwaysShowMinimumLimitCheckbox: () => {
|
|
207
|
+
essayResponseCommonComponents.alwaysShowMinLimitCheckBox()
|
|
208
|
+
.click()
|
|
209
|
+
.should('not.be.checked');
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
checkAlwaysShowMaximumLimitCheckbox: () => {
|
|
213
|
+
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
214
|
+
.click()
|
|
215
|
+
.should('be.checked');
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
uncheckAlwaysShowMaximumLimitCheckbox: () => {
|
|
219
|
+
essayResponseCommonComponents.alwaysShowMaxLimitCheckbox()
|
|
220
|
+
.click()
|
|
221
|
+
.should('not.be.checked');
|
|
222
|
+
},
|
|
223
|
+
|
|
205
224
|
verifyListItemLengthInResponseField: (length) => {
|
|
206
225
|
essayResponseCommonComponents.responseField()
|
|
207
226
|
.find('li')
|
|
@@ -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
|
});
|
|
@@ -21,7 +21,6 @@ const selectors = {
|
|
|
21
21
|
responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
|
|
22
22
|
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
23
23
|
correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]'),
|
|
24
|
-
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
25
24
|
correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]'),
|
|
26
25
|
correctAnswerResponseWrapperWithoutEnumeration: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper [class*="ResponseInputWrapper"] input'),
|
|
27
26
|
|
|
@@ -186,41 +185,6 @@ const steps = {
|
|
|
186
185
|
});
|
|
187
186
|
},
|
|
188
187
|
|
|
189
|
-
/**
|
|
190
|
-
* Verify correct answer section with alternate answers.
|
|
191
|
-
*
|
|
192
|
-
* @param {Object[]} correctAnswerArray - An array of objects representing the expected correct answers and their corresponding points.
|
|
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 cpntainer.
|
|
195
|
-
* @param {string[]} correctAnswerArray[].points - An array of point label strings associated with each correct answer group.
|
|
196
|
-
*
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
|
-
verifyCorrectAnswerSectionWithAlternateAnswer: (correctAnswerArray) => {
|
|
200
|
-
let responseIndex = 0;
|
|
201
|
-
let pointsLabelIndex = 0;
|
|
202
|
-
correctAnswerArray.forEach(({correctAnswers, points}) => {
|
|
203
|
-
correctAnswers.forEach((textContainers, index) => {
|
|
204
|
-
textContainers.forEach((correctAnswer) => {
|
|
205
|
-
fillInTheGapsTextCommonComponent.correctAnswerResponseWrapper()
|
|
206
|
-
.eq(responseIndex)
|
|
207
|
-
.within(() => {
|
|
208
|
-
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
|
209
|
-
fillInTheGapsTextCommonComponent.correctAnswerResponse()
|
|
210
|
-
.should('have.text', correctAnswer);
|
|
211
|
-
});
|
|
212
|
-
responseIndex += 1;
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
points.forEach((pointsText) => {
|
|
216
|
-
fillInTheGapsTextCommonComponent.correctAnswerPointsLabel()
|
|
217
|
-
.eq(pointsLabelIndex)
|
|
218
|
-
.should('have.text', pointsText);
|
|
219
|
-
pointsLabelIndex += 1;
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
|
|
224
188
|
verifyCorrectAnswerSectionNotExists: () => {
|
|
225
189
|
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.correctAnswerSectionWrapper(), 'notExist');
|
|
226
190
|
},
|
|
@@ -335,7 +299,7 @@ const steps = {
|
|
|
335
299
|
*/
|
|
336
300
|
verifyMaximumCharacterLimitInPreviewTab: (responseIndex, maxlen) => {
|
|
337
301
|
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
|
338
|
-
.should('have.attr', '
|
|
302
|
+
.should('have.attr', 'maxLength', maxlen);
|
|
339
303
|
},
|
|
340
304
|
|
|
341
305
|
/**
|
|
@@ -933,6 +897,19 @@ const steps = {
|
|
|
933
897
|
});
|
|
934
898
|
},
|
|
935
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
|
+
|
|
936
913
|
/**
|
|
937
914
|
* Verifies the border color of the answer input field at the specified index.
|
|
938
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,
|
|
@@ -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
|
|
|
@@ -19,6 +19,7 @@ const selectors = {
|
|
|
19
19
|
...customizeSpecialCharacterComponent,
|
|
20
20
|
...dialogBoxBase,
|
|
21
21
|
...equationEditorSectionCommonComponent,
|
|
22
|
+
...autoScoredScoringPreviewTab,
|
|
22
23
|
//Basic section
|
|
23
24
|
displayWordLimitLabel: () => cy.get('#Display-word-limit-dropdown-label'),
|
|
24
25
|
displayWordLimitDropdown: () => cy.get('#Display-word-limit-select'),
|
|
@@ -142,6 +143,7 @@ const steps = {
|
|
|
142
143
|
...dialogBoxBase.steps,
|
|
143
144
|
...equationEditorSectionCommonComponent.steps,
|
|
144
145
|
...createItemPage.steps,
|
|
146
|
+
...autoScoredScoringPreviewTab.steps,
|
|
145
147
|
|
|
146
148
|
clickOnSpecialCharactersPopupCloseButton: () => {
|
|
147
149
|
essayResponsePage.specialCharactersPopupCloseButton()
|
|
@@ -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 = {
|