itemengine-cypress-automation 1.0.113 → 1.0.115

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  43. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  44. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  45. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  46. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -3
  47. package/cypress/pages/essayResponseBasicPage.js +1 -26
  48. package/cypress/pages/essayResponsePage.js +21 -284
  49. package/cypress/pages/shortTextResponsePage.js +142 -103
  50. package/cypress/pages/textEntryMathPage.js +58 -7
  51. package/package.json +1 -1
  52. package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,121 @@
1
+ import { fillInTheGapsOverImageDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+
5
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
6
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
7
+ const correctAnswerArray = ['Flower', 'Leaf'];
8
+ const incorrectAnswerArray = ['Branch', 'Seed'];
9
+
10
+ describe('Create Item page - Fill in the gaps over image with dropdown: Manually and non scored', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ describe('Question Preview: Manually Scored', () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ cy.log('Navigate to fill in the gaps over image - dropdown question type');
19
+ fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
20
+ cy.barsPreLoaderWait();
21
+ fillInTheGapsOverImageDropdownPage.steps.addTextInQuestionInstructionsInputField('fill in the gaps');
22
+ fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
23
+ fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
24
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
25
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
26
+ fillInTheGapsOverImageDropdownPage.steps.expandScoringTypeDropdown();
27
+ fillInTheGapsOverImageDropdownPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
28
+ fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
29
+ });
30
+
31
+ it('In Preview tab, question instructions, uploaded image and dropdowns should be displayed in the preview tab', () => {
32
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionInstructionsTextPreviewTab('fill in the gaps');
33
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab(), 'visible');
34
+ utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), 3);
35
+ fillInTheGapsOverImageDropdownPage.steps.verifyTextInDropdownsInPreviewTab([{ dropdownIndex: 0, dropdownText: '​' }, { dropdownIndex: 1, dropdownText: '​' }]);
36
+ });
37
+
38
+ fillInTheGapsOverImageDropdownPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored');
39
+ });
40
+
41
+ describe('Question Preview: Non Scored', () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ cy.log('Navigate to fill in the gaps over image - dropdown question type');
45
+ fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
46
+ cy.barsPreLoaderWait();
47
+ fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
48
+ fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
49
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
50
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
51
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
52
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
53
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
54
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
55
+ fillInTheGapsOverImageDropdownPage.steps.expandScoringTypeDropdown();
56
+ fillInTheGapsOverImageDropdownPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
57
+ fillInTheGapsOverImageDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
58
+ fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
59
+ });
60
+
61
+ fillInTheGapsOverImageDropdownPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
62
+
63
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and the correct answer section should be displayed with correct answers', () => {
64
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
65
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
66
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
67
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
68
+ fillInTheGapsOverImageDropdownPage.steps.switchToStudentView();
69
+ });
70
+
71
+ it('When the user attempts the question incorrectly and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect dropdowns, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
72
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
73
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
74
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
75
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
76
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
77
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
78
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ cy.log('When user clicks on Check answer button after he attempts the question incorrectly incorrect icons should be displayed besides all incorrect dropdowns, status message \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
80
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
81
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
82
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
83
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
84
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
85
+ });
86
+
87
+ it('When the user attempts the question partially correct, then on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed besides incorrect dropdown, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
88
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
89
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
90
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
91
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
92
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
93
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
94
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
95
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
96
+ cy.log('When user clicks on Check answer button after he attempts the question partially correct, correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed besides incorrect dropdown, status message \'Your answer is incorrect\' should be displayed and correct answer section should not be displayed')
97
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
98
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
99
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
100
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
101
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
102
+ });
103
+
104
+ it('When user attempts the question correctly, on switching to \'Grading\' view, then correct icons should be displayed beside all the correct dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
105
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
106
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
107
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
108
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
109
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
110
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
111
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
112
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
113
+ cy.log('When user clicks on Check answer button after he attempts the question correctly, then correct icon should be displayed besides the correct dropdowns, status message \'Your answer is correct\' should be displayed and correct answer section should not be displayed')
114
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
115
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
116
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
117
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
118
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
119
+ });
120
+ });
121
+ });
@@ -0,0 +1,236 @@
1
+ import { fillInTheGapsOverImageDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
5
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
6
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
7
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
8
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
9
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
10
+
11
+ describe('Create item page - Fill in the gaps over image with dropdown: Partial different weights', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Question preview: Auto scored - Partial different weights - When \'Alternative answer\' points are more than \'Correct answer\' points', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ cy.log('Navigate to fill in the gaps over image - dropdown question type');
20
+ fillInTheGapsOverImageDropdownPage.steps.navigateToCreateQuestion('fill in the gaps over image - dropdown');
21
+ cy.barsPreLoaderWait();
22
+ fillInTheGapsOverImageDropdownPage.steps.uploadFile('highlightImage.jpg');
23
+ fillInTheGapsOverImageDropdownPage.steps.verifyImageIsUploaded();
24
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(10);
25
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(40);
26
+ fillInTheGapsOverImageDropdownPage.steps.insertResponseArea(80);
27
+ fillInTheGapsOverImageDropdownPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
28
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
29
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
30
+ fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
31
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
32
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
33
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
34
+ fillInTheGapsOverImageDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 7, 1: 1, 2: 5 });
35
+ fillInTheGapsOverImageDropdownPage.steps.addAlternativeAnswerAccordion(1);
36
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
37
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
38
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
39
+ fillInTheGapsOverImageDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 6, 1: 4, 2: 5 });
40
+ fillInTheGapsOverImageDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
41
+ fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
42
+ });
43
+
44
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective dropdown numeration', () => {
45
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
46
+ fillInTheGapsOverImageDropdownPage.steps.verifyDropdownNumerationPreviewTab();
47
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
48
+ });
49
+
50
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, status message and correct answer section should not be displayed', () => {
51
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
52
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
53
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(13, 15);
54
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
55
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
56
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
57
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
58
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
59
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
60
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
61
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, status message and correct answer section should not be displayed')
62
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
63
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
64
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
65
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
66
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
67
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
68
+ });
69
+
70
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, status message and correct answer section should not be displayed', () => {
71
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
72
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
73
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(15, 15);
74
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
75
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
76
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
77
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
78
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
79
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
80
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
81
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, status message and correct answer section should not be displayed')
82
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
83
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
84
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
85
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
86
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
87
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ });
89
+
90
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded with points of the correctly attempted responses according to the correct accordion and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
91
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
92
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
93
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(8, 15);
94
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
95
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
96
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
97
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
98
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
99
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
100
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, status message and correct answer section should not be displayed')
102
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
103
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
104
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(1);
105
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
106
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
107
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
108
+ });
109
+
110
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded with points of the correctly attempted responses from the alternative accordion and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
111
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
112
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
113
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(6, 15);
114
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
115
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
116
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
117
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
118
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
119
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
120
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
121
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
122
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
123
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
124
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
125
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
126
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
127
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
128
+ });
129
+
130
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the alternative accordion as points from the alternative accordion are more than the correct accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides dropdown with alternative answer responses, incorrect icon should be displayed beside dropdown with correct accordion responses as score achieved from the alternative responses is more than correct responses, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
131
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
132
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
133
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(6, 15);
134
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
135
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
136
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
137
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
138
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
139
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
140
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
141
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the dropdown with alternative answer responses, incorrect icon should be displayed beside dropdown with correct accordion response, status message and correct answer section should not be displayed')
142
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
143
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
144
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
145
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
146
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
147
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
148
+ });
149
+
150
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correct accordion as points from the correct accordion are more than the alternative accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides the correct dropdowns, incorrect icon should be displayed beside dropdown with alternative accordion response as points achieved from the correct accordion is more, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
151
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
152
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
153
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(7, 15);
154
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
155
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
156
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
157
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
158
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
159
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
160
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
161
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon icon should be displayed besides the correct dropdowns, incorrect icon should be displayed beside dropdown with alternative accordion response, status message and correct answer section should not be displayed')
162
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
163
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(0);
164
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
165
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
166
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
167
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
168
+ });
169
+
170
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with with points of the correctly attempted responses from the tab that has more points alloted for the response and on switching to \'Grading\' view, correct icon icon should be besides the common response, no icons should be displayed beside unattempted dropdowns, status message should not be displayed and correct answer section with all correct answers from the alternate accordion along with dropdown numeration should be displayed', () => {
171
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
172
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
173
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(5, 15);
174
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
175
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
176
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
177
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
178
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
179
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
180
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
181
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdown, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
182
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
183
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
184
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
185
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
186
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
187
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
188
+ });
189
+
190
+ it('When the user attempts the question incorrectly, then the user should be awarded with 0 points and on switching to \'Grading\' view, incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, status message should not be displayed and correct answer section with all alternative answers along with dropdown numeration should be displayed', () => {
191
+ fillInTheGapsOverImageDropdownPage.steps.resetQuestionPreview();
192
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
193
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(0, 15);
194
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
195
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
196
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
197
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
198
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
199
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
200
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
201
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
202
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
203
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
204
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
205
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
206
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
207
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
208
+ });
209
+
210
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the correct accordion than the alternative accordion but the score of the individual response selected from the alternative accordion overpowers the combined score of the correct accordion answers then on switching to the \'Grading view\', then points awarded should be of the alternative accordion, correct icon icons should be displayed besides alternative accordion responses, incorrect icon should be displayed besides correct accordion responses, correct/incorrect answer status message should not be displayed and correct answer section with all correct answers from the alternative accordion along with dropdown numeration should be displayed', () => {
211
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and the points per response are in decimal')
212
+ fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
213
+ fillInTheGapsOverImageDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 10.4, 1: 1.2, 2: 11.4 });
214
+ fillInTheGapsOverImageDropdownPage.steps.expandCorrectAnswerAccordion();
215
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, optionsForDropdown3[3]);
216
+ fillInTheGapsOverImageDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 1.2, 1: 2.2, 2: 1.6 });
217
+ fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
218
+ fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
219
+ fillInTheGapsOverImageDropdownPage.steps.verifyPreviewScore(11.4, 23);
220
+ fillInTheGapsOverImageDropdownPage.steps.switchToGradingView();
221
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
222
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
223
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
224
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
225
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
226
+ fillInTheGapsOverImageDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
227
+ cy.log('When the user attempts the question with more number of correct responses from the correct accordion than the alternative accordion but the score of the individual response selected from the alternative accordion overpowers the combined score of the correct accordion answers and clicks on the \'Check answer\' button, correct icon icons should be displayed beside the correct dropdowns from the correct accordion, incorrect icons should be displayed beside the incorrectly answered dropdowns, correct/incorrect answer status message, correct answer container should not be displayed')
228
+ fillInTheGapsOverImageDropdownPage.steps.checkAnswer();
229
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(0);
230
+ fillInTheGapsOverImageDropdownPage.steps.verifyIncorrectOptionIcon(1);
231
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectOptionIcon(2);
232
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
233
+ fillInTheGapsOverImageDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
234
+ });
235
+ });
236
+ });