itemengine-cypress-automation 1.0.36 → 1.0.37
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsAnswerNumerationAndOptionStyleDropdown.js +319 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsBasic.js +326 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsOptionLabelSection.js +202 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoring.js +188 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoringWithAlternateAnswer.js +759 -0
- package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +1 -276
- package/cypress/e2e/ILC/ListSorting/listSortingOptionsSection.js +287 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1 -941
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +952 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1 -849
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +860 -0
- package/package.json +1 -1
@@ -0,0 +1,202 @@
|
|
1
|
+
import { listSortingPage } from "../../../pages/listSortingPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
let options = ['plant', 'sprout', 'flower', 'seed'];
|
7
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
8
|
+
|
9
|
+
describe('Create Item page - list sorting: Additional settings - Option label section', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional settings: Option label section contents', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigating to list sorting question type');
|
18
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
19
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
listSortingPage.steps.addQuestionInstructions();
|
22
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
23
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
24
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
25
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
26
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
27
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
28
|
+
listSortingPage.steps.allotPoints('20');
|
29
|
+
listSortingPage.steps.expandAdditonalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
it('\'Option label\' should be displayed', () => {
|
33
|
+
utilities.verifyInnerText(listSortingPage.optionLabelLabel(), 'Option label');
|
34
|
+
utilities.verifyElementVisibilityState(listSortingPage.optionLabelLabel(), 'visible');
|
35
|
+
});
|
36
|
+
|
37
|
+
it('\'Include option labels\' label and checkbox should be displayed and it should be unchecked by default', () => {
|
38
|
+
utilities.verifyInnerText(listSortingPage.includeLabelsLabel(), 'Include option labels');
|
39
|
+
utilities.verifyElementVisibilityState(listSortingPage.includeLabelsCheckbox(), 'exist');
|
40
|
+
listSortingPage.steps.verifyIncludeLablesCheckboxIsUnchecked()
|
41
|
+
});
|
42
|
+
|
43
|
+
it('\'Top label\' and \'Bottom label\' labels and input fields should be displayed and they should be disabled by default', () => {
|
44
|
+
utilities.verifyInnerText(listSortingPage.topLabelLabel(), 'Top label');
|
45
|
+
utilities.verifyElementVisibilityState(listSortingPage.topLabelInputField(), 'exist');
|
46
|
+
listSortingPage.steps.verifyTopLabelInputFieldDisabled();
|
47
|
+
utilities.verifyInnerText(listSortingPage.bottomLabelLabel(), 'Bottom label');
|
48
|
+
utilities.verifyElementVisibilityState(listSortingPage.bottomLabelInputField(), 'exist');
|
49
|
+
listSortingPage.steps.verifyBottomLabelInputFieldDisabled();
|
50
|
+
});
|
51
|
+
|
52
|
+
it('When the user selects \'Include option labels\' checkbox then the \'Top label\' and \'Bottom label\' input fields should be enabled', () => {
|
53
|
+
listSortingPage.steps.checkIncludeLablesCheckbox();
|
54
|
+
listSortingPage.steps.verifyTopLabelInputFieldEnabled();
|
55
|
+
listSortingPage.steps.verifyBottomLabelInputFieldEnabled();
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When the \'Include option labels\' checkbox is checked user should be able to add inputs to \'Top label\' and \'Bottom label\' input fields', () => {
|
59
|
+
listSortingPage.steps.addInputToTopLabelInputField('Top label');
|
60
|
+
listSortingPage.steps.addInputToBottomLabelInputField('Bottom label');
|
61
|
+
});
|
62
|
+
|
63
|
+
it('CSS of \'Option label\' section', { tags: 'css' }, () => {
|
64
|
+
utilities.verifyCSS(listSortingPage.optionLabelLabel(), {
|
65
|
+
'color': css.color.labels,
|
66
|
+
'font-size': css.fontSize.default,
|
67
|
+
'font-weight': css.fontWeight.semibold
|
68
|
+
});
|
69
|
+
utilities.verifyCSS(listSortingPage.includeLabelsLabel(), {
|
70
|
+
'color': css.color.labelText,
|
71
|
+
'font-size': css.fontSize.normal,
|
72
|
+
'font-weight': css.fontWeight.regular
|
73
|
+
});
|
74
|
+
utilities.verifyCSS(listSortingPage.includeLabelsCheckbox().parents('.ngie-checkbox').find('svg g').eq(1), {
|
75
|
+
'fill': css.color.activeButtons
|
76
|
+
});
|
77
|
+
utilities.verifyCSS(listSortingPage.topLabelLabel(), {
|
78
|
+
'color': css.color.labels,
|
79
|
+
'font-size': css.fontSize.normal,
|
80
|
+
'font-weight': css.fontWeight.semibold
|
81
|
+
});
|
82
|
+
utilities.verifyCSS(listSortingPage.topLabelInputField(), {
|
83
|
+
'color': css.color.text,
|
84
|
+
'font-size': css.fontSize.default,
|
85
|
+
'font-weight': css.fontWeight.regular
|
86
|
+
});
|
87
|
+
utilities.verifyCSS(listSortingPage.bottomLabelLabel(), {
|
88
|
+
'color': css.color.labels,
|
89
|
+
'font-size': css.fontSize.normal,
|
90
|
+
'font-weight': css.fontWeight.semibold
|
91
|
+
});
|
92
|
+
utilities.verifyCSS(listSortingPage.bottomLabelInputField(), {
|
93
|
+
'color': css.color.text,
|
94
|
+
'font-size': css.fontSize.default,
|
95
|
+
'font-weight': css.fontWeight.regular
|
96
|
+
});
|
97
|
+
});
|
98
|
+
|
99
|
+
it('Accessibility of Option label section', { tags: 'a11y' }, () => {
|
100
|
+
cy.checkAccessibility(listSortingPage.optionLabelLabel().parents('.special-character-wrapper'))
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
describe('Additional settings: Option label set correct answer section', () => {
|
105
|
+
abortEarlySetup();
|
106
|
+
before(() => {
|
107
|
+
cy.log('Navigating to list sorting question type');
|
108
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
109
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
110
|
+
cy.barsPreLoaderWait();
|
111
|
+
listSortingPage.steps.addQuestionInstructions();
|
112
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
113
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
114
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
115
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
116
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
117
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
118
|
+
listSortingPage.steps.allotPoints('20');
|
119
|
+
listSortingPage.steps.expandAdditonalSettings();
|
120
|
+
listSortingPage.steps.checkIncludeLablesCheckbox();
|
121
|
+
});
|
122
|
+
|
123
|
+
it('When user adds input to \'Top label\' then it should be displayed at the top of the options in the \'Set correct answer\' section', () => {
|
124
|
+
listSortingPage.steps.addInputToTopLabelInputField('Top label');
|
125
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTopLabel(), 'Top label');
|
126
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionBottomLabel(), 'notExist');
|
127
|
+
cy.log('Post step: Clear top label input field')
|
128
|
+
listSortingPage.steps.clearTopLabelInputField();
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When user adds input to \'Bottom label\' then it should be displayed at the bottom of the options in the \'Set correct answer\' section ', () => {
|
132
|
+
listSortingPage.steps.addInputToBottomLabelInputField('Bottom label');
|
133
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionBottomLabel(), 'Bottom label');
|
134
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionTopLabel(), 'notExist');
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When user adds input to both \'Top label\' and \'Bottom label\' then it should be displayed at the top and bottom of the options in the \'Set correct answer\' section respectively', () => {
|
138
|
+
listSortingPage.steps.addInputToTopLabelInputField('Top label');
|
139
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTopLabel(), 'Top label');
|
140
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionBottomLabel(), 'Bottom label');
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When user unchecks the \'Include option labels\' checkbox then the labels should not be displayed in the \'Set correct answer\' section', () => {
|
144
|
+
listSortingPage.steps.uncheckIncludeLablesCheckbox();
|
145
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionTopLabel(), 'notExist');
|
146
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionBottomLabel(), 'notExist');
|
147
|
+
});
|
148
|
+
});
|
149
|
+
|
150
|
+
describe('Additional settings: Option label preview tab', () => {
|
151
|
+
abortEarlySetup();
|
152
|
+
before(() => {
|
153
|
+
cy.log('Navigating to list sorting question type');
|
154
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
155
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
156
|
+
cy.barsPreLoaderWait();
|
157
|
+
listSortingPage.steps.addQuestionInstructions();
|
158
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
159
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
160
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
161
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
162
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
163
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
164
|
+
listSortingPage.steps.allotPoints('20');
|
165
|
+
listSortingPage.steps.expandAdditonalSettings();
|
166
|
+
listSortingPage.steps.checkIncludeLablesCheckbox();
|
167
|
+
});
|
168
|
+
|
169
|
+
it('When user adds input to \'Top label\' then it should be displayed at the top of the options in the \'Preview tab\'', () => {
|
170
|
+
listSortingPage.steps.addInputToTopLabelInputField('Top label');
|
171
|
+
listSortingPage.steps.switchToPreviewTab();
|
172
|
+
utilities.verifyInnerText(listSortingPage.previewTabTopLabel(), 'Top label');
|
173
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabBottomLabel(), 'notExist');
|
174
|
+
listSortingPage.steps.switchToEditTab();
|
175
|
+
cy.log('Post step: Clear top label input field')
|
176
|
+
listSortingPage.steps.clearTopLabelInputField();
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When user adds input to \'Bottom label\' then it should be displayed at the bottom of the options in the \'Preview tab\' ', () => {
|
180
|
+
listSortingPage.steps.addInputToBottomLabelInputField('Bottom label');
|
181
|
+
listSortingPage.steps.switchToPreviewTab();
|
182
|
+
utilities.verifyInnerText(listSortingPage.previewTabBottomLabel(), 'Bottom label');
|
183
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabTopLabel(), 'notExist');
|
184
|
+
});
|
185
|
+
|
186
|
+
it('When user adds input to both \'Top label\' and \'Bottom label\' then it should be displayed at the top and bottom of the options in the \'Preview tab\' respectively', () => {
|
187
|
+
listSortingPage.steps.switchToEditTab();
|
188
|
+
listSortingPage.steps.addInputToTopLabelInputField('Top label');
|
189
|
+
listSortingPage.steps.switchToPreviewTab();
|
190
|
+
utilities.verifyInnerText(listSortingPage.previewTabTopLabel(), 'Top label');
|
191
|
+
utilities.verifyInnerText(listSortingPage.previewTabBottomLabel(), 'Bottom label');
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When user unchecks the \'Include option labels\' checkbox then the labels should not be displayed in the \'Preview tab\'', () => {
|
195
|
+
listSortingPage.steps.switchToEditTab();
|
196
|
+
listSortingPage.steps.uncheckIncludeLablesCheckbox();
|
197
|
+
listSortingPage.steps.switchToPreviewTab();
|
198
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabTopLabel(), 'notExist');
|
199
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabBottomLabel(), 'notExist');
|
200
|
+
});
|
201
|
+
});
|
202
|
+
});
|
@@ -0,0 +1,188 @@
|
|
1
|
+
import { listSortingPage } from "../../../pages/listSortingPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
let options = ['plant', 'sprout', 'flower', 'seed'];
|
6
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
7
|
+
|
8
|
+
describe('Create item page - List sorting: All or nothing scoring', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Show correct answer', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to list sorting question type');
|
17
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
listSortingPage.steps.addQuestionInstructions();
|
20
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
21
|
+
});
|
22
|
+
|
23
|
+
//Failing due to - https://redmine.zeuslearning.com/issues/539911
|
24
|
+
listSortingPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet()
|
25
|
+
|
26
|
+
it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
|
27
|
+
listSortingPage.steps.switchToEditTab();
|
28
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
29
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
30
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
31
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
32
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
33
|
+
listSortingPage.steps.allotPoints('15');
|
34
|
+
listSortingPage.steps.switchToPreviewTab();
|
35
|
+
listSortingPage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
|
36
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 15);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
|
40
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
41
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
42
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
43
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
44
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray)
|
45
|
+
listSortingPage.steps.resetQuestionPreview();
|
46
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
|
47
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
48
|
+
});
|
49
|
+
});
|
50
|
+
|
51
|
+
describe('Question Preview: AutoScored - All or Nothing', () => {
|
52
|
+
abortEarlySetup();
|
53
|
+
before(() => {
|
54
|
+
cy.log('Navigating to list sorting question type');
|
55
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
56
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
57
|
+
cy.barsPreLoaderWait();
|
58
|
+
listSortingPage.steps.addQuestionInstructions();
|
59
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
60
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
61
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
62
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
63
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
64
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
65
|
+
listSortingPage.steps.allotPoints('20');
|
66
|
+
listSortingPage.steps.expandAdditonalSettings();
|
67
|
+
listSortingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
68
|
+
listSortingPage.steps.switchToPreviewTab();
|
69
|
+
});
|
70
|
+
|
71
|
+
listSortingPage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
|
72
|
+
|
73
|
+
listSortingPage.tests.verifya11yOfCreateItemWrapperContents();
|
74
|
+
|
75
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect border or icons should not be displayed, a correct answer container with \'Correct answers:\' label and all correct answers with numeration should be displayed below the question preview', () => {
|
76
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
77
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 20);
|
78
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
79
|
+
listSortingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
80
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
81
|
+
utilities.verifyInnerText(listSortingPage.correctAnswerContainerCorrectAnswersLabel(), 'Correct answers:');
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
|
85
|
+
cy.log('Pre-step: Deselect the show correct checkbox')
|
86
|
+
listSortingPage.steps.uncheckShowCorrectAnswerCheckbox()
|
87
|
+
listSortingPage.steps.checkAnswer();
|
88
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
89
|
+
listSortingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
90
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
|
94
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
95
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
96
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2);
|
97
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 3);
|
98
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
|
99
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 20);
|
100
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
101
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
102
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
103
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
104
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
105
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
106
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
107
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
108
|
+
|
109
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
110
|
+
|
111
|
+
cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then red cross-mark icons should be displayed beside all incorrect the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
112
|
+
listSortingPage.steps.checkAnswer();
|
113
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
114
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
115
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
116
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
117
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
118
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
119
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
120
|
+
});
|
121
|
+
|
122
|
+
listSortingPage.tests.verifyCSSAndA11yOfIncorrectAnswerLabel()
|
123
|
+
|
124
|
+
it('When user attempts the question partially correct with some options at the correct position and some at incorrect then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
|
125
|
+
listSortingPage.steps.resetQuestionPreview();
|
126
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 0);
|
127
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
128
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2);
|
129
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
130
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
|
131
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox()
|
132
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 20);
|
133
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
134
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
135
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
136
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
137
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
138
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
139
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '3']);
|
140
|
+
|
141
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
142
|
+
|
143
|
+
cy.log('When user attempts the question partially correct and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position,, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
144
|
+
listSortingPage.steps.checkAnswer()
|
145
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
146
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
147
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
148
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
149
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
150
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
151
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
152
|
+
});
|
153
|
+
|
154
|
+
it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
|
155
|
+
listSortingPage.steps.resetQuestionPreview();
|
156
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
157
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
158
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
159
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
160
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
|
161
|
+
listSortingPage.steps.verifyPreviewTabScoreText(20, 20);
|
162
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox()
|
163
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
164
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
165
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
166
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
167
|
+
listSortingPage.steps.verifyCorrectAttemptBorder();
|
168
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
169
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
170
|
+
|
171
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
172
|
+
|
173
|
+
cy.log('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
174
|
+
listSortingPage.steps.checkAnswer();
|
175
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
176
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
177
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
178
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
179
|
+
listSortingPage.steps.verifyCorrectAttemptBorder();
|
180
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
181
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
182
|
+
});
|
183
|
+
|
184
|
+
listSortingPage.tests.verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel()
|
185
|
+
|
186
|
+
listSortingPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer('20');
|
187
|
+
});
|
188
|
+
});
|