itemengine-cypress-automation 1.0.180-essayResponseLazyLoadingFix-3170a00.0 → 1.0.182-repoUpdate22April-92d01da.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +4 -5
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +64 -3
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +530 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +119 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +263 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.smoke.js +179 -0
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +16 -16
- package/cypress/pages/audioPlayerPage.js +55 -543
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +4 -4
- package/cypress/pages/components/commonComponents.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +3 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
- package/cypress/pages/components/imageCanvasComponent.js +2 -1
- package/cypress/pages/components/index.js +1 -0
- package/cypress/pages/components/optionsWrapperComponent.js +11 -0
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +2 -2
- package/cypress/pages/createItemPage.js +29 -0
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +23 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +18 -0
- package/cypress/pages/gridFillPage.js +18 -2
- package/cypress/pages/index.js +1 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +122 -647
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLinePage.js +1196 -59
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +460 -22
- package/package.json +1 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -280,11 +280,15 @@ const steps = {
|
|
280
280
|
},
|
281
281
|
|
282
282
|
verifyLengthOfRulerInPreview: (length) => {
|
283
|
-
let lengthOfRuler = length.
|
283
|
+
let lengthOfRuler = length.replace(/\s|-/g, '');
|
284
284
|
rulerPage.rulerPreviewTab()
|
285
285
|
.find('svg g')
|
286
286
|
.eq(0)
|
287
|
-
.
|
287
|
+
.invoke('attr', 'data-name')
|
288
|
+
.then((dataName) => {
|
289
|
+
const trimmedDataName = dataName.trim().replace(/\s|-/g, '');
|
290
|
+
expect(trimmedDataName).to.equal(`Ruler${lengthOfRuler}`);
|
291
|
+
});
|
288
292
|
},
|
289
293
|
|
290
294
|
verifyColorOfRulerInPreview: (colorIndex) => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents } from "./components";
|
3
|
+
import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents, ckEditorToolbar, equationEditorFlyout, studentViewSettingsLabelComponent, enableOuterBorderComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, colorPopupComponent } from "./components";
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
5
5
|
const css = Cypress.env('css');
|
6
6
|
const colorLibrary = css.textSelectionColorLibrary;
|
@@ -12,8 +12,15 @@ const selectors = {
|
|
12
12
|
...autoScoredScoringSectionMultiResponseType,
|
13
13
|
...setPointsPopupBase,
|
14
14
|
...commonComponents,
|
15
|
+
...enableOuterBorderComponent,
|
16
|
+
...autoScoredScoringPreviewTab,
|
17
|
+
...additionalSettingsPanel,
|
18
|
+
...correctIncorrectAnswerLabelComponent,
|
19
|
+
...colorPopupComponent,
|
20
|
+
questionLabel: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] .title-casing'),
|
15
21
|
questionInputField: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] [title="Question"]'),
|
16
|
-
specifyPossibleOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"]'),
|
22
|
+
specifyPossibleOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] .question-text-wrapper'),
|
23
|
+
textSelectionModeLabel: () => cy.get('.text-selection-mode .options-label'),
|
17
24
|
textSelectionMode: (ariaLabel = null) => {
|
18
25
|
if (ariaLabel) {
|
19
26
|
return cy.get(`.text-selection-mode [type="button"][aria-label*="${ariaLabel}"]`)
|
@@ -21,15 +28,57 @@ const selectors = {
|
|
21
28
|
return cy.get('.text-selection-mode [type="button"]')
|
22
29
|
}
|
23
30
|
},
|
31
|
+
textSelectionModeButtonLabel: (ariaLabel = null) => {
|
32
|
+
if (ariaLabel) {
|
33
|
+
return cy.get(`.text-selection-mode [type="button"][aria-label*="${ariaLabel}"] .ngie-toggle-button-label`)
|
34
|
+
} else {
|
35
|
+
return cy.get('.text-selection-mode [type="button"] .ngie-toggle-button-label')
|
36
|
+
}
|
37
|
+
},
|
38
|
+
specifyPossibleOptionsLabel: () => cy.get('[class*="Highlightstyles__LabelWrapper"]'),
|
24
39
|
specifyPossibleOptionsTextSpans: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] span'),
|
40
|
+
specifyPossibleOptionsTextParagraphs: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] p'),
|
41
|
+
optionSpan: () => cy.get('span'),
|
42
|
+
selectedOptionSpecifyPossibleOptions: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] .highlighted'),
|
43
|
+
selectedOptionCounterSpecifyPossibleOptions: () => cy.get('[class*="Highlightstyles__CountWrapper"]'),
|
44
|
+
selectAllOptionsButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(0),
|
45
|
+
undoButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
|
46
|
+
redoButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
|
47
|
+
clearOptionsButton: () => cy.get('button[class*="Highlightstyles__IconButton"]').eq(3),
|
25
48
|
|
26
49
|
//Specify correct answer section
|
50
|
+
specifyCorrectAnswerTextWrapper: () => cy.get('[class*="Highlightstyles__Wrapper"] .question-text-wrapper'),
|
27
51
|
specifyCorrectAnswerTextSpans: () => cy.get('[class*="Highlightstyles__Wrapper"] span'),
|
52
|
+
specifyCorrectAnswerTextParagraphs: () => cy.get('[class*="Highlightstyles__Wrapper"] p'),
|
28
53
|
optionSpecifyCorrectAnswer: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
|
29
54
|
setPointsButton: () => cy.get('[class*="SetPointsPopupWrapper"] button'),
|
55
|
+
maximumOptionsCanBeSelectedErrorMessage: () => cy.get('[class*="Highlightstyles__AuthoringErrorMsg"]'),
|
56
|
+
maximumOptionsCanBeSelectedErrorMessagePreviewTab: () => cy.get('[class*="Highlightstyles__ErrorMessage"]'),
|
57
|
+
maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab: () => cy.get('.preview-selection-limit-error-wrapper'),
|
58
|
+
|
59
|
+
//Student view settings
|
60
|
+
showAvailableOptionsToStudentsLabel: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] [class*="label"]'),
|
61
|
+
showAvailableOptionsToStudentsCheckbox: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] input'),
|
62
|
+
maxNumberOfPossibleSelectionsLabel: () => cy.get('#Maximum-number-of-possible-selections-dropdown-label'),
|
63
|
+
maxNumberOfPossibleSelectionsDropdown: () => cy.get('#Maximum-number-of-possible-selections-select'),
|
64
|
+
showStudentMaximumNumberOfPossibleSelectionsCheckbox: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] input'),
|
65
|
+
showStudentMaximumNumberOfPossibleSelectionsLabel: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] [class*="label"]'),
|
66
|
+
maximumNumberOfSelectionsHelpText: () => cy.get('[class*="Highlightstyles__LimitWrapper"]'),
|
67
|
+
|
68
|
+
//Style and customization layout
|
69
|
+
filledInStyleLabel: () => cy.get('.text-selection-style-title'),
|
70
|
+
fillColorLabel: () => cy.get('[class*="StyleAndLayoutCustomizationstyles__SubSectionLabel"]'),
|
71
|
+
colorBlock: () => cy.get('.color-picker-block'),
|
72
|
+
editColorButton: () => cy.get('.ngie-icon-with-label-btn[aria-label="edit color"]'),
|
73
|
+
changeFontColorToWhiteCheckbox: () => cy.get('[data-ngie-testid="change-font-color-to-white-checkbox"] input'),
|
74
|
+
changeFontColorToWhiteCheckboxLabel: () => cy.get('[data-ngie-testid="change-font-color-to-white-checkbox"] [class*="label"]'),
|
30
75
|
|
31
76
|
//Preview tab
|
77
|
+
questionTextOuterBorderPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"]'),
|
32
78
|
questionTextPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] p'),
|
79
|
+
previewTabQuestionTextParagraphs: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] p'),
|
80
|
+
previewTabQuestionTextSpans: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"] span'),
|
81
|
+
questionTextWrapperPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] [class*="QuestionTextstyle__QuestionTextWrapper"]'),
|
33
82
|
optionPreviewTab: () => cy.get('[class*="Highlightstyles__HighlightPreviewWrapper"] .highlighted'),
|
34
83
|
optionCorrectAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1).find('.highlighted'),
|
35
84
|
correctAnswerSection: () => cy.get('[class*="Highlightstyles__Wrapper"]').eq(1),
|
@@ -50,6 +99,12 @@ const steps = {
|
|
50
99
|
...setPointsPopupBase.steps,
|
51
100
|
...commonComponents.steps,
|
52
101
|
...dialogBoxBase.steps,
|
102
|
+
...ckEditorToolbar.steps,
|
103
|
+
...equationEditorFlyout.steps,
|
104
|
+
...enableOuterBorderComponent.steps,
|
105
|
+
...additionalSettingsPanel.steps,
|
106
|
+
...styleAndLayoutCustomizationAccordionComponent.steps,
|
107
|
+
...colorPopupComponent.steps,
|
53
108
|
addInputToQuestionInputField: (text) => {
|
54
109
|
textSelectionPage.questionInputField()
|
55
110
|
.type(text);
|
@@ -78,7 +133,7 @@ const steps = {
|
|
78
133
|
},
|
79
134
|
|
80
135
|
verifyErroredStateOfSpecifyPossibleOptionsSection: () => {
|
81
|
-
utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextFieldWrapper(), {
|
136
|
+
utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextFieldWrapper().parent(), {
|
82
137
|
'border-color': css.color.errorFieldBorder,
|
83
138
|
'background-color': css.color.errorFieldBg
|
84
139
|
});
|
@@ -140,6 +195,62 @@ const steps = {
|
|
140
195
|
.should('have.text', 'This is Bold text input.lorem');
|
141
196
|
},
|
142
197
|
|
198
|
+
verifyImageAndAltTextInSpecifyCorrectAnswerSection: () => {
|
199
|
+
textSelectionPage.specifyCorrectAnswerTextWrapper()
|
200
|
+
.find('img')
|
201
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
202
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
203
|
+
},
|
204
|
+
|
205
|
+
verifyEquationInSpecifyCorrectAnswerSection: () => {
|
206
|
+
textSelectionPage.specifyCorrectAnswerTextWrapper()
|
207
|
+
.find('span[role="math"]')
|
208
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
209
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
210
|
+
},
|
211
|
+
|
212
|
+
verifyLinkInSpecifyCorrectAnswerSection: () => {
|
213
|
+
textSelectionPage.specifyCorrectAnswerTextWrapper()
|
214
|
+
.find('a')
|
215
|
+
.should('have.text', 'lorem')
|
216
|
+
.and('have.attr', 'href', `${Cypress.config().baseUrl}`);
|
217
|
+
},
|
218
|
+
|
219
|
+
verifyBoldTextInSpecifyCorrectAnswerSection: () => {
|
220
|
+
textSelectionPage.specifyCorrectAnswerTextWrapper()
|
221
|
+
.find('strong')
|
222
|
+
.should('exist')
|
223
|
+
.should('have.text', 'This is Bold text input.lorem');
|
224
|
+
},
|
225
|
+
|
226
|
+
verifyImageAndAltTextInPreviewTab: () => {
|
227
|
+
textSelectionPage.questionTextWrapperPreviewTab()
|
228
|
+
.find('img')
|
229
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
230
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
231
|
+
},
|
232
|
+
|
233
|
+
verifyEquationInPreviewTab: () => {
|
234
|
+
textSelectionPage.questionTextWrapperPreviewTab()
|
235
|
+
.find('span[role="math"]')
|
236
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
237
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
238
|
+
},
|
239
|
+
|
240
|
+
verifyLinkInPreviewTab: () => {
|
241
|
+
textSelectionPage.questionTextWrapperPreviewTab()
|
242
|
+
.find('a')
|
243
|
+
.should('have.text', 'lorem')
|
244
|
+
.and('have.attr', 'href', `${Cypress.config().baseUrl}`);
|
245
|
+
},
|
246
|
+
|
247
|
+
verifyBoldTextInPreviewTab: () => {
|
248
|
+
textSelectionPage.questionTextWrapperPreviewTab()
|
249
|
+
.find('strong')
|
250
|
+
.should('exist')
|
251
|
+
.should('have.text', 'This is Bold text input.lorem');
|
252
|
+
},
|
253
|
+
|
143
254
|
verifySpecifyPossibleOptionsFieldErrorMessage: () => {
|
144
255
|
textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
|
145
256
|
.next()
|
@@ -155,6 +266,24 @@ const steps = {
|
|
155
266
|
.click();
|
156
267
|
},
|
157
268
|
|
269
|
+
/**
|
270
|
+
* @param {string} textSelectionType Type of text selection
|
271
|
+
* @description Verify text selection mode is selected
|
272
|
+
*/
|
273
|
+
verifyTextSelectionModeIsSelected: (textSelectionType) => {
|
274
|
+
textSelectionPage.textSelectionMode(textSelectionType)
|
275
|
+
.should('have.attr', 'aria-pressed', 'true');
|
276
|
+
},
|
277
|
+
|
278
|
+
/**
|
279
|
+
* @param {string} textSelectionType Type of text selection
|
280
|
+
* @description Verify text selection mode is not selected
|
281
|
+
*/
|
282
|
+
verifyTextSelectionModeIsNotSelected: (textSelectionType) => {
|
283
|
+
textSelectionPage.textSelectionMode(textSelectionType)
|
284
|
+
.should('have.attr', 'aria-pressed', 'false');
|
285
|
+
},
|
286
|
+
|
158
287
|
/**
|
159
288
|
* @param {string} optionText Text of the option in specify possible options section
|
160
289
|
* @description Click on option in specify possible options section
|
@@ -246,18 +375,21 @@ const steps = {
|
|
246
375
|
|
247
376
|
/**
|
248
377
|
* @param {string} optionText Text of the option in specify possible options section
|
378
|
+
* @param {string} selectionColor type of color used for selection of option
|
249
379
|
* @description Verify hover state of the deselected option in specify possible options section
|
380
|
+
* @example verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection('Sample text', "blue")
|
250
381
|
*/
|
251
|
-
verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection: (optionText) => {
|
382
|
+
verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection: (optionText, selectionColor) => {
|
252
383
|
textSelectionPage.steps.hoverOnDeselectedOptionInSpecifyPossibleOptionsSection(optionText);
|
253
384
|
utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsTextSpans()
|
254
385
|
.contains(optionText), {
|
255
386
|
'color': css.color.text,
|
256
387
|
'font-size': css.fontSize.default,
|
257
388
|
'font-weight': css.fontWeight.regular,
|
258
|
-
'background-color': colorLibrary
|
259
|
-
'border': `
|
389
|
+
'background-color': colorLibrary[selectionColor].hoverBackground,
|
390
|
+
'border': `2px solid ${colorLibrary[selectionColor].hoverBorder}`
|
260
391
|
});
|
392
|
+
utilities.hoverAwayFromElement(textSelectionPage.specifyPossibleOptionsTextSpans().contains(optionText));
|
261
393
|
},
|
262
394
|
|
263
395
|
/**
|
@@ -335,18 +467,21 @@ const steps = {
|
|
335
467
|
},
|
336
468
|
|
337
469
|
/**
|
338
|
-
* @param {string} optionText Text of the option in
|
339
|
-
* @
|
470
|
+
* @param {string} optionText Text of the option in specify correct answer section
|
471
|
+
* @param {string} selectionColor type of color used for selection of option
|
472
|
+
* @description Verify hover state of the deselected option in specify correct answer section
|
473
|
+
* @example verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection('Sample text', "blue")
|
340
474
|
*/
|
341
|
-
verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection: (optionText) => {
|
475
|
+
verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection: (optionText, selectionColor) => {
|
342
476
|
textSelectionPage.steps.hoverOnDeselectedOptionInSpecifyCorrectAnswerSection(optionText);
|
343
477
|
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText), {
|
344
478
|
'color': css.color.text,
|
345
479
|
'font-size': css.fontSize.default,
|
346
480
|
'font-weight': css.fontWeight.regular,
|
347
|
-
'background-color': colorLibrary
|
348
|
-
'border': `
|
481
|
+
'background-color': colorLibrary[selectionColor].hoverBackground,
|
482
|
+
'border': `2px solid ${colorLibrary[selectionColor].hoverBorder}`
|
349
483
|
});
|
484
|
+
utilities.hoverAwayFromElement(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText));
|
350
485
|
},
|
351
486
|
|
352
487
|
/**
|
@@ -381,11 +516,24 @@ const steps = {
|
|
381
516
|
});
|
382
517
|
},
|
383
518
|
|
519
|
+
/**
|
520
|
+
* @param {string} optionText Text of the option in preview tab
|
521
|
+
* @example verifyOptionIsDisplayedToStudentsInPreviewTab('Sample text')
|
522
|
+
*/
|
523
|
+
verifyOptionIsDisplayedToStudentsInPreviewTab: (optionText) => {
|
524
|
+
utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
|
525
|
+
'color': css.color.text,
|
526
|
+
'font-size': css.fontSize.default,
|
527
|
+
'font-weight': css.fontWeight.regular,
|
528
|
+
'background-color': colorLibrary["blue"].hoverBackground
|
529
|
+
});
|
530
|
+
},
|
531
|
+
|
384
532
|
/**
|
385
533
|
* @param {string} optionText Text of the option in preview tab
|
386
|
-
* @example
|
534
|
+
* @example verifyStandardStateOptionInPreviewTab('Sample text')
|
387
535
|
*/
|
388
|
-
|
536
|
+
verifyStandardStateOptionInPreviewTab: (optionText) => {
|
389
537
|
utilities.verifyCSS(textSelectionPage.optionPreviewTab().contains(optionText), {
|
390
538
|
'color': css.color.text,
|
391
539
|
'font-size': css.fontSize.default,
|
@@ -545,6 +693,36 @@ const steps = {
|
|
545
693
|
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[5]);
|
546
694
|
},
|
547
695
|
|
696
|
+
/**
|
697
|
+
* @param {number[]} pointsArray Array of partial different points for options
|
698
|
+
* @description Add points to options in set points popup
|
699
|
+
*/
|
700
|
+
addPartialDifferentWeightsPointsInSetPointsPopup: (pointsArray) => {
|
701
|
+
textSelectionPage.setPointsButton()
|
702
|
+
.click();
|
703
|
+
setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField(pointsArray);
|
704
|
+
setPointsPopupBase.steps.saveSetPointsPopup();
|
705
|
+
},
|
706
|
+
|
707
|
+
/**
|
708
|
+
* Verify non-optional text is not interactive in preview tab
|
709
|
+
* @param {string} optionText Non-optional text in preview tab
|
710
|
+
*/
|
711
|
+
verifyNonOptionTextIsNotInteractiveInPreviewTab: (optionText) => {
|
712
|
+
utilities.hoverOverElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
|
713
|
+
utilities.verifyCSS(textSelectionPage.questionTextPreviewTab().contains(optionText), {
|
714
|
+
'background-color': css.color.transparent
|
715
|
+
});
|
716
|
+
utilities.hoverAwayFromElement(textSelectionPage.questionTextPreviewTab().contains(optionText));
|
717
|
+
textSelectionPage.questionTextPreviewTab()
|
718
|
+
.contains(optionText)
|
719
|
+
.click();
|
720
|
+
textSelectionPage.questionTextPreviewTab()
|
721
|
+
.contains(optionText)
|
722
|
+
.should('not.have.class', 'correct_answer')
|
723
|
+
.and('have.attr', 'aria-checked', 'false');
|
724
|
+
},
|
725
|
+
|
548
726
|
/**
|
549
727
|
* @param {number[]} pointsArray Array of partial different points for options
|
550
728
|
* @description Add points to options in set points popup
|
@@ -575,7 +753,6 @@ const steps = {
|
|
575
753
|
selectOptionInSpecifyPossibleOptionsSection: (textSelectionType, optionText) => {
|
576
754
|
if (textSelectionType === 'Custom') {
|
577
755
|
textSelectionPage.specifyPossibleOptionsTextFieldWrapper()
|
578
|
-
.find('.question-text-wrapper')
|
579
756
|
.selectText(optionText);
|
580
757
|
textSelectionPage.steps.verifyOptionIsSelectedInSpecifyPossibleOptionsSection(optionText);
|
581
758
|
} else {
|
@@ -585,7 +762,6 @@ const steps = {
|
|
585
762
|
},
|
586
763
|
|
587
764
|
/**
|
588
|
-
* @param {string} textSelectionType Type of text selection
|
589
765
|
* @param {*} optionText Text of the option in specify possible options section
|
590
766
|
* @description Deselect an option in specify possible options section
|
591
767
|
*/
|
@@ -607,6 +783,103 @@ const steps = {
|
|
607
783
|
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect answer: ${penaltyPoints}`);
|
608
784
|
},
|
609
785
|
|
786
|
+
/**
|
787
|
+
* @description Verify text and options displayed in specify correct answer section
|
788
|
+
* @param {string[]} textArray array of span-vise text in specify correct answer section
|
789
|
+
* @param {string[]} optionsArray array of options in specify correct answer section
|
790
|
+
*/
|
791
|
+
verifySpecifyCorrectAnswerTextAndOptions: (textArray, optionsArray) => {
|
792
|
+
textArray.forEach((text, index) => {
|
793
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), text);
|
794
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), 'visible');
|
795
|
+
});
|
796
|
+
optionsArray.forEach((optionText, index) => {
|
797
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.optionSpecifyCorrectAnswer(), index), optionText);
|
798
|
+
});
|
799
|
+
utilities.verifyElementCount(textSelectionPage.optionSpecifyCorrectAnswer(), optionsArray.length);
|
800
|
+
},
|
801
|
+
|
802
|
+
/**
|
803
|
+
*
|
804
|
+
* @param {string} optionText Text of the option in preview tab
|
805
|
+
* @param {string} selectionColor type of color used for selection of option
|
806
|
+
* @example verifySelectedStateOptionInPreviewTab('Sample text', "blue")
|
807
|
+
*/
|
808
|
+
verifySelectedStateOptionInSpecifyCorrectAnswerSection: (optionText, selectionColor) => {
|
809
|
+
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(optionText), {
|
810
|
+
'color': css.color.whiteText,
|
811
|
+
'font-size': css.fontSize.default,
|
812
|
+
'font-weight': css.fontWeight.regular,
|
813
|
+
'background-color': colorLibrary[selectionColor].background
|
814
|
+
});
|
815
|
+
},
|
816
|
+
|
817
|
+
/**
|
818
|
+
*
|
819
|
+
* @param {string} optionText Text of the option in preview tab
|
820
|
+
* @param {string} selectionColor type of color used for selection of option
|
821
|
+
* @example verifySelectedStateOptionInPreviewTab('Sample text', "blue")
|
822
|
+
*/
|
823
|
+
verifySelectedStateOptionInSpecifyPossibleOptionSection: (optionText, selectionColor) => {
|
824
|
+
utilities.verifyCSS(textSelectionPage.selectedOptionSpecifyPossibleOptions().contains(optionText), {
|
825
|
+
'color': css.color.whiteText,
|
826
|
+
'font-size': css.fontSize.default,
|
827
|
+
'font-weight': css.fontWeight.regular,
|
828
|
+
'background-color': colorLibrary[selectionColor].background
|
829
|
+
});
|
830
|
+
},
|
831
|
+
|
832
|
+
/**
|
833
|
+
* @param {number} selectedOptionCount Value of counter
|
834
|
+
* @description Verify option counter text and value
|
835
|
+
*/
|
836
|
+
verifyOptionCounterTextAndValue: (selectedOptionCount) => {
|
837
|
+
utilities.verifyTextContent(textSelectionPage.selectedOptionCounterSpecifyPossibleOptions(), `Option count: ${selectedOptionCount}`);
|
838
|
+
},
|
839
|
+
|
840
|
+
clearSelectedOptionsInSpecifyPossibleOptionSection: () => {
|
841
|
+
textSelectionPage.steps.clickOnClearOptionsButtonInSpecifyPossibleOptionSection();
|
842
|
+
textSelectionPage.steps.clickOnAcceptButtonInDialogBox();
|
843
|
+
},
|
844
|
+
|
845
|
+
clickOnClearOptionsButtonInSpecifyPossibleOptionSection: () => {
|
846
|
+
textSelectionPage.clearOptionsButton()
|
847
|
+
.click();
|
848
|
+
},
|
849
|
+
|
850
|
+
verifyClearPopupForClearingOptionSelection: () => {
|
851
|
+
utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'visible');
|
852
|
+
utilities.verifyInnerText(textSelectionPage.dialogBoxTitle(), 'Clear');
|
853
|
+
utilities.verifyInnerText(textSelectionPage.dialogBoxContent(), 'Are you sure you want to clear all options? This action will not delete template content but remove all options.');
|
854
|
+
utilities.verifyInnerText(textSelectionPage.buttonReject(), 'Cancel');
|
855
|
+
utilities.verifyInnerText(textSelectionPage.buttonAccept(), 'Confirm');
|
856
|
+
},
|
857
|
+
|
858
|
+
/**
|
859
|
+
* @param {number} paragraphIndex Index of the paragraph in specify possible options section
|
860
|
+
* @param {number} numberOfOptions Number of options inside the paragraph in specify possible options section
|
861
|
+
* @description Verify number of options inside a paragraph in specify possible options section
|
862
|
+
*/
|
863
|
+
verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection: (paragraphIndex, numberOfOptions) => {
|
864
|
+
textSelectionPage.specifyPossibleOptionsTextParagraphs()
|
865
|
+
.eq(paragraphIndex)
|
866
|
+
.within(() => {
|
867
|
+
utilities.verifyElementCount(textSelectionPage.optionSpan(), numberOfOptions)
|
868
|
+
});
|
869
|
+
},
|
870
|
+
|
871
|
+
verifySelectAllOptionsButtonIsDisplayed: () => {
|
872
|
+
utilities.verifyElementVisibilityState(textSelectionPage.selectAllOptionsButton(), 'visible');
|
873
|
+
textSelectionPage.selectAllOptionsButton()
|
874
|
+
.should('have.attr', 'aria-label', 'Select all options');
|
875
|
+
},
|
876
|
+
|
877
|
+
verifyQuestionTextOuterBorderIsDisplayedInPreviewTab: () => {
|
878
|
+
utilities.verifyCSS(textSelectionPage.questionTextOuterBorderPreviewTab(), {
|
879
|
+
'border': `1px solid ${css.color.outerBorder}`
|
880
|
+
});
|
881
|
+
},
|
882
|
+
|
610
883
|
/**
|
611
884
|
* Verify non-optional text is not interactive in preview tab
|
612
885
|
* @param {string} optionText Non-optional text in preview tab
|
@@ -616,14 +889,126 @@ const steps = {
|
|
616
889
|
utilities.verifyCSS(textSelectionPage.questionTextPreviewTab().contains(optionText), {
|
617
890
|
'background-color': css.color.transparent
|
618
891
|
});
|
619
|
-
|
620
|
-
|
621
|
-
|
892
|
+
},
|
893
|
+
|
894
|
+
verifyQuestionTextOuterBorderIsNotDisplayedInPreviewTab: () => {
|
895
|
+
utilities.verifyCSS(textSelectionPage.questionTextOuterBorderPreviewTab(), {
|
896
|
+
'border-width': '0px'
|
897
|
+
});
|
898
|
+
},
|
899
|
+
|
900
|
+
verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked: () => {
|
901
|
+
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
902
|
+
.should('not.be.checked');
|
903
|
+
},
|
904
|
+
|
905
|
+
verifyShowAvailableOptionsToStudentsCheckboxIsChecked: () => {
|
906
|
+
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
907
|
+
.should('be.checked');
|
908
|
+
},
|
909
|
+
|
910
|
+
uncheckShowAvailableOptionsToStudentsCheckbox: () => {
|
911
|
+
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
912
|
+
.click()
|
913
|
+
.should('not.be.checked');
|
914
|
+
},
|
915
|
+
|
916
|
+
checkShowAvailableOptionsToStudentsCheckbox: () => {
|
917
|
+
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
918
|
+
.click()
|
919
|
+
.should('be.checked');
|
920
|
+
},
|
921
|
+
|
922
|
+
expandMaxNumberOfPossibleSelectionsDropdown: () => {
|
923
|
+
textSelectionPage.maxNumberOfPossibleSelectionsDropdown()
|
622
924
|
.click();
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
925
|
+
},
|
926
|
+
|
927
|
+
/**
|
928
|
+
* Verify maximum number of possible selections dropdown options
|
929
|
+
* @param {string[]} options array of dropdown options
|
930
|
+
*/
|
931
|
+
verifyMaxNumberOfPossibleSelectionsDropdownListOptions: (options) => {
|
932
|
+
options.forEach((option, count) => {
|
933
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.dropdownListOption(), count), option);
|
934
|
+
});
|
935
|
+
},
|
936
|
+
|
937
|
+
/**
|
938
|
+
* @param {string} listOption - The option to be selected from the maximum number of possible selections dropdown
|
939
|
+
* @description Selects an option from the maximum number of possible selections dropdown. The dropdown options are dependent on the number of available options.
|
940
|
+
*/
|
941
|
+
selectOptionFromMaxNumberOfPossibleSelectionsDropdown: (listOption) => {
|
942
|
+
textSelectionPage.dropdownListOption()
|
943
|
+
.contains(listOption)
|
944
|
+
.click();
|
945
|
+
},
|
946
|
+
|
947
|
+
verifyShowStudentTheMaxNumberOfSelectionsCheckboxIsUnchecked: () => {
|
948
|
+
textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
949
|
+
.should('not.be.checked');
|
950
|
+
},
|
951
|
+
|
952
|
+
checkShowStudentTheMaxNumberOfSelectionsCheckbox: () => {
|
953
|
+
textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
954
|
+
.click()
|
955
|
+
.should('be.checked');
|
956
|
+
},
|
957
|
+
|
958
|
+
clickOnEditColorButton: () => {
|
959
|
+
textSelectionPage.editColorButton()
|
960
|
+
.click();
|
961
|
+
},
|
962
|
+
|
963
|
+
/**
|
964
|
+
* @description select a color block in style and customization layout accordion
|
965
|
+
* @param {number} index index of color block
|
966
|
+
*/
|
967
|
+
selectColorBlock: (index) => {
|
968
|
+
utilities.getNthElement(textSelectionPage.colorBlock(), index)
|
969
|
+
.click()
|
970
|
+
.should('have.attr', 'aria-pressed', 'true');
|
971
|
+
},
|
972
|
+
|
973
|
+
/**
|
974
|
+
* @description verify that a color block is selected in style and customization layout accordion
|
975
|
+
* @param {number} index index of color block
|
976
|
+
*/
|
977
|
+
verifyColorBlockIsSelected: (index) => {
|
978
|
+
utilities.getNthElement(textSelectionPage.colorBlock(), index)
|
979
|
+
.should('have.attr', 'aria-pressed', 'true');
|
980
|
+
},
|
981
|
+
|
982
|
+
/**
|
983
|
+
* @description verify the background color of a color block in style and customization layout accordion
|
984
|
+
* @param {number} index index of color block
|
985
|
+
* @param {string} color background color value of the color block in rgba format
|
986
|
+
*/
|
987
|
+
verifyColorBlockBackgroundColor: (index, color) => {
|
988
|
+
utilities.verifyCSS(utilities.getNthElement(textSelectionPage.colorBlock(), index), {
|
989
|
+
'background-color': color
|
990
|
+
});
|
991
|
+
},
|
992
|
+
|
993
|
+
verifyChangeFontColorToWhiteCheckboxIsChecked: () => {
|
994
|
+
textSelectionPage.changeFontColorToWhiteCheckbox()
|
995
|
+
.should('be.checked');
|
996
|
+
},
|
997
|
+
|
998
|
+
uncheckChangeFontColorToWhiteCheckbox: () => {
|
999
|
+
textSelectionPage.changeFontColorToWhiteCheckbox()
|
1000
|
+
.click()
|
1001
|
+
.should('not.be.checked');
|
1002
|
+
},
|
1003
|
+
|
1004
|
+
/**
|
1005
|
+
* @description select a color block in style and customization layout accordion
|
1006
|
+
* @param {number} index index of color block
|
1007
|
+
*/
|
1008
|
+
selectAColorBlock: (index) => {
|
1009
|
+
utilities.getNthElement(textSelectionPage.colorBlock(), index)
|
1010
|
+
.click();
|
1011
|
+
textSelectionPage.steps.verifyColorBlockIsSelected(index)
|
627
1012
|
}
|
628
1013
|
}
|
629
1014
|
|
@@ -632,6 +1017,15 @@ const tests = {
|
|
632
1017
|
...scoringSectionBaseEditTab.tests,
|
633
1018
|
...autoScoredScoringSectionMultiResponseType.tests,
|
634
1019
|
...commonComponents.tests,
|
1020
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
1021
|
+
...questionInstructionsComponent.tests,
|
1022
|
+
...studentViewSettingsLabelComponent.tests,
|
1023
|
+
...enableOuterBorderComponent.tests,
|
1024
|
+
...autoScoredStudentViewSettings.tests,
|
1025
|
+
...createQuestionBasePage.tests,
|
1026
|
+
...additionalSettingsPanel.tests,
|
1027
|
+
...additionalSettingsAccessibilitySectionComponent.tests,
|
1028
|
+
...styleAndLayoutCustomizationAccordionComponent.tests,
|
635
1029
|
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
636
1030
|
it('When user selects a scoring type, then in the \'Correct\' accordion all the contents should be displayed', () => {
|
637
1031
|
textSelectionPage.specifyCorrectAnswerTextSpans()
|
@@ -641,6 +1035,50 @@ const tests = {
|
|
641
1035
|
});
|
642
1036
|
});
|
643
1037
|
},
|
1038
|
+
|
1039
|
+
/**
|
1040
|
+
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
1041
|
+
* @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
|
1042
|
+
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
1043
|
+
*/
|
1044
|
+
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
1045
|
+
it('When the user selects the options as correct answer, then the selected answer should be set as correct answer', () => {
|
1046
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
|
1047
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
|
1048
|
+
});
|
1049
|
+
|
1050
|
+
it(`When the user deselects all the selected options in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
|
1051
|
+
textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
|
1052
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
1053
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
1054
|
+
if (accordionName == 'Correct') {
|
1055
|
+
autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
|
1056
|
+
.within(() => {
|
1057
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
1058
|
+
});
|
1059
|
+
} else {
|
1060
|
+
autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
|
1061
|
+
.within(() => {
|
1062
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
1063
|
+
});
|
1064
|
+
};
|
1065
|
+
});
|
1066
|
+
|
1067
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
|
1068
|
+
|
1069
|
+
it('When the user selects an option, the error message should disappear', () => {
|
1070
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
|
1071
|
+
textSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
|
1072
|
+
});
|
1073
|
+
|
1074
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
1075
|
+
|
1076
|
+
//CSS covered while verifying selected and deselected state of options
|
1077
|
+
|
1078
|
+
it('Accessibility of accordion contents', { tags: 'a11y' }, () => {
|
1079
|
+
cy.checkAccessibility(textSelectionPage.pointsInputField().parents('.highlight-set-correct-wrapper'))
|
1080
|
+
});
|
1081
|
+
}
|
644
1082
|
}
|
645
1083
|
|
646
1084
|
export const textSelectionPage = {
|