itemengine-cypress-automation 1.0.203-31stMayFixes-16985aa.0 → 1.0.203
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/config-files/ilqa.json +1 -1
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +3 -3
- package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +14 -2
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightBasic.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightBasic.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +356 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +320 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +355 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/toleranceThresholdScoring.js +141 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/pagination.js +170 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettingsForDropzones.js +170 -0
- package/cypress/e2e/ILC/ImageHighlight/Scoring/singleSelectionPreviewScoring.js +250 -0
- package/cypress/e2e/ILC/ImageHighlight/singleMultipleSelection.js +99 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/additionalSettings.js +89 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/styleAndLayoutCustomizationBorderProperties.js +53 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/styleAndLayoutCustomizationGridProperties.js +98 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/styleAndLayoutCustomizationLayoutProperties.js +89 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/styleAndLayoutCustomizationBorderProperties.js +54 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/styleAndLayoutCustomizationLayoutProperties.js +90 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/styleAndLayoutCutomizationGridProperties.js +99 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingPenaltyScoring.js +61 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +227 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +380 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +294 -0
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +383 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +7 -7
- package/cypress/pages/chartsBarPage.js +1 -4
- package/cypress/pages/chartsDotPlotPage.js +0 -13
- package/cypress/pages/components/additionalSettingsPanel.js +1 -0
- package/cypress/pages/components/ariaLabelSectionComponent.js +1 -1
- package/cypress/pages/components/chartsCommonComponent.js +19 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +1 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +1836 -134
- package/cypress/pages/components/singleMultipleSelectionModeComponent.js +74 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +25 -2
- package/cypress/pages/essayResponsePage.js +9 -1
- package/cypress/pages/feedbackScalePage.js +1 -1
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +111 -30
- package/cypress/pages/matchingPage.js +2 -1
- package/cypress/pages/multipleSelectionGridPage.js +4 -2
- package/cypress/pages/shortTextResponsePage.js +2 -2
- package/cypress/pages/singleSelectionGridPage.js +4 -2
- package/cypress/pages/textEntryMathPage.js +1 -0
- package/cypress/pages/textEntryMathWithImagePage.js +1 -1
- package/cypress/pages/uploadResponsePage.js +1 -3
- package/package.json +2 -2
@@ -0,0 +1,170 @@
|
|
1
|
+
import { dragAndDropIntoCategoriesPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create Item page - Drag and drop into categories: Pagination cases - Edit tab and preview tab', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Pagination cases - Specify correct answer section', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to Drag and drop into categories question type');
|
15
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
dragAndDropIntoCategoriesPage.steps.setRowsAndColumnsForQuestion();
|
18
|
+
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Bat', 'Eagle']);
|
19
|
+
});
|
20
|
+
|
21
|
+
it('When there are less than 8 columns in the table, then the left and right arrow navigation button should not be displayed in the \'Specify correct answer\' table', () => {
|
22
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection(), 'notExist');
|
23
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection(), 'notExist');
|
24
|
+
});
|
25
|
+
|
26
|
+
it('When the user adds multiple columns in the table such that they exceed the viewport, then the left and right arrow navigation button should be displayed in the \'Specify correct answer\' table', () => {
|
27
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(8);
|
28
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection(), 'visible');
|
29
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection(), 'visible');
|
30
|
+
});
|
31
|
+
|
32
|
+
it('By default the left arrow navigation button should be disabled and right arrow navigation should be enabled in \'Specify correct answer\' table', () => {
|
33
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection());
|
34
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection());
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When user clicks on the right arrow navigation button, then the table should be scrolled by one column towards its right and the left and right arrow navigation button should now be enabled', () => {
|
38
|
+
cy.log('Pre-step: Setting number of columns to 15');
|
39
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(15);
|
40
|
+
dragAndDropIntoCategoriesPage.steps.clickOnRightArrowNavigationButtonSpecifyCorrectAnswerSection();
|
41
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnIsVisibleInTableSpecifyCorrectAnswer(8);
|
42
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection());
|
43
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection());
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When user has navigated to the rightmost column of the table, then the right arrow navigation button should be disabled and left arrow should be enabled', () => {
|
47
|
+
for (let index = 9; index < 16; index++) {
|
48
|
+
dragAndDropIntoCategoriesPage.steps.clickOnRightArrowNavigationButtonSpecifyCorrectAnswerSection();
|
49
|
+
}
|
50
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection());
|
51
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection());
|
52
|
+
});
|
53
|
+
|
54
|
+
it('When user clicks on the left arrow navigation button, then the table should be scrolled by one column towards its left and the right arrow navigation button should be enabled', () => {
|
55
|
+
dragAndDropIntoCategoriesPage.steps.clickOnLeftArrowNavigationButtonSpecifyCorrectAnswerSection();
|
56
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnIsVisibleInTableSpecifyCorrectAnswer(8);
|
57
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection());
|
58
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection());
|
59
|
+
});
|
60
|
+
|
61
|
+
it('CSS of \'Specify correct answer\' Columns and Rows input steppers section\'', { tags: 'css' }, () => {
|
62
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection(), {
|
63
|
+
'color': css.color.nextPreviousButtonFill
|
64
|
+
});
|
65
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection(), {
|
66
|
+
'color': css.color.nextPreviousButtonFill
|
67
|
+
});
|
68
|
+
});
|
69
|
+
|
70
|
+
it('Accessibility of \'Specify correct answer\' Columns and Rows input steppers section\'', { tags: 'a11y' }, () => {
|
71
|
+
cy.checkAccessibility(dragAndDropIntoCategoriesPage.specifyCorrectAnswerSectionWrapper());
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When user has navigated towards the left using the left arrow navigation button, then the right arrow navigation button should be enabled again', () => {
|
75
|
+
for (let index = 9; index < 16; index++) {
|
76
|
+
dragAndDropIntoCategoriesPage.steps.clickOnLeftArrowNavigationButtonSpecifyCorrectAnswerSection();
|
77
|
+
}
|
78
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection());
|
79
|
+
});
|
80
|
+
|
81
|
+
it('When the number of columns is reduced such that they do not exceed the viewport, then the then the left and right arrow navigation button should not be displayed in the \'Specify correct answer\' table', () => {
|
82
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(7);
|
83
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonSpecifyCorrectAnswerSection(), 'notExist');
|
84
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonSpecifyCorrectAnswerSection(), 'notExist');
|
85
|
+
});
|
86
|
+
});
|
87
|
+
|
88
|
+
describe('Pagination cases - Preview tab', () => {
|
89
|
+
abortEarlySetup();
|
90
|
+
before(() => {
|
91
|
+
cy.log('Navigating to Drag and drop into categories question type');
|
92
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
93
|
+
cy.barsPreLoaderWait();
|
94
|
+
dragAndDropIntoCategoriesPage.steps.setRowsAndColumnsForQuestion();
|
95
|
+
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Bat', 'Eagle']);
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When there are less than 8 columns in the table, then the left and right arrow navigation button should not be displayed in the \'Specify correct answer\' table', () => {
|
99
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
100
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab(), 'notExist');
|
101
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab(), 'notExist');
|
102
|
+
});
|
103
|
+
|
104
|
+
it('When the user adds columns in the table such that they exceed the viewport, then the left and right arrow navigation button should be displayed in the \'Specify correct answer\' table', () => {
|
105
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
106
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(8);
|
107
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
108
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab(), 'visible');
|
109
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab(), 'visible');
|
110
|
+
});
|
111
|
+
|
112
|
+
it('By default the left arrow navigation button should be disabled and right arrow navigation should be enabled in \'Specify correct answer\' table', () => {
|
113
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab());
|
114
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab());
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When user clicks on the right arrow navigation button, then the table should be scrolled by one column towards its right and the left and right arrow navigation button should now be enabled', () => {
|
118
|
+
cy.log('Pre-step: Setting number of columns to 15');
|
119
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
120
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(15);
|
121
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
122
|
+
dragAndDropIntoCategoriesPage.steps.clickOnRightArrowNavigationButtonPreviewTab();
|
123
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnIsVisibleInTablePreviewTab(8);
|
124
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab());
|
125
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab());
|
126
|
+
});
|
127
|
+
|
128
|
+
it('When user has navigated to the rightmost column of the table, then the right arrow navigation button should be disabled and left arrow should be enabled', () => {
|
129
|
+
for (let index = 9; index < 16; index++) {
|
130
|
+
dragAndDropIntoCategoriesPage.steps.clickOnRightArrowNavigationButtonPreviewTab();
|
131
|
+
}
|
132
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab());
|
133
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab());
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When user clicks on the left arrow navigation button, then the table should be scrolled by one column towards its left and the right arrow navigation button should be enabled', () => {
|
137
|
+
dragAndDropIntoCategoriesPage.steps.clickOnLeftArrowNavigationButtonPreviewTab();
|
138
|
+
dragAndDropIntoCategoriesPage.steps.verifyColumnIsVisibleInTablePreviewTab(8);
|
139
|
+
utilities.verifyElementNotDisabled(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab());
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user has navigated towards the left using the left arrow navigation button, then the right arrow navigation button should be enabled again', () => {
|
143
|
+
for (let index = 9; index < 16; index++) {
|
144
|
+
dragAndDropIntoCategoriesPage.steps.clickOnLeftArrowNavigationButtonPreviewTab();
|
145
|
+
}
|
146
|
+
utilities.verifyElementDisabled(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab());
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When the number of columns is reduced such that they do not exceed the viewport, then the then the left and right arrow navigation button should not be displayed in the \'Specify correct answer\' table', () => {
|
150
|
+
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
151
|
+
dragAndDropIntoCategoriesPage.steps.addInputToColumnInputStepper(7);
|
152
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
153
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab(), 'notExist');
|
154
|
+
utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab(), 'notExist');
|
155
|
+
});
|
156
|
+
|
157
|
+
it('CSS of \'Specify correct answer\' Columns and Rows input steppers section\'', { tags: 'css' }, () => {
|
158
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.leftArrowNavigationButtonPreviewTab(), {
|
159
|
+
'color': css.color.nextPreviousButtonFill
|
160
|
+
});
|
161
|
+
utilities.verifyCSS(dragAndDropIntoCategoriesPage.rightArrowNavigationButtonPreviewTab(), {
|
162
|
+
'color': css.color.nextPreviousButtonFill
|
163
|
+
});
|
164
|
+
});
|
165
|
+
|
166
|
+
it('Accessibility of \'Specify correct answer\' Columns and Rows input steppers section\'', { tags: 'a11y' }, () => {
|
167
|
+
cy.checkAccessibility(dragAndDropIntoCategoriesPage.previewTabQuestionWrapper());
|
168
|
+
});
|
169
|
+
});
|
170
|
+
});
|
@@ -0,0 +1,170 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const enumerationOptions = {
|
5
|
+
'Numerical': ['1', '2'],
|
6
|
+
'Alphabet (uppercase)': ['A', 'B'],
|
7
|
+
'Alphabet (lowercase)': ['a', 'b'],
|
8
|
+
'Roman numeral (uppercase)': ['I', 'II'],
|
9
|
+
'Roman numeral (lowercase)': ['i', 'ii'],
|
10
|
+
};
|
11
|
+
const css = Cypress.env('css');
|
12
|
+
|
13
|
+
describe('Fill In the gaps with drag and drop - Additional settings : Grading view, ARIA label for dropzones', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
describe('Additional Settings: Grading view - Contents in edit tab', () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
|
24
|
+
});
|
25
|
+
|
26
|
+
fillInTheGapsDragAndDropPage.tests.verifyGradingViewEnumerationSectionContents('Dropzone');
|
27
|
+
|
28
|
+
it('When the user selects "Without enumeration" radio button, the identifiers section should disappear', () => {
|
29
|
+
fillInTheGapsDragAndDropPage.steps.selectEnumerationType('without enumeration');
|
30
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.identifiersLabel(), 'notExist');
|
31
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.numericalToggleButton(), 'notExist');
|
32
|
+
});
|
33
|
+
|
34
|
+
it('When the user selects "With enumeration" radio button again, the identifiers section should appear again', () => {
|
35
|
+
fillInTheGapsDragAndDropPage.steps.selectEnumerationType('with enumeration');
|
36
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.identifiersLabel(), 'visible');
|
37
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.numericalToggleButton(), 'visible');
|
38
|
+
})
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Additional settings: Grading view - functionality in preview tab', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
45
|
+
cy.barsPreLoaderWait();
|
46
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves']);
|
47
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Leaves': 1});
|
48
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
|
49
|
+
});
|
50
|
+
|
51
|
+
Object.keys(enumerationOptions).forEach(option => {
|
52
|
+
it(`When "${option}" toggle button is selected in the dropzone identifiers section, then on switching to the preview tab dropzone numeration should not be displayed`, () => {
|
53
|
+
fillInTheGapsDragAndDropPage.steps.selectIdentifierToggleButton(option);
|
54
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
55
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumerationNotExists();
|
56
|
+
});
|
57
|
+
|
58
|
+
it(`When the user switches to the "Grading view", then the "${option}" numeration should be displayed in the dropzones as well as correct answer options in the correct answer section`, () => {
|
59
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
60
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneEnumeration(enumerationOptions[option]);
|
61
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesEnumeration(enumerationOptions[option]);
|
62
|
+
cy.log('Post step: Switch to Edit tab')
|
63
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
64
|
+
});
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user selects "without enumeration" radio button, then in the "Grading view", numeration should not be displayed for dropzones and in the correct answer section, the entire question preview should be displayed with correct answers', () => {
|
68
|
+
fillInTheGapsDragAndDropPage.steps.selectEnumerationType('without enumeration');
|
69
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
70
|
+
fillInTheGapsDragAndDropPage.steps.switchToGradingView();
|
71
|
+
utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswerSectionWithoutEnumerationWrapper(), 'Lorem ipsum dolor sit amet, \nPetals\n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \nLeaves\n tempus tellus dapibus.');
|
72
|
+
fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesWithoutEnumeration(['Petals', 'Leaves']);
|
73
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumerationNotExists();
|
74
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.correctAnswersNumeration(), 'notExist');
|
75
|
+
});
|
76
|
+
|
77
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
78
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswerSectionWithoutEnumerationWrapper(), {
|
79
|
+
'color': css.color.text,
|
80
|
+
'font-size': css.fontSize.default,
|
81
|
+
'font-weight': css.fontWeight.regular
|
82
|
+
});
|
83
|
+
fillInTheGapsDragAndDropPage.correctAnswerSectionWithoutEnumerationWrapper()
|
84
|
+
.within(() => {
|
85
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswerResponseWrapperWithoutEnumeration(), {
|
86
|
+
'color': css.color.text,
|
87
|
+
'font-size': css.fontSize.default,
|
88
|
+
'font-weight': css.fontWeight.regular
|
89
|
+
});
|
90
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.correctAnswerResponseWrapperWithoutEnumeration(), {
|
91
|
+
'border': `1px solid ${css.color.correctAnswer}`
|
92
|
+
});
|
93
|
+
})
|
94
|
+
});
|
95
|
+
|
96
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
97
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.correctAnswerSectionWithoutEnumerationWrapper().parents('[class*="question-preview-wrapper"]'));
|
98
|
+
});
|
99
|
+
});
|
100
|
+
|
101
|
+
describe('Additional settings: ARIA label for dropzones - Contents in edit tab', () => {
|
102
|
+
abortEarlySetup();
|
103
|
+
before(() => {
|
104
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
105
|
+
cy.barsPreLoaderWait();
|
106
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
|
107
|
+
});
|
108
|
+
|
109
|
+
fillInTheGapsDragAndDropPage.tests.verifyAriaLabelSectionContents('dropzones');
|
110
|
+
|
111
|
+
it('When the users adds a new dropzone, the count of the aria label text input fields should update accordingly', () => {
|
112
|
+
fillInTheGapsDragAndDropPage.steps.addResponseArea();
|
113
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.ariaLabelInputField(), 3);
|
114
|
+
fillInTheGapsDragAndDropPage.steps.verifyAriaLabelTextInputFields(2);
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When the user deletes any dropzone, the count of the aria label texts input fields should update accordingly', () => {
|
118
|
+
fillInTheGapsDragAndDropPage.steps.deleteAResponseArea(1);
|
119
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.ariaLabelInputField(), 2);
|
120
|
+
fillInTheGapsDragAndDropPage.steps.verifyAriaLabelTextInputFields(0);
|
121
|
+
fillInTheGapsDragAndDropPage.steps.verifyAriaLabelTextInputFields(1);
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When the user has not set \'ARIA label\' input field, then default aria labels should be present for the dropzones of the specify correct answer section', () => {
|
125
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelSpecifyCorrectAnswerSection(0, 'Response Area');
|
126
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelSpecifyCorrectAnswerSection(1, 'Response Area');
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user sets aria label, then in the dropzones of the specify correct answer section, the aria labels should also update', () => {
|
130
|
+
fillInTheGapsDragAndDropPage.steps.enterTextInAriaLabelInputField(0, 'Add answer for response 1');
|
131
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelSpecifyCorrectAnswerSection(0, 'Add answer for response 1');
|
132
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelSpecifyCorrectAnswerSection(1, 'Response Area');
|
133
|
+
});
|
134
|
+
});
|
135
|
+
|
136
|
+
describe('Additional settings: ARIA label for dropzones - functionality in preview tab', () => {
|
137
|
+
abortEarlySetup();
|
138
|
+
before(() => {
|
139
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
140
|
+
cy.barsPreLoaderWait();
|
141
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
|
142
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
143
|
+
});
|
144
|
+
|
145
|
+
it('When the user has not set \'ARIA label\' input field, then default aria labels should be present for the dropzones in the preview tab', () => {
|
146
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(0, 'Response Area');
|
147
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(1, 'Response Area');
|
148
|
+
});
|
149
|
+
|
150
|
+
it('When the user has set \'ARIA label\', then it should be present for the dropzones in the preview tab', () => {
|
151
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
152
|
+
fillInTheGapsDragAndDropPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
|
153
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
154
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(0, 'Correct response 1');
|
155
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(1, 'Response Area');
|
156
|
+
});
|
157
|
+
|
158
|
+
it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
|
159
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.dropzonePreviewTab().parents('[class*="question-preview-wrapper"]'));
|
160
|
+
});
|
161
|
+
|
162
|
+
it('When the user clears the set value in the \'ARIA label\' input field, then the default aria labels should be present for the dropzones in the preview tab', () => {
|
163
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
164
|
+
fillInTheGapsDragAndDropPage.steps.clearTextInAriaLabelInputField(0);
|
165
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
166
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(0, 'Response Area');
|
167
|
+
fillInTheGapsDragAndDropPage.steps.verifyDropzoneAriaLabelPreviewTab(1, 'Response Area');
|
168
|
+
});
|
169
|
+
});
|
170
|
+
});
|
@@ -0,0 +1,250 @@
|
|
1
|
+
import { imageHighlightPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const flowerHighlightRegion = [[40, 6], [40, 20], [55, 20], [55, 6]];
|
7
|
+
const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
|
8
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
9
|
+
|
10
|
+
describe('Create Item page - Image highlight: Alternative answer with single selection', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Question Preview: AutoScored - Single selection: When correct answer points are more than alternate answer points', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
cy.log('Navigating to highlight image question type');
|
19
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
22
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
23
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
24
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
25
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
26
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
27
|
+
imageHighlightPage.steps.selectSingleSelectionToggle();
|
28
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
29
|
+
imageHighlightPage.steps.allotPoints(20);
|
30
|
+
imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
|
31
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
32
|
+
imageHighlightPage.steps.allotPoints(12);
|
33
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
|
37
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
38
|
+
imageHighlightPage.steps.switchToGradingView();
|
39
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab();
|
40
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
41
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
42
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
43
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
47
|
+
utilities.verifyCSS(imageHighlightPage.correctIncorrectAnswerTextWrapper(), {
|
48
|
+
'border': `1px solid ${css.color.incorrectAnswer}`,
|
49
|
+
'color': css.color.text,
|
50
|
+
'font-size': css.fontSize.default,
|
51
|
+
'font-weight': css.fontWeight.regular
|
52
|
+
});
|
53
|
+
utilities.verifyCSS(imageHighlightPage.highlightNumerationPreviewTab(), {
|
54
|
+
'color': css.color.text,
|
55
|
+
'font-size': css.fontSize.small,
|
56
|
+
'font-weight': css.fontWeight.regular
|
57
|
+
});
|
58
|
+
utilities.verifyCSS(imageHighlightPage.correctAnswerContainerAnswerWrapper().find('.question-text-wrapper'), {
|
59
|
+
'color': css.color.text,
|
60
|
+
'font-size': css.fontSize.default,
|
61
|
+
'font-weight': css.fontWeight.regular
|
62
|
+
});
|
63
|
+
});
|
64
|
+
|
65
|
+
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
66
|
+
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
67
|
+
});
|
68
|
+
|
69
|
+
it('When user attempts the response from the correct accordion, full points should be alloted on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
70
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
71
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
72
|
+
imageHighlightPage.steps.verifyPreviewScore(20, 20);
|
73
|
+
imageHighlightPage.steps.switchToGradingView();
|
74
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
75
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
76
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
77
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
78
|
+
});
|
79
|
+
|
80
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
81
|
+
utilities.verifyCSS(imageHighlightPage.correctIncorrectAnswerTextWrapper(), {
|
82
|
+
'border': `1px solid ${css.color.correctAnswer}`,
|
83
|
+
'color': css.color.text,
|
84
|
+
'font-size': css.fontSize.default,
|
85
|
+
'font-weight': css.fontWeight.regular
|
86
|
+
});
|
87
|
+
utilities.verifyCSS(imageHighlightPage.highlightNumerationPreviewTab(), {
|
88
|
+
'color': css.color.text,
|
89
|
+
'font-size': css.fontSize.small,
|
90
|
+
'font-weight': css.fontWeight.regular
|
91
|
+
});
|
92
|
+
});
|
93
|
+
|
94
|
+
it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
95
|
+
cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points from the alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
99
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
100
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
101
|
+
imageHighlightPage.steps.verifyPreviewScore(12, 20);
|
102
|
+
imageHighlightPage.steps.switchToGradingView();
|
103
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
104
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
105
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
106
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
107
|
+
});
|
108
|
+
|
109
|
+
it('When user attempts the question with incorrect highlight region then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () =>{
|
110
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
111
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
112
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
113
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
114
|
+
imageHighlightPage.steps.switchToGradingView();
|
115
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
|
116
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
117
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
|
118
|
+
});
|
119
|
+
});
|
120
|
+
|
121
|
+
describe('Question Preview: AutoScored - Single selection: When correct answer points are less than alternate answer points', () => {
|
122
|
+
abortEarlySetup();
|
123
|
+
before(() => {
|
124
|
+
cy.log('Navigating to highlight image question type');
|
125
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
126
|
+
cy.barsPreLoaderWait();
|
127
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
128
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
129
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
130
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
131
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
132
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
133
|
+
imageHighlightPage.steps.selectSingleSelectionToggle();
|
134
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
135
|
+
imageHighlightPage.steps.allotPoints(10);
|
136
|
+
imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
|
137
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
138
|
+
imageHighlightPage.steps.allotPoints(20);
|
139
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
|
143
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
144
|
+
imageHighlightPage.steps.switchToGradingView();
|
145
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab();
|
146
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
147
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
148
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
149
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 2'], [1]);
|
150
|
+
});
|
151
|
+
|
152
|
+
it('When the user highlights a correct region with points less than alternative answer, then the user should be awarded with points from correct accordian and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
153
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
154
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
155
|
+
imageHighlightPage.steps.verifyPreviewScore(10, 20);
|
156
|
+
imageHighlightPage.steps.switchToGradingView();
|
157
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
158
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
159
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
160
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
161
|
+
});
|
162
|
+
|
163
|
+
it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points from alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
164
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
165
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
166
|
+
imageHighlightPage.steps.verifyPreviewScore(20, 20);
|
167
|
+
imageHighlightPage.steps.switchToGradingView();
|
168
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
169
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
170
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
171
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
172
|
+
});
|
173
|
+
|
174
|
+
it('When user attempts the question with incorrect highlight region then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () =>{
|
175
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
176
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
177
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
178
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 20);
|
179
|
+
imageHighlightPage.steps.switchToGradingView();
|
180
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
|
181
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
182
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 2'], [1]);
|
183
|
+
});
|
184
|
+
});
|
185
|
+
|
186
|
+
describe('Question Preview: AutoScored - Single selection: When correct answer points are equal to alternate answer points', () => {
|
187
|
+
abortEarlySetup();
|
188
|
+
before(() => {
|
189
|
+
cy.log('Navigating to highlight image question type');
|
190
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
191
|
+
cy.barsPreLoaderWait();
|
192
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
193
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
194
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
195
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
196
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
197
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
198
|
+
imageHighlightPage.steps.selectSingleSelectionToggle();
|
199
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
200
|
+
imageHighlightPage.steps.allotPoints(10);
|
201
|
+
imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
|
202
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
203
|
+
imageHighlightPage.steps.allotPoints(10);
|
204
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
205
|
+
});
|
206
|
+
|
207
|
+
it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
|
208
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 10);
|
209
|
+
imageHighlightPage.steps.switchToGradingView();
|
210
|
+
imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab();
|
211
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
212
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
213
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
214
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
|
215
|
+
});
|
216
|
+
|
217
|
+
it('When the user highlights a correct region with points equal to alternative answer, then the user should be awarded with points from correct accordian and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
218
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
219
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(0);
|
220
|
+
imageHighlightPage.steps.verifyPreviewScore(10, 10);
|
221
|
+
imageHighlightPage.steps.switchToGradingView();
|
222
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
223
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
|
224
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
225
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
226
|
+
});
|
227
|
+
|
228
|
+
it('When user attempts the response from the alternative accordion, then the user should be awarded with points specified for alternative accordion and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
229
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
230
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(1);
|
231
|
+
imageHighlightPage.steps.verifyPreviewScore(10, 10);
|
232
|
+
imageHighlightPage.steps.switchToGradingView();
|
233
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
234
|
+
imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
|
235
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
236
|
+
imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
|
237
|
+
});
|
238
|
+
|
239
|
+
it('When user attempts the question with incorrect highlight region then no points should be given and on switching to \'Grading\' view, incorrect icon should be displayed beside the wrong response, a status message with text \'Your answer is incorrect\' should be displayed and correct answer section should be displayed', () =>{
|
240
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
241
|
+
imageHighlightPage.steps.resetQuestionPreview();
|
242
|
+
imageHighlightPage.steps.highlightARegionInPreviewTab(2);
|
243
|
+
imageHighlightPage.steps.verifyPreviewScore(0, 10);
|
244
|
+
imageHighlightPage.steps.switchToGradingView();
|
245
|
+
imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
|
246
|
+
imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
247
|
+
imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
|
248
|
+
});
|
249
|
+
});
|
250
|
+
});
|