itemengine-cypress-automation 1.0.247-06SeptUpdates-b1623d7.0 → 1.0.247

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  3. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +349 -0
  4. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +348 -0
  5. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +415 -0
  6. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingPenaltyScoring.js +54 -0
  7. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightBasic.js +254 -0
  8. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightBasic.js +255 -0
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +4 -0
  10. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -0
  11. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +3 -0
  12. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +2 -0
  15. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +2 -0
  16. package/cypress/e2e/ILC/ImageHighlight/toolsFunctionalityEditTab.js +2 -2
  17. package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSameList.js +270 -0
  18. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsBasic.js +95 -0
  19. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +236 -0
  20. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialEqualWeightsBasic.js +150 -0
  21. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/setPointsPopup.js +88 -0
  22. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/specifyCorrectAnswerSection.js +97 -0
  23. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/studentViewSettings.js +134 -0
  24. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/additionalSettings.js +131 -0
  25. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabBasicSection.js +167 -0
  26. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabScoring.js +202 -0
  27. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/headerSection.js +76 -0
  28. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/manuallyAndNonScoredEditTab.js +72 -0
  29. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/minimumScoringPenaltyPointsAndRoundingDropdown.js +197 -0
  30. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/optionsOrientationSection.js +180 -0
  31. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/specifyCorrectAnswerSection.js +95 -0
  32. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/studentViewSettings.js +130 -0
  33. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
  34. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionsPanel.js +121 -0
  35. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneConnectorStyle.js +68 -0
  36. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionAlignment.js +71 -0
  37. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionPlacement.js +64 -0
  38. package/cypress/e2e/ILC/MatchingDropdown/styleAndLayoutCustomization.js +270 -0
  39. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +7 -7
  40. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +7 -7
  41. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +7 -7
  42. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
  43. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
  44. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
  45. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  46. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
  47. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
  48. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
  49. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +4 -4
  50. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +4 -4
  51. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +272 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +6 -6
  53. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  54. package/cypress/pages/audioPlayerPage.js +4 -4
  55. package/cypress/pages/audioResponsePage.js +9 -1
  56. package/cypress/pages/chartsBarPage.js +3 -3
  57. package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +51 -0
  58. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  59. package/cypress/pages/components/index.js +1 -10
  60. package/cypress/pages/components/listOrderingCommonStyleAndLayoutComponent.js +604 -0
  61. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  62. package/cypress/pages/components/setPointsPopupBase.js +6 -6
  63. package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
  64. package/cypress/pages/essayResponseBasicPage.js +4 -4
  65. package/cypress/pages/essayResponseMathPage.js +4 -4
  66. package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -2
  67. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -2
  68. package/cypress/pages/index.js +0 -1
  69. package/cypress/pages/itemPreviewPage.js +1 -2
  70. package/cypress/pages/itemPreviewSettingsPage.js +3 -3
  71. package/cypress/pages/listOrderingPage.js +384 -10
  72. package/cypress/pages/matchingPage.js +512 -13
  73. package/cypress/pages/multipleSelectionPage.js +2 -2
  74. package/cypress/pages/numberLineLabelPage.js +3 -3
  75. package/cypress/pages/shortTextResponsePage.js +0 -37
  76. package/cypress/pages/singleSelectionPage.js +2 -2
  77. package/cypress/pages/textEntryMathPage.js +41 -9
  78. package/cypress/pages/textSelectionPage.js +2 -2
  79. package/cypress/pages/uploadResponsePage.js +2 -3
  80. package/cypress/pages/videoResponsePage.js +9 -2
  81. package/package.json +1 -1
  82. package/cypress/fixtures/specialAndMathCharacters.js +0 -120
  83. package/cypress/pages/components/autoScoredAdditionalSettings.js +0 -183
  84. package/cypress/pages/components/autoScoredPreviewBase.js +0 -92
  85. package/cypress/pages/components/autoScoredScoringSection.js +0 -199
  86. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +0 -377
  87. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -297
  88. package/cypress/pages/components/autoScoredStudentViewSettingsForPredefinedOptions.js +0 -84
  89. package/cypress/pages/components/listSortingAndOrderingBase.js +0 -401
  90. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +0 -91
  91. package/cypress/pages/components/scoringSectionBase.js +0 -354
  92. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +0 -80
  93. package/cypress/pages/components/specialCharactersFlyoutComponent.js +0 -59
  94. package/cypress/pages/listSortingPage.js +0 -1198
@@ -1,199 +0,0 @@
1
- import { autoScoredPreviewBase } from "./autoScoredPreviewBase";
2
- import { autoScoredSetCorrectAnswerSection } from "./autoScoredSetCorrectAnswerSection";
3
- import { createQuestionBasePage } from "./createQuestionBasePage";
4
- import { scoringSectionBase } from "./scoringSectionBase";
5
- import { commonComponents } from "./commonComponents";
6
- import { previewScoringAndShowCorrectAnswerComponent } from "./previewScoringAndShowCorrectAnswerComponent";
7
- const css = Cypress.env('css');
8
- //Note: deprecated file
9
- const steps = {
10
- correctIncorrectLabelAndBorderExists: (questionType) => {
11
- switch (questionType) {
12
- case 'multiple selection':
13
- return true;
14
- case 'single selection':
15
- return false;
16
- case 'fill in the gaps - text':
17
- return true;
18
- case 'fill in the gaps - dropdown':
19
- return true;
20
- case 'fill in the gaps - drag and drop':
21
- return true;
22
- case 'short text response':
23
- return false;
24
- case 'fill in the gaps - drag and drop':
25
- return true;
26
- case 'list matching':
27
- return true;
28
- case 'list ordering':
29
- return true;
30
- case 'list sorting':
31
- return true;
32
- case 'highlight':
33
- return true;
34
- case 'fill in the gaps over image - text':
35
- return true;
36
- case 'fill in the gaps over image - dropdown':
37
- return true;
38
- default:
39
- throw new Error('Invalid question type');
40
- }
41
- },
42
-
43
- verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer: () => {
44
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
45
- .should('have.css', 'color', css.color.text)
46
- .and('not.have.css', 'background-color', css.color.correctAnswer);
47
- },
48
-
49
- verifyPreviewTabPointsBackgroundForCorrectAnswer: () => {
50
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
51
- .should('have.css', 'color', css.color.whiteText)
52
- .and('have.css', 'background-color', css.color.correctAnswer);
53
- }
54
- }
55
-
56
- const tests = {
57
- verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField: () => {
58
- it('When the user selects \'Auto Scored\' option from the Scoring Type dropdown, then \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed', () => {
59
- scoringSectionBase.pointsLabel()
60
- .verifyInnerText('Points')
61
- .and('be.visible');
62
- scoringSectionBase.pointsInputField()
63
- .should('have.value', '')
64
- .and('be.visible');
65
- scoringSectionBase.steps.expandMinimumScoringDropdown();
66
- scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
67
- scoringSectionBase.minimumScoreIfAttemptedLabel()
68
- .verifyInnerText('Minimum points')
69
- .and('be.visible');
70
- scoringSectionBase.minimumScoreIfAttemptedInputField()
71
- .should('have.value', '')
72
- .and('be.visible');
73
- });
74
-
75
- it('CSS of \'Points\' and \'Minimum score awarded (if attempted)\' labels', { tags: 'css' }, () => {
76
- scoringSectionBase.minimumScoreIfAttemptedLabel()
77
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
78
- scoringSectionBase.pointsLabel()
79
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
80
- });
81
-
82
- it('Accessibility of \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields', { tags: 'a11y' }, () => {
83
- cy.checkAccessibility(scoringSectionBase.minimumScoreIfAttemptedInputField());
84
- cy.checkAccessibility(scoringSectionBase.pointsInputField());
85
- });
86
- },
87
-
88
- verifyEditTabNonScoredScoringSectionContents: () => {
89
- it('When the user selects \'Non Scored\' option from the Scoring Type dropdown, then the \'Set Correct Answer\' section should be displayed and \'Points\' input field should be displayed in disabled state with prefilled \'0\' points and \'Minimum score awarded (if attempted)\' input field should not be displayed', () => {
90
- scoringSectionBase.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
91
- autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel()
92
- .should('be.visible');
93
- autoScoredSetCorrectAnswerSection.correctTab()
94
- .should('be.visible');
95
- scoringSectionBase.pointsLabel()
96
- .should('be.visible')
97
- .verifyInnerText('Points');
98
- scoringSectionBase.pointsInputField()
99
- .should('have.value', '0')
100
- .should('be.disabled');
101
- scoringSectionBase.minimumScoringDropdown()
102
- .should('not.exist');
103
- });
104
-
105
- it('Accessibility of disabled Points field', { tags: 'a11y' }, () => {
106
- cy.checkAccessibility(scoringSectionBase.pointsLabel().parents('.set-correct-answer-points-wrapper'));
107
- });
108
- },
109
-
110
- verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet: () => {
111
- it('When the user has not set correct answer option(s) and alloted points, \'Student view\' radio button should be checked, \'Grading view\' button should not be checked, 0 points should be displayed and no correct or incorrect icons should be displayed in the preview tab', () => {
112
- createQuestionBasePage.steps.switchToPreviewTab();
113
- previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
114
- .should('be.checked');
115
- previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
116
- .should('not.be.checked');
117
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
118
- .should('have.text', '0/0');
119
- autoScoredPreviewBase.correctIcon()
120
- .should('not.exist');
121
- autoScoredPreviewBase.incorrectIcon()
122
- .should('not.exist');
123
- });
124
- },
125
-
126
- verifyCSSAndA11yOfCorrectAnswerIcon: () => {
127
- it('Check CSS of correct answer icon', { tags: 'css' }, () => {
128
- for (let index = 0; index < 2; index++) {
129
- autoScoredPreviewBase.correctIcon()
130
- .verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
131
- };
132
- });
133
-
134
- it('Accessibility of correct answer icon', { tags: 'a11y' }, () => {
135
- cy.checkAccessibility(autoScoredPreviewBase.correctIcon());
136
- });
137
- },
138
-
139
- verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel: (questionType) => {
140
- it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
141
- previewScoringAndShowCorrectAnswerComponent.previewScoreText()
142
- .should('have.css', 'color', css.color.primaryBtn)
143
- .and('have.css', 'background-color', css.color.correctAnswer)
144
- if (steps.correctIncorrectLabelAndBorderExists(questionType)) {
145
- autoScoredPreviewBase.correctIncorrectAnswerLabel()
146
- .verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold)
147
- .parent()
148
- .find('.icon-correct')
149
- .verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
150
- autoScoredPreviewBase.steps.verifyCorrectAttemptBorder();
151
- } else {
152
- autoScoredPreviewBase.correctIncorrectAnswerLabel()
153
- .should('not.exist');
154
- autoScoredPreviewBase.correctIncorrectAnswerBorder()
155
- .should('not.exist');
156
- }
157
- });
158
-
159
- it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
160
- cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
161
- });
162
- },
163
-
164
- verifyCSSAndA11yOfIncorrectAnswerLabel: (questionType) => {
165
- it('CSS of incorrect answer state', { tags: 'css' }, () => {
166
- cy.log('Pre requisite: The user has attempted the question incorrectly')
167
- cy.log('Pre step: Select show answer checkbox')
168
- previewScoringAndShowCorrectAnswerComponent.steps.checkShowCorrectAnswerCheckbox();
169
- cy.log('Verifying CSS of incorrect crossmark icon')
170
- autoScoredPreviewBase.incorrectIcon()
171
- .eq(0)
172
- .verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
173
- if (steps.correctIncorrectLabelAndBorderExists(questionType)) {
174
- autoScoredPreviewBase.correctIncorrectAnswerLabel()
175
- .verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
176
- .parent()
177
- .find('.icon-incorrect')
178
- .verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
179
- autoScoredPreviewBase.steps.verifyIncorrectAttemptBorder();
180
- } else {
181
- autoScoredPreviewBase.correctIncorrectAnswerLabel()
182
- .should('not.exist');
183
- autoScoredPreviewBase.correctIncorrectAnswerBorder()
184
- .should('not.exist');
185
- }
186
- });
187
-
188
- it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
189
- cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
190
- cy.log('Post step: Deselect show answer checkbox')
191
- previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
192
- });
193
- }
194
- }
195
-
196
- export const autoScoredScoringSection = {
197
- tests,
198
- steps
199
- }
@@ -1,377 +0,0 @@
1
- import utilities from "../../support/helpers/utilities";
2
- import { commonComponents } from "./commonComponents";
3
- import { scoringSectionBase } from "./scoringSectionBase";
4
- const css = Cypress.env('css');
5
- //Note: deprecated file
6
- const selectors = {
7
- allOrNothingCheckboxLabel: () => cy.get('label[for*="defaultScoring"]'),
8
- allOrNothingCheckbox: () => cy.get('input[type*="radio"][aria-label="All or Nothing"]'),
9
- partialDifferentWeightsCheckboxLabel: () => cy.get('label[for*="partialScoring"]'),
10
- partialDifferentWeightsCheckbox: () => cy.get('input[type*="radio"][aria-label="Partial - different weights"]'),
11
- partialEqualWeightsCheckbox: () => cy.get('input[type="radio"][aria-label="Partial - equal weights"]'),
12
- partialEqualWeightsCheckboxLabel: () => cy.get('label[for*="partialEqualScoring"]'),
13
- pointsPerResponseLabel: () => cy.get('[class*="PartialPointsPerResponseLabel"]'),
14
- partialEqualWeightsPointsPerResponseScore: () => cy.get('[class*="EqualPoints"]'),
15
- penaltyPointsLabel: () => cy.get('.penalty-points-label'),
16
- penaltyPointsInputField: () => cy.get('.penlty-points-input-field [type="text"]'),
17
- rounddownScoreCheckboxLabel: () => cy.get('#rounding-dropdown-label'),
18
- rounddownScoreCheckbox: () => cy.get('[data-ngie-testid="round-down-score-checkbox"] input'),
19
- roundingLabel: () => cy.get('#rounding-dropdown-label'),
20
- roundingDropdown: () => cy.get('#rounding-select'),
21
- roundingDropdownListOptions: (ariaLabel = null) => {
22
- if (ariaLabel) {
23
- return cy.get(`[aria-labelledby*="rounding-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
24
- } else {
25
- return cy.get('[aria-labelledby*="rounding-dropdown-label"] [role="option"]')
26
- }
27
- },
28
- penaltyScoringLabel: () => cy.get('#penalty-scoring-dropdown-label'),
29
- penaltyScoringDropdown: () => cy.get('#penalty-scoring-select'),
30
- penaltyScoringDropdownListOptions: (ariaLabel = null) => {
31
- if (ariaLabel) {
32
- return cy.get(`[aria-labelledby*="penalty-scoring-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
33
- } else {
34
- return cy.get('[aria-labelledby*="penalty-scoring-dropdown-label"] [role="option"]')
35
- }
36
- },
37
- minimumPointsLabel: () => cy.get('.min-score-points-label'),
38
- minimumPointsInputField: () => cy.get('.min-score-points-input-field input'),
39
- roundNegativeScoresToZeroCheckboxLabel: () => cy.get('[data-ngie-testid="round-negative-scores-to-zero-checkbox"]'),
40
- roundNegativeScoresToZeroCheckbox: () => cy.get('[data-ngie-testid="round-negative-scores-to-zero-checkbox"] input'),
41
- }
42
-
43
- const steps = {
44
- //V3 - This function should be updated in all files
45
- selectAllOrNothingCheckbox: () => {
46
- autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox()
47
- .click()
48
- .should('be.checked');
49
- },
50
-
51
- //V3 - This function should be updated in all files
52
- selectPartialEqualWeightsCheckbox: () => {
53
- autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox()
54
- .click()
55
- .should('be.checked');
56
- },
57
-
58
- //V3 - This function should be updated in all files
59
- selectPartialDifferentWeightsCheckbox: () => {
60
- autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckbox()
61
- .click()
62
- .should('be.checked');
63
- },
64
-
65
- //V3 - This function should be updated in all files
66
- verifyDefaultPenaltyPointsInputFieldAndLabel: () => {
67
- autoScoredScoringSectionMultipleResponsesType.steps.expandPenaltyScoringDropdown();
68
- autoScoredScoringSectionMultipleResponsesType.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
69
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel()
70
- .verifyInnerText('Penalty points')
71
- .should('be.visible');
72
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
73
- .should('have.value', '')
74
- .and('be.visible');
75
- },
76
-
77
- //V3 - This function should be updated in all files
78
- verifyDefaultRoundDownScoreCheckboxCheckedAndLabel: () => {
79
- autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
80
- .verifyInnerText('Rounding')
81
- .and('be.visible');
82
- autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
83
- .verifyInnerText('None');
84
- },
85
-
86
- expandRoundingDropdown: () => {
87
- autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
88
- .click();
89
- },
90
-
91
- /**
92
- * @param {("none" | "round down if <= 0.99" | "round down if <= 0.50"|"round down if <= 0.50; Round up if > 0.50")} dropdownOption aria-label of dropdown options
93
- * @description this function selects dropdown option from rounding dropdown
94
- */
95
- selectOptionFromRoundingDropdownOption: (dropdownOption) => {
96
- autoScoredScoringSectionMultipleResponsesType.roundingDropdownListOptions(dropdownOption)
97
- .click();
98
- },
99
-
100
- expandPenaltyScoringDropdown: () => {
101
- autoScoredScoringSectionMultipleResponsesType.penaltyScoringDropdown()
102
- .click();
103
- },
104
-
105
- /**
106
- * @param {("No penalty points" | "Penalty points for the entire question" | "Penalty points for each incorrect option")} dropdownOption aria-label of dropdown options
107
- * @description this function selects dropdown option from penalty points dropdown
108
- */
109
- selectOptionFromPenaltyScoringDropdown: (dropdownOption) => {
110
- autoScoredScoringSectionMultipleResponsesType.penaltyScoringDropdownListOptions(dropdownOption)
111
- .click();
112
- },
113
-
114
- //V3 - This function should be updated in all files
115
- allotPenaltyPoints: (points) => {
116
- autoScoredScoringSectionMultipleResponsesType.steps.expandPenaltyScoringDropdown();
117
- autoScoredScoringSectionMultipleResponsesType.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
118
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
119
- .clear()
120
- .type(points)
121
- .should('have.value', points);
122
- },
123
-
124
- //V3 - This function should be updated in all files
125
- clearPenaltyPoints: () => {
126
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
127
- .clear()
128
- .should('have.value', '');
129
- },
130
-
131
- //V3 - This function should be updated in all files
132
- uncheckRoundDownScoreCheckbox: () => {
133
- autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckbox()
134
- .click()
135
- .should('not.be.checked');
136
- },
137
-
138
- //V3 - This function should be updated in all files
139
- addPartialDifferentWeightsPoints: (responsePointsArray) => {
140
- responsePointsArray.forEach((points, count) => {
141
- scoringSectionBase.pointsInputField()
142
- .eq(count)
143
- .clear()
144
- .type(points, { delay: 500 })
145
- .blur()
146
- .should('have.value', points);
147
- });
148
- },
149
-
150
- //V3 - This function should be updated in all files
151
- /**
152
- * @param {number} points points displayed in partial equal weights points per response
153
- * @description Verify points displayed in partial equal weights points per response
154
- */
155
- verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
156
- autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsPointsPerResponseScore()
157
- .each(($element) => {
158
- cy.wrap($element)
159
- .verifyInnerText(`${points}`);
160
- });
161
- },
162
-
163
- //V3 - This function should be updated in all files
164
- verifyPointsPerResponseLabel: () => {
165
- autoScoredScoringSectionMultipleResponsesType.pointsPerResponseLabel()
166
- .verifyInnerText('Points per response')
167
- .should('be.visible');
168
- },
169
-
170
- //V3 - This function should be updated in all files
171
- verifyPartialDifferentWeightsPointsInputFieldIsEmpty: () => {
172
- scoringSectionBase.pointsInputField()
173
- .each(($element) => {
174
- cy.wrap($element)
175
- .should('have.value', '')
176
- .and('exist');
177
- });
178
- },
179
-
180
- //V3 - This function should be updated in all files
181
- verifyPartialDifferentWeightsPointsInputFieldIsDisabled: () => {
182
- scoringSectionBase.pointsInputField()
183
- .each(($element) => {
184
- cy.wrap($element)
185
- .should('be.disabled');
186
- });
187
- },
188
-
189
- //V3 - This function should be updated in all files
190
- verifyPartialDifferentWeightsPointsInputFieldIsEnabled: (index) => {
191
- scoringSectionBase.pointsInputField()
192
- .eq(index)
193
- .should('not.be.disabled');
194
- },
195
-
196
- //V3 - This function should be updated in all files
197
- verifyCheckedStateOfRoundDownScoreCheckbox: () => {
198
- autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckbox()
199
- .should('be.checked');
200
- },
201
-
202
- //V3 - This function should be updated in all files
203
- verifyPartialDifferentWeightsPointsInputFieldValue: (pointsFieldArray) => {
204
- pointsFieldArray.forEach((points, count) => {
205
- scoringSectionBase.pointsInputField()
206
- .eq(count)
207
- .should('have.value', points);
208
- });
209
- },
210
-
211
- verifyAllOrNothingRadioButtonIsChecked: () => {
212
- autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox()
213
- .should('be.checked');
214
- },
215
-
216
- verifyPartialEqualWeightsRadioButtonIsUnchecked: () => {
217
- autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox()
218
- .should('not.be.checked');
219
- },
220
-
221
- verifyPartialDifferentWeightsRadioButtonIsUnchecked: () => {
222
- autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckbox()
223
- .should('not.be.checked');
224
- },
225
-
226
- allotMinimumPoints: (points) => {
227
- autoScoredScoringSectionMultipleResponsesType.minimumPointsInputField()
228
- .clear()
229
- .type(points)
230
- .should('have.value', points);
231
- },
232
-
233
- focusInAndOutOfMinimumPointsInputField: () => {
234
- autoScoredScoringSectionMultipleResponsesType.minimumPointsInputField()
235
- .click()
236
- .blur();
237
- },
238
-
239
- clearMinimumPointsInputField: () => {
240
- autoScoredScoringSectionMultipleResponsesType.minimumPointsInputField()
241
- .clear()
242
- .should('have.value', '');
243
- },
244
-
245
- verifyDefaultRoundingNegativeScoresToZeroCheckboxCheckedAndLabel: () => {
246
- utilities.verifyInnerText(autoScoredScoringSectionMultipleResponsesType.roundNegativeScoresToZeroCheckboxLabel(), 'Round negative scores to zero')
247
- utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.roundNegativeScoresToZeroCheckboxLabel(), 'visible')
248
- autoScoredScoringSectionMultipleResponsesType.roundNegativeScoresToZeroCheckbox()
249
- .should('be.checked');
250
- },
251
- }
252
-
253
- const tests = {
254
- verifyAutoScoredScoringTypeSectionWithCSSAnda11y: () => {
255
- it('\'All or nothing\', \'Partial - equal weights\' and \'Partial - different weights\' labels and radio buttons should be displayed and by default \'All or nothing\' radio button should be selected', () => {
256
- utilities.verifyInnerText(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckboxLabel(), 'All or nothing');
257
- utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckboxLabel(), 'visible');
258
- autoScoredScoringSectionMultipleResponsesType.steps.verifyAllOrNothingRadioButtonIsChecked();
259
- utilities.verifyInnerText(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckboxLabel(), 'Partial - equal weights');
260
- utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckboxLabel(), 'visible');
261
- autoScoredScoringSectionMultipleResponsesType.steps.verifyPartialEqualWeightsRadioButtonIsUnchecked();
262
- utilities.verifyInnerText(autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckboxLabel(), 'Partial - different weights');
263
- utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckboxLabel(), 'visible');
264
- autoScoredScoringSectionMultipleResponsesType.steps.verifyPartialDifferentWeightsRadioButtonIsUnchecked();
265
- });
266
-
267
- it('CSS of Scoring section', { tags: 'css' }, () => {
268
- utilities.verifyCSS(scoringSectionBase.scoringLabel(), {
269
- 'color': css.color.sectionHeading,
270
- 'font-size': css.fontSize.default,
271
- 'font-weight': css.fontWeight.semibold
272
- });
273
- utilities.verifyCSS(scoringSectionBase.scoringTypeLabel(), {
274
- 'color': css.color.labels,
275
- 'font-size': css.fontSize.normal,
276
- 'font-weight': css.fontWeight.semibold
277
- });
278
- utilities.verifyCSS(scoringSectionBase.scoringTypeDropdown().find('.dropdown-label-text'), {
279
- 'color': css.color.liText,
280
- 'font-size': css.fontSize.default,
281
- 'font-weight': css.fontWeight.regular
282
- });
283
- utilities.verifyCSS(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckboxLabel(), {
284
- 'color': css.color.labelText,
285
- 'font-size': css.fontSize.normal,
286
- 'font-weight': css.fontWeight.regular
287
- });
288
- utilities.verifyCSS(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckboxLabel(), {
289
- 'color': css.color.labelText,
290
- 'font-size': css.fontSize.normal,
291
- 'font-weight': css.fontWeight.regular
292
- });
293
- utilities.verifyCSS(autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckboxLabel(), {
294
- 'color': css.color.labelText,
295
- 'font-size': css.fontSize.normal,
296
- 'font-weight': css.fontWeight.regular
297
- });
298
- });
299
-
300
- it('Accessibility of Scoring Section', { tags: 'a11y' }, () => {
301
- cy.checkAccessibility(scoringSectionBase.scoringTypeDropdown());
302
- cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox().parents('.ngie-radio-group-wrapper'));
303
- });
304
- },
305
-
306
- //V3- need to update this for all files
307
- verifyPenaltyPointsInputField: () => {
308
- it('User should be able to enter points in \'Penalty Points\' input field', () => {
309
- autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(2);
310
- });
311
-
312
- it('CSS of \'Penalty Points\' label and input field', { tags: 'css' }, () => {
313
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel()
314
- .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
315
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
316
- .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
317
- });
318
-
319
- it('Accessibility of \'Penalty Points\' label and input field', { tags: 'a11y' }, () => {
320
- cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel().parents('.points-container'));
321
- });
322
- },
323
-
324
- //V3- need to update this for all files
325
- verifyPenaltyPointsErroredState: (allocatedPoints, penaltyPoints) => {
326
- it('When the user focuses in and out of the empty \'Penalty points\' input field, any validation text should not be displayed', () => {
327
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
328
- .click()
329
- .blur();
330
- commonComponents.errorMessage()
331
- .should('not.exist');
332
- });
333
-
334
- it(`If the user enters points more than the allocated points in \'Penalty points\' input field, an error message \'Error: Penalty points cannot be greater than allocated points: ${allocatedPoints}\' should be displayed`, () => {
335
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
336
- .clear()
337
- .type(penaltyPoints)
338
- .should('have.value', penaltyPoints)
339
- .blur();
340
- commonComponents.errorMessage()
341
- .verifyInnerText(`Error: Penalty points cannot be greater than allocated points:${allocatedPoints}`);
342
- });
343
-
344
- it('The error message should disappear once the user removes the entered points from the \'Penalty points\' input field', () => {
345
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
346
- .clear()
347
- .blur();
348
- commonComponents.errorMessage()
349
- .should('not.exist');
350
- });
351
- },
352
-
353
- //V3- need to update this for all files
354
- verifyCSSandA11yOfRoundDownScoreCheckboxInCheckedState: () => {
355
- it('CSS of \'Round down score\' checkbox - checked state', { tags: 'css' }, () => {
356
- autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
357
- .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
358
- utilities.verifyCSS(autoScoredScoringSectionMultipleResponsesType.roundingDropdown(), {
359
- 'color': css.color.liText,
360
- 'font-size': css.fontSize.default,
361
- 'font-weight': css.fontWeight.regular,
362
- 'border': `1px solid ${css.color.defaultDropdownBorder}`
363
- })
364
- });
365
-
366
- it('Accessibility of \'Round down score\' checkbox - checked state', { tags: 'a11y' }, () => {
367
- cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.roundingDropdown());
368
- });
369
- },
370
- }
371
-
372
-
373
- export const autoScoredScoringSectionMultipleResponsesType = {
374
- ...selectors,
375
- steps,
376
- tests
377
- }