itemengine-cypress-automation 1.0.365-RCA-IEI5709-1b901dc.0 → 1.0.368-IEI-5697-mcq-flakiness-1174fdb.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/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +226 -0
- package/cypress/e2e/ILC/MultipleSelection/editTabScoringSection.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabScoringSection.js +6 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +44 -0
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +192 -0
- package/cypress/e2e/ILC/SingleSelection/checkScoringLabelBannerAndCorrectAnswer.js +2 -0
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +94 -88
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +5 -1
- package/cypress/pages/components/additionalSettingsPanel.js +2 -2
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
- package/cypress/pages/components/mcqAdditionalSettingsBase.js +1 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +0 -1
- package/cypress/pages/gradingViewPage.js +8 -0
- package/cypress/pages/multipleSelectionPage.js +9 -1
- package/package.json +1 -1
@@ -201,6 +201,232 @@ describe('Create Item page - Multiple selection: All or nothing ', () => {
|
|
201
201
|
});
|
202
202
|
});
|
203
203
|
|
204
|
+
views.forEach((view) => {
|
205
|
+
describe(`Multiple selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
206
|
+
abortEarlySetup();
|
207
|
+
before(() => {
|
208
|
+
switch (view) {
|
209
|
+
case 'Question preview':
|
210
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
211
|
+
cy.barsPreLoaderWait();
|
212
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
213
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
214
|
+
multipleSelectionPage.steps.expandScoringTypeDropdown();
|
215
|
+
multipleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
216
|
+
multipleSelectionPage.steps.allotPoints(20);
|
217
|
+
multipleSelectionPage.steps.switchToPreviewTab();
|
218
|
+
break;
|
219
|
+
case 'Item preview':
|
220
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
221
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
222
|
+
break;
|
223
|
+
case 'Grading view':
|
224
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
225
|
+
break;
|
226
|
+
};
|
227
|
+
});
|
228
|
+
|
229
|
+
beforeEach(() => {
|
230
|
+
switch (view) {
|
231
|
+
case 'Question preview':
|
232
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
233
|
+
multipleSelectionPage.steps.resetQuestionPreview();
|
234
|
+
break;
|
235
|
+
case 'Item preview':
|
236
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
237
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
238
|
+
break;
|
239
|
+
case 'Grading view':
|
240
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
241
|
+
break;
|
242
|
+
}
|
243
|
+
});
|
244
|
+
|
245
|
+
if (view === 'Question preview') {
|
246
|
+
after(() => {
|
247
|
+
multipleSelectionPage.steps.clickOnSaveQuestionButtonWithForceTrue();
|
248
|
+
cy.wait(5000);
|
249
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
250
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
251
|
+
});
|
252
|
+
};
|
253
|
+
|
254
|
+
it('Question instructions should be visible', () => {
|
255
|
+
multipleSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
256
|
+
multipleSelectionPage.steps.verifyVisibityOfQuestionInstructionsText();
|
257
|
+
});
|
258
|
+
|
259
|
+
it('User should be able to attempt the question in student view and correct/incorrect icons, Your answer is correct/incorrect label, correct answer section should not be displayed in grading view', () => {
|
260
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
261
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
262
|
+
if (view === 'Grading view') {
|
263
|
+
studentViewPage.steps.submitResponse();
|
264
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
265
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
266
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
267
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
268
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
269
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
270
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
271
|
+
multipleSelectionPage.steps.verifyAnswerBannerNotExist();
|
272
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
273
|
+
};
|
274
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
275
|
+
multipleSelectionPage.steps.checkManuallyScoredScoringLabel();
|
276
|
+
};
|
277
|
+
});
|
278
|
+
});
|
279
|
+
});
|
280
|
+
|
281
|
+
views.forEach((view) => {
|
282
|
+
describe(`Multiple selection - Non scored: ${view}`, { tags: 'smoke' }, () => {
|
283
|
+
abortEarlySetup();
|
284
|
+
before(() => {
|
285
|
+
switch (view) {
|
286
|
+
case 'Question preview':
|
287
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
288
|
+
cy.barsPreLoaderWait();
|
289
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
290
|
+
multipleSelectionPage.steps.expandScoringTypeDropdown();
|
291
|
+
multipleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
292
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
293
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
294
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
295
|
+
multipleSelectionPage.steps.switchToPreviewTab();
|
296
|
+
break;
|
297
|
+
case 'Item preview':
|
298
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
299
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
300
|
+
break;
|
301
|
+
case 'Grading view':
|
302
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
303
|
+
break;
|
304
|
+
};
|
305
|
+
});
|
306
|
+
|
307
|
+
beforeEach(() => {
|
308
|
+
switch (view) {
|
309
|
+
case 'Question preview':
|
310
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
311
|
+
multipleSelectionPage.steps.resetQuestionPreview();
|
312
|
+
break;
|
313
|
+
case 'Item preview':
|
314
|
+
multipleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
315
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
316
|
+
break;
|
317
|
+
case 'Grading view':
|
318
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
319
|
+
break;
|
320
|
+
}
|
321
|
+
});
|
322
|
+
|
323
|
+
if (view === 'Question preview') {
|
324
|
+
after(() => {
|
325
|
+
multipleSelectionPage.steps.clickOnSaveQuestionButton();
|
326
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
327
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
328
|
+
});
|
329
|
+
};
|
330
|
+
|
331
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
332
|
+
if (view === 'Grading view') {
|
333
|
+
studentViewPage.steps.submitResponse();
|
334
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
335
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
336
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
337
|
+
};
|
338
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
339
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
340
|
+
multipleSelectionPage.steps.switchToGradingView();
|
341
|
+
multipleSelectionPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
342
|
+
};
|
343
|
+
//Remove the if-else condition and line 346 once https://weldnorthed.atlassian.net/browse/IEI-5704 is fixed.
|
344
|
+
if(view === 'Question preview'){
|
345
|
+
utilities.verifyInnerText(multipleSelectionPage.correctAnswersLabel(), 'Correct answers');
|
346
|
+
}
|
347
|
+
else{
|
348
|
+
utilities.verifyInnerText(multipleSelectionPage.correctAnswersLabel(), 'Correct answer');
|
349
|
+
}
|
350
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
351
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
352
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
353
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
354
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
355
|
+
});
|
356
|
+
|
357
|
+
it('When the user attempts the question incorrectly,and on switching to \'Grading\' view non scoring label should be displayed, incorrect icon should be displayed beside incorrect response, a status message with text \'Your answer is incorrect\' and correct answer section with correct answer should be displayed', () => {
|
358
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(2);
|
359
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(3);
|
360
|
+
if (view === 'Grading view') {
|
361
|
+
studentViewPage.steps.submitResponse();
|
362
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
363
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
364
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
365
|
+
};
|
366
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
367
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
368
|
+
multipleSelectionPage.steps.switchToGradingView();
|
369
|
+
};
|
370
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
371
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
372
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(2);
|
373
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(3);
|
374
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
375
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
376
|
+
});
|
377
|
+
|
378
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
379
|
+
if (view === 'Grading view') {
|
380
|
+
studentViewPage.steps.clearResponses();
|
381
|
+
};
|
382
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
383
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
384
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(2);
|
385
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(3);
|
386
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
387
|
+
if (view === 'Grading view') {
|
388
|
+
studentViewPage.steps.submitResponse();
|
389
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
390
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
391
|
+
};
|
392
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
393
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
394
|
+
multipleSelectionPage.steps.switchToGradingView();
|
395
|
+
};
|
396
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(0);
|
397
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
398
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(2);
|
399
|
+
multipleSelectionPage.steps.verifyIncorrectOptionIconGradingView(3);
|
400
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
401
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
402
|
+
});
|
403
|
+
|
404
|
+
it('When user attempts the question correctly, and on switching to \'Grading\' view non scoring label should be displayed, correct icons should be displayed beside the correct response, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
405
|
+
if (view === 'Grading view') {
|
406
|
+
studentViewPage.steps.clearResponses();
|
407
|
+
};
|
408
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(0);
|
409
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInPreviewTab(1);
|
410
|
+
if (view === 'Grading view') {
|
411
|
+
studentViewPage.steps.submitResponse();
|
412
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
413
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
414
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
415
|
+
};
|
416
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
417
|
+
multipleSelectionPage.steps.checkNonScoredScoringLabel();
|
418
|
+
multipleSelectionPage.steps.switchToGradingView();
|
419
|
+
};
|
420
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(0);
|
421
|
+
multipleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
422
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
423
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
424
|
+
multipleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
425
|
+
multipleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
426
|
+
});
|
427
|
+
});
|
428
|
+
});
|
429
|
+
|
204
430
|
if (!grepTags || !grepTags.includes('smoke')) {
|
205
431
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
206
432
|
abortEarlySetup();
|
@@ -224,6 +224,7 @@ describe('Create item page - Multiple selection: Scoring section', () => {
|
|
224
224
|
before(() => {
|
225
225
|
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
226
226
|
cy.barsPreLoaderWait();
|
227
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
227
228
|
});
|
228
229
|
|
229
230
|
it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
|
@@ -237,6 +237,9 @@ describe('Create item page - Multiple selection grid: Scoring section', () => {
|
|
237
237
|
before(() => {
|
238
238
|
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
239
239
|
cy.barsPreLoaderWait();
|
240
|
+
multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
241
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
242
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
240
243
|
});
|
241
244
|
|
242
245
|
it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
|
@@ -263,6 +266,9 @@ describe('Create item page - Multiple selection grid: Scoring section', () => {
|
|
263
266
|
before(() => {
|
264
267
|
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
265
268
|
cy.barsPreLoaderWait();
|
269
|
+
multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
270
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
271
|
+
multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
266
272
|
});
|
267
273
|
|
268
274
|
it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { multipleSelectionGridPage } from "../../../pages";
|
2
|
+
|
3
|
+
describe('Multiple selection grid - Additional settings', () => {
|
4
|
+
before(() => {
|
5
|
+
cy.loginAs('admin');
|
6
|
+
});
|
7
|
+
|
8
|
+
it('Open dropdown', () => {
|
9
|
+
multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
|
10
|
+
cy.barsPreLoaderWait();
|
11
|
+
multipleSelectionGridPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
12
|
+
});
|
13
|
+
|
14
|
+
it('Select dropdown option', () => {
|
15
|
+
multipleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
16
|
+
multipleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
17
|
+
});
|
18
|
+
|
19
|
+
it('Select dropdown option', () => {
|
20
|
+
multipleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
21
|
+
multipleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
22
|
+
});
|
23
|
+
|
24
|
+
it('Select dropdown option', () => {
|
25
|
+
multipleSelectionGridPage.steps.expandMinimumScoringDropdown();
|
26
|
+
multipleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
27
|
+
});
|
28
|
+
|
29
|
+
it('Open dropdown', () => {
|
30
|
+
multipleSelectionGridPage.steps.expandScoringTypeDropdown();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('Select dropdown option', () => {
|
34
|
+
multipleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
35
|
+
});
|
36
|
+
|
37
|
+
it('Open dropdown', () => {
|
38
|
+
multipleSelectionGridPage.steps.expandScoringTypeDropdown();
|
39
|
+
});
|
40
|
+
|
41
|
+
it('Select dropdown option', () => {
|
42
|
+
multipleSelectionGridPage.steps.selectOptionFromScoringTypeDropdown('Auto scored');
|
43
|
+
});
|
44
|
+
});
|
@@ -168,6 +168,198 @@ describe('Create Item page - Single Selection: Scoring cases', () => {
|
|
168
168
|
});
|
169
169
|
});
|
170
170
|
|
171
|
+
views.forEach((view) => {
|
172
|
+
describe(`Single selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
173
|
+
abortEarlySetup();
|
174
|
+
before(() => {
|
175
|
+
switch (view) {
|
176
|
+
case 'Question preview':
|
177
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
178
|
+
cy.barsPreLoaderWait();
|
179
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
180
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
181
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
182
|
+
singleSelectionPage.steps.allotPoints(20);
|
183
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
184
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
185
|
+
break;
|
186
|
+
case 'Item preview':
|
187
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
188
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
189
|
+
break;
|
190
|
+
case 'Grading view':
|
191
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
192
|
+
break;
|
193
|
+
};
|
194
|
+
});
|
195
|
+
|
196
|
+
beforeEach(() => {
|
197
|
+
switch (view) {
|
198
|
+
case 'Question preview':
|
199
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
200
|
+
singleSelectionPage.steps.resetQuestionPreview();
|
201
|
+
break;
|
202
|
+
case 'Item preview':
|
203
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
204
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
205
|
+
break;
|
206
|
+
case 'Grading view':
|
207
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
208
|
+
break;
|
209
|
+
}
|
210
|
+
});
|
211
|
+
|
212
|
+
if (view === 'Question preview') {
|
213
|
+
after(() => {
|
214
|
+
singleSelectionPage.steps.clickOnSaveQuestionButton();
|
215
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
216
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
217
|
+
});
|
218
|
+
};
|
219
|
+
|
220
|
+
it('Question instructions should be visible', () => {
|
221
|
+
singleSelectionPage.steps.verifyQuestionInstructionsTextPreviewTab('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
222
|
+
singleSelectionPage.steps.verifyVisibityOfQuestionInstructionsText();
|
223
|
+
});
|
224
|
+
|
225
|
+
it('User should be able to attempt the question in student view and correct/incorrect icons, Your answer is correct/incorrect label, correct answer section should not be displayed in grading view', () => {
|
226
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
227
|
+
if (view === 'Grading view') {
|
228
|
+
studentViewPage.steps.submitResponse();
|
229
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
230
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
231
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
232
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
233
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
234
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
235
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
236
|
+
singleSelectionPage.steps.verifyAnswerBannerNotExist();
|
237
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
238
|
+
};
|
239
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
240
|
+
singleSelectionPage.steps.checkManuallyScoredScoringLabel();
|
241
|
+
};
|
242
|
+
});
|
243
|
+
});
|
244
|
+
});
|
245
|
+
|
246
|
+
views.forEach((view) => {
|
247
|
+
describe(`Single selection - Non scored:${view}`, { tags: 'smoke' }, () => {
|
248
|
+
abortEarlySetup();
|
249
|
+
before(() => {
|
250
|
+
switch (view) {
|
251
|
+
case 'Question preview':
|
252
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
253
|
+
cy.barsPreLoaderWait();
|
254
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
255
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
256
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
257
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
258
|
+
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
259
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
260
|
+
break;
|
261
|
+
case 'Item preview':
|
262
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
263
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
264
|
+
break;
|
265
|
+
case 'Grading view':
|
266
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
267
|
+
break;
|
268
|
+
};
|
269
|
+
});
|
270
|
+
|
271
|
+
beforeEach(() => {
|
272
|
+
switch (view) {
|
273
|
+
case 'Question preview':
|
274
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
275
|
+
singleSelectionPage.steps.resetQuestionPreview();
|
276
|
+
break;
|
277
|
+
case 'Item preview':
|
278
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
279
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
280
|
+
break;
|
281
|
+
case 'Grading view':
|
282
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
283
|
+
break;
|
284
|
+
}
|
285
|
+
});
|
286
|
+
|
287
|
+
if (view === 'Question preview') {
|
288
|
+
after(() => {
|
289
|
+
singleSelectionPage.steps.clickOnSaveQuestionButton();
|
290
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
291
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
292
|
+
});
|
293
|
+
};
|
294
|
+
|
295
|
+
it('When the user selects \'Grading\' view without attempting the question, non scoring label should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and correct/incorrect icons should not be displayed', () => {
|
296
|
+
if (view === 'Grading view') {
|
297
|
+
studentViewPage.steps.submitResponse();
|
298
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
299
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
300
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
301
|
+
};
|
302
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
303
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
304
|
+
singleSelectionPage.steps.switchToGradingView();
|
305
|
+
singleSelectionPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
306
|
+
};
|
307
|
+
//Remove the if-else condition and line 308 once https://weldnorthed.atlassian.net/browse/IEI-5704 is fixed.
|
308
|
+
if(view === 'Question preview'){
|
309
|
+
utilities.verifyInnerText(singleSelectionPage.correctAnswersLabel(), 'Correct answers');
|
310
|
+
}
|
311
|
+
else{
|
312
|
+
utilities.verifyInnerText(singleSelectionPage.correctAnswersLabel(), 'Correct answer');
|
313
|
+
}
|
314
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
315
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(0);
|
316
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
317
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
318
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
319
|
+
});
|
320
|
+
|
321
|
+
it('When the user attempts the question incorrectly,and on switching to \'Grading\' view non scoring label should be displayed, incorrect icon should be displayed beside incorrect response, a status message with text \'Your answer is incorrect\' and correct answer section with correct answer should be displayed', () => {
|
322
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(0);
|
323
|
+
if (view === 'Grading view') {
|
324
|
+
studentViewPage.steps.submitResponse();
|
325
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
326
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
327
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
328
|
+
};
|
329
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
330
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
331
|
+
singleSelectionPage.steps.switchToGradingView();
|
332
|
+
};
|
333
|
+
singleSelectionPage.steps.verifyIncorrectOptionIconGradingView(0);
|
334
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(1);
|
335
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(2);
|
336
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleGradingView(3);
|
337
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
338
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionExist();
|
339
|
+
});
|
340
|
+
|
341
|
+
it('When user attempts the question correctly, and on switching to \'Grading\' view non scoring label should be displayed, correct icons should be displayed beside the correct response, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
342
|
+
if (view === 'Grading view') {
|
343
|
+
studentViewPage.steps.clearResponses();
|
344
|
+
};
|
345
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
346
|
+
if (view === 'Grading view') {
|
347
|
+
studentViewPage.steps.submitResponse();
|
348
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
349
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
350
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
351
|
+
};
|
352
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
353
|
+
singleSelectionPage.steps.checkNonScoredScoringLabel();
|
354
|
+
singleSelectionPage.steps.switchToGradingView();
|
355
|
+
};
|
356
|
+
singleSelectionPage.steps.verifyCorrectOptionIconGradingView(1);
|
357
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
358
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
359
|
+
});
|
360
|
+
});
|
361
|
+
});
|
362
|
+
|
171
363
|
if (!grepTags || !grepTags.includes('smoke')) {
|
172
364
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
173
365
|
abortEarlySetup();
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { singleSelectionPage } from "../../../pages";
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
3
4
|
|
4
5
|
describe('Create Item page - Single selection', () => {
|
5
6
|
before(() => {
|
@@ -64,6 +65,7 @@ describe('Create Item page - Single selection', () => {
|
|
64
65
|
before(() => {
|
65
66
|
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
66
67
|
cy.barsPreLoaderWait();
|
68
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
67
69
|
});
|
68
70
|
|
69
71
|
it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
|
@@ -4,106 +4,112 @@ import utilities from "../../../support/helpers/utilities";
|
|
4
4
|
|
5
5
|
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
6
6
|
|
7
|
-
describe('
|
8
|
-
abortEarlySetup();
|
7
|
+
describe('Create Item page - Single selection', () => {
|
9
8
|
before(() => {
|
10
|
-
cy.
|
11
|
-
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
12
|
-
singleSelectionPage.steps.addQuestionInstructions();
|
13
|
-
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
14
|
-
singleSelectionPage.steps.expandScoringTypeDropdown();
|
15
|
-
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
16
|
-
singleSelectionPage.steps.switchToPreviewTab();
|
9
|
+
cy.loginAs('admin');
|
17
10
|
});
|
18
11
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
describe('Question Preview: Manually Scored', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
cy.log('Adding question instructions and options, select Manually Scored scoring type and add points for the question');
|
16
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
17
|
+
singleSelectionPage.steps.addQuestionInstructions();
|
18
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
19
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
20
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
21
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
23
22
|
});
|
24
|
-
});
|
25
23
|
|
26
|
-
|
24
|
+
it('In Preview tab, Question Instructions and options should be displayed along with radio button', () => {
|
25
|
+
singleSelectionPage.steps.verifyQuestionInstructionsText();
|
26
|
+
options.forEach((optionsText, count) => {
|
27
|
+
utilities.verifyInnerText(utilities.getNthElement(singleSelectionPage.optionTextPreviewTab(), count), optionsText);
|
28
|
+
});
|
29
|
+
});
|
27
30
|
|
28
|
-
|
29
|
-
singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
|
30
|
-
});
|
31
|
-
});
|
31
|
+
singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored')
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
cy.log('Adding question instructions and options, select Non Scored scoring type and set correct answer');
|
37
|
-
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
38
|
-
singleSelectionPage.steps.addQuestionInstructions();
|
39
|
-
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
40
|
-
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
41
|
-
singleSelectionPage.steps.expandScoringTypeDropdown();
|
42
|
-
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
43
|
-
//singleSelectionPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
44
|
-
singleSelectionPage.steps.switchToPreviewTab();
|
33
|
+
it('User should able to save question with manually scored scoring type', () => {
|
34
|
+
singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
|
35
|
+
});
|
45
36
|
});
|
46
37
|
|
47
|
-
|
38
|
+
describe('Question Preview: Non Scored', () => {
|
39
|
+
abortEarlySetup();
|
40
|
+
before(() => {
|
41
|
+
cy.log('Adding question instructions and options, select Non Scored scoring type and set correct answer');
|
42
|
+
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
43
|
+
singleSelectionPage.steps.addQuestionInstructions();
|
44
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
45
|
+
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
46
|
+
singleSelectionPage.steps.expandScoringTypeDropdown();
|
47
|
+
singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
48
|
+
//singleSelectionPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
49
|
+
singleSelectionPage.steps.switchToPreviewTab();
|
50
|
+
});
|
48
51
|
|
49
|
-
|
50
|
-
singleSelectionPage.steps.switchToGradingView();
|
51
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
52
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
53
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
54
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
55
|
-
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
56
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
57
|
-
//correct answer section
|
58
|
-
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
59
|
-
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
60
|
-
});
|
52
|
+
singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
|
61
53
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
/*cy.log('When the user has attempted the question incorrectly clicks on \'Check answer\' button, then correct icons should be displayed besides correct response and incorrect icon should be displayed beside incorrect option, incorrect answer border and a label should not be displayed below the question preview')
|
75
|
-
singleSelectionPage.steps.checkAnswer();
|
76
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
77
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
78
|
-
singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
|
79
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
80
|
-
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
81
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
|
82
|
-
});
|
54
|
+
it('When the user selects \'Grading\' view without attempting the question, no icons should be displayed besides the unattempted options, correct answer label and border should not be displayed and correct answer section should be displayed with correct answer', () => {
|
55
|
+
singleSelectionPage.steps.switchToGradingView();
|
56
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
57
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
58
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
59
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
60
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
61
|
+
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
62
|
+
//correct answer section
|
63
|
+
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
64
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
65
|
+
});
|
83
66
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
67
|
+
it('When the user attempts the question incorrectly, then on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icons should be displayed besides unattempted options, incorrect answer border and label should not be displayed below the question preview and correct anser section should be displayed with correct answer', () => {
|
68
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(2);
|
69
|
+
singleSelectionPage.steps.switchToGradingView();
|
70
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
71
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
72
|
+
singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
|
73
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
74
|
+
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
75
|
+
//correct answer section
|
76
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
77
|
+
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
78
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
79
|
+
/*cy.log('When the user has attempted the question incorrectly clicks on \'Check answer\' button, then correct icons should be displayed besides correct response and incorrect icon should be displayed beside incorrect option, incorrect answer border and a label should not be displayed below the question preview')
|
80
|
+
singleSelectionPage.steps.checkAnswer();
|
81
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
82
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
83
|
+
singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
|
84
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
85
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
86
|
+
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
|
87
|
+
});
|
105
88
|
|
106
|
-
|
107
|
-
|
89
|
+
it('When user attempts the question correctly, then on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, no icons should be displayed besides unattempted responses, correct answer border, a label and correct answer section should not be displayed below the question preview', () => {
|
90
|
+
singleSelectionPage.steps.resetQuestionPreview();
|
91
|
+
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
92
|
+
singleSelectionPage.steps.switchToGradingView();
|
93
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
94
|
+
singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
|
95
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
96
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
97
|
+
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
98
|
+
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
99
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
100
|
+
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
101
|
+
/*cy.log('When the user has attempted the question with correct responses and clicks on \'Check answer\' button, then correct icon should be displayed besides correct response, correct answer border and a label should not be displayed below the question preview')
|
102
|
+
singleSelectionPage.steps.checkAnswer();
|
103
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
104
|
+
singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
|
105
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
106
|
+
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
107
|
+
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
108
|
+
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
|
109
|
+
});
|
110
|
+
|
111
|
+
it('User should able to save question with non scored scoring type', () => {
|
112
|
+
singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
|
113
|
+
});
|
108
114
|
});
|
109
115
|
});
|
@@ -58,12 +58,16 @@ describe('Create Item page - Single selection grid', () => {
|
|
58
58
|
singleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
|
59
59
|
})
|
60
60
|
});
|
61
|
-
|
61
|
+
|
62
62
|
describe('Question Preview: Non Scored - Save as you go', () => {
|
63
63
|
abortEarlySetup();
|
64
64
|
before(() => {
|
65
65
|
singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
|
66
66
|
cy.barsPreLoaderWait();
|
67
|
+
singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
|
68
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
|
69
|
+
singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
|
70
|
+
singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
|
67
71
|
});
|
68
72
|
|
69
73
|
it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
|
@@ -23,8 +23,8 @@ const selectors = {
|
|
23
23
|
return cy.get('[aria-labelledby*="Font-Size-dropdown-label"] [role="option"]')
|
24
24
|
}
|
25
25
|
},
|
26
|
-
fontSizeListOptionLabels: () => cy.get('[aria-labelledby
|
27
|
-
fontSizesLabels: () => cy.get('[aria-labelledby
|
26
|
+
fontSizeListOptionLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-label-text'),
|
27
|
+
fontSizesLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-post-label-text'),
|
28
28
|
}
|
29
29
|
|
30
30
|
const steps = {
|
@@ -81,7 +81,6 @@ const steps = {
|
|
81
81
|
scoringSectionBaseEditTab.scoringTypeDropdownListOptions(convertedString)
|
82
82
|
.should('be.visible') // Ensure the dropdown option is visible
|
83
83
|
.click();
|
84
|
-
cy.wait(2000); // Wait for the dropdown to close
|
85
84
|
utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
|
86
85
|
},
|
87
86
|
|
@@ -15,6 +15,14 @@ const steps = {
|
|
15
15
|
gradingViewPage.scoredPointsInputField()
|
16
16
|
.should('have.value', scoredPoints);
|
17
17
|
utilities.verifyTextContent(gradingViewPage.TotalPoints(), `/ ${TotalPoints} points`)
|
18
|
+
},
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @description Verify that scores are not displayed in grading view for non scored questions
|
22
|
+
*/
|
23
|
+
verifyScoresNotVisibleForNonScoredQuestions: () => {
|
24
|
+
utilities.verifyElementVisibilityState(gradingViewPage.scoredPointsInputField(),'notExist'),
|
25
|
+
utilities.verifyElementVisibilityState(gradingViewPage.TotalPoints(),'notExist')
|
18
26
|
}
|
19
27
|
}
|
20
28
|
|
@@ -891,7 +891,15 @@ const steps = {
|
|
891
891
|
optionsTextArray.forEach((option, optionIndex) => {
|
892
892
|
utilities.verifyTextContent(utilities.getNthElement(multipleSelectionPage.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
|
893
893
|
});
|
894
|
-
}
|
894
|
+
},
|
895
|
+
|
896
|
+
/**
|
897
|
+
* Clicks on the save question button.
|
898
|
+
*/
|
899
|
+
clickOnSaveQuestionButtonWithForceTrue: () => {
|
900
|
+
createQuestionBasePage.saveQuestionButton()
|
901
|
+
.click({force:true});
|
902
|
+
},
|
895
903
|
}
|
896
904
|
|
897
905
|
const tests = {
|