itemengine-cypress-automation 1.0.72 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/cypress/e2e/ILC/AudioResponse/{audioResponseMinimalPreviewSection.js → audioResponseMinimalPreviewSection.smoke.js} +263 -254
  2. package/cypress/e2e/ILC/AudioResponse/{audioResponseStandardPreviewSection.js → audioResponseStandardPreviewSection.smoke.js} +100 -97
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.smoke.js +121 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachCell.js → groupedOptionsPartialScoreForEachCell.smoke.js} +1 -1
  5. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachResponse.js → groupedOptionsPartialScoreForEachResponse.smoke.js} +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.smoke.js +164 -0
  7. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{standardTotalScoreDividedBetweenResponse.js → standardTotalScoreDividedBetweenResponse.smoke.js} +21 -18
  8. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +753 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.smoke.js +943 -0
  10. package/cypress/e2e/ILC/EssayResponse/{essayResponseCustomizeFormattingOptions1.js → essayResponseCustomizeFormattingOptions1.smoke.js} +113 -110
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +581 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.smoke.js +111 -0
  13. package/cypress/e2e/ILC/EssayResponse/{essayResponsePreviewContentsForAllViews.js → essayResponsePreviewContentsForAllViews.smoke.js} +6 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.smoke.js +81 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/{fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js → fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.smoke.js} +25 -22
  16. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAllOrNothingScoring.js → fillInTheGapsDropdownAllOrNothingScoring.smoke.js} +16 -14
  17. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.smoke.js} +80 -74
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.smoke.js +361 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.smoke.js +137 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.smoke.js +171 -0
  21. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.smoke.js} +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextAllOrNothingScoring.js → fillInTheGapsOverImageTextAllOrNothingScoring.smoke.js} +32 -29
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextCheckAnswerForAllViews.js → fillInTheGapsOverImageTextCheckAnswerForAllViews.smoke.js} +5 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.smoke.js +137 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.smoke.js +146 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewContentsForAllViews.js → fillInTheGapsOverImageTextPreviewContentsForAllViews.smoke.js} +5 -3
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewTab.js → fillInTheGapsOverImageTextPreviewTab.smoke.js} +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextShowCorrectAnswerForAllView.js → fillInTheGapsOverImageTextShowCorrectAnswerForAllView.smoke.js} +6 -4
  29. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextAutoScoredScoring.js → fillInTheGapsTextAutoScoredScoring.smoke.js} +12 -9
  30. package/cypress/e2e/ILC/Highlight/HighlightScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +36 -34
  31. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.smoke.js +462 -0
  32. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.smoke.js +148 -0
  33. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.smoke.js +185 -0
  34. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.smoke.js +138 -0
  35. package/cypress/e2e/ILC/HighlightImage/{highlightImagePreviewTab.js → highlightImagePreviewTab.smoke.js} +1 -1
  36. package/cypress/e2e/ILC/HighlightImage/{highlightImageToolsFunctionalityPreviewTab.js → highlightImageToolsFunctionalityPreviewTab.smoke.js} +4 -4
  37. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.smoke.js +122 -0
  38. package/cypress/e2e/ILC/ListMatching/{listMatchingAlternateAnswer.js → listMatchingAlternateAnswer.smoke.js} +47 -43
  39. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.smoke.js +211 -0
  40. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.smoke.js +254 -0
  41. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.smoke.js +191 -0
  42. package/cypress/e2e/ILC/ListOrdering/ListOrderingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +34 -32
  43. package/cypress/e2e/ILC/ListSorting/ListSortingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +41 -38
  44. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.smoke.js +269 -0
  45. package/cypress/e2e/ILC/MultipleSelectionGrid/{multipleSelectionGridAutoScoredScoring.js → multipleSelectionGridAutoScoredScoring.smoke.js} +36 -34
  46. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.smoke.js +407 -0
  47. package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoring.js → singleSelectionGridAutoScoredScoring.smoke.js} +32 -29
  48. package/cypress/e2e/ILC/UploadResponse/{uploadResponsePreview.js → uploadResponsePreview.smoke.js} +64 -59
  49. package/cypress/e2e/ILC/VideoResponse/{videoResponsePreviewTab.js → videoResponsePreviewTab.smoke.js} +290 -281
  50. package/cypress/pages/components/additionalSettingsPanel.js +0 -27
  51. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  52. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +321 -0
  53. package/cypress/pages/components/createQuestionBasePage.js +1 -7
  54. package/cypress/pages/components/essayResponseCommonComponents.js +0 -6
  55. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -13
  56. package/cypress/pages/components/index.js +2 -1
  57. package/cypress/pages/components/mcqAdditionalSettingsBase.js +0 -10
  58. package/cypress/pages/components/scoringSectionBase.js +3 -2
  59. package/cypress/pages/createItemPage.js +3 -79
  60. package/cypress/pages/dialogBoxBase.js +8 -23
  61. package/cypress/pages/index.js +1 -4
  62. package/cypress/pages/itemPreviewSettingsPage.js +446 -0
  63. package/cypress/pages/multipleSelectionPage.js +113 -64
  64. package/cypress/pages/selectQuestionResourceToolPage.js +0 -5
  65. package/cypress/pages/shortTextResponsePage.js +0 -6
  66. package/cypress/pages/singleSelectionPage.js +0 -1
  67. package/package.json +2 -2
  68. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.js +0 -116
  69. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.js +0 -160
  70. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +0 -932
  71. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -572
  72. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.js +0 -106
  73. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +0 -76
  74. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +0 -134
  75. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +0 -133
  76. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.js +0 -457
  77. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.js +0 -143
  78. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.js +0 -178
  79. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +0 -125
  80. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.js +0 -117
  81. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +0 -207
  82. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +0 -246
  83. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +0 -185
  84. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +0 -820
  85. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +0 -936
  86. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +0 -263
  87. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.js +0 -402
  88. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.js +0 -356
  89. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.js +0 -134
  90. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.js +0 -156
@@ -72,12 +72,6 @@ const steps = {
72
72
  .verifyInnerText(correctAnswer)
73
73
  shortTextResponsePage.previewTabCorrectAnswerResponse()
74
74
  .should('have.length', 1);
75
- },
76
-
77
- enterTextInShortTextResponseInputField: (correctAnswer) => {
78
- shortTextResponsePage.setCorrectAnswerResponseField()
79
- .type(correctAnswer)
80
- .should('have.value', correctAnswer);
81
75
  }
82
76
  }
83
77
 
@@ -32,7 +32,6 @@ const steps = {
32
32
  ...mcqPreviewComponents.steps,
33
33
  ...autoScoredSetCorrectAnswerSection.steps,
34
34
  ...autoScoredScoringSection.steps,
35
- ...mcqAdditionalSettingsBase.steps,
36
35
  checkCorrectAnswerRadioButton: (option) => {
37
36
  mcqSetCorrectAnswerSection.correctAnswerOptionsWrapper(option)
38
37
  .click()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,4 +29,4 @@
29
29
  "cypress-real-events": "^1.7.6",
30
30
  "react-uuid": "^2.0.0"
31
31
  }
32
- }
32
+ }
@@ -1,116 +0,0 @@
1
- import { dragAndDropIntoCategoriesAllOrNothingScoring } from "../../../../pages/dragAndDropIntoCategoriesAllOrNothingScoring";
2
- import { dragAndDropIntoCategoriesPage } from "../../../../pages/dragAndDropIntoCategoriesPage";
3
- import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
-
5
- describe('Create Item page - drag and drop into categories: Preview tab scoring functionality - grouped options layout', () => {
6
- before(() => {
7
- cy.loginAs('admin');
8
- });
9
-
10
- describe('Show correct answer - grouped options layout', () => {
11
- abortEarlySetup();
12
- before(() => {
13
- cy.log('Navigating to drag and drop into categories question type');
14
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
15
- cy.barsPreLoaderWait();
16
- dragAndDropIntoCategoriesPage.steps.setQuestionForGroupedResponseOptions();
17
- });
18
-
19
- dragAndDropIntoCategoriesPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
20
-
21
- dragAndDropIntoCategoriesAllOrNothingScoring.tests.verifyShowCorrectAnswerBasicFunctionality();
22
- });
23
-
24
- describe('Question preview: AutoScored: All or nothing - grouped options layout', () => {
25
- abortEarlySetup();
26
- before(() => {
27
- cy.log('Navigating to drag and drop into categories question type');
28
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
29
- cy.barsPreLoaderWait();
30
- dragAndDropIntoCategoriesPage.steps.setQuestionForGroupedResponseOptions();
31
- dragAndDropIntoCategoriesPage.steps.setCorrectTabAnswerOptions();
32
- dragAndDropIntoCategoriesPage.steps.allotPoints(10);
33
- dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
34
- dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
35
- dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
36
- });
37
-
38
- dragAndDropIntoCategoriesAllOrNothingScoring.tests.verifyAutoScoredAllOrNothingScoring()
39
-
40
- dragAndDropIntoCategoriesPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(10);
41
- });
42
-
43
- describe('Question Preview: AutoScored - All or Nothing - grouped options layout with identical draggable response options in preview tab', () => {
44
- let groupedOptions = [['Bat', 'Eagle', 'Whale', 'Platypus'], ['Bat', 'Parrot', 'Ostrich', 'Flying squirrel']];
45
- abortEarlySetup();
46
- before(() => {
47
- cy.log('Navigate to drag and drop into categories question type, fill the necessary details and points and switch to preview tab');
48
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
49
- cy.barsPreLoaderWait();
50
- dragAndDropIntoCategoriesPage.steps.selectResponseOptionsLayout('Grouped');
51
- dragAndDropIntoCategoriesPage.steps.addGroupTitle(0, 'Group A');
52
- dragAndDropIntoCategoriesPage.steps.addOption();
53
- dragAndDropIntoCategoriesPage.steps.addOption();
54
- dragAndDropIntoCategoriesPage.steps.addInputToOptionsForDragAndDropFields(groupedOptions[0]);
55
- dragAndDropIntoCategoriesPage.steps.addGroupWithTitleAndOptionsInResponseOptionsSection(1, 'Group B', groupedOptions[1]);
56
- dragAndDropIntoCategoriesPage.steps.allotPoints(20);
57
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
58
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
59
- dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
60
- dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
61
- dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
62
- });
63
-
64
- it('Case: When user has identical options to give as input', () => {
65
- cy.log('Both the identical options should be visible in the draggable response options section and when user clicks on \'Show correct answer\' checkbox only one of the identical options should be displayed in the correct answer section');
66
- dragAndDropIntoCategoriesPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, groupedOptions[0]);
67
- dragAndDropIntoCategoriesPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, groupedOptions[1]);
68
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
69
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle']], [1, 2]);
70
-
71
- cy.log('Post-step: Unchecking show correct answer checkbox');
72
- dragAndDropIntoCategoriesPage.steps.uncheckShowCorrectAnswerCheckbox();
73
-
74
- cy.log('When the user gives the correct answer inputs and user selects the show correct answer checkbox, green check-mark icon should be displayed besides both the responses, user should be awarded full points and no correct answer section should be displayed');
75
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
76
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
77
- cy.log('User should be awarded full points')
78
- dragAndDropIntoCategoriesPage.previewScoreText()
79
- .verifyInnerText('20/20');
80
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
81
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
82
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
83
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
84
-
85
- dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
86
-
87
- cy.log('When user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides correct answer responses and no correct answer section should be displayed');
88
- dragAndDropIntoCategoriesPage.steps.checkAnswer();
89
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
90
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
91
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
92
-
93
- cy.log('When the user attempts the question with the identical option then on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides the original option set as correct responses, red cross-mark icon should be displayed against the identical option and user should be awarded 0 points');
94
- dragAndDropIntoCategoriesPage.steps.resetQuestionPreview();
95
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
96
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
97
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInGroupedResponseContainerOfPreviewTab('Bat')
98
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
99
- cy.log('User should be awarded 0 points')
100
- dragAndDropIntoCategoriesPage.previewScoreText()
101
- .verifyInnerText('0/20');
102
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
103
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
104
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
105
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat']], [1]);
106
-
107
- dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
108
-
109
- cy.log('When user clicks on \'Check answer\' button, green check-mark icon should be displayed besides the original options set as correct responses, red cross-mark icon should be displayed against the identical option ')
110
- dragAndDropIntoCategoriesPage.steps.checkAnswer();
111
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
112
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
113
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
114
- });
115
- });
116
- });
@@ -1,160 +0,0 @@
1
- import { dragAndDropIntoCategoriesAllOrNothingScoring } from "../../../../pages/dragAndDropIntoCategoriesAllOrNothingScoring";
2
- import { dragAndDropIntoCategoriesPage } from "../../../../pages/dragAndDropIntoCategoriesPage";
3
- import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
- const css = Cypress.env('css');
5
- const identicalOptionArray = ['Bat', 'Eagle', 'Bat'];
6
-
7
- describe('Create Item page - drag and drop into categories: Preview tab Scoring Section', () => {
8
- before(() => {
9
- cy.loginAs('admin');
10
- });
11
-
12
- describe('Show correct answer', () => {
13
- abortEarlySetup();
14
- before(() => {
15
- cy.log('Navigating to drag and drop into categories question type');
16
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
17
- cy.barsPreLoaderWait();
18
- dragAndDropIntoCategoriesPage.steps.setQuestion();
19
- });
20
-
21
- dragAndDropIntoCategoriesPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
22
-
23
- it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
24
- dragAndDropIntoCategoriesPage.steps.switchToEditTab();
25
- dragAndDropIntoCategoriesPage.steps.setCorrectTabAnswerOptions();
26
- dragAndDropIntoCategoriesPage.steps.allotPoints(10);
27
- dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
28
- dragAndDropIntoCategoriesPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
29
- dragAndDropIntoCategoriesPage.previewScoreText()
30
- .verifyInnerText('0/10');
31
- });
32
-
33
- it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
34
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
35
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
36
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Platypus', 2);
37
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Ostrich', 3);
38
- dragAndDropIntoCategoriesPage.steps.resetQuestionPreview();
39
- for (let index = 0; index < 4; index++) {
40
- dragAndDropIntoCategoriesPage.steps.verifyEmptyStateOfCategoryCellInPreviewTab(index);
41
- }
42
- });
43
- });
44
-
45
- describe('Question preview: AutoScored: All or nothing', () => {
46
- abortEarlySetup();
47
- before(() => {
48
- cy.log('Navigating to drag and drop into categories question type');
49
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
50
- cy.barsPreLoaderWait();
51
- dragAndDropIntoCategoriesPage.steps.setQuestion();
52
- dragAndDropIntoCategoriesPage.steps.setCorrectTabAnswerOptions();
53
- dragAndDropIntoCategoriesPage.steps.allotPoints(10);
54
- dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
55
- dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
56
- dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
57
- });
58
-
59
- it('CSS of \'Score\' and \'Show correct answer\'', { tags: 'css' }, () => {
60
- dragAndDropIntoCategoriesPage.previewScoreText()
61
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
62
- dragAndDropIntoCategoriesPage.showCorrectAnswerCheckboxLabel()
63
- .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
64
- });
65
-
66
- dragAndDropIntoCategoriesPage.tests.verifyQuestionPreviewOnSelectingShowCorrectAnswerWithoutAttempting(10);
67
-
68
- it('CSS of category cell numeration and correct answer section', () => {
69
- dragAndDropIntoCategoriesPage.correctAnswerLabel()
70
- .verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.regular);
71
- dragAndDropIntoCategoriesPage.correctAnswerCategoryCell()
72
- .should('have.css', 'border', `1px solid ${css.color.correctAnswerContainerBorder}`)
73
- .eq(0)
74
- .within(() => {
75
- dragAndDropIntoCategoriesPage.categoryCellNumeration()
76
- .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
77
- .should('have.css', 'border', `1px solid ${css.color.titleContainerBorder}`)
78
- .and('have.css', 'background-color', `${css.color.titleContainerBg}`);
79
- dragAndDropIntoCategoriesPage.correctAnswerOption()
80
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular)
81
- .should('have.css', 'border', `1px solid ${css.color.titleContainerBorder}`);
82
- });
83
- });
84
-
85
- dragAndDropIntoCategoriesPage.tests.verifyQuestionPreviewOnClickingCheckAnswerWithoutAttempting();
86
-
87
- dragAndDropIntoCategoriesAllOrNothingScoring.tests.verifyAutoScoredAllOrNothingScoring()
88
-
89
- dragAndDropIntoCategoriesPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(10);
90
- });
91
-
92
- describe('Question Preview: AutoScored - All or Nothing standard options layout with identical draggable response options in preview tab', () => {
93
- abortEarlySetup();
94
- before(() => {
95
- cy.log('Navigate to drag and drop into categories question type, fill the necessary details and points and switch to preview tab');
96
- dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
97
- cy.barsPreLoaderWait();
98
- dragAndDropIntoCategoriesPage.addOptionButton()
99
- .click();
100
- dragAndDropIntoCategoriesPage.steps.addInputToOptionsForDragAndDropFields(identicalOptionArray);
101
- dragAndDropIntoCategoriesPage.steps.allotPoints(20);
102
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Bat', 0);
103
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfSetCorrectAnswerSection('Eagle', 1);
104
- dragAndDropIntoCategoriesPage.steps.expandAdditonalSettings();
105
- dragAndDropIntoCategoriesPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
106
- dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
107
- });
108
-
109
- it('Case: When user has identical options to give as input', () => {
110
- cy.log('Both the identical options should be visible in the draggable response options section and when user clicks on \'Show correct answer\' checkbox only one of the identical options should be displayed in the correct answer section');
111
- dragAndDropIntoCategoriesPage.steps.verifyDraggableResponsesPreviewTab('drag and drop into categories', identicalOptionArray);
112
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
113
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle']], [1, 2]);
114
-
115
- cy.log('Post-step: Unchecking show correct answer checkbox');
116
- dragAndDropIntoCategoriesPage.steps.uncheckShowCorrectAnswerCheckbox();
117
-
118
- cy.log('When the user gives the correct answer inputs and user selects the show correct answer checkbox, green check-mark icon should be displayed besides both the responses, user should be awarded full points and no correct answer section should be displayed');
119
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
120
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
121
- cy.log('User should be awarded full points')
122
- dragAndDropIntoCategoriesPage.previewScoreText()
123
- .verifyInnerText('20/20');
124
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
125
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
126
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
127
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
128
-
129
- dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
130
-
131
- cy.log('When user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides correct answer responses and no correct answer section should be displayed');
132
- dragAndDropIntoCategoriesPage.steps.checkAnswer();
133
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
134
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
135
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
136
-
137
- cy.log('When the user attempts the question with the identical option then on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides the original option set as correct responses, red cross-mark icon should be displayed against the identical option and user should be awarded 0 points');
138
- dragAndDropIntoCategoriesPage.steps.resetQuestionPreview();
139
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
140
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
141
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Bat');
142
- dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Eagle', 1);
143
- cy.log('User should be awarded 0 points')
144
- dragAndDropIntoCategoriesPage.previewScoreText()
145
- .verifyInnerText('0/20');
146
- dragAndDropIntoCategoriesPage.steps.checkShowCorrectAnswerCheckbox();
147
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
148
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
149
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat']], [1]);
150
-
151
- dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
152
-
153
- cy.log('When user clicks on \'Check answer\' button, green check-mark icon should be displayed besides the original options set as correct responses, red cross-mark icon should be displayed against the identical option ')
154
- dragAndDropIntoCategoriesPage.steps.checkAnswer();
155
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
156
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
157
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotVisible();
158
- });
159
- });
160
- });