itemengine-cypress-automation 1.0.86 → 1.0.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
  4. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
  5. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
  6. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
  7. package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
  8. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
  9. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
  10. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
  11. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  12. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
  13. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
  21. package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
  22. package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
  23. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
  24. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
  25. package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
  26. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
  27. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
  28. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
  29. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
  30. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
  31. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
  32. package/cypress/fixtures/theme/ilc.json +3 -0
  33. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
  34. package/cypress/pages/components/colorPopupComponent.js +26 -3
  35. package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
  36. package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
  37. package/cypress/pages/components/equationEditorFlyout.js +124 -0
  38. package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
  39. package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
  40. package/cypress/pages/components/index.js +3 -1
  41. package/cypress/pages/components/opacityComponent.js +31 -4
  42. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
  43. package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
  44. package/cypress/pages/drawingResponsePage.js +33 -138
  45. package/cypress/pages/essayResponsePage.js +612 -26
  46. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
  47. package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
  48. package/package.json +1 -1
@@ -0,0 +1,115 @@
1
+ import { correctAnswerViewPage, essayResponseBasicPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
6
+ const views = utilities.getViews(gradingAndCorrectAnsView);
7
+ var itemReferenceID = "";
8
+
9
+ describe('Create item page - Essay response - Basic: Grading view, Correct answer view contents', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ if (views.includes('Grading view')) {
15
+ describe('Grading view contents', { tags: 'smoke' }, () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ cy.log('Navigating to Essay response - basic question type');
19
+ essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
20
+ cy.barsPreLoaderWait();
21
+ essayResponseBasicPage.steps.addQuestionInstructions();
22
+ essayResponseBasicPage.steps.allotPoints(10);
23
+ essayResponseBasicPage.steps.clickOnSaveQuestionButton();
24
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
25
+ //Global variable issue, not working inside before
26
+ itemPreviewPage.referenceID()
27
+ .invoke('text')
28
+ .then(($refID) => {
29
+ itemReferenceID = $refID;
30
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
31
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.previewTabToolbarOption(), 'visible');
32
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
33
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
34
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
35
+ essayResponseBasicPage.steps.enterInputInResponseField('This is a test for grading view preview contents');
36
+ studentViewPage.steps.submitResponse();
37
+ studentViewPage.steps.clickOnGoToGradingViewButton();
38
+ });
39
+ });
40
+
41
+ it('Question instructions should be visible', () => {
42
+ utilities.verifyInnerText(essayResponseBasicPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
43
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.questionInstructionsText(), 'visible');
44
+ });
45
+
46
+ it('The response submitted by the student should be visible in the response field of the grading view. The formatting toolbar options should not be visible in grading view', () => {
47
+ essayResponseBasicPage.responseField()
48
+ .verifyInnerHTML('<p><strong><em><u>This is a test for grading view preview contents</u></em></strong></p>');
49
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.previewTabToolbarWrapper(), 'hidden');
50
+ });
51
+
52
+ it('The content in the response field should not be editable', () => {
53
+ essayResponseBasicPage.steps.verifyGradingViewResponseFieldIsNonEditable();
54
+ });
55
+
56
+ it('Word count should be displayed in the format \'Maximum 1000 words\'', () => {
57
+ essayResponseBasicPage.steps.verifyResponseFieldWordCount(1000);
58
+ });
59
+
60
+ it('Empty score input field and total score should be displayed', () => {
61
+ gradingViewPage.steps.verifyGradingViewScore('', 10);
62
+ });
63
+
64
+ it('CSS of content in the response field', { tags: 'css' }, () => {
65
+ utilities.verifyCSS(essayResponseBasicPage.responseField().find('u'), {
66
+ 'color': css.color.text,
67
+ 'font-size': css.fontSize.default,
68
+ 'font-weight': css.fontWeight.bold
69
+ });
70
+ });
71
+
72
+ it('Accessibility of content in the response field', { tags: 'a11y' }, () => {
73
+ cy.checkAccessibility(essayResponseBasicPage.responseField());
74
+ });
75
+ });
76
+ }
77
+
78
+ if (views.includes('Correct answer view')) {
79
+ describe('Correct answer view contents', { tags: 'smoke' }, () => {
80
+ abortEarlySetup();
81
+ before(() => {
82
+ cy.log('Navigating to Essay response - basic question type');
83
+ essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
84
+ cy.barsPreLoaderWait();
85
+ essayResponseBasicPage.steps.addQuestionInstructions();
86
+ essayResponseBasicPage.steps.allotPoints(10);
87
+ essayResponseBasicPage.steps.clickOnSaveQuestionButton();
88
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
89
+ //Global variable issue, not working inside before
90
+ itemPreviewPage.referenceID()
91
+ .invoke('text')
92
+ .then(($refID) => {
93
+ itemReferenceID = $refID
94
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
95
+ });
96
+ });
97
+
98
+ it('Question instructions should be visible', () => {
99
+ utilities.verifyTextContent(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
100
+ utilities.verifyElementVisibilityState(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'visible');
101
+ });
102
+
103
+ it('\'This is a manual scored question\' help text should be displayed in the correct answer view', () => {
104
+ utilities.verifyTextContent(correctAnswerViewPage.manualScoredQuestionHelpText(), 'This is a manual scored question.');
105
+ utilities.verifyElementVisibilityState(correctAnswerViewPage.manualScoredQuestionHelpText(), 'visible');
106
+ });
107
+
108
+ it('The points alloted to the question should be displayed', () => {
109
+ correctAnswerViewPage.steps.verifyAvailablePoints(10);
110
+ });
111
+
112
+ //Need to add CSS and A11y here once updated designs are available for correct answer
113
+ });
114
+ }
115
+ });
@@ -0,0 +1,79 @@
1
+ import { essayResponseBasicPage, itemPreviewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ let previewContentViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+
9
+ const defaultFormattingOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Undo (Ctrl+Z)', 'Redo (Ctrl+Y)'];
10
+
11
+ describe('Create item page - Essay response - Basic: Preview contents', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ views.forEach((view) => {
17
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ switch (view) {
21
+ case 'Question preview':
22
+ cy.log('Navigating to Essay response question type');
23
+ essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
24
+ cy.barsPreLoaderWait();
25
+ essayResponseBasicPage.steps.addQuestionInstructions();
26
+ essayResponseBasicPage.steps.allotPoints(10);
27
+ essayResponseBasicPage.steps.switchToPreviewTab();
28
+ break;
29
+ case 'Item view':
30
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
31
+ break;
32
+ case 'Item preview':
33
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID[0])}`);
34
+ itemPreviewPage.steps.switchToPreviewTab();
35
+ break;
36
+ case 'Student view':
37
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID[0])}`);
38
+ break;
39
+ };
40
+ });
41
+
42
+ if (view === 'Question preview') {
43
+ after(() => {
44
+ essayResponseBasicPage.steps.clickOnSaveQuestionButton();
45
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
46
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
47
+ });
48
+ };
49
+
50
+ it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab.join('')} along with a separator after ${defaultFormattingOptionsPreviewTab[2]} option`, () => {
51
+ essayResponseBasicPage.steps.verifyDefaultToolbarOptions(defaultFormattingOptionsPreviewTab, defaultFormattingOptionsPreviewTab[2]);
52
+ });
53
+
54
+ it('Word count should be displayed in the format \'Maximum 1000 words\'', () => {
55
+ essayResponseBasicPage.steps.verifyResponseFieldWordCount(1000);
56
+ });;
57
+
58
+ it('When the user updates the formatting options and types something in the response field', () => {
59
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
60
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
61
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
62
+ essayResponseBasicPage.steps.enterInputInResponseField('This is a test for grading view preview contents');
63
+ essayResponseBasicPage.responseField()
64
+ .verifyInnerHTML('<p><strong><em><u>​​​​​​​This is a test for grading view preview contents</u></em></strong><br></p>');
65
+ });
66
+
67
+ it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
68
+ utilities.verifyCSS(essayResponseBasicPage.previewTabToolbarOption('Bold (Ctrl+B)').find('.cke_button_icon'), {
69
+ 'color': css.color.activeButtons
70
+ });
71
+ });
72
+
73
+ it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
74
+ cy.checkAccessibility(essayResponseBasicPage.previewTabToolbarWrapper());
75
+ });
76
+ });
77
+ });
78
+ });
79
+
@@ -271,4 +271,163 @@ describe('Create item page - Fill in the gaps over image - drag and drop: Partia
271
271
  fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-4, 10.5);
272
272
  });
273
273
  });
274
+
275
+ describe('Question preview: Auto scored - Partial different weights: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
276
+ abortEarlySetup();
277
+ before(() => {
278
+ fillInTheGapsOverImageDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
279
+ cy.barsPreLoaderWait();
280
+ fillInTheGapsOverImageDragAndDropPage.steps.uploadFile('highlightImage.jpg');
281
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyImageIsUploaded();
282
+ fillInTheGapsOverImageDragAndDropPage.steps.addMultipleOptionFields(3);
283
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(10);
284
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(40);
285
+ fillInTheGapsOverImageDragAndDropPage.steps.insertResponseArea(80);
286
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMaxCapacityPerDropzoneDropdown();
287
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('2');
288
+ fillInTheGapsOverImageDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Flower', 'Stem']);
289
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Flower': 1, 'Leaves': 2 });
290
+ fillInTheGapsOverImageDragAndDropPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
291
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 5 });
292
+ fillInTheGapsOverImageDragAndDropPage.steps.checkAllowStudentToCheckAnswerCheckbox();
293
+ });
294
+
295
+ //Penalty points for the entire question
296
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
297
+ fillInTheGapsOverImageDragAndDropPage.steps.expandPenaltyScoringDropdown();
298
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
299
+ fillInTheGapsOverImageDragAndDropPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
300
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPenaltyPoints(4);
301
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
302
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
303
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-4, 20);
304
+ });
305
+
306
+ it('When the user attempts the question correctly along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
307
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
308
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 1 });
309
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(5, 20);
310
+ });
311
+
312
+ it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
313
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
314
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 1, 'Flower': 2 });
315
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(5, 20);
316
+ });
317
+
318
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
319
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
320
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
321
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
322
+ fillInTheGapsOverImageDragAndDropPage.steps.allotMinimumPoints(3);
323
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
324
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
325
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(3, 20);
326
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
327
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
328
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
329
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
330
+ });
331
+
332
+ //Penalty points for each incorrect dropzone - Specify total penalty points
333
+ it('When the user sets penalty scoring to \'Penalty points for each incorrect dropzone\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points of all the empty and incorrect dropzone', () => {
334
+ fillInTheGapsOverImageDragAndDropPage.steps.expandPenaltyScoringDropdown();
335
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect dropzone');
336
+ fillInTheGapsOverImageDragAndDropPage.steps.allotTotalPenaltyPoints(4);
337
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
338
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
339
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-3.99, 20);
340
+ });
341
+
342
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
343
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
344
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Flower': 1, 'Roots': 1, 'Leaves': 2 });
345
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(12.67, 20);
346
+ });
347
+
348
+ it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect dropzone should get deducted from the awarded points', () => {
349
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
350
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Stem': 1, 'Roots': 1, 'Leaves': 2 });
351
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(12.67, 20);
352
+ });
353
+
354
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
355
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
356
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
357
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
358
+ fillInTheGapsOverImageDragAndDropPage.steps.allotMinimumPoints(3);
359
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
360
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
361
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(3, 20);
362
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
363
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
364
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
365
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
366
+ });
367
+
368
+ //Penalty points for each incorrect dropzone - Specify points for each incorrect dropzone
369
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect dropzone\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
370
+ fillInTheGapsOverImageDragAndDropPage.steps.selectPenaltyPointsForEachIncorrectDropzone();
371
+ fillInTheGapsOverImageDragAndDropPage.steps.allotPenaltyPointsForEachIncorrectDropzone(4);
372
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
373
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
374
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-12, 20);
375
+ });
376
+
377
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
378
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
379
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Flower': 1, 'Roots': 1, 'Leaves': 2 });
380
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(10, 20);
381
+ });
382
+
383
+ it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect dropzone should get deducted from the awarded points', () => {
384
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
385
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Stem': 1, 'Roots': 2 });
386
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(1, 20);
387
+ });
388
+
389
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
390
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
391
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
392
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
393
+ fillInTheGapsOverImageDragAndDropPage.steps.allotMinimumPoints(3);
394
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
395
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
396
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(3, 20);
397
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
398
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
399
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
400
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
401
+ });
402
+
403
+ // Penalty points for each incorrect option - Automatically set penalty for each incorrect dropzone to total points / no. of incorrect dropzone
404
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect dropzone\', and checks \'Automatically set penalty for each incorrect dropzone to total points / no. of incorrect dropzone\' checkbox and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
405
+ fillInTheGapsOverImageDragAndDropPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
406
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
407
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
408
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-20.01, 20);
409
+ });
410
+
411
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
412
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
413
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Flower': 1, 'Roots': 1, 'Leaves': 2 });
414
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(7.33, 20);
415
+ });
416
+
417
+ it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
418
+ fillInTheGapsOverImageDragAndDropPage.steps.resetQuestionPreview();
419
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 1, 'Stem': 2 });
420
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(-4.34, 20);
421
+ });
422
+
423
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
424
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToEditTab();
425
+ fillInTheGapsOverImageDragAndDropPage.steps.expandMinimumScoringDropdown();
426
+ fillInTheGapsOverImageDragAndDropPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
427
+ fillInTheGapsOverImageDragAndDropPage.steps.allotMinimumPoints(3);
428
+ fillInTheGapsOverImageDragAndDropPage.steps.switchToPreviewTab();
429
+ fillInTheGapsOverImageDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Roots': 0 });
430
+ fillInTheGapsOverImageDragAndDropPage.steps.verifyPreviewScore(3, 20);
431
+ });
432
+ });
274
433
  });