itemengine-cypress-automation 1.0.113 → 1.0.115
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
- package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
- package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
- package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
- package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
- package/cypress/pages/audioResponsePage.js +523 -66
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
- package/cypress/pages/components/equationEditorFlyout.js +11 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
- package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
- package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
- package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
- package/cypress/pages/components/questionInputFieldComponent.js +0 -7
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -3
- package/cypress/pages/essayResponseBasicPage.js +1 -26
- package/cypress/pages/essayResponsePage.js +21 -284
- package/cypress/pages/shortTextResponsePage.js +142 -103
- package/cypress/pages/textEntryMathPage.js +58 -7
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +1 -1
@@ -1,21 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { createQuestionBasePage, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInstructionsComponent, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, additionalSettingsPanel } from "./components/";
|
2
|
+
import { dialogBoxBase } from "./dialogBoxBase";
|
3
|
+
import utilities from "../support/helpers/utilities";
|
3
4
|
const css = Cypress.env('css');
|
4
5
|
|
5
6
|
const selectors = {
|
6
|
-
...scoringSectionBase,
|
7
|
-
...createQuestionBasePage,
|
8
|
-
...additionalSettingsPanel,
|
9
7
|
...questionInstructionsComponent,
|
10
|
-
...
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
...specialAndCustomSpecialCharactersComponent,
|
16
|
-
...previewScoringAndShowCorrectAnswerComponent,
|
17
|
-
setCorrectAnswerResponseField: () => cy.get('.short-text-response-input-field input'),
|
18
|
-
setCorrectAnswerResponseFieldWrapper: () => cy.get('.short-text-response-input-field input').parents('.MuiTextField-root'),
|
8
|
+
...autoScoredSpecifyCorrectAnswerSection,
|
9
|
+
|
10
|
+
correctAnswerAccordionLabel: () => cy.get('[class*="AnswerAccordionstyles__Label"]'),
|
11
|
+
specifyCorrectAnswerResponseField: () => cy.get('.short-text-response-input-field input'),
|
12
|
+
specifyCorrectAnswerResponseFieldWrapper: () => cy.get('.short-text-response-input-field input').parents('.MuiTextField-root'),
|
19
13
|
exactRadioOptionLabel: () => cy.get('.ngie-radio-label').eq(0),
|
20
14
|
containsTextRadioOptionLabel: () => cy.get('.ngie-radio-label').eq(1),
|
21
15
|
caseSensitiveCheckboxLabel: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] .MuiFormControlLabel-label'),
|
@@ -24,10 +18,10 @@ const selectors = {
|
|
24
18
|
containsTextRadioButton: () => cy.get('input[aria-label="Contains text"]'),
|
25
19
|
caseSensitiveCheckbox: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] input'),
|
26
20
|
ignoreSpacesBeforeAndAfterCheckbox: () => cy.get('[data-ngie-testid="ignore-spaces-before-and-after-checkbox"] input'),
|
27
|
-
previewTabResponseField: () => cy.get('
|
21
|
+
previewTabResponseField: () => cy.get('.input-field input:visible'),
|
28
22
|
previewTabResponseFieldWrapper: () => cy.get('[class*="edit-question-preview-wrapper"] .short-text-preview-response-input-field input').parents('.MuiTextField-root'),
|
29
23
|
//Preview tab
|
30
|
-
|
24
|
+
previewTabCorrectAnswerWrapper: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerWrapper"]'),
|
31
25
|
previewTabCorrectAnswerLabel: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerLabel"]'),
|
32
26
|
previewTabCorrectAnswerResponse: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerValueWrapper"]'),
|
33
27
|
previewTabResponseFieldSpecialCharactersButton: () => cy.get('.cloze-with-text-response-preview-wrapper .custon-special-character-button'),
|
@@ -47,31 +41,56 @@ const selectors = {
|
|
47
41
|
|
48
42
|
const steps = {
|
49
43
|
...createQuestionBasePage.steps,
|
44
|
+
...autoScoredStudentViewSettings.steps,
|
45
|
+
...autoScoredScoringPreviewTab.steps,
|
46
|
+
...scoringSectionBaseEditTab.steps,
|
50
47
|
...questionInstructionsComponent.steps,
|
51
|
-
...scoringSectionBase.steps,
|
52
48
|
...additionalSettingsPanel.steps,
|
53
|
-
...
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
...autoScoredSpecifyCorrectAnswerSection.steps,
|
50
|
+
|
51
|
+
verifyCorrectIcon: () => {
|
52
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
53
|
+
},
|
54
|
+
|
55
|
+
verifyIncorrectIcon: () => {
|
56
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
|
57
|
+
},
|
58
|
+
|
59
|
+
verifyCorrectIncorrectIconNotVisibleGradingView: () => {
|
60
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'notExist');
|
61
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'notExist');
|
62
|
+
},
|
63
|
+
|
64
|
+
verifyCorrectAttemptBorder: () => {
|
65
|
+
utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
|
66
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
67
|
+
});
|
68
|
+
},
|
69
|
+
|
70
|
+
verifyIncorrectAttemptBorder: () => {
|
71
|
+
utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
|
72
|
+
'border': `1px solid ${css.color.incorrectAnswer}`
|
73
|
+
});
|
61
74
|
},
|
62
75
|
|
63
|
-
|
64
|
-
|
65
|
-
.
|
76
|
+
verifyCorrectIncorrectBorderNotExist: () => {
|
77
|
+
shortTextResponsePage.previewTabResponseField()
|
78
|
+
.parent()
|
79
|
+
.find('fieldset')
|
80
|
+
.should('not.have.css', 'border', `1px solid ${css.color.incorrectAnswer}`)
|
81
|
+
.and('not.have.css', 'border', `1px solid ${css.color.correctAnswer}`);
|
66
82
|
},
|
67
83
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
shortTextResponsePage.
|
74
|
-
|
84
|
+
/**
|
85
|
+
* @param {String} correctAnswer correct answer in correct answer wrapper present in grading view
|
86
|
+
* @description function verifies correct answer wrapper in grading view
|
87
|
+
*/
|
88
|
+
verifyCorrectAnswerResponseInCorrectAnswerWrapper: (correctAnswer) => {
|
89
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
|
90
|
+
utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
|
91
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'visible');
|
92
|
+
utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerResponse(), correctAnswer);
|
93
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerResponse(), 'visible');
|
75
94
|
},
|
76
95
|
|
77
96
|
createBasicShortTextResponseQuestion: (inputQuestion, points, inputAnswer) => {
|
@@ -79,31 +98,73 @@ const steps = {
|
|
79
98
|
.type(inputQuestion);
|
80
99
|
shortTextResponsePage.pointsInputField()
|
81
100
|
.type(points);
|
82
|
-
shortTextResponsePage.
|
101
|
+
shortTextResponsePage.specifyCorrectAnswerResponseField()
|
83
102
|
.type(inputAnswer);
|
84
103
|
shortTextResponsePage.saveQuestionButton()
|
85
104
|
.click();
|
105
|
+
},
|
106
|
+
|
107
|
+
/**
|
108
|
+
* @param {string} text text to entered in set correct answer input field
|
109
|
+
*/
|
110
|
+
enterTextInAnswerInputFieldSpecifyCorrectAnswerSection: (text) => {
|
111
|
+
shortTextResponsePage.specifyCorrectAnswerResponseField()
|
112
|
+
.type(text)
|
113
|
+
.should('have.value', text);
|
114
|
+
},
|
115
|
+
|
116
|
+
clearAndFocusOutOfSpecifyCorrectAnswerInputField: (text) => {
|
117
|
+
shortTextResponsePage.setCorrectAnswerResponseField()
|
118
|
+
.clear()
|
119
|
+
.blur();
|
120
|
+
},
|
121
|
+
|
122
|
+
/**
|
123
|
+
* @param {string} text text to entered in set correct answer input field
|
124
|
+
*/
|
125
|
+
enterTextInAnswerInputFieldPreviewTab: (text) => {
|
126
|
+
shortTextResponsePage.previewTabResponseField()
|
127
|
+
.clear()
|
128
|
+
.type(text)
|
129
|
+
.should('have.value', text);
|
130
|
+
},
|
131
|
+
|
132
|
+
/**
|
133
|
+
* @param {string} text text to entered in set correct answer input field
|
134
|
+
*/
|
135
|
+
verifyTextInAnswerInputFieldPreviewTab: (text) => {
|
136
|
+
shortTextResponsePage.previewTabResponseField()
|
137
|
+
.should('have.value', text);
|
138
|
+
},
|
139
|
+
|
140
|
+
verifyCorrectAnswerErrorMessage: () => {
|
141
|
+
utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Answer is required.');
|
142
|
+
},
|
143
|
+
|
144
|
+
verifyCorrectAnswerErrorMessageIsNotDisplayed: () => {
|
145
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
146
|
+
},
|
147
|
+
|
148
|
+
verifyCorrectAnswerWrapperNotExist: () => {
|
149
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'notExist');
|
86
150
|
}
|
87
151
|
}
|
88
152
|
|
89
153
|
const tests = {
|
90
|
-
...
|
154
|
+
...autoScoredScoringPreviewTab.tests,
|
155
|
+
...scoringSectionBaseEditTab.tests,
|
156
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
91
157
|
...createQuestionBasePage.tests,
|
92
|
-
...
|
158
|
+
...dialogBoxBase.tests,
|
159
|
+
...commonComponents.tests,
|
93
160
|
...additionalSettingsPanel.tests,
|
94
|
-
...
|
95
|
-
|
96
|
-
...autoScoredScoringSection.tests,
|
97
|
-
...autoScoredAdditionalSettings.tests,
|
98
|
-
...specialCharactersFlyoutComponent.tests,
|
99
|
-
...specialAndCustomSpecialCharactersComponent.tests,
|
100
|
-
...previewScoringAndShowCorrectAnswerComponent.tests,
|
101
|
-
...studentResponseAndLayoutComponent.tests,
|
161
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
162
|
+
|
102
163
|
verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel: (answerInput, score, isCorrect) => {
|
103
164
|
shortTextResponsePage.previewTabResponseField()
|
104
165
|
.clear()
|
105
166
|
.type(answerInput);
|
106
|
-
|
167
|
+
autoScoredScoringPreviewTab.previewScoreText()
|
107
168
|
.verifyInnerText(score);
|
108
169
|
autoScoredPreviewBase.checkAnswerButton()
|
109
170
|
.click();
|
@@ -116,71 +177,42 @@ const tests = {
|
|
116
177
|
};
|
117
178
|
},
|
118
179
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
180
|
+
/**
|
181
|
+
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
182
|
+
* @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
|
183
|
+
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
184
|
+
*/
|
185
|
+
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
186
|
+
it('User should be able to enter answer in Answer input field in specify correct answer section', () => {
|
187
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Petals');
|
123
188
|
});
|
124
189
|
|
125
|
-
it('
|
126
|
-
shortTextResponsePage.
|
127
|
-
|
128
|
-
|
129
|
-
.should('be.visible');
|
190
|
+
it('When user focuses in and out of the response accordion \'Answer\' input field, \'Error: Answer is required.\' error message should be displayed', () => {
|
191
|
+
shortTextResponsePage.steps.clearAndFocusOutOfSpecifyCorrectAnswerInputField();
|
192
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
193
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Answer is required.');
|
130
194
|
});
|
131
195
|
|
132
|
-
|
133
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
134
|
-
.type('Lorem Ipsum')
|
135
|
-
.should('have.value', 'Lorem Ipsum');
|
136
|
-
});
|
196
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
|
137
197
|
|
138
|
-
it(
|
139
|
-
|
140
|
-
|
141
|
-
.clear();
|
142
|
-
cy.get('body')
|
143
|
-
.click();
|
144
|
-
commonComponents.errorMessage()
|
145
|
-
.should('have.text', 'Error: Please set a correct answer.');
|
146
|
-
if (tabName == 'Correct tab') {
|
147
|
-
autoScoredSetCorrectAnswerSection.correctTab()
|
148
|
-
.within(() => {
|
149
|
-
autoScoredSetCorrectAnswerSection.setCorrectAnswerErrorIcon()
|
150
|
-
.should('be.visible');
|
151
|
-
});
|
152
|
-
} else {
|
153
|
-
autoScoredSetCorrectAnswerSection.alternateAnswerTab(1)
|
154
|
-
.within(() => {
|
155
|
-
autoScoredSetCorrectAnswerSection.setCorrectAnswerErrorIcon()
|
156
|
-
.should('be.visible');
|
157
|
-
});
|
158
|
-
};
|
198
|
+
it('When gives an input to \'Answer\' input field,then error message should disappear', () => {
|
199
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Nature');
|
200
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
159
201
|
});
|
160
202
|
|
161
|
-
|
203
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
162
204
|
|
163
|
-
it(
|
164
|
-
shortTextResponsePage.
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
205
|
+
it(`CSS of ${accordionName} accordion contents`, { tags: 'css' }, () => {
|
206
|
+
utilities.verifyCSS(utilities.getNthElement(shortTextResponsePage.correctAnswerAccordionLabel(), 0), {
|
207
|
+
'color': css.color.accordionLabel,
|
208
|
+
'font-size': css.fontSize.default,
|
209
|
+
'font-weight': css.fontWeight.bold
|
210
|
+
});
|
169
211
|
});
|
170
212
|
|
171
|
-
it(
|
172
|
-
cy.checkAccessibility(shortTextResponsePage.
|
213
|
+
it(`Accessibility of ${accordionName} accordion contents`, { tags: 'a11y' }, () => {
|
214
|
+
cy.checkAccessibility(shortTextResponsePage.correctAnswerAccordionLabel().parents('[aria-label="Specify correct answer section"]'));
|
173
215
|
});
|
174
|
-
|
175
|
-
it('When the user has added text in correct answer response field, the error message should disappear', () => {
|
176
|
-
shortTextResponsePage.setCorrectAnswerResponseField()
|
177
|
-
.type('dolor sit amet')
|
178
|
-
.should('have.value', 'dolor sit amet');
|
179
|
-
commonComponents.errorMessage()
|
180
|
-
.should('not.exist');
|
181
|
-
});
|
182
|
-
|
183
|
-
autoScoredSetCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(tabName);
|
184
216
|
},
|
185
217
|
|
186
218
|
verifyMinimumScoreAwardedForIncorrectAnswer: (totalPoints) => {
|
@@ -196,12 +228,19 @@ const tests = {
|
|
196
228
|
shortTextResponsePage.previewTabResponseField()
|
197
229
|
.type('Incorrect answer')
|
198
230
|
.blur();
|
199
|
-
|
231
|
+
autoScoredScoringPreviewTab.previewScoreText()
|
200
232
|
.then(($points) => {
|
201
233
|
expect($points.text()).to.equal(`1/${totalPoints}`);
|
202
234
|
});
|
203
235
|
});
|
204
|
-
}
|
236
|
+
},
|
237
|
+
|
238
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
239
|
+
it('In the \'Correct\' accordion, one answer input field should be visible', () => {
|
240
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.specifyCorrectAnswerResponseField(), 'visible');
|
241
|
+
utilities.verifyElementCount(shortTextResponsePage.specifyCorrectAnswerResponseField(), 1);
|
242
|
+
});
|
243
|
+
},
|
205
244
|
}
|
206
245
|
|
207
246
|
export const shortTextResponsePage = {
|
@@ -80,7 +80,8 @@ const selectors = {
|
|
80
80
|
textContainersAriaLabelInputFieldNumeration: () => cy.get('[class*="ClozeMathstyle__Numeration"]'),
|
81
81
|
|
82
82
|
//Preview tab
|
83
|
-
responseFieldPreviewTab: () => cy.get('.preview-question-text-wrapper
|
83
|
+
responseFieldPreviewTab: () => cy.get('.preview-question-text-wrapper .response-input-field'),
|
84
|
+
responseFieldWrapperPreviewTab: () => cy.get('.cloze-response-wrapper'),
|
84
85
|
responseFieldNumerationPreviewTab: () => cy.get('.preview-question-text-wrapper .response-input-adornment'),
|
85
86
|
questionContainerPreviewTab: () => cy.get('[class*="ClozeWithTextPreviewstyle__QuestionPreviewWrapper"]'),
|
86
87
|
tickIcon: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper .tick-icon-wrapper'),
|
@@ -619,21 +620,39 @@ const steps = {
|
|
619
620
|
});
|
620
621
|
},
|
621
622
|
|
622
|
-
//Preview
|
623
|
+
//Preview
|
624
|
+
/**
|
625
|
+
* This function verifies the input field text of response area
|
626
|
+
* @param {number} index index of response field
|
627
|
+
* @param {string} inputFieldText input field text in the preview tab
|
628
|
+
*/
|
629
|
+
verifyResponseAreaTextContentPreviewTab: (index, inputFieldText) => {
|
630
|
+
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab(), index), inputFieldText);
|
631
|
+
},
|
632
|
+
|
623
633
|
/**
|
624
634
|
*@description Verifies the correctness of answer responses in the correct answer section, including the count.
|
625
|
-
* @param {string[]
|
635
|
+
* @param {string[]} correctAnswerArray An array of arrays, each containing the expected answer options for a specific correct answer section.
|
626
636
|
*/
|
627
637
|
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
628
638
|
utilities.verifyElementCount(textEntryMathPage.correctAnswersContainerResponse(), correctAnswerArray.length);
|
629
639
|
correctAnswerArray.forEach((correctAnswer, index) => {
|
630
640
|
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersContainerResponseNumeration(), index), index + 1);
|
631
|
-
|
632
|
-
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersContainerResponse(), index), answerOption);
|
633
|
-
});
|
641
|
+
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersContainerResponse(), index), correctAnswer);
|
634
642
|
});
|
635
643
|
},
|
636
644
|
|
645
|
+
/**
|
646
|
+
*@description Verifies the correctness of answer responses in the correct answer section, including the count.
|
647
|
+
* @param {string} correctAnswerArray the expected answer options aria label for a specific correct answer section.
|
648
|
+
*/
|
649
|
+
verifyCorrectAnswerResponsesAriaLabel: (index, correctAnswerAriaLabel) => {
|
650
|
+
textEntryMathPage.correctAnswersContainerResponse()
|
651
|
+
.eq(index)
|
652
|
+
.find('[role="math"]')
|
653
|
+
.should('have.attr', 'aria-label', correctAnswerAriaLabel);
|
654
|
+
},
|
655
|
+
|
637
656
|
verifyResponseFieldNumerationPreviewTab: () => {
|
638
657
|
textEntryMathPage.responseFieldNumerationPreviewTab()
|
639
658
|
.each(($element, index) => {
|
@@ -662,18 +681,49 @@ const steps = {
|
|
662
681
|
.click();
|
663
682
|
},
|
664
683
|
|
684
|
+
/**
|
685
|
+
* This function verifies the correct/incorrect icon does not exist
|
686
|
+
* @param {number} index of the response field
|
687
|
+
*/
|
688
|
+
verifyCorrectIncorrectIconNotExist: (index) => {
|
689
|
+
textEntryMathPage.responseFieldWrapperPreviewTab()
|
690
|
+
.eq(index)
|
691
|
+
.within(() => {
|
692
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.tickIcon(), 'notExist');
|
693
|
+
});
|
694
|
+
},
|
695
|
+
|
696
|
+
/**
|
697
|
+
* This function verifies the correct icon for the response field
|
698
|
+
* @param {number} index of the response field
|
699
|
+
*/
|
665
700
|
verifyCorrectResponseIcon: (index) => {
|
666
701
|
textEntryMathPage.tickIcon()
|
667
702
|
.eq(index)
|
668
703
|
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
669
704
|
},
|
670
705
|
|
706
|
+
/**
|
707
|
+
* This function verifies the incorrect icon for the response field
|
708
|
+
* @param {number} index of the response field
|
709
|
+
*/
|
671
710
|
verifyIncorrectResponseIcon: (index) => {
|
672
711
|
textEntryMathPage.tickIcon()
|
673
712
|
.eq(index)
|
674
713
|
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
675
714
|
},
|
676
715
|
|
716
|
+
/**
|
717
|
+
* This function verifies the aria label entered in the response field
|
718
|
+
* @param {string} ariaLabel of the equation entered
|
719
|
+
*/
|
720
|
+
verifyResponseFieldEquationAriaLabel: (responseIndex, ariaLabel) => {
|
721
|
+
textEntryMathPage.responseFieldPreviewTab()
|
722
|
+
.eq(responseIndex)
|
723
|
+
.find('[role="math"]')
|
724
|
+
.should('have.attr', 'aria-label', ariaLabel);
|
725
|
+
},
|
726
|
+
|
677
727
|
verifyCorrectAnswerSectionNotExists: () => {
|
678
728
|
utilities.verifyElementVisibilityState(textEntryMathPage.correctAnswersLabel(), 'notExist');
|
679
729
|
utilities.verifyElementVisibilityState(textEntryMathPage.correctAnswersContainerResponse(), 'notExist');
|
@@ -696,7 +746,7 @@ const steps = {
|
|
696
746
|
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
|
697
747
|
}
|
698
748
|
});
|
699
|
-
}
|
749
|
+
}
|
700
750
|
}
|
701
751
|
|
702
752
|
const tests = {
|
@@ -706,6 +756,7 @@ const tests = {
|
|
706
756
|
...autoScoredSpecifyCorrectAnswerSection.tests,
|
707
757
|
...scoringSectionBaseEditTab.tests,
|
708
758
|
...autoScoredScoringSectionMultiResponseType.tests,
|
759
|
+
...autoScoredScoringPreviewTab.tests,
|
709
760
|
|
710
761
|
/**
|
711
762
|
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
package/package.json
CHANGED
@@ -84,7 +84,7 @@ export function runSorryCypressSpinnaker() {
|
|
84
84
|
startTime = process.env.START_TIME;
|
85
85
|
ciBuildId = setCiBuildId("spinnaker", startTime);
|
86
86
|
const envArgs = setCommandLineEnvArgs()
|
87
|
-
let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs},grepTags=-css+-a11y --spec "cypress/e2e/ILC/**/*.
|
87
|
+
let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs},grepTags=-css+-a11y --spec "cypress/e2e/ILC/**/*.js"`;
|
88
88
|
execSync(command, { stdio: "inherit" });
|
89
89
|
}
|
90
90
|
|