itemengine-cypress-automation 1.0.197 → 1.0.198
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ImageHighlight/editTabScoring.js +355 -0
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +83 -0
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +205 -0
- package/cypress/e2e/ILC/ImageHighlight/specifyCorrectAnswerSection.js +92 -0
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +404 -0
- package/cypress/e2e/ILC/ImageHighlight/supportedFileTypes.js +42 -0
- package/cypress/e2e/ILC/ImageHighlight/toolSettings.js +73 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/editTabScoring.js +253 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsBasic.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialEqualWeightsBasic.js +164 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/setPointsPopup.js +83 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/specifyCorrectAnswerSection.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/studentViewSettings.js +179 -0
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +5 -21
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +3 -37
- package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -1
- package/cypress/pages/components/enableOuterBorderComponent.js +16 -2
- package/cypress/pages/components/index.js +3 -1
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/components/setPointsPopupBase.js +7 -10
- package/cypress/pages/components/showAvailableOptionsToStudents.js +76 -0
- package/cypress/pages/components/showStudentMaximumNumberOfPossibleSelections.js +56 -0
- package/cypress/pages/imageHighlightPage.js +434 -4
- package/cypress/pages/listOrderingPage.js +287 -43
- package/cypress/pages/textSelectionPage.js +6 -71
- package/package.json +1 -1
@@ -0,0 +1,214 @@
|
|
1
|
+
import { dialogBoxBase, listOrderingPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const grepTags = Cypress.env('grepTags');
|
6
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
7
|
+
const views = utilities.getViews(correctAnswerViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
10
|
+
const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
11
|
+
|
12
|
+
describe('Create item page - List ordering: All or nothing for "Horizontal" option orientation', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
views.forEach((view) => {
|
18
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
switch (view) {
|
22
|
+
case 'Question preview':
|
23
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
26
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
27
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
28
|
+
listOrderingPage.steps.allotPoints(20);
|
29
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
30
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
31
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(correctAnswerArray);
|
32
|
+
listOrderingPage.steps.switchToPreviewTab();
|
33
|
+
break;
|
34
|
+
case 'Item preview':
|
35
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
36
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
37
|
+
break;
|
38
|
+
case 'Grading view':
|
39
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
40
|
+
break;
|
41
|
+
};
|
42
|
+
});
|
43
|
+
|
44
|
+
beforeEach(() => {
|
45
|
+
switch (view) {
|
46
|
+
case 'Question preview':
|
47
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
48
|
+
listOrderingPage.steps.resetQuestionPreview();
|
49
|
+
break;
|
50
|
+
case 'Item preview':
|
51
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
52
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
53
|
+
break;
|
54
|
+
case 'Grading view':
|
55
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
56
|
+
break;
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
if (view === 'Question preview') {
|
61
|
+
after(() => {
|
62
|
+
listOrderingPage.steps.clickOnSaveQuestionButton();
|
63
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
64
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
65
|
+
});
|
66
|
+
};
|
67
|
+
|
68
|
+
it('When the user selects \'Grading\' view without attempting the question, then incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
|
69
|
+
if (view === 'Grading view') {
|
70
|
+
studentViewPage.steps.submitResponse();
|
71
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
72
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
73
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
74
|
+
};
|
75
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
76
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
77
|
+
listOrderingPage.steps.switchToGradingView();
|
78
|
+
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
79
|
+
};
|
80
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('sprout');
|
81
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('plant');
|
82
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('flower');
|
83
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('seed');
|
84
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
85
|
+
utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
|
86
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
87
|
+
listOrderingPage.steps.verifyCorrectOptionIconsCorrectAnswerSection();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
|
91
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('sprout', 3);
|
92
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 0);
|
93
|
+
if (view === 'Grading view') {
|
94
|
+
studentViewPage.steps.submitResponse();
|
95
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
96
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
97
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
98
|
+
};
|
99
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
100
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
101
|
+
listOrderingPage.steps.switchToGradingView();
|
102
|
+
};
|
103
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('sprout');
|
104
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('plant');
|
105
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('flower');
|
106
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('seed');
|
107
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
108
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
109
|
+
});
|
110
|
+
|
111
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
|
112
|
+
if (view === 'Grading view') {
|
113
|
+
studentViewPage.steps.clearResponses();
|
114
|
+
};
|
115
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
116
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('plant', 0);
|
117
|
+
if (view === 'Grading view') {
|
118
|
+
studentViewPage.steps.submitResponse();
|
119
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
120
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
121
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
122
|
+
};
|
123
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
124
|
+
listOrderingPage.steps.verifyPreviewScore(0, 20);
|
125
|
+
listOrderingPage.steps.switchToGradingView();
|
126
|
+
};
|
127
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('plant');
|
128
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('sprout');
|
129
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('seed');
|
130
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('flower');
|
131
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
132
|
+
listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
|
133
|
+
});
|
134
|
+
|
135
|
+
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
136
|
+
if (view === 'Grading view') {
|
137
|
+
studentViewPage.steps.clearResponses();
|
138
|
+
};
|
139
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('seed', 0);
|
140
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('sprout', 1);
|
141
|
+
if (view === 'Grading view') {
|
142
|
+
studentViewPage.steps.submitResponse();
|
143
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
144
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
145
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
146
|
+
};
|
147
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
148
|
+
listOrderingPage.steps.verifyPreviewScore(20, 20);
|
149
|
+
listOrderingPage.steps.switchToGradingView();
|
150
|
+
listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
151
|
+
};
|
152
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('seed');
|
153
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('sprout');
|
154
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('plant');
|
155
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('flower');
|
156
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
157
|
+
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
158
|
+
});
|
159
|
+
});
|
160
|
+
});
|
161
|
+
|
162
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
163
|
+
describe.only('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
164
|
+
abortEarlySetup();
|
165
|
+
before(() => {
|
166
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
167
|
+
cy.barsPreLoaderWait();
|
168
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
169
|
+
listOrderingPage.steps.allotPoints(20);
|
170
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
171
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
172
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
173
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
174
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(correctAnswerArray);
|
175
|
+
});
|
176
|
+
|
177
|
+
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
178
|
+
listOrderingPage.steps.expandMinimumScoringDropdown();
|
179
|
+
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
180
|
+
listOrderingPage.steps.allotMinimumPoints(2);
|
181
|
+
listOrderingPage.steps.switchToPreviewTab();
|
182
|
+
listOrderingPage.steps.switchToGradingView();
|
183
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
184
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
185
|
+
});
|
186
|
+
|
187
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
188
|
+
listOrderingPage.steps.resetQuestionPreview();
|
189
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('sprout', 3);
|
190
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 0);
|
191
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
192
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
193
|
+
});
|
194
|
+
|
195
|
+
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then considering the default list order incorrect, the user should be awarded with minimum points', () => {
|
196
|
+
listOrderingPage.steps.switchToEditTab();
|
197
|
+
listOrderingPage.steps.expandMinimumScoringDropdown();
|
198
|
+
listOrderingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
199
|
+
listOrderingPage.steps.allotMinimumPoints(2);
|
200
|
+
listOrderingPage.steps.switchToPreviewTab();
|
201
|
+
listOrderingPage.steps.switchToGradingView();
|
202
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
203
|
+
listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
204
|
+
});
|
205
|
+
|
206
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
207
|
+
listOrderingPage.steps.resetQuestionPreview();
|
208
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('sprout', 3);
|
209
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 0);
|
210
|
+
listOrderingPage.steps.verifyPreviewScore(2, 20);
|
211
|
+
});
|
212
|
+
});
|
213
|
+
};
|
214
|
+
});
|
@@ -96,36 +96,20 @@ describe('Create Item page - List ordering : Student view settings', () => {
|
|
96
96
|
cy.barsPreLoaderWait();
|
97
97
|
});
|
98
98
|
|
99
|
-
|
100
|
-
utilities.verifyInnerText(listOrderingPage.enableOuterBorderForQuestionLabel(), 'Enable outer border for question');
|
101
|
-
utilities.verifyElementVisibilityState(listOrderingPage.enableOuterBorderForQuestionLabel(), 'visible');
|
102
|
-
utilities.verifyElementVisibilityState(listOrderingPage.enableOuterBorderForQuestionLabel(), 'exist');
|
103
|
-
listOrderingPage.steps.verifyEnableOuterBorderForQuestionCheckboxCheckedState();
|
104
|
-
});
|
105
|
-
|
106
|
-
it('CSS of \'Enable outer border\' label and checkbox - checked state', { tags: 'css' }, () => {
|
107
|
-
utilities.verifyCSS(listOrderingPage.enableOuterBorderForQuestionLabel(), {
|
108
|
-
'color': css.color.labelText,
|
109
|
-
'font-size': css.fontSize.normal,
|
110
|
-
'font-weight': css.fontWeight.regular
|
111
|
-
});
|
112
|
-
utilities.verifyCSS(listOrderingPage.enableOuterBorderForQuestionLabel().parent().find('svg g g').eq(0), {
|
113
|
-
'fill': css.color.activeButtons
|
114
|
-
});
|
115
|
-
});
|
99
|
+
listOrderingPage.tests.verifyEnableOuterBorderContents();
|
116
100
|
|
117
101
|
it('The user should be able to uncheck the \'Enable outer border for question\' checkbox', () => {
|
118
|
-
listOrderingPage.steps.
|
102
|
+
listOrderingPage.steps.uncheckEnableOuterBorderCheckbox();
|
119
103
|
});
|
120
104
|
|
121
105
|
it('CSS of \'Enable outer border for question\' checkbox - unchecked state', { tags: 'css' }, () => {
|
122
|
-
utilities.verifyCSS(listOrderingPage.
|
106
|
+
utilities.verifyCSS(listOrderingPage.enableOuterBorderCheckbox().parent().find('svg'), {
|
123
107
|
'fill': css.color.uncheckedCheckbox
|
124
108
|
});
|
125
109
|
});
|
126
110
|
|
127
111
|
it('Accessibility of \'Enable outer border for question\' checkbox - unchecked state', { tags: 'a11y' }, () => {
|
128
|
-
cy.checkAccessibility(listOrderingPage.
|
112
|
+
cy.checkAccessibility(listOrderingPage.enableOuterBorderCheckbox().parents('[data-ngie-testid*="enable-outer-border-for-question-checkbox"]'));
|
129
113
|
});
|
130
114
|
});
|
131
115
|
|
@@ -150,7 +134,7 @@ describe('Create Item page - List ordering : Student view settings', () => {
|
|
150
134
|
|
151
135
|
it('When the user unchecks the \'Enable outer border for question\' checkbox, then the outer border over the question preview should not be displayed', () => {
|
152
136
|
listOrderingPage.steps.switchToEditTab();
|
153
|
-
listOrderingPage.steps.
|
137
|
+
listOrderingPage.steps.uncheckEnableOuterBorderCheckbox();
|
154
138
|
listOrderingPage.steps.switchToPreviewTab()
|
155
139
|
listOrderingPage.steps.verifyOuterBorderOfQuestionPreviewNotExists();
|
156
140
|
});
|
@@ -140,41 +140,7 @@ describe('Create Item page - Text selection: Student view settings', () => {
|
|
140
140
|
cy.barsPreLoaderWait();
|
141
141
|
});
|
142
142
|
|
143
|
-
|
144
|
-
utilities.verifyInnerText(textSelectionPage.showAvailableOptionsToStudentsLabel(), 'Show the available options to students');
|
145
|
-
utilities.verifyElementVisibilityState(textSelectionPage.showAvailableOptionsToStudentsLabel(), 'visible');
|
146
|
-
utilities.verifyElementVisibilityState(textSelectionPage.showAvailableOptionsToStudentsCheckbox(), 'exist');
|
147
|
-
textSelectionPage.steps.verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked();
|
148
|
-
});
|
149
|
-
|
150
|
-
it('CSS of \'Show the available options to students\' checkbox and label - unchecked state', { tags: 'css' }, () => {
|
151
|
-
utilities.verifyCSS(textSelectionPage.showAvailableOptionsToStudentsLabel(), {
|
152
|
-
'color': css.color.labelText,
|
153
|
-
'font-size': css.fontSize.normal,
|
154
|
-
'font-weight': css.fontWeight.regular
|
155
|
-
});
|
156
|
-
utilities.verifyCSS(textSelectionPage.showAvailableOptionsToStudentsCheckbox().parent().find('svg'), {
|
157
|
-
'fill': css.color.uncheckedCheckbox
|
158
|
-
});
|
159
|
-
});
|
160
|
-
|
161
|
-
it('Accessibility of \'Show the available options to students\' checkbox - unchecked state', { tags: 'a11y' }, () => {
|
162
|
-
cy.checkAccessibility(textSelectionPage.showAvailableOptionsToStudentsCheckbox().parents('[data-ngie-testid="show-the-available-options-to-students-checkbox"]'));
|
163
|
-
});
|
164
|
-
|
165
|
-
it('User should be able to check the \'Show the available options to students\' checkbox', () => {
|
166
|
-
textSelectionPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
167
|
-
});
|
168
|
-
|
169
|
-
it('CSS of "Enable outer border for question" label and checkbox - checked state', { tags: 'css' }, () => {
|
170
|
-
utilities.verifyCSS(textSelectionPage.showAvailableOptionsToStudentsCheckbox().parent().find('svg g g').eq(0), {
|
171
|
-
'fill': css.color.activeButtons
|
172
|
-
});
|
173
|
-
});
|
174
|
-
|
175
|
-
it('Accessibility of \'Show the available options to students\' checkbox - checked state', { tags: 'a11y' }, () => {
|
176
|
-
cy.checkAccessibility(textSelectionPage.showAvailableOptionsToStudentsCheckbox().parents('[data-ngie-testid="show-the-available-options-to-students-checkbox"]'));
|
177
|
-
});
|
143
|
+
textSelectionPage.tests.verifyShowAvailableOptionsToStudentsEditTab()
|
178
144
|
});
|
179
145
|
|
180
146
|
describe('Show the available options to students: Preview tab', () => {
|
@@ -390,7 +356,7 @@ describe('Create Item page - Text selection: Student view settings', () => {
|
|
390
356
|
'background-color': css.color.warningContainerBackground
|
391
357
|
});
|
392
358
|
});
|
393
|
-
|
359
|
+
|
394
360
|
it('Accessibility of \'Maximum n options can be selected.\' error message', { tags: 'a11y' }, () => {
|
395
361
|
cy.checkAccessibility(textSelectionPage.maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab());
|
396
362
|
});
|
@@ -418,7 +384,7 @@ describe('Create Item page - Text selection: Student view settings', () => {
|
|
418
384
|
'font-weight': css.fontWeight.bold
|
419
385
|
});
|
420
386
|
});
|
421
|
-
|
387
|
+
|
422
388
|
it('Accessibility of help text \'Maximum number of possible selections: n\'', { tags: 'a11y' }, () => {
|
423
389
|
cy.checkAccessibility(textSelectionPage.maximumNumberOfSelectionsHelpText());
|
424
390
|
});
|
@@ -69,7 +69,7 @@ describe('Create item page - Video response: Preview contents', () => {
|
|
69
69
|
utilities.verifyElementVisibilityState(videoResponsePage.recordingTimer(), 'visible');
|
70
70
|
});
|
71
71
|
|
72
|
-
it('CSS of recording interface', { tags: 'css' }, () => {
|
72
|
+
it.skip('CSS of recording interface', { tags: 'css' }, () => {
|
73
73
|
utilities.verifyCSS(videoResponsePage.clickTapAnywhereArea(), {
|
74
74
|
'background-color': css.color.clickTapAnywhereAreaBg
|
75
75
|
});
|
Binary file
|
@@ -17,7 +17,7 @@ const selectors = {
|
|
17
17
|
groupedOptionsContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="GroupDiv"]'),
|
18
18
|
groupedOptionsTitlePreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="GroupTitleWrapper"]'),
|
19
19
|
groupedOptionsGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="DraggableGroupsGrid"]'),
|
20
|
-
draggableOptionText: () => cy.get('.icon-container-wrapper [class*="
|
20
|
+
draggableOptionText: () => cy.get('.icon-container-wrapper [class*="DraggableItemsstyle__QuestionTextWrapper"]:visible'),
|
21
21
|
optionContainerItemListPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .item-list'),
|
22
22
|
optionContainerItemListSpecifyCorrectAnswerSection: () => cy.get('.item-list'),
|
23
23
|
draggableOptionDragIcon: () => cy.get('.drag-icon-button')
|
@@ -2,8 +2,8 @@ import utilities from "../../support/helpers/utilities";
|
|
2
2
|
const css = Cypress.env('css');
|
3
3
|
|
4
4
|
const selectors = {
|
5
|
-
enableOuterBorderLabel: () => cy.get('[data-ngie-testid
|
6
|
-
enableOuterBorderCheckbox: () => cy.get('[data-ngie-testid
|
5
|
+
enableOuterBorderLabel: () => cy.get('[data-ngie-testid*="enable-outer-border"] .MuiFormControlLabel-label'),
|
6
|
+
enableOuterBorderCheckbox: () => cy.get('[data-ngie-testid*="enable-outer-border"] input'),
|
7
7
|
}
|
8
8
|
|
9
9
|
const steps = {
|
@@ -49,6 +49,20 @@ const tests = {
|
|
49
49
|
'fill': css.color.activeButtons
|
50
50
|
});
|
51
51
|
});
|
52
|
+
|
53
|
+
it('The user should be able to uncheck the \'Enable outer border for question\' checkbox', () => {
|
54
|
+
enableOuterBorderComponent.steps.uncheckEnableOuterBorderCheckbox();
|
55
|
+
});
|
56
|
+
|
57
|
+
it('CSS of \'Enable outer border for question\' checkbox - unchecked state', { tags: 'css' }, () => {
|
58
|
+
utilities.verifyCSS(enableOuterBorderComponent.enableOuterBorderCheckbox().parent().find('svg'), {
|
59
|
+
'fill': css.color.uncheckedCheckbox
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Accessibility of \'Enable outer border for question\' checkbox - unchecked state', { tags: 'a11y' }, () => {
|
64
|
+
cy.checkAccessibility(enableOuterBorderComponent.enableOuterBorderCheckbox().parents('[data-ngie-testid*="enable-outer-border-for-question-checkbox"]'));
|
65
|
+
});
|
52
66
|
}
|
53
67
|
}
|
54
68
|
|
@@ -71,4 +71,6 @@ export * from './chartsCommonComponent';
|
|
71
71
|
export * from './numberLineCommonComponent';
|
72
72
|
export * from './limitNumberOfRetakeComponent';
|
73
73
|
export * from './allowTeachersToDownloadStudentResponseComponent';
|
74
|
-
export * from './singleMultipleSelectionModeComponent';
|
74
|
+
export * from './singleMultipleSelectionModeComponent';
|
75
|
+
export * from './showAvailableOptionsToStudents';
|
76
|
+
export * from './showStudentMaximumNumberOfPossibleSelections';
|
@@ -13,7 +13,7 @@ const selectors = {
|
|
13
13
|
minimumScoreIfAttemptedInputField: () => cy.get('.min-score-points-input-field input[type="text"]'),
|
14
14
|
pointsLabel: () => cy.get('.points-label'),
|
15
15
|
//TODO: Need to update below selectors, once https://redmine.zeuslearning.com/issues/553983 gets resolved
|
16
|
-
pointsInputField: () => cy.get('[class*="points-input-field"]
|
16
|
+
pointsInputField: () => cy.get('[class*="points-input-field"] input[type="text"]'),
|
17
17
|
pleaseEnterPointsErrorMessage: () => cy.get('[class*="ErrorBlockstyles__ErrorText"]:visible'),
|
18
18
|
pointsWrapper: () => cy.get('.set-correct-answer-points-wrapper'),
|
19
19
|
minimumScoringLabel: () => cy.get('#minimum-scoring-dropdown-label'),
|
@@ -9,8 +9,8 @@ const selector = {
|
|
9
9
|
setPointsPopupTitle: () => cy.get('.dialog-title-wrapper'),
|
10
10
|
setPointsPopupOptions: () => cy.get('[class*="SetPointsPopupstyle__MappedAnswer"]'),
|
11
11
|
setPointsPopupPointsLabel: () => cy.get('[class*="SetPointsPopupstyle__PointLabel"]'),
|
12
|
-
setPointsPopupSaveButton: () => cy.get('
|
13
|
-
setPointsPopupCancelButton: () => cy.get('
|
12
|
+
setPointsPopupSaveButton: () => cy.get('[class*="popup"][class*="-wrapper"] button').eq(1),
|
13
|
+
setPointsPopupCancelButton: () => cy.get('[class*="popup"][class*="-wrapper"] button').eq(0),
|
14
14
|
}
|
15
15
|
|
16
16
|
const steps = {
|
@@ -34,14 +34,11 @@ const steps = {
|
|
34
34
|
*/
|
35
35
|
allotPointsToSetPointsPopupPointsInputField: (pointsArray) => {
|
36
36
|
pointsArray.forEach((points, index) => {
|
37
|
-
|
38
|
-
.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
.type(points, { delay: 500 })
|
43
|
-
.should('have.value', points);
|
44
|
-
});
|
37
|
+
scoringSectionBase.pointsInputField()
|
38
|
+
.eq(index)
|
39
|
+
.clear()
|
40
|
+
.type(points)
|
41
|
+
.blur();
|
45
42
|
});
|
46
43
|
},
|
47
44
|
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
2
|
+
|
3
|
+
const selectors = {
|
4
|
+
showAvailableOptionsToStudentsLabel: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] [class*="label"]'),
|
5
|
+
showAvailableOptionsToStudentsCheckbox: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] input')
|
6
|
+
}
|
7
|
+
|
8
|
+
const steps = {
|
9
|
+
verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked: () => {
|
10
|
+
showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox()
|
11
|
+
.should('not.be.checked');
|
12
|
+
},
|
13
|
+
|
14
|
+
verifyShowAvailableOptionsToStudentsCheckboxIsChecked: () => {
|
15
|
+
showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox()
|
16
|
+
.should('be.checked');
|
17
|
+
},
|
18
|
+
|
19
|
+
uncheckShowAvailableOptionsToStudentsCheckbox: () => {
|
20
|
+
showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox()
|
21
|
+
.click()
|
22
|
+
.should('not.be.checked');
|
23
|
+
},
|
24
|
+
|
25
|
+
checkShowAvailableOptionsToStudentsCheckbox: () => {
|
26
|
+
showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox()
|
27
|
+
.click()
|
28
|
+
.should('be.checked');
|
29
|
+
},
|
30
|
+
}
|
31
|
+
|
32
|
+
const tests = {
|
33
|
+
verifyShowAvailableOptionsToStudentsEditTab: () => {
|
34
|
+
it('\'Show the available options to students\' label and checkbox should be displayed. By default, \'Show the available options to students\' checkbox should be in unchecked state', () => {
|
35
|
+
utilities.verifyInnerText(showAvailableOptionsToStudents.showAvailableOptionsToStudentsLabel(), 'Show the available options to students');
|
36
|
+
utilities.verifyElementVisibilityState(showAvailableOptionsToStudents.showAvailableOptionsToStudentsLabel(), 'visible');
|
37
|
+
utilities.verifyElementVisibilityState(showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox(), 'exist');
|
38
|
+
showAvailableOptionsToStudents.steps.verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked();
|
39
|
+
});
|
40
|
+
|
41
|
+
it('CSS of \'Show the available options to students\' checkbox and label - unchecked state', { tags: 'css' }, () => {
|
42
|
+
utilities.verifyCSS(showAvailableOptionsToStudents.showAvailableOptionsToStudentsLabel(), {
|
43
|
+
'color': css.color.labelText,
|
44
|
+
'font-size': css.fontSize.normal,
|
45
|
+
'font-weight': css.fontWeight.regular
|
46
|
+
});
|
47
|
+
utilities.verifyCSS(showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox().parent().find('svg'), {
|
48
|
+
'fill': css.color.uncheckedCheckbox
|
49
|
+
});
|
50
|
+
});
|
51
|
+
|
52
|
+
it('Accessibility of \'Show the available options to students\' checkbox - unchecked state', { tags: 'a11y' }, () => {
|
53
|
+
cy.checkAccessibility(showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox().parents('[data-ngie-testid="show-the-available-options-to-students-checkbox"]'));
|
54
|
+
});
|
55
|
+
|
56
|
+
it('User should be able to check the \'Show the available options to students\' checkbox', () => {
|
57
|
+
showAvailableOptionsToStudents.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('CSS of \'Enable outer border\' label and checkbox - checked state', { tags: 'css' }, () => {
|
61
|
+
utilities.verifyCSS(showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox().parent().find('svg g g').eq(0), {
|
62
|
+
'fill': css.color.activeButtons
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
it('Accessibility of \'Show the available options to students\' checkbox - checked state', { tags: 'a11y' }, () => {
|
67
|
+
cy.checkAccessibility(showAvailableOptionsToStudents.showAvailableOptionsToStudentsCheckbox().parents('[data-ngie-testid="show-the-available-options-to-students-checkbox"]'));
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
export const showAvailableOptionsToStudents = {
|
73
|
+
...selectors,
|
74
|
+
steps,
|
75
|
+
tests
|
76
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
2
|
+
import { commonComponents } from "./commonComponents";
|
3
|
+
|
4
|
+
const selectors = {
|
5
|
+
maxNumberOfPossibleSelectionsLabel: () => cy.get('#Maximum-number-of-possible-selections-dropdown-label'),
|
6
|
+
maxNumberOfPossibleSelectionsDropdown: () => cy.get('#Maximum-number-of-possible-selections-select'),
|
7
|
+
showStudentMaximumNumberOfPossibleSelectionsCheckbox: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] input'),
|
8
|
+
showStudentMaximumNumberOfPossibleSelectionsLabel: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] [class*="label"]'),
|
9
|
+
maximumNumberOfSelectionsHelpText: () => cy.get('[class*="__LimitWrapper"]'),
|
10
|
+
maximumOptionsCanBeSelectedErrorMessage: () => cy.get('[class*="__AuthoringErrorMsg"]'),
|
11
|
+
maximumOptionsCanBeSelectedErrorMessagePreviewTab: () => cy.get('[class*="__ErrorMessage"]'),
|
12
|
+
maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab: () => cy.get('.preview-selection-limit-error-wrapper')
|
13
|
+
}
|
14
|
+
|
15
|
+
const steps = {
|
16
|
+
/**
|
17
|
+
* Verify maximum number of possible selections dropdown options
|
18
|
+
* @param {string[]} options array of dropdown options
|
19
|
+
*/
|
20
|
+
verifyMaxNumberOfPossibleSelectionsDropdownListOptions: (options) => {
|
21
|
+
options.forEach((option, count) => {
|
22
|
+
utilities.verifyInnerText(utilities.getNthElement(commonComponents.dropdownListOption(), count), option);
|
23
|
+
});
|
24
|
+
},
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param {string} listOption - The option to be selected from the maximum number of possible selections dropdown
|
28
|
+
* @description Selects an option from the maximum number of possible selections dropdown. The dropdown options are dependent on the number of available options.
|
29
|
+
*/
|
30
|
+
selectOptionFromMaxNumberOfPossibleSelectionsDropdown: (listOption) => {
|
31
|
+
commonComponents.dropdownListOption()
|
32
|
+
.contains(listOption)
|
33
|
+
.click();
|
34
|
+
},
|
35
|
+
|
36
|
+
verifyShowStudentTheMaxNumberOfSelectionsCheckboxIsUnchecked: () => {
|
37
|
+
showStudentMaximumNumberOfPossibleSelections.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
38
|
+
.should('not.be.checked');
|
39
|
+
},
|
40
|
+
|
41
|
+
checkShowStudentTheMaxNumberOfSelectionsCheckbox: () => {
|
42
|
+
showStudentMaximumNumberOfPossibleSelections.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
43
|
+
.click()
|
44
|
+
.should('be.checked');
|
45
|
+
},
|
46
|
+
|
47
|
+
expandMaxNumberOfPossibleSelectionsDropdown: () => {
|
48
|
+
showStudentMaximumNumberOfPossibleSelections.maxNumberOfPossibleSelectionsDropdown()
|
49
|
+
.click();
|
50
|
+
},
|
51
|
+
}
|
52
|
+
|
53
|
+
export const showStudentMaximumNumberOfPossibleSelections = {
|
54
|
+
...selectors,
|
55
|
+
steps
|
56
|
+
}
|