itemengine-cypress-automation 1.0.349-miscellaneous-questions-r2-a9064f0.0 → 1.0.349
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/ContentBlocks/editTabBasics.js +62 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +112 -3
- package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +210 -0
- package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +208 -0
- package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +89 -1
- package/cypress/pages/audioPlayerPage.js +2 -0
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/contentBlocksPage.js +2 -0
- package/package.json +2 -2
@@ -1,8 +1,11 @@
|
|
1
|
-
import { contentBlocksPage } from "../../../pages";
|
1
|
+
import { contentBlocksPage, dialogBoxBase, itemPreviewPage } from "../../../pages";
|
2
|
+
import { browseItemsPage } from "../../../pages/components";
|
2
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
4
5
|
const css = Cypress.env('css');
|
5
6
|
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
6
9
|
describe('Content blocks - Edit tab', () => {
|
7
10
|
before(() => {
|
8
11
|
cy.loginAs('admin');
|
@@ -82,6 +85,62 @@ describe('Content blocks - Edit tab', () => {
|
|
82
85
|
it('Accessibility of header section', { tags: 'a11y' }, () => {
|
83
86
|
cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
|
84
87
|
});
|
88
|
+
|
89
|
+
describe('Saving a question with incomplete authoring', () => {
|
90
|
+
abortEarlySetup();
|
91
|
+
before(() => {
|
92
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
93
|
+
});
|
94
|
+
|
95
|
+
it('User should be able to save the resource with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save button is clicked', () => {
|
96
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter text block']);
|
97
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
98
|
+
});
|
99
|
+
contentBlocksPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
100
|
+
});
|
101
|
+
|
102
|
+
describe('User should be able to edit incomplete authored resource', () => {
|
103
|
+
abortEarlySetup();
|
104
|
+
before(() => {
|
105
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
106
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
107
|
+
contentBlocksPage.steps.editItem();
|
108
|
+
});
|
109
|
+
|
110
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
111
|
+
contentBlocksPage.steps.verifyWarningIconOnRequiredFields([
|
112
|
+
'Please enter text block',
|
113
|
+
]);
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
117
|
+
contentBlocksPage.steps.enterTextInTextBlockInputField(0, 'Text block text');
|
118
|
+
contentBlocksPage.steps.verifyErrorMessageIsNotDisplayed();
|
119
|
+
});
|
120
|
+
|
121
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
122
|
+
contentBlocksPage.steps.saveAQuestionAndVerifySnackbar();
|
123
|
+
});
|
124
|
+
|
125
|
+
it('Warning icon should not be visible', () => {
|
126
|
+
contentBlocksPage.steps.verifyWarningIconNotExist();
|
127
|
+
});
|
128
|
+
});
|
129
|
+
|
130
|
+
describe('Save as you go - Browse item page contents', () => {
|
131
|
+
abortEarlySetup();
|
132
|
+
before(() => {
|
133
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
134
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
135
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
136
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
137
|
+
browseItemsPage.steps.navigateToBrowseItemsPage();
|
138
|
+
});
|
139
|
+
|
140
|
+
it('When user saves an incompletely authored resource then a warning icon should be visible in browse items page', () => {
|
141
|
+
browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
|
142
|
+
});
|
143
|
+
});
|
85
144
|
});
|
86
145
|
|
87
146
|
describe('Body section', () => {
|
@@ -113,10 +172,9 @@ describe('Content blocks - Edit tab', () => {
|
|
113
172
|
contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderTextNotExist(contentBlocksPage.verifyTextBlockInputFieldPlaceholderText);
|
114
173
|
});
|
115
174
|
|
116
|
-
it('When user clears text and focuses out of text block input field, then error message
|
175
|
+
it('When user clears text and focuses out of text block input field, then error message should not be displayed', () => {
|
117
176
|
contentBlocksPage.steps.clearAndFocusOutOfTextBlockInputField();
|
118
|
-
utilities.
|
119
|
-
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'visible');
|
177
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'notExist');
|
120
178
|
});
|
121
179
|
|
122
180
|
it('When user enters text again then error message should not be displayed', () => {
|
@@ -251,12 +251,15 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
251
251
|
case 'Question preview':
|
252
252
|
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
253
253
|
cy.barsPreLoaderWait();
|
254
|
+
dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options in correct categories.');
|
254
255
|
dragAndDropIntoCategoriesPage.steps.expandScoringTypeDropdown();
|
255
256
|
dragAndDropIntoCategoriesPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
256
257
|
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.scoringTypeDropdown(), 'Manually scored');
|
257
258
|
cy.log('Adding wait to ensure Manually scored is selected');
|
258
259
|
cy.wait(2000);
|
260
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
259
261
|
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Parrot', 'Whale']);
|
262
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
260
263
|
break;
|
261
264
|
case 'Grading view':
|
262
265
|
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
@@ -282,6 +285,11 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
282
285
|
});
|
283
286
|
};
|
284
287
|
|
288
|
+
it('Question instructions should be visible', () => {
|
289
|
+
dragAndDropIntoCategoriesPage.steps.verifyQuestionInstructionsTextPreviewTab('Drag and drop options in correct categories.');
|
290
|
+
dragAndDropIntoCategoriesPage.steps.verifyVisibityOfQuestionInstructionsText();
|
291
|
+
});
|
292
|
+
|
285
293
|
it('When the user selects \'Grading\' view, correct answer section should not be displayed', () => {
|
286
294
|
if (view === 'Grading view') {
|
287
295
|
studentViewPage.steps.submitResponse();
|
@@ -290,6 +298,23 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
290
298
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExists();
|
291
299
|
};
|
292
300
|
});
|
301
|
+
|
302
|
+
it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
|
303
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Parrot': 0, 'Whale': 1 });
|
304
|
+
if (view === 'Grading view') {
|
305
|
+
studentViewPage.steps.submitResponse();
|
306
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
307
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
308
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
309
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsNotExist();
|
310
|
+
dragAndDropIntoCategoriesPage.steps.verifyAnswerStatusBannerNotExist();
|
311
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExist();
|
312
|
+
};
|
313
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
314
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
315
|
+
dragAndDropIntoCategoriesPage.steps.checkManuallyScoredScoringLabel();
|
316
|
+
};
|
317
|
+
});
|
293
318
|
});
|
294
319
|
});
|
295
320
|
|
@@ -455,10 +480,12 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
455
480
|
case 'Question preview':
|
456
481
|
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
457
482
|
cy.barsPreLoaderWait();
|
458
|
-
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Bat', 'Eagle']);
|
459
|
-
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Bat': 0, 'Eagle': 1 });
|
460
483
|
dragAndDropIntoCategoriesPage.steps.expandScoringTypeDropdown();
|
461
484
|
dragAndDropIntoCategoriesPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
485
|
+
dragAndDropIntoCategoriesPage.steps.addMultipleOptionFields(7);
|
486
|
+
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Bat', 'Eagle', 'Parrot', 'Whale', 'Platypus', 'Ostrich', 'Flying squirrel', 'Peacock', 'Kite']);
|
487
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Bat': 0, 'Eagle': 1, 'Parrot': 2, 'Platypus': 3, 'Ostrich': 4, 'Whale': 5, 'Flying squirrel': 6, 'Peacock': 7, 'Kite': 8 });
|
488
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
462
489
|
break;
|
463
490
|
case 'Grading view':
|
464
491
|
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
@@ -484,15 +511,97 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
484
511
|
});
|
485
512
|
};
|
486
513
|
|
514
|
+
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', () => {
|
515
|
+
if (view === 'Grading view') {
|
516
|
+
studentViewPage.steps.submitResponse();
|
517
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
518
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
519
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
520
|
+
};
|
521
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
522
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
523
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
524
|
+
dragAndDropIntoCategoriesPage.steps.checkNonScoredScoringLabel();
|
525
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
526
|
+
};
|
527
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.correctAnswersLabel(), 'Correct answers');
|
528
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsNotExist();
|
529
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle'], ['Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], ['Flying squirrel'], ['Peacock'], ['Kite']], ['1', '2', '3', '4', '5', '6', '7', '8', '9']);
|
530
|
+
});
|
531
|
+
|
487
532
|
it('When the user attempts the question incorrectly for a non scored Question, then the incorrect Answer label and correct answer section should not be displayed', () => {
|
488
533
|
if (view === 'Grading view') {
|
489
|
-
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat':
|
534
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 8, 'Eagle': 7, 'Parrot': 3, 'Platypus': 2, 'Ostrich': 8, 'Whale': 6, 'Ostrich': 0, 'Flying squirrel': 5, 'Peacock': 4, 'Kite': 1 });
|
490
535
|
studentViewPage.steps.submitResponse();
|
491
536
|
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
492
537
|
studentViewPage.steps.clickOnGoToGradingViewButton();
|
493
538
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
539
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(0);
|
540
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(1);
|
541
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(2);
|
542
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(3);
|
543
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(4);
|
544
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(5);
|
545
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(6);
|
546
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(7);
|
547
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(8);
|
548
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle'], ['Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], ['Flying squirrel'], ['Peacock'], ['Kite']], ['1', '2', '3', '4', '5', '6', '7', '8', '9']);
|
494
549
|
};
|
495
550
|
});
|
551
|
+
|
552
|
+
it('hen 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 beside the correct answer responses, incorrect icon should be displayed beside incorrect answer responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
|
553
|
+
if (view === 'Grading view') {
|
554
|
+
studentViewPage.steps.clearResponses();
|
555
|
+
};
|
556
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Parrot': 2, 'Platypus': 4 });
|
557
|
+
if (view === 'Grading view') {
|
558
|
+
studentViewPage.steps.submitResponse();
|
559
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
560
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
561
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
562
|
+
};
|
563
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
564
|
+
dragAndDropIntoCategoriesPage.steps.checkNonScoredScoringLabel();
|
565
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
566
|
+
};
|
567
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
568
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
569
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(2);
|
570
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(3);
|
571
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
572
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle'], ['Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], ['Flying squirrel'], ['Peacock'], ['Kite']], ['1', '2', '3', '4', '5', '6', '7', '8', '9']);
|
573
|
+
});
|
574
|
+
|
575
|
+
it('When the 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 responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
|
576
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
577
|
+
dragAndDropIntoCategoriesPage.steps.resetQuestionPreview();
|
578
|
+
};
|
579
|
+
if (view === 'Grading view') {
|
580
|
+
studentViewPage.steps.clearResponses();
|
581
|
+
};
|
582
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Parrot': 2, 'Platypus': 3, 'Ostrich': 4, 'Whale': 5, 'Flying squirrel': 6, 'Peacock': 7, 'Kite': 8 });
|
583
|
+
if (view === 'Grading view') {
|
584
|
+
studentViewPage.steps.submitResponse();
|
585
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
586
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
587
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
588
|
+
};
|
589
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
590
|
+
dragAndDropIntoCategoriesPage.steps.checkNonScoredScoringLabel();
|
591
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
592
|
+
};
|
593
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
594
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
595
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(2);
|
596
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(3);
|
597
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(4);
|
598
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(5);
|
599
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(6);
|
600
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(7);
|
601
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(8);
|
602
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
603
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExists();
|
604
|
+
});
|
496
605
|
});
|
497
606
|
|
498
607
|
})
|
@@ -213,6 +213,216 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
213
213
|
});
|
214
214
|
});
|
215
215
|
|
216
|
+
views.forEach((view) => {
|
217
|
+
describe(`${view}: Matching drag and drop - Manually scored`, { tags: 'smoke' }, () => {
|
218
|
+
abortEarlySetup();
|
219
|
+
before(() => {
|
220
|
+
switch (view) {
|
221
|
+
case 'Question preview':
|
222
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
223
|
+
cy.barsPreLoaderWait();
|
224
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answers.');
|
225
|
+
matchingPage.steps.expandScoringTypeDropdown();
|
226
|
+
matchingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
227
|
+
matchingPage.steps.allotPoints(20);
|
228
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
229
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
230
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
231
|
+
matchingPage.steps.switchToPreviewTab();
|
232
|
+
break;
|
233
|
+
case 'Item preview':
|
234
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
235
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
236
|
+
break;
|
237
|
+
case 'Grading view':
|
238
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
239
|
+
break;
|
240
|
+
};
|
241
|
+
});
|
242
|
+
|
243
|
+
beforeEach(() => {
|
244
|
+
switch (view) {
|
245
|
+
case 'Question preview':
|
246
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
247
|
+
matchingPage.steps.resetQuestionPreview();
|
248
|
+
break;
|
249
|
+
case 'Item preview':
|
250
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
251
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
252
|
+
break;
|
253
|
+
case 'Grading view':
|
254
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
255
|
+
break;
|
256
|
+
}
|
257
|
+
});
|
258
|
+
|
259
|
+
if (view === 'Question preview') {
|
260
|
+
after(() => {
|
261
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
262
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
263
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
264
|
+
});
|
265
|
+
};
|
266
|
+
|
267
|
+
it('Question instructions should be visible', () => {
|
268
|
+
matchingPage.steps.verifyQuestionInstructionsTextPreviewTab('Fill the categories with the right answers.');
|
269
|
+
matchingPage.steps.verifyVisibityOfQuestionInstructionsText();
|
270
|
+
});
|
271
|
+
|
272
|
+
it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
|
273
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);
|
274
|
+
if (view === 'Grading view') {
|
275
|
+
studentViewPage.steps.submitResponse();
|
276
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
277
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
278
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
279
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
280
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
281
|
+
matchingPage.steps.verifyAnswerStatusBannerNotExist();
|
282
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExist();
|
283
|
+
};
|
284
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
285
|
+
matchingPage.steps.checkManuallyScoredScoringLabel();
|
286
|
+
};
|
287
|
+
});
|
288
|
+
});
|
289
|
+
})
|
290
|
+
|
291
|
+
views.forEach((view) => {
|
292
|
+
describe(`${view}: Matching drag and drop - Non scored`, { tags: 'smoke' }, () => {
|
293
|
+
abortEarlySetup();
|
294
|
+
before(() => {
|
295
|
+
switch (view) {
|
296
|
+
case 'Question preview':
|
297
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
298
|
+
cy.barsPreLoaderWait();
|
299
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
|
300
|
+
matchingPage.steps.expandScoringTypeDropdown();
|
301
|
+
matchingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
302
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
303
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
304
|
+
matchingPage.steps.enterTextInOptionInputField(optionsArray);
|
305
|
+
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
306
|
+
matchingPage.steps.switchToPreviewTab();
|
307
|
+
break;
|
308
|
+
case 'Item preview':
|
309
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
310
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
311
|
+
break;
|
312
|
+
case 'Grading view':
|
313
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
314
|
+
break;
|
315
|
+
};
|
316
|
+
});
|
317
|
+
|
318
|
+
beforeEach(() => {
|
319
|
+
switch (view) {
|
320
|
+
case 'Question preview':
|
321
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
322
|
+
matchingPage.steps.resetQuestionPreview();
|
323
|
+
break;
|
324
|
+
case 'Item preview':
|
325
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
326
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
327
|
+
break;
|
328
|
+
case 'Grading view':
|
329
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
330
|
+
break;
|
331
|
+
}
|
332
|
+
});
|
333
|
+
|
334
|
+
if (view === 'Question preview') {
|
335
|
+
after(() => {
|
336
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
337
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
338
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
339
|
+
});
|
340
|
+
};
|
341
|
+
|
342
|
+
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', () => {
|
343
|
+
if (view === 'Grading view') {
|
344
|
+
studentViewPage.steps.submitResponse();
|
345
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
346
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
347
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
348
|
+
};
|
349
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
350
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
351
|
+
matchingPage.steps.switchToGradingView();
|
352
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
353
|
+
};
|
354
|
+
matchingPage.steps.verifyDropzoneNumeration();
|
355
|
+
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
356
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
357
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
358
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
359
|
+
});
|
360
|
+
|
361
|
+
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', () => {
|
362
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Bear', dropzoneIndex: 0 }, { optionText: 'Eagle', dropzoneIndex: 1 }, { optionText: 'Fish', dropzoneIndex: 2 }]);
|
363
|
+
if (view === 'Grading view') {
|
364
|
+
studentViewPage.steps.submitResponse();
|
365
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
366
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
367
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
368
|
+
};
|
369
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
370
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
371
|
+
matchingPage.steps.switchToGradingView();
|
372
|
+
};
|
373
|
+
matchingPage.steps.verifyIncorrectOptionIcon(0);
|
374
|
+
matchingPage.steps.verifyIncorrectOptionIcon(1);
|
375
|
+
matchingPage.steps.verifyIncorrectOptionIcon(2);
|
376
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
377
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
378
|
+
});
|
379
|
+
|
380
|
+
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 should be displayed', () => {
|
381
|
+
if (view === 'Grading view') {
|
382
|
+
studentViewPage.steps.clearResponses();
|
383
|
+
};
|
384
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
385
|
+
if (view === 'Grading view') {
|
386
|
+
studentViewPage.steps.submitResponse();
|
387
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
388
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
389
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
390
|
+
};
|
391
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
392
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
393
|
+
matchingPage.steps.switchToGradingView();
|
394
|
+
};
|
395
|
+
matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(0);
|
396
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
397
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
398
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
399
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
400
|
+
});
|
401
|
+
|
402
|
+
it('When the 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 responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
|
403
|
+
if (view === 'Grading view') {
|
404
|
+
studentViewPage.steps.clearResponses();
|
405
|
+
};
|
406
|
+
matchingPage.steps.clickAndDropOptionInDropzonePreviewTab([{ optionText: 'Elephant', dropzoneIndex: 0 }, { optionText: 'Fish', dropzoneIndex: 1 }, { optionText: 'Cat', dropzoneIndex: 2 }]);
|
407
|
+
if (view === 'Grading view') {
|
408
|
+
studentViewPage.steps.submitResponse();
|
409
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
410
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
411
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
412
|
+
};
|
413
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
414
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
415
|
+
matchingPage.steps.switchToGradingView();
|
416
|
+
};
|
417
|
+
matchingPage.steps.verifyCorrectOptionIcon(0);
|
418
|
+
matchingPage.steps.verifyCorrectOptionIcon(1);
|
419
|
+
matchingPage.steps.verifyCorrectOptionIcon(2);
|
420
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
421
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
422
|
+
});
|
423
|
+
});
|
424
|
+
});
|
425
|
+
|
216
426
|
if (!grepTags || !grepTags.includes('smoke')) {
|
217
427
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
218
428
|
abortEarlySetup();
|
@@ -207,6 +207,214 @@ describe('Create item page - Matching: All or nothing ', () => {
|
|
207
207
|
});
|
208
208
|
});
|
209
209
|
|
210
|
+
views.forEach((view) => {
|
211
|
+
describe(`${view}: Matching dropdown - Manually scored`, { tags: 'smoke' }, () => {
|
212
|
+
abortEarlySetup();
|
213
|
+
before(() => {
|
214
|
+
switch (view) {
|
215
|
+
case 'Question preview':
|
216
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
217
|
+
cy.barsPreLoaderWait();
|
218
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
219
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Match the following using dropdowns.');
|
220
|
+
matchingPage.steps.expandScoringTypeDropdown();
|
221
|
+
matchingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
222
|
+
matchingPage.steps.allotPoints(20);
|
223
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
224
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
225
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
226
|
+
matchingPage.steps.switchToPreviewTab();
|
227
|
+
break;
|
228
|
+
case 'Item preview':
|
229
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
230
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
231
|
+
break;
|
232
|
+
case 'Grading view':
|
233
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
234
|
+
break;
|
235
|
+
};
|
236
|
+
});
|
237
|
+
|
238
|
+
beforeEach(() => {
|
239
|
+
switch (view) {
|
240
|
+
case 'Question preview':
|
241
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
242
|
+
matchingPage.steps.resetQuestionPreview();
|
243
|
+
break;
|
244
|
+
case 'Item preview':
|
245
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
246
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
247
|
+
break;
|
248
|
+
case 'Grading view':
|
249
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
250
|
+
break;
|
251
|
+
}
|
252
|
+
});
|
253
|
+
|
254
|
+
if (view === 'Question preview') {
|
255
|
+
after(() => {
|
256
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
257
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
258
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
259
|
+
});
|
260
|
+
};
|
261
|
+
|
262
|
+
it('Question instructions should be visible', () => {
|
263
|
+
matchingPage.steps.verifyQuestionInstructionsTextPreviewTab('Match the following using dropdowns.');
|
264
|
+
matchingPage.steps.verifyVisibityOfQuestionInstructionsText();
|
265
|
+
});
|
266
|
+
|
267
|
+
it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
|
268
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[0] }, { dropdownIndex: 1, dropdownOption: optionsArray[1] }]);
|
269
|
+
if (view === 'Grading view') {
|
270
|
+
studentViewPage.steps.submitResponse();
|
271
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
272
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
273
|
+
gradingViewPage.steps.verifyGradingViewScore('', 20);
|
274
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
|
275
|
+
matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
|
276
|
+
matchingPage.steps.verifyAnswerStatusBannerNotExist();
|
277
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExist();
|
278
|
+
};
|
279
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
280
|
+
matchingPage.steps.checkManuallyScoredScoringLabel();
|
281
|
+
};
|
282
|
+
});
|
283
|
+
});
|
284
|
+
});
|
285
|
+
|
286
|
+
views.forEach((view) => {
|
287
|
+
describe(`${view}: Matching dropdown - Non scored`, { tags: 'smoke' }, () => {
|
288
|
+
abortEarlySetup();
|
289
|
+
before(() => {
|
290
|
+
switch (view) {
|
291
|
+
case 'Question preview':
|
292
|
+
matchingPage.steps.navigateToCreateQuestion('matching');
|
293
|
+
cy.barsPreLoaderWait();
|
294
|
+
matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
|
295
|
+
matchingPage.steps.addTextInQuestionInstructionsInputField('Match the following using dropdowns.');
|
296
|
+
matchingPage.steps.addMultipleOptionFields(2);
|
297
|
+
matchingPage.steps.enterTextInPromptInputField(promptTextArray);
|
298
|
+
matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
|
299
|
+
matchingPage.steps.expandScoringTypeDropdown();
|
300
|
+
matchingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
301
|
+
matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
302
|
+
matchingPage.steps.switchToPreviewTab();
|
303
|
+
break;
|
304
|
+
case 'Item preview':
|
305
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
306
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
307
|
+
break;
|
308
|
+
case 'Grading view':
|
309
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
310
|
+
break;
|
311
|
+
};
|
312
|
+
});
|
313
|
+
|
314
|
+
beforeEach(() => {
|
315
|
+
switch (view) {
|
316
|
+
case 'Question preview':
|
317
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
318
|
+
matchingPage.steps.resetQuestionPreview();
|
319
|
+
break;
|
320
|
+
case 'Item preview':
|
321
|
+
matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
322
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
323
|
+
break;
|
324
|
+
case 'Grading view':
|
325
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
326
|
+
break;
|
327
|
+
}
|
328
|
+
});
|
329
|
+
|
330
|
+
if (view === 'Question preview') {
|
331
|
+
after(() => {
|
332
|
+
matchingPage.steps.clickOnSaveQuestionButton();
|
333
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
334
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
335
|
+
});
|
336
|
+
};
|
337
|
+
|
338
|
+
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', () => {
|
339
|
+
if (view === 'Grading view') {
|
340
|
+
studentViewPage.steps.submitResponse();
|
341
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
342
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
343
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
344
|
+
};
|
345
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
346
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
347
|
+
matchingPage.steps.switchToGradingView();
|
348
|
+
matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
349
|
+
};
|
350
|
+
matchingPage.steps.verifyDropdownNumeration(0);
|
351
|
+
matchingPage.steps.verifyDropdownNumeration(1);
|
352
|
+
matchingPage.steps.verifyDropdownNumeration(2);
|
353
|
+
matchingPage.steps.verifyCorrectIncorrectIconsNotExist();
|
354
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
355
|
+
utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
|
356
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
357
|
+
});
|
358
|
+
|
359
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to "Grading" view, incorrect icons should be displayed besides all incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers along with numeration should be displayed', () => {
|
360
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[0] }, { dropdownIndex: 1, dropdownOption: optionsArray[1] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
|
361
|
+
if (view === 'Grading view') {
|
362
|
+
studentViewPage.steps.submitResponse();
|
363
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
364
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
365
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
366
|
+
};
|
367
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
368
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
369
|
+
matchingPage.steps.switchToGradingView();
|
370
|
+
};
|
371
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
|
372
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
373
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
|
374
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
375
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
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 beside the correct answer responses, incorrect icon should be displayed beside incorrect answer responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
|
379
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
380
|
+
if (view === 'Grading view') {
|
381
|
+
studentViewPage.steps.submitResponse();
|
382
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
383
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
384
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
385
|
+
};
|
386
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
387
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
388
|
+
matchingPage.steps.switchToGradingView();
|
389
|
+
};
|
390
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
391
|
+
matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
|
392
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
393
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
394
|
+
matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
|
395
|
+
});
|
396
|
+
|
397
|
+
it('When the 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 responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
|
398
|
+
matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
|
399
|
+
if (view === 'Grading view') {
|
400
|
+
studentViewPage.steps.submitResponse();
|
401
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
402
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
403
|
+
gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
|
404
|
+
};
|
405
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
406
|
+
matchingPage.steps.checkNonScoredScoringLabel();
|
407
|
+
matchingPage.steps.switchToGradingView();
|
408
|
+
};
|
409
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(0);
|
410
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(1);
|
411
|
+
matchingPage.steps.verifyCorrectOptionIconDropdown(2);
|
412
|
+
matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
413
|
+
matchingPage.steps.verifyCorrectAnswerSectionNotExists();
|
414
|
+
});
|
415
|
+
});
|
416
|
+
});
|
417
|
+
|
210
418
|
if (!grepTags || !grepTags.includes('smoke')) {
|
211
419
|
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
212
420
|
abortEarlySetup();
|
@@ -1,9 +1,12 @@
|
|
1
|
-
import { audioPlayerPage, dialogBoxBase, selectQuestionResourceToolPage } from "../../../pages";
|
1
|
+
import { audioPlayerPage, dialogBoxBase, selectQuestionResourceToolPage, itemPreviewPage } from "../../../pages";
|
2
|
+
import { browseItemsPage } from "../../../pages/components";
|
2
3
|
import utilities from "../../../support/helpers/utilities";
|
3
4
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
5
|
import constants from "../../../fixtures/constants";
|
5
6
|
const css = Cypress.env('css');
|
6
7
|
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
7
10
|
describe('Create question page - Audio player: Header section and saving resource tool', () => {
|
8
11
|
before(() => {
|
9
12
|
cy.loginAs('admin');
|
@@ -122,4 +125,89 @@ describe('Create question page - Audio player: Header section and saving resourc
|
|
122
125
|
audioPlayerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
123
126
|
});
|
124
127
|
});
|
128
|
+
|
129
|
+
describe('Saving a question with incomplete authoring', () => {
|
130
|
+
abortEarlySetup();
|
131
|
+
before(() => {
|
132
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
133
|
+
});
|
134
|
+
|
135
|
+
it('User should be able to save the resource with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save button is clicked', () => {
|
136
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please add a source URL']);
|
137
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
138
|
+
});
|
139
|
+
audioPlayerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
140
|
+
});
|
141
|
+
|
142
|
+
describe('User should be able to edit incomplete authored resource', () => {
|
143
|
+
abortEarlySetup();
|
144
|
+
before(() => {
|
145
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
146
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
147
|
+
audioPlayerPage.steps.editItem();
|
148
|
+
});
|
149
|
+
|
150
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
151
|
+
audioPlayerPage.steps.verifyWarningIconOnRequiredFields([
|
152
|
+
'Please add a source URL',
|
153
|
+
]);
|
154
|
+
});
|
155
|
+
|
156
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
157
|
+
audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
|
158
|
+
audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
|
159
|
+
});
|
160
|
+
|
161
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
162
|
+
audioPlayerPage.steps.saveAQuestionAndVerifySnackbar();
|
163
|
+
});
|
164
|
+
|
165
|
+
it('Warning icon should not be visible', () => {
|
166
|
+
audioPlayerPage.steps.verifyWarningIconNotExist();
|
167
|
+
});
|
168
|
+
});
|
169
|
+
|
170
|
+
describe('User should be able to edit incomplete authored resource when add audio URL is selected', () => {
|
171
|
+
abortEarlySetup();
|
172
|
+
before(() => {
|
173
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
174
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
175
|
+
audioPlayerPage.steps.editItem();
|
176
|
+
});
|
177
|
+
|
178
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
179
|
+
audioPlayerPage.steps.selectAddAudioURLRadioButton();
|
180
|
+
audioPlayerPage.steps.verifyWarningIconOnRequiredFields([
|
181
|
+
'Please add a source URL',
|
182
|
+
]);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
186
|
+
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
|
187
|
+
audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
|
188
|
+
});
|
189
|
+
|
190
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
191
|
+
audioPlayerPage.steps.saveAQuestionAndVerifySnackbar();
|
192
|
+
});
|
193
|
+
|
194
|
+
it('Warning icon should not be visible', () => {
|
195
|
+
audioPlayerPage.steps.verifyWarningIconNotExist();
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
describe('Save as you go - Browse item page contents', () => {
|
200
|
+
abortEarlySetup();
|
201
|
+
before(() => {
|
202
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
203
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
204
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
205
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
206
|
+
browseItemsPage.steps.navigateToBrowseItemsPage();
|
207
|
+
});
|
208
|
+
|
209
|
+
it('When user saves an incompletely authored resource then a warning icon should be visible in browse items page', () => {
|
210
|
+
browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
|
211
|
+
});
|
212
|
+
});
|
125
213
|
});
|
@@ -2,6 +2,7 @@ import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
3
|
import { ckEditorToolbar, commonComponents, createQuestionBasePage, equationEditorFlyout, playbackControlsBaseComponent } from "./components";
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
5
|
+
import { createItemPage } from "./createItemPage";
|
5
6
|
|
6
7
|
const selectors = {
|
7
8
|
...playbackControlsBaseComponent,
|
@@ -127,6 +128,7 @@ const steps = {
|
|
127
128
|
...ckEditorToolbar.steps,
|
128
129
|
...equationEditorFlyout.steps,
|
129
130
|
...commonComponents.steps,
|
131
|
+
...createItemPage.steps,
|
130
132
|
/**
|
131
133
|
* Uploads a file to the audio player by attaching the file located at the specified filePath.
|
132
134
|
* @param {string} filePath - The file path to the file to be uploaded.
|
@@ -146,17 +146,23 @@ const steps = {
|
|
146
146
|
.within(() => {
|
147
147
|
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
148
148
|
});
|
149
|
-
}
|
149
|
+
}
|
150
150
|
else if (field === 'Please select a file type') {
|
151
151
|
// Upload Response Select File Type Accordion
|
152
152
|
cy.get('.edit-question-edit-tab-wrapper .ngie-accordion-summary')
|
153
153
|
.within(() => {
|
154
154
|
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
155
155
|
});
|
156
|
+
} else if (field === 'Please enter text block') {
|
157
|
+
// Content Block Body Label
|
158
|
+
cy.get('.options-label')
|
159
|
+
.within(() => {
|
160
|
+
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
161
|
+
});
|
156
162
|
}
|
157
163
|
})
|
158
164
|
},
|
159
|
-
|
165
|
+
|
160
166
|
|
161
167
|
clickOnEditQuestionButton: () => {
|
162
168
|
createQuestionBasePage.editButton()
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.349
|
3
|
+
"version": "1.0.349",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -52,4 +52,4 @@
|
|
52
52
|
"devDependencies": {
|
53
53
|
"@applitools/eyes-cypress": "^3.47.0"
|
54
54
|
}
|
55
|
-
}
|
55
|
+
}
|