itemengine-cypress-automation 1.0.580-ITEM-1388-9c911b1.0 → 1.0.581-IEI-7178-2371612.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/ShortTextResponseNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +30 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +30 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +30 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingWeightsBasic.js +7 -7
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +130 -3
- package/cypress/e2e/ILC/dataApi/fetchItems.js +0 -16
- package/cypress/e2e/ILC/dataApi/fetchQuestion.js +7 -17
- package/cypress/e2e/ILC/dataApi/fetchResourcesAndTools.js +1 -7
- package/cypress/e2e/ILC/dataApi/saveItems.js +6 -16
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +41 -3
- package/cypress/e2e/ILC/dataApi/saveQuestionsMCQAlternateAnswers.js +15 -14
- package/cypress/e2e/ILC/dataApi/saveResourcesAndTools.js +11 -0
- package/cypress/pages/shortTextResponsePage.js +22 -8
- package/cypress/support/helpers/createItem.js +13 -44
- package/package.json +1 -1
|
@@ -144,6 +144,17 @@ describe('Set Resource and tool Data API cases', () => {
|
|
|
144
144
|
.should('not.exist');
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
+
it('Reference id already exists message should be received in the response, with status code 500', () => {
|
|
148
|
+
cy.get('td[class="response-col_status"]')
|
|
149
|
+
.eq(0)
|
|
150
|
+
.should('have.text', '200');
|
|
151
|
+
cy.get('pre[class="microlight"]')
|
|
152
|
+
.eq(1)
|
|
153
|
+
.find('span')
|
|
154
|
+
.eq(7)
|
|
155
|
+
.should('have.text',"\"Key (reference_id, organisation_id)=(myPassageRef01, 7e15466c-30cb-4fdf-b160-6e6fc3660d0e) already exists.\"");
|
|
156
|
+
});
|
|
157
|
+
|
|
147
158
|
it('Entering request to create multiple resources with valid reference id', () => {
|
|
148
159
|
cy.get('textarea[class="body-param__text"]')
|
|
149
160
|
.clear()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { createQuestionBasePage, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInstructionsComponent, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, additionalSettingsPanel, acceptedStudentInputComponent, studentViewSettingsLabelComponent, customizeSpecialCharacterComponent, studentResponseAndLayoutComponent, printPreviewComponent } from "./components/";
|
|
1
|
+
import { createQuestionBasePage, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInstructionsComponent, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, additionalSettingsPanel, acceptedStudentInputComponent, studentViewSettingsLabelComponent, customizeSpecialCharacterComponent, studentResponseAndLayoutComponent, printPreviewComponent, showAlternativeAnswersComponent } from "./components/";
|
|
2
2
|
import { dialogBoxBase } from "./dialogBoxBase";
|
|
3
3
|
import utilities from "../support/helpers/utilities";
|
|
4
4
|
import { createItemPage } from "./createItemPage";
|
|
5
5
|
const css = Cypress.env('css');
|
|
6
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
6
7
|
|
|
7
8
|
const selectors = {
|
|
8
9
|
...questionInstructionsComponent,
|
|
@@ -18,6 +19,7 @@ const selectors = {
|
|
|
18
19
|
...createQuestionBasePage,
|
|
19
20
|
...printPreviewComponent,
|
|
20
21
|
...autoScoredScoringSectionMultiResponseType,
|
|
22
|
+
...showAlternativeAnswersComponent,
|
|
21
23
|
|
|
22
24
|
answerLabelSpecifyCorrectAnswerSection: () => cy.get('.answer-label'),
|
|
23
25
|
displayCharacterCountLabel: () => cy.get('[data-ngie-testid="display-character-count-checkbox"] .MuiFormControlLabel-label'),
|
|
@@ -65,7 +67,13 @@ const selectors = {
|
|
|
65
67
|
//Preview tab
|
|
66
68
|
previewTabResponseField: () => cy.get('.input-field input:visible'),
|
|
67
69
|
previewTabResponseFieldWrapper: () => cy.get('.input-wrapper:visible'),
|
|
68
|
-
previewTabCorrectAnswerWrapper: () =>
|
|
70
|
+
previewTabCorrectAnswerWrapper: () => {
|
|
71
|
+
if (alternativeAnswerCheck) {
|
|
72
|
+
return cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"]');
|
|
73
|
+
} else {
|
|
74
|
+
return cy.get('[class*="ShortTextResponsestyles__CorrectAnswerWrapper"]');
|
|
75
|
+
}
|
|
76
|
+
},
|
|
69
77
|
previewTabCorrectAnswerLabel: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerLabel"]'),
|
|
70
78
|
previewTabCorrectAnswerResponse: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerValueWrapper"]'),
|
|
71
79
|
responseFieldCountPreviewTab: () => cy.get('[class*="InputLimitLabelWrapper"]'),
|
|
@@ -127,6 +135,7 @@ const steps = {
|
|
|
127
135
|
...createItemPage.steps,
|
|
128
136
|
...printPreviewComponent.steps,
|
|
129
137
|
...autoScoredScoringSectionMultiResponseType.steps,
|
|
138
|
+
...showAlternativeAnswersComponent.steps,
|
|
130
139
|
|
|
131
140
|
verifyCorrectIcon: () => {
|
|
132
141
|
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
|
@@ -143,13 +152,13 @@ const steps = {
|
|
|
143
152
|
|
|
144
153
|
verifyCorrectAttemptBorder: () => {
|
|
145
154
|
utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
|
|
146
|
-
'border': `
|
|
155
|
+
'border': `0.8px solid ${css.color.correctAnswer}`
|
|
147
156
|
});
|
|
148
157
|
},
|
|
149
158
|
|
|
150
159
|
verifyIncorrectAttemptBorder: () => {
|
|
151
160
|
utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
|
|
152
|
-
'border': `
|
|
161
|
+
'border': `0.8px solid ${css.color.incorrectAnswer}`
|
|
153
162
|
});
|
|
154
163
|
},
|
|
155
164
|
|
|
@@ -165,10 +174,15 @@ const steps = {
|
|
|
165
174
|
* @param {String} correctAnswer correct answer in correct answer wrapper present in grading view
|
|
166
175
|
* @description function verifies correct answer wrapper in grading view
|
|
167
176
|
*/
|
|
168
|
-
verifyCorrectAnswerResponseInCorrectAnswerWrapper: (correctAnswer) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
177
|
+
verifyCorrectAnswerResponseInCorrectAnswerWrapper: (correctAnswer, correctAnswerPoints = '') => {
|
|
178
|
+
if (alternativeAnswerCheck) {
|
|
179
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
|
|
180
|
+
(correctAnswerPoints !== '') && shortTextResponsePage.steps.verifyCorrectAnswersLabelAndPointVisible(`(${correctAnswerPoints} points)`);
|
|
181
|
+
} else {
|
|
182
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
|
|
183
|
+
utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
|
|
184
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'visible');
|
|
185
|
+
}
|
|
172
186
|
utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerResponse(), correctAnswer);
|
|
173
187
|
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerResponse(), 'visible');
|
|
174
188
|
},
|
|
@@ -145,18 +145,24 @@ Cypress.Commands.add('createItem', (itemName) => {
|
|
|
145
145
|
"mappedKey": "ChoiceA",
|
|
146
146
|
"isCaseSensitive": false,
|
|
147
147
|
"answerSetId": 0
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"xmlIdentifier": "RESPONSE",
|
|
151
|
+
"mappedKey": "ChoiceB",
|
|
152
|
+
"isCaseSensitive": false,
|
|
153
|
+
"answerSetId": 0
|
|
148
154
|
}
|
|
149
155
|
],
|
|
150
156
|
"instruction": "",
|
|
151
157
|
"isAutoScored": true,
|
|
152
158
|
"mappedCorrectResponse": [],
|
|
153
159
|
"defaultResponse": [],
|
|
154
|
-
"points":
|
|
160
|
+
"points": 2,
|
|
155
161
|
"scoringTypeId": 1,
|
|
162
|
+
"questionXml": "<assessmentItem xmlns=\"http://www.imsglobal.org/xsd/imsqti_v2p2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\" identifier=\"choiceMultiple\" title=\"Welcome to Biodome\" timeDependent=\"false\"><responseDeclaration identifier=\"RESPONSE\" cardinality=\"multiple\" baseType=\"identifier\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\"SCORE\" cardinality=\"single\" baseType=\"float\"/><itemBody><choiceInteraction responseIdentifier=\"RESPONSE\" orientation=\"horizontal\"><prompt></prompt><simpleChoice identifier=\"ChoiceA\">1</simpleChoice><simpleChoice identifier=\"ChoiceB\">2</simpleChoice><simpleChoice identifier=\"ChoiceC\">3</simpleChoice><simpleChoice identifier=\"ChoiceD\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\"/></assessmentItem>",
|
|
156
163
|
"typeId": 5,
|
|
157
164
|
"metadata": {
|
|
158
165
|
"acknowledgements": "",
|
|
159
|
-
"setMinimumOrMaximumNumberOfAnswers": false,
|
|
160
166
|
"sampleAnswer": "",
|
|
161
167
|
"toolSettingsResourcesOrder": [
|
|
162
168
|
{
|
|
@@ -204,60 +210,23 @@ Cypress.Commands.add('createItem', (itemName) => {
|
|
|
204
210
|
"disablePrevIncorrect": false,
|
|
205
211
|
"roundingType": 1,
|
|
206
212
|
"isMultipleColumns": false,
|
|
207
|
-
"optionAlignment": 1
|
|
208
|
-
"isIncompleteAuthoring": false,
|
|
209
|
-
"showPointsWarning": false,
|
|
210
|
-
"showOptionsWarning": false
|
|
213
|
+
"optionAlignment": 1
|
|
211
214
|
},
|
|
212
215
|
"content": {
|
|
213
216
|
"correctResponses": [
|
|
214
217
|
{
|
|
215
218
|
"answerSetId": 0,
|
|
216
219
|
"correctAnswers": [
|
|
217
|
-
"ChoiceA"
|
|
220
|
+
"ChoiceA",
|
|
221
|
+
"ChoiceB"
|
|
218
222
|
]
|
|
219
223
|
}
|
|
220
224
|
],
|
|
221
225
|
"instructionsForPrint": "",
|
|
222
|
-
"viewMode": "defaultScoring",
|
|
223
|
-
"choices": {
|
|
224
|
-
"responseIdentifier": "RESPONSE",
|
|
225
|
-
"optionsList": [
|
|
226
|
-
{
|
|
227
|
-
"optionNumber": 1,
|
|
228
|
-
"optionIdentifier": "ChoiceA",
|
|
229
|
-
"text": "1"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"optionNumber": 2,
|
|
233
|
-
"optionIdentifier": "ChoiceB",
|
|
234
|
-
"text": "2"
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"optionNumber": 3,
|
|
238
|
-
"optionIdentifier": "ChoiceC",
|
|
239
|
-
"text": "3"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"optionNumber": 4,
|
|
243
|
-
"optionIdentifier": "ChoiceD",
|
|
244
|
-
"text": "4"
|
|
245
|
-
}
|
|
246
|
-
]
|
|
247
|
-
},
|
|
248
|
-
"identifier": "choiceMultiple",
|
|
249
|
-
"questionItemInstruction": "test",
|
|
250
|
-
"resIdentifier": "RESPONSE",
|
|
251
|
-
"responseDeclaration": {
|
|
252
|
-
"mappedCorrectResponses": [],
|
|
253
|
-
"correctResponses": [
|
|
254
|
-
"ChoiceA"
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
226
|
"answerSets": [
|
|
258
227
|
{
|
|
259
228
|
"id": 0,
|
|
260
|
-
"points":
|
|
229
|
+
"points": 2
|
|
261
230
|
}
|
|
262
231
|
]
|
|
263
232
|
},
|
|
@@ -276,7 +245,7 @@ Cypress.Commands.add('createItem', (itemName) => {
|
|
|
276
245
|
"answerSets": [
|
|
277
246
|
{
|
|
278
247
|
"id": 0,
|
|
279
|
-
"points":
|
|
248
|
+
"points": 2
|
|
280
249
|
}
|
|
281
250
|
]
|
|
282
251
|
}
|