itemengine-cypress-automation 1.0.68 → 1.0.69
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/fixtures/theme/ilc.json +2 -1
- package/cypress/pages/audioPlayerPage.js +2 -2
- package/cypress/pages/components/additionalSettingsPanel.js +46 -14
- package/cypress/pages/components/autoScoredAdditionalSettings.js +6 -6
- package/cypress/pages/components/autoScoredPreviewBase.js +6 -8
- package/cypress/pages/components/autoScoredScoringSection.js +22 -18
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +60 -9
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -7
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/draggableOptionsContainer.js +2 -1
- package/cypress/pages/components/equationEditorFlyout.js +2 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +10 -4
- package/cypress/pages/components/figOverImageCommonComponent.js +2 -1
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +34 -14
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +7 -7
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/mcqAdditionalSettingsBase.js +10 -0
- package/cypress/pages/components/mcqQuestionCommonComponents.js +1 -1
- package/cypress/pages/components/mcqScoringComponent.js +1 -1
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +20 -18
- package/cypress/pages/components/questionInstructionsComponent.js +1 -1
- package/cypress/pages/components/scoringSectionBase.js +30 -1
- package/cypress/pages/components/setPointsPopupBase.js +2 -1
- package/cypress/pages/components/uploadImageSectionComponent.js +8 -8
- package/cypress/pages/createItemPage.js +83 -1
- package/cypress/pages/dialogBoxBase.js +3 -7
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +5 -4
- package/cypress/pages/essayResponsePage.js +1 -0
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -0
- package/cypress/pages/fillInTheGapsScoring.js +215 -317
- package/cypress/pages/highlightImagePage.js +6 -4
- package/cypress/pages/highlightPage.js +1 -2
- package/cypress/pages/index.js +4 -0
- package/cypress/pages/listMatchingPage.js +5 -4
- package/cypress/pages/listMatchingScoring.js +274 -272
- package/cypress/pages/listOrderingPage.js +23 -14
- package/cypress/pages/listSortingPage.js +7 -9
- package/cypress/pages/multipleSelectionPage.js +2 -1
- package/cypress/pages/shortTextResponsePage.js +9 -0
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/uploadResponsePage.js +296 -15
- package/cypress/pages/videoResponsePage.js +5 -6
- package/package.json +1 -1
@@ -84,7 +84,8 @@
|
|
84
84
|
"incorrectAnswerHighlightRegion": "rgba(209, 51, 51, 0.4)",
|
85
85
|
"fileUploadProgressBarFill": "rgb(74, 147, 224)",
|
86
86
|
"responseContainerPointer": "rgba(0, 0, 46, 0.4)",
|
87
|
-
"activeHighlightBorder": "rgb(41, 0, 128)"
|
87
|
+
"activeHighlightBorder": "rgb(41, 0, 128)",
|
88
|
+
"hoverHighlightBorder": "rgb(66, 0, 204)"
|
88
89
|
},
|
89
90
|
"fontSize": {
|
90
91
|
"extraSmall": "10px",
|
@@ -34,10 +34,10 @@ const selectors = {
|
|
34
34
|
customizeUIControlAccordion: () => cy.get('.ngie-accordion-summary[role="button"]').eq(0),
|
35
35
|
advancedPlayerSettingsAccordion: () => cy.get('.ngie-accordion-summary[role="button"]').eq(1),
|
36
36
|
customizeControlPlayButton: () => cy.get('[data-ngie-testid="play-toggle-button"]'),
|
37
|
-
customizeControlButtonLabel: () => cy.get('
|
37
|
+
customizeControlButtonLabel: () => cy.get('[data-ngie-testid="play-toggle-button"]').find('.ngie-toggle-button-label'),
|
38
38
|
customizeControlPauseButton: () => cy.get('[data-ngie-testid="pause-toggle-button"]'),
|
39
39
|
customizeControlSeekButton: () => cy.get('[data-ngie-testid="seek-toggle-button"]'),
|
40
|
-
advancedPlayerButtonLabel: () => cy.get('
|
40
|
+
advancedPlayerButtonLabel: () => cy.get('[data-ngie-testid="timer-toggle-button"]').find('.ngie-toggle-button-label'),
|
41
41
|
advancedPlayerTimerButton: () => cy.get('[data-ngie-testid="timer-toggle-button"]'),
|
42
42
|
advancedPlayerProgressBarButton: () => cy.get('[data-ngie-testid="progress-bar-toggle-button"]'),
|
43
43
|
advancedPlayerVolumeControlButton: () => cy.get('[data-ngie-testid="volume-control-toggle-button"]'),
|
@@ -11,11 +11,13 @@ const selectors = {
|
|
11
11
|
additionalSettingsAcknowledgementsLabel: () => cy.get('.additional-settings-detail-wrapper .additional-settings-label').eq(2),
|
12
12
|
additionalSettingsTeacherGuidelinesInputField: () => cy.get('[title="Teacher Scoring Guidelines"]'),
|
13
13
|
additionalSettingsSampleAnswerInputField: () => cy.get('[title="Sample Answer"]'),
|
14
|
-
additionalSettingsAcknowledgementsInputField: () => cy.get('[title="
|
14
|
+
additionalSettingsAcknowledgementsInputField: () => cy.get('[title="acknowledgements & reference"]'),
|
15
15
|
//Font-size dropdown
|
16
16
|
fontSizeLabel: () => cy.get('#Font-Size-dropdown-label'),
|
17
17
|
fontSizeDropdown: () => cy.get('#Font-Size-select'),
|
18
|
-
fontSizeListOptions: (optionIndex) => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"]').eq(optionIndex)
|
18
|
+
fontSizeListOptions: (optionIndex) => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"]').eq(optionIndex),
|
19
|
+
fontSizeListOptionLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"] .dropdown-label-text'),
|
20
|
+
fontSizesLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label Font-Size-placeholder"] li[role="option"] .dropdown-post-label-text'),
|
19
21
|
}
|
20
22
|
|
21
23
|
const steps = {
|
@@ -31,6 +33,33 @@ const steps = {
|
|
31
33
|
.click();
|
32
34
|
additionalSettingsPanel.fontSizeListOptions(dropdownOptionIndex)
|
33
35
|
.click();
|
36
|
+
},
|
37
|
+
|
38
|
+
enterTextInTeacherGuidelinesInputField: (teacherGuidelinesText) => {
|
39
|
+
additionalSettingsPanel.additionalSettingsTeacherGuidelinesInputField()
|
40
|
+
.click()
|
41
|
+
.type(teacherGuidelinesText)
|
42
|
+
.blur();
|
43
|
+
additionalSettingsPanel.additionalSettingsTeacherGuidelinesInputField()
|
44
|
+
.should('have.text', teacherGuidelinesText);
|
45
|
+
},
|
46
|
+
|
47
|
+
enterTextInSampleAnswerInputField: (sampleAnswer) => {
|
48
|
+
additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
|
49
|
+
.click()
|
50
|
+
.type(sampleAnswer)
|
51
|
+
.blur();
|
52
|
+
additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
|
53
|
+
.should('have.text', sampleAnswer);
|
54
|
+
},
|
55
|
+
|
56
|
+
enterTextInAcknowledgementsInputField: (acknowledgements) => {
|
57
|
+
additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
|
58
|
+
.click()
|
59
|
+
.type(acknowledgements)
|
60
|
+
.blur();
|
61
|
+
additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
|
62
|
+
.should('have.text', acknowledgements);
|
34
63
|
}
|
35
64
|
}
|
36
65
|
|
@@ -62,7 +91,7 @@ const tests = {
|
|
62
91
|
.should('have.text', 'Teacher scoring guidelines');
|
63
92
|
});
|
64
93
|
|
65
|
-
it('\'Sample
|
94
|
+
it('\'Sample answer\' label and input field should be displayed and user should be able to enter \'Sample answer\'', () => {
|
66
95
|
additionalSettingsPanel.additionalSettingsSampleAnswerLabel()
|
67
96
|
.verifyInnerText('Sample answer');
|
68
97
|
additionalSettingsPanel.additionalSettingsSampleAnswerInputField()
|
@@ -70,9 +99,9 @@ const tests = {
|
|
70
99
|
.should('have.text', 'Sample Answer');
|
71
100
|
});
|
72
101
|
|
73
|
-
it('\'Acknowledgements\' label and input field should be displayed and user should be able to enter \'Acknowledgements\'', () => {
|
102
|
+
it('\'Acknowledgements & reference\' label and input field should be displayed and user should be able to enter \'Acknowledgements\'', () => {
|
74
103
|
additionalSettingsPanel.additionalSettingsAcknowledgementsLabel()
|
75
|
-
.
|
104
|
+
.verifyInnerText('Acknowledgements & reference');
|
76
105
|
additionalSettingsPanel.additionalSettingsAcknowledgementsInputField()
|
77
106
|
.type('Acknowledgements')
|
78
107
|
.should('have.text', 'Acknowledgements');
|
@@ -110,9 +139,8 @@ const tests = {
|
|
110
139
|
},
|
111
140
|
|
112
141
|
verifyFontSizeSectionContents: () => {
|
113
|
-
const
|
114
|
-
|
115
|
-
it('CSS of \'Font Size\' dropdown', { tags: 'css' }, () => {
|
142
|
+
const fontSizes = { 'Tiny': '12 px', 'Small': '14 px', 'Default': '16 px', 'Normal': '18 px', 'Big': '22 px', 'Huge': '26 px' };
|
143
|
+
it('CSS of \'Font Size\' dropdown - default state', { tags: 'css' }, () => {
|
116
144
|
additionalSettingsPanel.fontSizeLabel()
|
117
145
|
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
118
146
|
additionalSettingsPanel.fontSizeDropdown()
|
@@ -128,24 +156,28 @@ const tests = {
|
|
128
156
|
.verifyInnerText('Default');
|
129
157
|
});
|
130
158
|
|
131
|
-
it(
|
159
|
+
it(`Clicking on \'Font size\' dropdown should open a list of ${Object.keys(fontSizes).length} options - ${Object.keys(fontSizes).join(',')}`, () => {
|
132
160
|
additionalSettingsPanel.fontSizeDropdown()
|
133
161
|
.realClick();
|
134
162
|
additionalSettingsPanel.fontSizeListOptions(0)
|
135
163
|
.should('be.visible');
|
136
|
-
|
137
|
-
additionalSettingsPanel.
|
138
|
-
.
|
164
|
+
Object.keys(fontSizes).forEach((size, index) => {
|
165
|
+
additionalSettingsPanel.fontSizeListOptionLabels()
|
166
|
+
.eq(index)
|
167
|
+
.verifyInnerText(size);
|
168
|
+
additionalSettingsPanel.fontSizesLabels()
|
169
|
+
.eq(index)
|
170
|
+
.verifyInnerText(fontSizes[size]);
|
139
171
|
});
|
140
172
|
cy.get('body')
|
141
173
|
.click();
|
142
174
|
});
|
143
175
|
|
144
|
-
it('CSS of Font size dropdown
|
176
|
+
it('CSS of Font size dropdown - active state', { tags: 'css' }, () => {
|
145
177
|
cy.log('Pre step: Clicking on Font size dropdown')
|
146
178
|
additionalSettingsPanel.fontSizeDropdown()
|
147
179
|
.click();
|
148
|
-
additionalSettingsPanel.fontSizeListOptions(
|
180
|
+
additionalSettingsPanel.fontSizeListOptions(2)
|
149
181
|
.verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
|
150
182
|
.should('have.css', 'background-color', css.color.liTextSelectedBg);
|
151
183
|
additionalSettingsPanel.fontSizeListOptions(1)
|
@@ -5,7 +5,7 @@ const css = Cypress.env('css');
|
|
5
5
|
|
6
6
|
const selectors = {
|
7
7
|
allowStudentsToCheckAnswerLabel: () => cy.get('.allow-student-check-answer-checkbox-wrapper .MuiFormControlLabel-label'),
|
8
|
-
allowStudentsToCheckAnswerCheckbox: () => cy.get('.ngie-checkbox [aria-label="Allow
|
8
|
+
allowStudentsToCheckAnswerCheckbox: () => cy.get('.ngie-checkbox [aria-label="Allow student to check answer"]'),
|
9
9
|
checkAnswerLabel: () => cy.get('.edit-check-answer-label'),
|
10
10
|
maximumCheckAnswerAttemptsLabel: () => cy.get('[class*="CheckAnswerstyles__OptionWrapper"] label[class*="MuiFormLabel-root MuiInputLabel-root"]'),
|
11
11
|
maximumCheckAnswerAttemptsInputField: () => cy.get('[class*="CheckAnswerstyles__OptionWrapper"] input[type="text"]'),
|
@@ -48,11 +48,11 @@ const tests = {
|
|
48
48
|
.verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
|
49
49
|
});
|
50
50
|
|
51
|
-
it('\'Check Answer\' label, \'Allow
|
51
|
+
it('\'Check Answer\' label, \'Allow student to check answer\' checkbox label and checkbox should be displayed and by default it should be unchecked', () => {
|
52
52
|
autoScoredAdditionalSettings.checkAnswerLabel()
|
53
53
|
.verifyInnerText('Check answer');
|
54
54
|
autoScoredAdditionalSettings.allowStudentsToCheckAnswerLabel()
|
55
|
-
.verifyInnerText('Allow
|
55
|
+
.verifyInnerText('Allow student to check answer');
|
56
56
|
autoScoredAdditionalSettings.allowStudentsToCheckAnswerCheckbox()
|
57
57
|
.should('not.be.checked');
|
58
58
|
if (questionType === 'multiple selection' || questionType === 'single selection') {
|
@@ -64,7 +64,7 @@ const tests = {
|
|
64
64
|
}
|
65
65
|
});
|
66
66
|
|
67
|
-
it('When the user checks the \'Allow
|
67
|
+
it('When the user checks the \'Allow student to check answer\' checkbox, \'Maximum check answer attempts\' label and input field should be displayed', () => {
|
68
68
|
autoScoredAdditionalSettings.allowStudentsToCheckAnswerCheckbox()
|
69
69
|
.click()
|
70
70
|
.should('be.checked');
|
@@ -121,7 +121,7 @@ const tests = {
|
|
121
121
|
.should('not.have.class', 'Mui-disabled');
|
122
122
|
});
|
123
123
|
|
124
|
-
it('When the user unchecks the \'Allow
|
124
|
+
it('When the user unchecks the \'Allow student to check answer\' checkbox, then the \'Maximum check answer attempts\' input field should not be displayed and in Preview tab the \'Check Answer\' button should not be displayed', () => {
|
125
125
|
cy.log('Pre step: Switching to Edit tab')
|
126
126
|
createQuestionBasePage.steps.switchToEditTab();
|
127
127
|
autoScoredAdditionalSettings.allowStudentsToCheckAnswerCheckbox()
|
@@ -164,7 +164,7 @@ const tests = {
|
|
164
164
|
.click();
|
165
165
|
autoScoredPreviewBase.checkAnswerButton()
|
166
166
|
.click();
|
167
|
-
autoScoredPreviewBase.
|
167
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
168
168
|
.should('not.exist');
|
169
169
|
autoScoredPreviewBase.correctIcon()
|
170
170
|
.should('not.exist');
|
@@ -4,7 +4,7 @@ const css = Cypress.env('css');
|
|
4
4
|
const selectors = {
|
5
5
|
correctIcon: () => cy.get('.icon-correct'),
|
6
6
|
incorrectIcon: () => cy.get('.icon-incorrect'),
|
7
|
-
|
7
|
+
correctIncorrectAnswerLabel: () => cy.get('.answer-label-text'),
|
8
8
|
checkAnswerButton: () => cy.get('.check-answer-and-status-wrapper button'),
|
9
9
|
correctIncorrectAnswerBorder: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answer-border"]')
|
10
10
|
}
|
@@ -29,7 +29,7 @@ const steps = {
|
|
29
29
|
},
|
30
30
|
|
31
31
|
verifyCorrectIncorrectAnswerLabel: (labelText) => {
|
32
|
-
autoScoredPreviewBase.
|
32
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
33
33
|
.should('be.visible')
|
34
34
|
.verifyInnerText(`${labelText} answer`)
|
35
35
|
.parents('[class*="CorrectIncorrectAnswerstyles__AnswerLabelWrapper"]')
|
@@ -60,20 +60,18 @@ const steps = {
|
|
60
60
|
},
|
61
61
|
|
62
62
|
verifyCorrectIncorrectAnswerLabelNotExists: () => {
|
63
|
-
autoScoredPreviewBase.
|
63
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
64
64
|
.should('not.exist');
|
65
65
|
},
|
66
66
|
|
67
67
|
verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked: () => {
|
68
|
-
cy.log('After
|
69
|
-
previewScoringAndShowCorrectAnswerComponent.
|
70
|
-
.click()
|
71
|
-
.should('not.be.checked');
|
68
|
+
cy.log('After selecting student view radio button, the question preview should return to the previous state');
|
69
|
+
previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
|
72
70
|
autoScoredPreviewBase.correctIcon()
|
73
71
|
.should('not.exist');
|
74
72
|
autoScoredPreviewBase.incorrectIcon()
|
75
73
|
.should('not.exist');
|
76
|
-
autoScoredPreviewBase.
|
74
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
77
75
|
.should('not.exist');
|
78
76
|
autoScoredPreviewBase.correctIncorrectAnswerBorder()
|
79
77
|
.should('not.exist');
|
@@ -42,7 +42,7 @@ const steps = {
|
|
42
42
|
|
43
43
|
verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer: () => {
|
44
44
|
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
45
|
-
.should('have.css', 'color', css.color.
|
45
|
+
.should('have.css', 'color', css.color.text)
|
46
46
|
.and('not.have.css', 'background-color', css.color.correctAnswer);
|
47
47
|
},
|
48
48
|
|
@@ -62,8 +62,10 @@ const tests = {
|
|
62
62
|
scoringSectionBase.pointsInputField()
|
63
63
|
.should('have.value', '')
|
64
64
|
.and('be.visible');
|
65
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
66
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
65
67
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
66
|
-
.verifyInnerText('Minimum
|
68
|
+
.verifyInnerText('Minimum points')
|
67
69
|
.and('be.visible');
|
68
70
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
69
71
|
.should('have.value', '')
|
@@ -96,7 +98,7 @@ const tests = {
|
|
96
98
|
scoringSectionBase.pointsInputField()
|
97
99
|
.should('have.value', '0')
|
98
100
|
.should('be.disabled');
|
99
|
-
scoringSectionBase.
|
101
|
+
scoringSectionBase.minimumScoringDropdown()
|
100
102
|
.should('not.exist');
|
101
103
|
});
|
102
104
|
|
@@ -106,11 +108,17 @@ const tests = {
|
|
106
108
|
},
|
107
109
|
|
108
110
|
verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet: () => {
|
109
|
-
it('When the user has not set correct answer option(s) and alloted points, \'
|
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', () => {
|
110
112
|
createQuestionBasePage.steps.switchToPreviewTab();
|
111
|
-
previewScoringAndShowCorrectAnswerComponent.
|
112
|
-
.should('
|
113
|
+
previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
|
114
|
+
.should('be.checked');
|
115
|
+
previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
|
116
|
+
.should('not.be.checked');
|
113
117
|
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
118
|
+
.should('have.text', '0/0');
|
119
|
+
autoScoredPreviewBase.correctIcon()
|
120
|
+
.should('not.exist');
|
121
|
+
autoScoredPreviewBase.incorrectIcon()
|
114
122
|
.should('not.exist');
|
115
123
|
});
|
116
124
|
},
|
@@ -134,14 +142,14 @@ const tests = {
|
|
134
142
|
.should('have.css', 'color', css.color.primaryBtn)
|
135
143
|
.and('have.css', 'background-color', css.color.correctAnswer)
|
136
144
|
if (steps.correctIncorrectLabelAndBorderExists(questionType)) {
|
137
|
-
autoScoredPreviewBase.
|
145
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
138
146
|
.verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold)
|
139
147
|
.parent()
|
140
|
-
.find('.
|
148
|
+
.find('.icon-correct')
|
141
149
|
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
142
150
|
autoScoredPreviewBase.steps.verifyCorrectAttemptBorder();
|
143
151
|
} else {
|
144
|
-
autoScoredPreviewBase.
|
152
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
145
153
|
.should('not.exist');
|
146
154
|
autoScoredPreviewBase.correctIncorrectAnswerBorder()
|
147
155
|
.should('not.exist');
|
@@ -157,22 +165,20 @@ const tests = {
|
|
157
165
|
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
158
166
|
cy.log('Pre requisite: The user has attempted the question incorrectly')
|
159
167
|
cy.log('Pre step: Select show answer checkbox')
|
160
|
-
previewScoringAndShowCorrectAnswerComponent.
|
161
|
-
.click()
|
162
|
-
.should('be.checked');
|
168
|
+
previewScoringAndShowCorrectAnswerComponent.steps.checkShowCorrectAnswerCheckbox();
|
163
169
|
cy.log('Verifying CSS of incorrect crossmark icon')
|
164
170
|
autoScoredPreviewBase.incorrectIcon()
|
165
171
|
.eq(0)
|
166
172
|
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
167
173
|
if (steps.correctIncorrectLabelAndBorderExists(questionType)) {
|
168
|
-
autoScoredPreviewBase.
|
174
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
169
175
|
.verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
|
170
176
|
.parent()
|
171
|
-
.find('.
|
177
|
+
.find('.icon-incorrect')
|
172
178
|
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
173
179
|
autoScoredPreviewBase.steps.verifyIncorrectAttemptBorder();
|
174
180
|
} else {
|
175
|
-
autoScoredPreviewBase.
|
181
|
+
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
176
182
|
.should('not.exist');
|
177
183
|
autoScoredPreviewBase.correctIncorrectAnswerBorder()
|
178
184
|
.should('not.exist');
|
@@ -182,9 +188,7 @@ const tests = {
|
|
182
188
|
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
183
189
|
cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
|
184
190
|
cy.log('Post step: Deselect show answer checkbox')
|
185
|
-
previewScoringAndShowCorrectAnswerComponent.
|
186
|
-
.click()
|
187
|
-
.should('not.be.checked');
|
191
|
+
previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
|
188
192
|
});
|
189
193
|
}
|
190
194
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
1
2
|
import { commonComponents } from "./commonComponents";
|
2
3
|
import { scoringSectionBase } from "./scoringSectionBase";
|
3
4
|
const css = Cypress.env('css');
|
@@ -13,8 +14,24 @@ const selectors = {
|
|
13
14
|
partialEqualWeightsPointsPerResponseScore: () => cy.get('.cloze-with-text-partial-points'),
|
14
15
|
penaltyPointsLabel: () => cy.get('.penalty-points-label'),
|
15
16
|
penaltyPointsInputField: () => cy.get('.penlty-points-input-field [type="text"]'),
|
16
|
-
rounddownScoreCheckboxLabel: () => cy.get('
|
17
|
+
rounddownScoreCheckboxLabel: () => cy.get('#rounding-dropdown-label'),
|
17
18
|
rounddownScoreCheckbox: () => cy.get('[data-ngie-testid="round-down-score-checkbox"] input'),
|
19
|
+
roundingDropdown: () => cy.get('#rounding-select'),
|
20
|
+
roundingDropdownListOptions: (ariaLabel = null) => {
|
21
|
+
if (ariaLabel) {
|
22
|
+
return cy.get(`[aria-labelledby*="rounding-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
23
|
+
} else {
|
24
|
+
return cy.get('[aria-labelledby*="rounding-dropdown-label"] [role="option"]')
|
25
|
+
}
|
26
|
+
},
|
27
|
+
penaltyScoringDropdown: () => cy.get('#penalty-scoring-select'),
|
28
|
+
penaltyScoringDropdownListOptions: (ariaLabel = null) => {
|
29
|
+
if (ariaLabel) {
|
30
|
+
return cy.get(`[aria-labelledby*="penalty-scoring-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
31
|
+
} else {
|
32
|
+
return cy.get('[aria-labelledby*="penalty-scoring-dropdown-label"] [role="option"]')
|
33
|
+
}
|
34
|
+
},
|
18
35
|
}
|
19
36
|
|
20
37
|
const steps = {
|
@@ -41,6 +58,8 @@ const steps = {
|
|
41
58
|
|
42
59
|
//V3 - This function should be updated in all files
|
43
60
|
verifyDefaultPenaltyPointsInputFieldAndLabel: () => {
|
61
|
+
autoScoredScoringSectionMultipleResponsesType.steps.expandPenaltyScoringDropdown();
|
62
|
+
autoScoredScoringSectionMultipleResponsesType.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
44
63
|
autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel()
|
45
64
|
.verifyInnerText('Penalty points')
|
46
65
|
.should('be.visible');
|
@@ -52,14 +71,44 @@ const steps = {
|
|
52
71
|
//V3 - This function should be updated in all files
|
53
72
|
verifyDefaultRoundDownScoreCheckboxCheckedAndLabel: () => {
|
54
73
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
55
|
-
.verifyInnerText('
|
74
|
+
.verifyInnerText('Rounding')
|
56
75
|
.and('be.visible');
|
57
|
-
autoScoredScoringSectionMultipleResponsesType.
|
58
|
-
.
|
76
|
+
autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
|
77
|
+
.verifyInnerText('None');
|
78
|
+
},
|
79
|
+
|
80
|
+
expandRoundingDropdown: () => {
|
81
|
+
autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
|
82
|
+
.click();
|
83
|
+
},
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @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
|
87
|
+
* @description this function selects dropdown option from rounding dropdown
|
88
|
+
*/
|
89
|
+
selectOptionFromRoundingDropdownOption: (dropdownOption) => {
|
90
|
+
autoScoredScoringSectionMultipleResponsesType.roundingDropdownListOptions(dropdownOption)
|
91
|
+
.click();
|
92
|
+
},
|
93
|
+
|
94
|
+
expandPenaltyScoringDropdown: () => {
|
95
|
+
autoScoredScoringSectionMultipleResponsesType.penaltyScoringDropdown()
|
96
|
+
.click();
|
97
|
+
},
|
98
|
+
|
99
|
+
/**
|
100
|
+
* @param {("No penalty points" | "Penalty points for the entire question" | "Penalty points for each incorrect option")} dropdownOption aria-label of dropdown options
|
101
|
+
* @description this function selects dropdown option from penalty points dropdown
|
102
|
+
*/
|
103
|
+
selectOptionFromPenaltyScoringDropdown: (dropdownOption) => {
|
104
|
+
autoScoredScoringSectionMultipleResponsesType.penaltyScoringDropdownListOptions(dropdownOption)
|
105
|
+
.click();
|
59
106
|
},
|
60
107
|
|
61
108
|
//V3 - This function should be updated in all files
|
62
109
|
allotPenaltyPoints: (points) => {
|
110
|
+
autoScoredScoringSectionMultipleResponsesType.steps.expandPenaltyScoringDropdown();
|
111
|
+
autoScoredScoringSectionMultipleResponsesType.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
63
112
|
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
64
113
|
.clear()
|
65
114
|
.type(points)
|
@@ -248,14 +297,16 @@ const tests = {
|
|
248
297
|
it('CSS of \'Round down score\' checkbox - checked state', { tags: 'css' }, () => {
|
249
298
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
250
299
|
.verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
|
251
|
-
autoScoredScoringSectionMultipleResponsesType.
|
252
|
-
.
|
253
|
-
|
254
|
-
|
300
|
+
utilities.verifyCSS(autoScoredScoringSectionMultipleResponsesType.roundingDropdown(), {
|
301
|
+
'color' : css.color.liText,
|
302
|
+
'font-size' : css.fontSize.default,
|
303
|
+
'font-weight' : css.fontWeight.regular,
|
304
|
+
'border' : `1px solid ${css.color.defaultDropdownBorder}`
|
305
|
+
})
|
255
306
|
});
|
256
307
|
|
257
308
|
it('Accessibility of \'Round down score\' checkbox - checked state', { tags: 'a11y' }, () => {
|
258
|
-
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.
|
309
|
+
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.roundingDropdown());
|
259
310
|
});
|
260
311
|
},
|
261
312
|
}
|
@@ -82,9 +82,9 @@ const steps = {
|
|
82
82
|
|
83
83
|
const tests = {
|
84
84
|
verifyAutoScoredSetCorrectAnswerHeaderSectionContents: (questionType) => {
|
85
|
-
it('\'
|
85
|
+
it('\'Specify correct answer\' label and help text should be displayed in \'Specify correct answer\' section', () => {
|
86
86
|
autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel()
|
87
|
-
.verifyInnerText('
|
87
|
+
.verifyInnerText('Specify correct answer');
|
88
88
|
|
89
89
|
let helpText;
|
90
90
|
switch (questionType) {
|
@@ -142,14 +142,14 @@ const tests = {
|
|
142
142
|
autoScoredSetCorrectAnswerSection.setCorrectAnswerHelpText().verifyInnerText(helpText);
|
143
143
|
});
|
144
144
|
|
145
|
-
it('CSS of \'
|
146
|
-
cy.log('CSS of
|
145
|
+
it('CSS of \'Specify correct answer\' header section', { tags: 'css' }, () => {
|
146
|
+
cy.log('CSS of Specify correct answer label')
|
147
147
|
autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel()
|
148
148
|
.verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.semibold);
|
149
|
-
cy.log('CSS of
|
149
|
+
cy.log('CSS of Specify correct answer help text')
|
150
150
|
autoScoredSetCorrectAnswerSection.setCorrectAnswerHelpText()
|
151
151
|
.verifyCSS(css.color.helperText, css.fontSize.normal, css.fontWeight.regular);
|
152
|
-
cy.log('CSS of
|
152
|
+
cy.log('CSS of Specify correct answer correct tab')
|
153
153
|
autoScoredSetCorrectAnswerSection.correctTab()
|
154
154
|
.verifyCSS(css.color.secondaryBtnActive, css.fontSize.default, css.fontWeight.bold);
|
155
155
|
});
|
@@ -163,7 +163,7 @@ const tests = {
|
|
163
163
|
verifyAutoScoredAlternateAnswer: (questionType = null) => {
|
164
164
|
it('\'Add Alternate Answer\' button should be present', () => {
|
165
165
|
autoScoredSetCorrectAnswerSection.alternateAnswerButton()
|
166
|
-
.verifyInnerText('Add
|
166
|
+
.verifyInnerText('Add alternative answer');
|
167
167
|
});
|
168
168
|
|
169
169
|
it('CSS of \'Add Alternate Answer\' button', { tags: 'css' }, () => {
|
@@ -69,7 +69,7 @@ const steps = {
|
|
69
69
|
createQuestionBasePage.previewTab()
|
70
70
|
.should('have.attr', 'aria-selected', 'true');
|
71
71
|
},
|
72
|
-
|
72
|
+
|
73
73
|
clickOnSaveQuestionButton: () => {
|
74
74
|
createQuestionBasePage.saveQuestionButton()
|
75
75
|
.click();
|
@@ -83,6 +83,12 @@ const steps = {
|
|
83
83
|
verifyPreviewTabNotSelectedState: () => {
|
84
84
|
createQuestionBasePage.previewTab()
|
85
85
|
.should('have.attr', 'aria-selected', 'false');
|
86
|
+
},
|
87
|
+
|
88
|
+
verifySavedSuccessfullySnackbar: () => {
|
89
|
+
commonComponents.snackbar()
|
90
|
+
.should('have.text', 'Saved successfully!')
|
91
|
+
.should('be.visible');
|
86
92
|
}
|
87
93
|
}
|
88
94
|
|
@@ -114,7 +120,7 @@ const tests = {
|
|
114
120
|
});
|
115
121
|
|
116
122
|
it('\'Save\' button should be displayed', () => {
|
117
|
-
if (questionType === 'Passage' || questionType === 'Reading ruler') {
|
123
|
+
if (questionType === 'Passage' || questionType === 'Reading ruler' || questionType === 'Audio player') {
|
118
124
|
createQuestionBasePage.saveQuestionButton()
|
119
125
|
.verifyInnerText('Save');
|
120
126
|
}
|
@@ -28,7 +28,8 @@ const selectors = {
|
|
28
28
|
},
|
29
29
|
previewTabGroupedResponseContainer: () => cy.get('.edit-question-preview-wrapper [class*="GroupDiv"]'),
|
30
30
|
previewTabGroupedResponseTitle: () => cy.get('.edit-question-preview-wrapper [class*="GroupTitleWrapper"]'),
|
31
|
-
previewTabGroupedResponseOptionsGrid: () => cy.get('.edit-question-preview-wrapper [class*="DraggableGroupsGrid"]')
|
31
|
+
previewTabGroupedResponseOptionsGrid: () => cy.get('.edit-question-preview-wrapper [class*="DraggableGroupsGrid"]'),
|
32
|
+
draggableOptionText: () => cy.get('.icon-container-wrapper [class*="DraggableItemsstyle__QuestionTextWrapper"]')
|
32
33
|
}
|
33
34
|
|
34
35
|
const steps = {
|
@@ -30,7 +30,8 @@ const selectors = {
|
|
30
30
|
buttonPrevious: () => cy.get('.previous-btn'),
|
31
31
|
inputFieldCursor: () => cy.get('.mq-hasCursor'),
|
32
32
|
inputFieldFirstEmptyBox: () => cy.get('.mq-empty').eq(0),
|
33
|
-
categoryTooltip: () => cy.get('.__react_component_tooltip')
|
33
|
+
categoryTooltip: () => cy.get('.__react_component_tooltip'),
|
34
|
+
dialogBoxTitle: () => cy.get('[role="alertdialog"]')
|
34
35
|
}
|
35
36
|
|
36
37
|
const steps = {
|
@@ -14,9 +14,9 @@ const selectors = {
|
|
14
14
|
previewTabToolbarWrapper: () => cy.get('.toolbar-overlay'),
|
15
15
|
previewTabToolbarOption: (formattingOption = null) => {
|
16
16
|
if (formattingOption) {
|
17
|
-
return cy.get(`.essay-preview-wrapper a[title = "${formattingOption}"]`)
|
17
|
+
return cy.get(`.essay-preview-wrapper a[title = "${formattingOption}"]`)
|
18
18
|
} else {
|
19
|
-
return cy.get('.essay-preview-wrapper a[
|
19
|
+
return cy.get('.essay-preview-wrapper a[role="button"]')
|
20
20
|
}
|
21
21
|
},
|
22
22
|
//Additional settings
|
@@ -37,8 +37,8 @@ const selectors = {
|
|
37
37
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
38
38
|
wordLimitReachedWarningMessage: () => cy.get('[data-at="limit-reached"]'),
|
39
39
|
//Preview tab
|
40
|
-
responseField: () => cy.get('[title="Enter your response to the question here."]')
|
41
|
-
responseFieldWordCount: () => cy.get('[data-at="character-count"]')
|
40
|
+
responseField: () => cy.get('[title="Enter your response to the question here."]'),
|
41
|
+
responseFieldWordCount: () => cy.get('[data-at="character-count"]'),
|
42
42
|
}
|
43
43
|
|
44
44
|
const steps = {
|
@@ -96,6 +96,12 @@ const steps = {
|
|
96
96
|
.type('{backspace}');
|
97
97
|
},
|
98
98
|
|
99
|
+
enterTextInPredefinedTextInputField: (predefinedText) => {
|
100
|
+
essayResponseCommonComponents.predefinedTextInputField()
|
101
|
+
.type(predefinedText)
|
102
|
+
.should('have.text', predefinedText);
|
103
|
+
},
|
104
|
+
|
99
105
|
verifyGradingViewResponseFieldIsNonEditable: () => {
|
100
106
|
essayResponseCommonComponents.responseField()
|
101
107
|
.should('have.attr', 'contenteditable', 'false');
|
@@ -9,6 +9,7 @@ const pointerDropdownList = ['Left', 'Right', 'Top', 'Bottom', 'Top left', 'Top
|
|
9
9
|
|
10
10
|
const selectors = {
|
11
11
|
addResponseContainerButton: () => cy.get('[class*="ResponseOnImagestyles"] .ngie-icon-with-label-btn').eq(0),
|
12
|
+
addResponseContainerButtonWrapper: () => cy.get('[class*="ResponseOnImagestyles__ButtonWrapper"]'),
|
12
13
|
//Change selectors after https://redmine.zeuslearning.com/issues/518498 is fixed
|
13
14
|
responseContainer: () => cy.get('.react-draggable'),
|
14
15
|
responseContainerCloseButton: () => cy.get('.remove-button'),
|
@@ -30,7 +31,7 @@ const selectors = {
|
|
30
31
|
ariaLabelsInputFieldNumeration: () => cy.get('.start-adornment'),
|
31
32
|
pleaseAddResponseTokenHelpText: () => cy.get('[class*="ClozeWithTextResponsestyles__AddResponseLabel"]'),
|
32
33
|
setCorrectAnswerResponseFieldLabel: () => cy.get('.cloze-with-text-form-control-wrapper .input-field-label'),
|
33
|
-
imageSectionImageLabel: () => cy.get('[class*="
|
34
|
+
imageSectionImageLabel: () => cy.get('[class*="LabelImage"][class*="styles__LabelWrapper"]'),
|
34
35
|
imageSectionImage: () => cy.get('.image-container img'),
|
35
36
|
imagePreviewTab: () => cy.get('[class*="ClozeWithTextResponsestyles__ContentWrapper"] .image-container img'),
|
36
37
|
imagePropertiesContainer: () => cy.get('[class*="AddTextResponseOnImagestyles__DimensionsContainer"]'),
|