itemengine-cypress-automation 1.0.166-migrationScripts-b8c79a0.0 → 1.0.167-repoUpdate10April-1465c8c.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +83 -0
  2. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +200 -0
  3. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +56 -0
  4. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +95 -0
  5. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +71 -0
  6. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +72 -0
  7. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +71 -0
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +22 -11
  10. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  12. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +161 -0
  13. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +308 -0
  14. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +216 -0
  15. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +336 -0
  16. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +570 -0
  17. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +214 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +356 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +299 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +18 -7
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +11 -6
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +355 -0
  23. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +2 -36
  25. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +22 -34
  26. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +8 -24
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +5 -25
  28. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +68 -114
  29. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +67 -111
  30. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +71 -123
  31. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +41 -63
  32. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +21 -25
  33. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +50 -85
  34. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +68 -115
  35. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +54 -98
  36. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +72 -120
  37. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  38. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +309 -0
  39. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  40. package/cypress/e2e/ILC/Matching/toolSettings.js +72 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +1033 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +28 -0
  43. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +236 -0
  44. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +239 -0
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +278 -0
  46. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +178 -0
  47. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +407 -0
  48. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +273 -0
  49. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +278 -0
  50. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +228 -0
  51. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +120 -0
  52. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +659 -0
  53. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +149 -0
  54. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +151 -0
  55. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +171 -0
  56. package/cypress/e2e/ILC/NumberLine/headerSection.js +76 -0
  57. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +54 -0
  58. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +200 -0
  59. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +67 -0
  60. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +135 -0
  61. package/cypress/e2e/ILC/NumberLine/toolSettings.js +73 -0
  62. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +372 -0
  63. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +1014 -0
  64. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +235 -0
  65. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +235 -0
  66. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +235 -0
  67. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +457 -0
  68. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +342 -0
  69. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +342 -0
  70. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +342 -0
  71. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +155 -0
  72. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +314 -0
  73. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +275 -0
  74. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +314 -0
  75. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +290 -0
  76. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
  77. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +137 -0
  78. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  79. package/cypress/fixtures/theme/ilc.json +14 -26
  80. package/cypress/pages/brainingCampManipulativePage.js +122 -0
  81. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  84. package/cypress/pages/components/colorPopupComponent.js +2 -2
  85. package/cypress/pages/components/defaultToolDropdown.js +77 -0
  86. package/cypress/pages/components/gridQuestionCommonComponent.js +629 -2
  87. package/cypress/pages/components/index.js +3 -0
  88. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  89. package/cypress/pages/components/measuringToolComponent.js +2 -2
  90. package/cypress/pages/components/resetPopupComponent.js +74 -0
  91. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  92. package/cypress/pages/components/setPointsPopupBase.js +6 -4
  93. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +60 -3
  94. package/cypress/pages/components/toolSettingsComponent.js +80 -12
  95. package/cypress/pages/components/toolsAndControlsComponent.js +69 -0
  96. package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -8
  97. package/cypress/pages/feedbackScalePage copy.js +716 -0
  98. package/cypress/pages/feedbackScalePage.js +591 -449
  99. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
  100. package/cypress/pages/graphingPage.js +9 -145
  101. package/cypress/pages/gridFillPage.js +135 -120
  102. package/cypress/pages/highlightPage.js +0 -394
  103. package/cypress/pages/index.js +5 -2
  104. package/cypress/pages/matchingPage.js +78 -20
  105. package/cypress/pages/multipleSelectionGridPage.js +88 -1
  106. package/cypress/pages/numberLinePage.js +723 -0
  107. package/cypress/pages/singleSelectionGridPage.js +86 -0
  108. package/cypress/pages/textSelectionPage.js +582 -0
  109. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +3 -12
  110. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +0 -1
  111. package/cypress/support/migrationHelpers/migrationScript.js +0 -10
  112. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +0 -8
  113. package/package.json +1 -1
@@ -0,0 +1,142 @@
1
+ import { textSelectionPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ var itemReferenceID = "";
5
+ const checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(checkAnswerViews);
7
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
8
+
9
+ describe('Create item page - Matching - Check answer functionality', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ views.forEach((view) => {
15
+ //Note: Remove after https://redmine.zeuslearning.com/issues/549542 is fixed
16
+ const checkAnswer = (view) => {
17
+ switch (view) {
18
+ case 'Question preview':
19
+ case 'Item preview':
20
+ textSelectionPage.steps.checkAnswer();
21
+ break;
22
+ case 'Student view':
23
+ studentViewPage.steps.checkAnswer();
24
+ break;
25
+ default:
26
+ throw new Error(`Unsupported page identifier: ${view}`);
27
+ }
28
+ };
29
+
30
+ describe(`${view} - Check answer functionality`, { tags: 'smoke' }, () => {
31
+ abortEarlySetup();
32
+ before(() => {
33
+ switch (view) {
34
+ case 'Question preview':
35
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
36
+ cy.barsPreLoaderWait();
37
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Highlight the correct statements.');
38
+ textSelectionPage.steps.clearQuestionInputField();
39
+ paragraphTextArray.forEach((paragraphText) => {
40
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
41
+ });
42
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
43
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
44
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[0]);
45
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[1]);
46
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[2]);
47
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
48
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
49
+ textSelectionPage.steps.allotPoints(20);
50
+ textSelectionPage.steps.checkAllowStudentToCheckAnswerCheckbox();
51
+ textSelectionPage.steps.switchToPreviewTab();
52
+ break;
53
+ case 'Item preview':
54
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
55
+ itemPreviewPage.steps.switchToPreviewTab();
56
+ break;
57
+ case 'Student view':
58
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ break;
60
+ }
61
+ });
62
+
63
+ beforeEach(() => {
64
+ switch (view) {
65
+ case 'Question preview':
66
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
67
+ textSelectionPage.steps.resetQuestionPreview();
68
+ break;
69
+ case 'Item preview':
70
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
71
+ itemPreviewPage.steps.resetQuestionPreview();
72
+ break;
73
+ case 'Student view':
74
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
75
+ break;
76
+ }
77
+ });
78
+
79
+ if (view === 'Question preview') {
80
+ after(() => {
81
+ textSelectionPage.steps.clickOnSaveQuestionButton();
82
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
83
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
84
+ });
85
+ };
86
+
87
+ it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer status message and correct answer section should not be displayed', () => {
88
+ checkAnswer(view);
89
+ textSelectionPage.steps.verifyCorrectIncorrectIconsNotExist();
90
+ textSelectionPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
91
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
92
+ });
93
+
94
+ it('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
95
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
96
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[3]);
97
+ checkAnswer(view);
98
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[0]);
99
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
100
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
101
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[3]);
102
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
103
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
104
+ });
105
+
106
+ it('When the user attempts the question partially correct and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct icons should be displayed besides correct responses, a status message with text \'Your answer is incorrect\' should be displayed. Correct answer section should not be displayed', () => {
107
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
108
+ checkAnswer(view);
109
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
110
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
111
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
112
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
113
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
114
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
115
+ });
116
+
117
+ it('When the user attempts the question partially correct with an incorrect response, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
118
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
119
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
120
+ checkAnswer(view);
121
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
122
+ textSelectionPage.steps.verifyCorrectIncorrectIconForOptionNotExist(paragraphTextArray[1]);
123
+ textSelectionPage.steps.verifyIncorrectIconForOption(paragraphTextArray[2]);
124
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
125
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
126
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
127
+ });
128
+
129
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
130
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
131
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
132
+ checkAnswer(view);
133
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
134
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
135
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
136
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[3]);
137
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
138
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
139
+ });
140
+ });
141
+ });
142
+ });
@@ -0,0 +1,137 @@
1
+ import { textSelectionPage, 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 previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+
9
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
10
+
11
+ describe('Create item page - Text selection : 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
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
23
+ cy.barsPreLoaderWait();
24
+ textSelectionPage.steps.addTextInQuestionInstructionsInputField('Select the correct statements.');
25
+ textSelectionPage.steps.clearQuestionInputField();
26
+ paragraphTextArray.forEach((paragraphText) => {
27
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
28
+ });
29
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
30
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
31
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[0]);
32
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[1]);
33
+ textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[2]);
34
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
35
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
36
+ textSelectionPage.steps.allotPoints(20);
37
+ textSelectionPage.steps.switchToPreviewTab();
38
+ break;
39
+ case 'Item view':
40
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
41
+ break;
42
+ case 'Item preview':
43
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
44
+ textSelectionPage.steps.switchToPreviewTab();
45
+ break;
46
+ case 'Student view':
47
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
48
+ break;
49
+ case 'Grading view':
50
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
51
+ break;
52
+ case 'Correct answer view':
53
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
54
+ break;
55
+ default:
56
+ throw new Error('Invalid view');
57
+ }
58
+ });
59
+
60
+ after(() => {
61
+ if (view === 'Question preview') {
62
+ textSelectionPage.steps.clickOnSaveQuestionButton();
63
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
64
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
65
+ }
66
+ if (view === 'Student view') {
67
+ studentViewPage.steps.submitResponse();
68
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
69
+ }
70
+ });
71
+
72
+ it('Question instructions should be visible', () => {
73
+ utilities.verifyInnerText(textSelectionPage.questionInstructionsText(), 'Highlight the correct statements.');
74
+ utilities.verifyElementVisibilityState(textSelectionPage.questionInstructionsText(), 'visible');
75
+ });
76
+
77
+ it('The added text in Question input field should be displayed in the preview tab question', () => {
78
+ paragraphTextArray.forEach((paragraphText, index) => {
79
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPreviewTab(), index), `${paragraphText}`);
80
+ });
81
+ });
82
+
83
+ it('The text which is not available as option should not be interactive in preview tab', () => {
84
+ textSelectionPage.steps.verifyNonOptionTextIsNotInteractiveInPreviewTab(paragraphTextArray[3]);
85
+ });
86
+
87
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
88
+ it('The selected options in specify possible options section should be displayed and by default all options should not be selected', () => {
89
+ for (let index = 0; index < 3; index++) {
90
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), paragraphTextArray[index]);
91
+ utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.optionPreviewTab(), index), 'visible');
92
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[index]);
93
+ };
94
+ utilities.verifyElementCount(textSelectionPage.optionPreviewTab(), 3);
95
+ });
96
+
97
+ it('When user hovers on the available options, then those options should be displayed in hover state highlight', () => {
98
+ for (let index = 0; index < 3; index++) {
99
+ textSelectionPage.steps.verifyHoverStateOfOptionInPreviewTab(paragraphTextArray[index], "blue");
100
+ };
101
+ });
102
+
103
+ it('When user selects an option, then that option should be displayed in selected state', () => {
104
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
105
+ textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[0], "blue");
106
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
107
+ textSelectionPage.steps.verifySelectedStateOptionInPreviewTab(paragraphTextArray[1], "blue");
108
+ });
109
+
110
+ it('When user clicks on a selected option, then that option should be deselected', () => {
111
+ textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
112
+ textSelectionPage.steps.verifyDeselectedStateOptionInPreviewTab(paragraphTextArray[0]);
113
+ });
114
+ } else if (view === 'Grading view') {
115
+ it('The question text should be displayed with the selected correct options and status message \' Your answer is correct\' should be displayed', () => {
116
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
117
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
118
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
119
+ });
120
+
121
+ it('The submitted answer options should not be editable', () => {
122
+ textSelectionPage.steps.clickOnOptionInPreviewTab(paragraphTextArray[0]);
123
+ textSelectionPage.steps.verifyOptionIsSelectedInPreviewTab(paragraphTextArray[0]);
124
+ textSelectionPage.steps.clickOnOptionInPreviewTab(paragraphTextArray[2]);
125
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
126
+ });
127
+ } else {
128
+ it('The question text should be displayed with the selected correct options', () => {
129
+ for (let index = 0; index < 2; index++) {
130
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[index]);
131
+ };
132
+ textSelectionPage.steps.verifyOptionIsNotSelectedInPreviewTab(paragraphTextArray[2]);
133
+ });
134
+ }
135
+ });
136
+ });
137
+ });
@@ -5,7 +5,7 @@ import { dialogBoxBase, multipleSelectionPage, rulerPage } from "../../../pages"
5
5
 
6
6
  const css = Cypress.env('css');
7
7
 
8
- const tools = ['Ruler', 'Protractor', 'Reading ruler'];
8
+ const tools = ['Ruler', 'Protractor', 'Reading ruler', 'Simple calculator', 'Scientific calculator'];
9
9
  const lengthOfRuler = ['15 cm', '30 cm', '40 cm'];
10
10
  const rotationOptions = ['None', 'Allow rotation', 'Allow rotation and display angle'];
11
11
  const unitOfMeasurementOptions = ['Centimeter', 'Inch', 'Pixel', 'Both centimeter and inch', 'Custom image'];
@@ -18,7 +18,7 @@ describe('Create Item page: Tool settings', () => {
18
18
  describe('Tool settings: Contents', () => {
19
19
  abortEarlySetup();
20
20
  before(() => {
21
- multipleSelectionPage.steps.navigateToCreateQuestion('short text response');
21
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
22
22
  });
23
23
 
24
24
  it('By default \'Tool settings\' accordion should be collapsed and by clicking on the \'Tool settings\' accordion, user should be able to expand the accordion', () => {
@@ -87,7 +87,7 @@ describe('Create Item page: Tool settings', () => {
87
87
  describe('Tool settings: Ruler tool popup content', () => {
88
88
  abortEarlySetup();
89
89
  before(() => {
90
- multipleSelectionPage.steps.navigateToCreateQuestion('short text response');
90
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
91
91
  toolSettingsComponent.steps.expandToolSettingsAccordion();
92
92
  });
93
93
 
@@ -230,7 +230,7 @@ describe('Create Item page: Tool settings', () => {
230
230
  describe('Tool settings: Edit tool settings', () => {
231
231
  abortEarlySetup();
232
232
  before(() => {
233
- multipleSelectionPage.steps.navigateToCreateQuestion('short text response');
233
+ multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
234
234
  toolSettingsComponent.steps.expandToolSettingsAccordion();
235
235
  });
236
236
 
@@ -132,7 +132,10 @@
132
132
  "gridCellHiddenStateBorder": "rgb(117, 117, 154)",
133
133
  "gridCellIcon": "rgb(41, 0, 128)",
134
134
  "gridBorder": "rgb(0, 0, 124)",
135
- "uploadedFileName": "rgb(0, 0, 124)"
135
+ "uploadedFileName": "rgb(0, 0, 124)",
136
+ "feedbackHeart": "rgb(255, 56, 0)",
137
+ "manipulativeOptionContainerBorder": "rgb(186, 201, 255)",
138
+ "cellIcon": "rgb(186, 201, 255)"
136
139
  },
137
140
  "fontSize": {
138
141
  "extraSmall": "10px",
@@ -152,48 +155,33 @@
152
155
  "semibold": "600",
153
156
  "bold": "700"
154
157
  },
155
- "highlightColorLibrary": [
156
- {
157
- "title": "aliceBlue",
158
- "background": "rgb(245, 248, 255)",
159
- "border": "rgb(82, 0, 255)",
160
- "hoverBackground": "rgba(245, 248, 255, 0.4)",
161
- "hoverBorder": "rgb(107, 139, 255)"
158
+ "textSelectionColorLibrary": {
159
+ "blue": {
160
+ "background": "rgb(82, 0, 255)",
161
+ "hoverBackground": "rgba(82, 0, 255, 0.2)",
162
+ "hoverBorder": "rgba(82, 0, 255, 0.4)"
162
163
  },
163
- {
164
- "title": "purple",
164
+ "darkGreen":{
165
165
  "background": "rgb(186, 201, 255)",
166
- "border": "rgb(82, 0, 255)",
167
166
  "hoverBackground": "rgba(186, 201, 255, 0.4)",
168
167
  "hoverBorder": "rgb(107, 139, 255)"
169
168
  },
170
- {
171
- "title": "lightBlue",
169
+ "brown":{
172
170
  "background": "rgb(128, 239, 255)",
173
- "border": "rgb(0, 112, 128)",
174
171
  "hoverBackground": "rgba(128, 239, 255, 0.4)",
175
172
  "hoverBorder": "rgb(0, 156, 179)"
176
173
  },
177
- {
178
- "title": "orange",
174
+ "grey":{
179
175
  "background": "rgb(255, 238, 215)",
180
- "border": "rgb(128, 102, 69)",
181
176
  "hoverBackground": "rgba(255, 238, 215, 0.4)",
182
177
  "hoverBorder": "rgb(153, 134, 67)"
183
178
  },
184
- {
179
+ "black":{
185
180
  "title": "yellow",
186
181
  "background": "rgb(255, 238, 78)",
187
182
  "border": "rgb(64, 59, 20)",
188
183
  "hoverBackground": "rgba(255, 238, 78, 0.4)",
189
184
  "hoverBorder": "rgb(153, 141, 32)"
190
- },
191
- {
192
- "title": "grey",
193
- "background": "rgb(220, 223, 230)",
194
- "border": "rgb(61, 62, 64)",
195
- "hoverBackground": "rgba(220, 223, 230, 0.4)",
196
- "hoverBorder": "rgb(122, 124, 128)"
197
185
  }
198
- ]
186
+ }
199
187
  }
@@ -0,0 +1,122 @@
1
+ import { questionInstructionsComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent } from "./components"
2
+
3
+ const selectors = {
4
+ ...questionInstructionsComponent,
5
+ ...commonComponents,
6
+ ...scoringSectionBaseEditTab,
7
+ ...additionalSettingsPanel,
8
+ addManipulativeLabel: () => cy.get('[class*="BrainingcampManipulativestyle__GroupNavigationWrapper"] [class*="BrainingcampManipulativestyle__WrapperSubHeader"]'),
9
+ selectAManipulativeToggleButton: () => cy.get('[data-ngie-testid="select-a-manipulative-toggle-button"]'),
10
+ enterShareCodeToggleButton: () => cy.get('[data-ngie-testid="enter-share-code-toggle-button"]'),
11
+ selectAManipulativeToggleButtonLabel: () => cy.get('.ngie-toggle-button-label').eq(0),
12
+ enterShareCodeToggleButtonLabel: () => cy.get('.ngie-toggle-button-label').eq(1),
13
+ manipulativeOptionToggleButton: (ariaLabel = null) => {
14
+ if (ariaLabel) {
15
+ return cy.get(`[class*="BrainingcampManipulativestyle__ManipulativeCard"][role="button"][aria-label*="${ariaLabel}"]`)
16
+ } else {
17
+ return cy.get('[class*="BrainingcampManipulativestyle__ManipulativeCard"][role="button"]')
18
+ }
19
+ },
20
+ selectAManipulativeLabel: () => cy.get('[class*="SelectManipulativeWrapper"] [class*="BrainingcampManipulativestyle__WrapperSubHeader"]'),
21
+ enterAShareCodeLabel: () => cy.get('[class*="EnterShareCodeWrapper"] [class*="BrainingcampManipulativestyle__WrapperSubHeader"]'),
22
+ enterAShareCodeInputField: () => cy.get('[class*="EnterShareCodeWrapper"] input'),
23
+ previewTabCanvas: () => cy.get('.canvas'),
24
+ }
25
+
26
+ const steps = {
27
+ ...createQuestionBasePage.steps,
28
+ ...questionInstructionsComponent.steps,
29
+ ...scoringSectionBaseEditTab.steps,
30
+ ...commonComponents.steps,
31
+ ...additionalSettingsPanel.steps,
32
+ ...toolSettingsComponent.steps,
33
+
34
+ verifySelectAManipulativeToggleButtonIsSelected: () => {
35
+ brainingCampManipulativePage.selectAManipulativeToggleButton()
36
+ .should('have.attr', 'aria-pressed', 'true');
37
+ },
38
+
39
+ verifySelectAManipulativeToggleButtonIsNotSelected: () => {
40
+ brainingCampManipulativePage.selectAManipulativeToggleButton()
41
+ .should('have.attr', 'aria-pressed', 'false');
42
+ },
43
+
44
+ verifyEnterShareCodeToggleButtonIsSelected: () => {
45
+ brainingCampManipulativePage.enterShareCodeToggleButton()
46
+ .should('have.attr', 'aria-pressed', 'true');
47
+ },
48
+
49
+ verifyEnterShareCodeToggleButtonIsNotSelected: () => {
50
+ brainingCampManipulativePage.enterShareCodeToggleButton()
51
+ .should('have.attr', 'aria-pressed', 'false');
52
+ },
53
+
54
+ /**
55
+ * @description Select a manipulative in edit tab
56
+ * @param {string} manipulativeName Name of the manipulative
57
+ */
58
+ selectAManipulative: (manipulativeName) => {
59
+ brainingCampManipulativePage.manipulativeOptionToggleButton(manipulativeName)
60
+ .click()
61
+ .should('have.attr', 'aria-label', `${manipulativeName} pressed toggle`);
62
+ },
63
+
64
+ /**
65
+ * @description Verify a manipulative is selected
66
+ * @param {string} manipulativeName Name of the manipulative
67
+ */
68
+ verifyAManipulativeOptionIsSelected: (manipulativeName) => {
69
+ brainingCampManipulativePage.manipulativeOptionToggleButton(manipulativeName)
70
+ .should('have.attr', 'aria-label', `${manipulativeName} pressed toggle`);
71
+ },
72
+
73
+ /**
74
+ * @description Verify a manipulative is not selected
75
+ * @param {string} manipulativeName Name of the manipulative
76
+ */
77
+ verifyAManipulativeOptionIsNotSelected: (manipulativeName) => {
78
+ brainingCampManipulativePage.manipulativeOptionToggleButton(manipulativeName)
79
+ .should('have.attr', 'aria-label', `${manipulativeName} not pressed toggle`);
80
+ },
81
+
82
+ selectEnterShareCodeToggleButton: () => {
83
+ brainingCampManipulativePage.enterShareCodeToggleButton()
84
+ .click()
85
+ .should('have.attr', 'aria-pressed', 'true');
86
+ },
87
+
88
+ selectSelectAManipulativeToggleButton: () => {
89
+ brainingCampManipulativePage.selectAManipulativeToggleButton()
90
+ .click()
91
+ .should('have.attr', 'aria-pressed', 'true');
92
+ },
93
+
94
+ focusInAndFocusOutOfEnterAShareCodeInputField: () => {
95
+ brainingCampManipulativePage.enterAShareCodeInputField()
96
+ .click()
97
+ .blur();
98
+ },
99
+
100
+ addShareCodeInEnterAShareCodeInputField: (shareCode) => {
101
+ brainingCampManipulativePage.enterAShareCodeInputField()
102
+ .clear()
103
+ .type(shareCode)
104
+ .blur();
105
+ },
106
+ }
107
+
108
+ const tests = {
109
+ ...createQuestionBasePage.tests,
110
+ ...questionInstructionsComponent.tests,
111
+ ...commonComponents.tests,
112
+ ...scoringSectionBaseEditTab.tests,
113
+ ...additionalSettingsPanel.tests,
114
+ ...additionalSettingsAccessibilitySectionComponent.tests,
115
+ ...toolSettingsComponent.steps,
116
+ }
117
+
118
+ export const brainingCampManipulativePage = {
119
+ ...selectors,
120
+ steps,
121
+ tests
122
+ }
@@ -31,7 +31,7 @@ const selectors = {
31
31
  totalPenaltyPointsInputField: () => cy.get('input[aria-label="total penalty points"]'),
32
32
  specifyPointsForEachIncorrectOptionRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
33
33
  specifyPointsForEachIncorrectOptionRadioButtonLabel: () => cy.get('label[aria-label*="Specify points for each incorrect"]'),
34
- penaltyPointsForEachIncorrectOptionInputField: () => cy.get('input[aria-label="penalty points for each incorrect option"]'),
34
+ penaltyPointsForEachIncorrectOptionInputField: () => cy.get('input[aria-label*="Penalty points for each incorrect"]'),
35
35
  penaltyPointsDetailsSectionInputFieldLabel: () => cy.get('[class*="PenaltyScoreForEachIncorrectstyles__PointsLabel"]'),
36
36
  penaltyPointsDetailsSectionAllottedPointsLabel: () => cy.get('[class*="PenaltyScoreForEachIncorrectstyles__LabelFieldWrapper"]'),
37
37
  roundingLabel: () => cy.get('#rounding-dropdown-label'),
@@ -207,6 +207,9 @@ const tests = {
207
207
  case 'grid fill':
208
208
  helpText = 'You can set the correct answer by selecting the correct cell(s) in the grid.';
209
209
  break;
210
+ case 'number line':
211
+ helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s)';
212
+ break;
210
213
  default:
211
214
  throw new Error('Invalid question type');
212
215
  }
@@ -115,7 +115,7 @@ const tests = {
115
115
  'font-size': css.fontSize.normal,
116
116
  'font-weight': css.fontWeight.regular
117
117
  });
118
- utilities.verifyCSS(autoScoredStudentViewSettings.allowStudentToCheckAnswerCheckbox().parents('[data-ngie-testid="allow-student-to-check-answer-checkbox"]').find('g').eq(1), {
118
+ utilities.verifyCSS(autoScoredStudentViewSettings.allowStudentToCheckAnswerCheckbox().parents('[data-ngie-testid="allow-students-to-check-answer-checkbox"]').find('g').eq(1), {
119
119
  'fill': css.color.activeButtons
120
120
  });
121
121
  utilities.verifyCSS(autoScoredStudentViewSettings.maximumCheckAnswerAttemptsDropdownLabel(), {
@@ -14,8 +14,8 @@ const selectors = {
14
14
  hexLabel: () => cy.get('.hex-settings-wrapper .inline-text-property-label'),
15
15
  hexInputField: () => cy.get('.hex-settings-wrapper input'),
16
16
  setToNoColorButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
17
- cancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
18
- okButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(2),
17
+ cancelButton: () => cy.get('.compact-popup-action-button-wrapper button').contains('Cancel'),
18
+ okButton: () => cy.get('.compact-popup-action-button-wrapper button').contains('OK'),
19
19
  dialogBoxTitle: () => cy.get('#alert-dialog-title'),
20
20
  opacityGradientHue: () => cy.get('.react-colorful__last-control [class="react-colorful__interactive"]'),
21
21
  opacityGradientPicker: () => cy.get('.react-colorful__last-control .react-colorful__pointer-fill'),
@@ -0,0 +1,77 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ const css = Cypress.env('css');
3
+
4
+ const selectors = {
5
+ defaultToolDropdownLabel: () => cy.get('#Default-tool-dropdown-label'),
6
+ defaultToolDropdown: () => cy.get('#Default-tool-select'),
7
+ defaultToolDropdownOptions: (dropdownOption = null) => {
8
+ if (dropdownOption) {
9
+ return cy.get(`[aria-labelledby*="Default-tool"] [role="option"][aria-label*="${dropdownOption}"]`)
10
+ } else {
11
+ return cy.get('[aria-labelledby*="Default-tool"] [role="option"]')
12
+ }
13
+ },
14
+ }
15
+
16
+ const steps = {
17
+ expandDefaultToolDropdown: () => {
18
+ defaultToolDropdown.defaultToolDropdown()
19
+ .click();
20
+ },
21
+
22
+ /**
23
+ * This function selects dropdown option from default tool dropdown
24
+ * @param {string} dropdownOption aria-label of the dropdown option
25
+ */
26
+ selectOptionFromDefaultToolDropdown: (dropdownOption) => {
27
+ defaultToolDropdown.defaultToolDropdownOptions(dropdownOption)
28
+ .eq(0)
29
+ .click();
30
+ },
31
+ }
32
+
33
+ const tests = {
34
+ verifyDefaultToolDropdown:(toolOptionsArray)=>{
35
+ it('\'Default tool\' label and dropdown should be displayed with \'Point\' option selected by default', () => {
36
+ utilities.verifyInnerText(defaultToolDropdown.defaultToolDropdownLabel(), 'Default tool');
37
+ utilities.verifyInnerText(defaultToolDropdown.defaultToolDropdown(), toolOptionsArray[0]);
38
+ });
39
+
40
+ it(`${toolOptionsArray} options should be displayed when the user expands the \'Default tool\' dropdown`, () => {
41
+ defaultToolDropdown.steps.expandDefaultToolDropdown();
42
+ toolOptionsArray.forEach((dropdownOption) => {
43
+ utilities.verifyElementVisibilityState(defaultToolDropdown.defaultToolDropdownOptions(dropdownOption), 'exist');
44
+ });
45
+ utilities.verifyElementCount(defaultToolDropdown.defaultToolDropdownOptions(), toolOptionsArray.length);
46
+ defaultToolDropdown.steps.selectOptionFromDefaultToolDropdown(toolOptionsArray[0]);
47
+ });
48
+
49
+ it('CSS of default tool dropdown', { tags: 'css' }, () => {
50
+ defaultToolDropdown.steps.expandDefaultToolDropdown();
51
+ utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownLabel(), {
52
+ 'color': css.color.labels,
53
+ 'font-size': css.fontSize.normal,
54
+ 'font-weight': css.fontWeight.semibold
55
+ });
56
+ utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions('Point'), {
57
+ 'color': css.color.liText,
58
+ 'background-color': css.color.liTextSelectedBg,
59
+ 'font-size': css.fontSize.default,
60
+ 'font-weight': css.fontWeight.regular
61
+ });
62
+ utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions('Segment'), {
63
+ 'color': css.color.liText,
64
+ 'background-color': css.color.transparent,
65
+ 'font-size': css.fontSize.default,
66
+ 'font-weight': css.fontWeight.regular
67
+ });
68
+ defaultToolDropdown.steps.selectOptionFromDefaultToolDropdown('Point');
69
+ });
70
+ }
71
+ }
72
+
73
+ export const defaultToolDropdown = {
74
+ ...selectors,
75
+ steps,
76
+ tests
77
+ }