itemengine-cypress-automation 1.0.198-drawingResponseEnumUpdate-1aa98cf.0 → 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 +2 -2
package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
import { itemPreviewPage, listOrderingPage, studentViewPage } from "../../../../pages";
|
2
|
+
import { ckEditorToolbar, equationEditorFlyout } from "../../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
7
|
+
const views = utilities.getViews(previewContentViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
const css = Cypress.env('css');
|
10
|
+
|
11
|
+
describe('Create item page - List ordering - Preview contents in all views', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
views.forEach((view) => {
|
17
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
18
|
+
abortEarlySetup();
|
19
|
+
before(() => {
|
20
|
+
switch (view) {
|
21
|
+
case 'Question preview':
|
22
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
25
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
|
26
|
+
listOrderingPage.steps.allotPoints(10);
|
27
|
+
cy.log('Add image to option input field')
|
28
|
+
listOrderingPage.steps.focusInOptionsInputField(0);
|
29
|
+
ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar();
|
30
|
+
ckEditorToolbar.steps.addImageToInputField();
|
31
|
+
listOrderingPage.steps.enterTextInOptionInputField(0, 'Fox');
|
32
|
+
cy.log('Add bold text to option input field')
|
33
|
+
listOrderingPage.steps.focusInOptionsInputField(1);
|
34
|
+
ckEditorToolbar.steps.selectBoldOptionFromCKEditorToolbar();
|
35
|
+
listOrderingPage.steps.enterTextInOptionInputField(1, 'This is a bold option');
|
36
|
+
cy.log('Add equation to option input field')
|
37
|
+
listOrderingPage.steps.enterTextInOptionInputField(2, 'Solve the following');
|
38
|
+
listOrderingPage.steps.focusInOptionsInputField(2);
|
39
|
+
ckEditorToolbar.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
40
|
+
equationEditorFlyout.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
41
|
+
listOrderingPage.steps.enterTextInOptionInputField(3, 'alpha');
|
42
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('This is a bold option', 0);
|
43
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('Solve the following', 1);
|
44
|
+
listOrderingPage.steps.switchToPreviewTab();
|
45
|
+
break;
|
46
|
+
case 'Item view':
|
47
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
48
|
+
break;
|
49
|
+
case 'Item preview':
|
50
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
listOrderingPage.steps.switchToPreviewTab();
|
52
|
+
break;
|
53
|
+
case 'Student view':
|
54
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
55
|
+
break;
|
56
|
+
case 'Grading view':
|
57
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
58
|
+
break;
|
59
|
+
case 'Correct answer view':
|
60
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
61
|
+
break;
|
62
|
+
default:
|
63
|
+
throw new Error('Invalid view');
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
after(() => {
|
68
|
+
if (view === 'Question preview') {
|
69
|
+
listOrderingPage.steps.clickOnSaveQuestionButton();
|
70
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
71
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
72
|
+
}
|
73
|
+
if (view === 'Student view') {
|
74
|
+
studentViewPage.steps.submitResponse();
|
75
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
76
|
+
}
|
77
|
+
});
|
78
|
+
|
79
|
+
it('Question instructions should be visible', () => {
|
80
|
+
utilities.verifyInnerText(listOrderingPage.questionInstructionsText(), 'Arrange options in correct order.');
|
81
|
+
utilities.verifyElementVisibilityState(listOrderingPage.questionInstructionsText(), 'visible');
|
82
|
+
});
|
83
|
+
|
84
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
85
|
+
it(`When the user has added image, equation, bold text to the options input fields, then they should be displayed in the options container in ${view}`, () => {
|
86
|
+
listOrderingPage.steps.verifyHorizontalOptionWithImageInPreviewTab(0);
|
87
|
+
listOrderingPage.steps.verifyHorizontalOptionWithBoldTextInPreviewTab(1);
|
88
|
+
listOrderingPage.steps.verifyHorizontalOptionWithEquationTextInPreviewTab(2);
|
89
|
+
});
|
90
|
+
|
91
|
+
it('User should be able to reorder options containing image, bold text and equation options in the list', () => {
|
92
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('This is a bold option', 0);
|
93
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('Solve the following', 1);
|
94
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInPreviewTab('This is a bold option', 0);
|
95
|
+
listOrderingPage.steps.verifyHorizontalOptionWithBoldTextInPreviewTab(0);
|
96
|
+
listOrderingPage.steps.verifyHorizontalOptionWithEquationTextInPreviewTab(1);
|
97
|
+
listOrderingPage.steps.verifyHorizontalOptionWithImageInPreviewTab(2);
|
98
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInPreviewTab('alpha', 3);
|
99
|
+
});
|
100
|
+
} else if (view === 'Grading view') {
|
101
|
+
it(`The order of the responses should be as per the submitted response`, () => {
|
102
|
+
listOrderingPage.steps.verifyHorizontalOptionWithBoldTextInPreviewTab(0);
|
103
|
+
listOrderingPage.steps.verifyHorizontalOptionWithEquationTextInPreviewTab(1);
|
104
|
+
listOrderingPage.steps.verifyHorizontalOptionWithImageInPreviewTab(2);
|
105
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInPreviewTab('alpha', 3);
|
106
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('This is a bold option');
|
107
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('Solve the following');
|
108
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('Fox');
|
109
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('alpha');
|
110
|
+
listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
111
|
+
listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
|
112
|
+
});
|
113
|
+
|
114
|
+
it('The order of the responses should not be editable', () => {
|
115
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('This is a bold option', 2);
|
116
|
+
listOrderingPage.steps.verifyHorizontalOptionWithBoldTextInPreviewTab(0);
|
117
|
+
listOrderingPage.steps.verifyHorizontalOptionWithEquationTextInPreviewTab(1);
|
118
|
+
listOrderingPage.steps.verifyHorizontalOptionWithImageInPreviewTab(2);
|
119
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInPreviewTab('alpha', 3);
|
120
|
+
});
|
121
|
+
} else {
|
122
|
+
it('The order of the options should be as per the correct answer order', () => {
|
123
|
+
listOrderingPage.steps.verifyHorizontalOptionWithBoldTextInPreviewTab(0);
|
124
|
+
listOrderingPage.steps.verifyHorizontalOptionWithEquationTextInPreviewTab(1);
|
125
|
+
listOrderingPage.steps.verifyHorizontalOptionWithImageInPreviewTab(2);
|
126
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInPreviewTab('alpha', 3);
|
127
|
+
});
|
128
|
+
}
|
129
|
+
|
130
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
131
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab(), {
|
132
|
+
'background-color': css.color.defaultBackground,
|
133
|
+
'border': `1px solid ${css.color.draggableOptionBorder}`
|
134
|
+
});
|
135
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
|
136
|
+
'color': css.color.text,
|
137
|
+
'font-size': css.fontSize.default,
|
138
|
+
'font-weight': css.fontWeight.regular
|
139
|
+
});
|
140
|
+
utilities.verifyCSS(listOrderingPage.horizontalOptionPreviewTab().find('.question-text-wrapper'), {
|
141
|
+
'color': css.color.text,
|
142
|
+
'font-size': css.fontSize.default,
|
143
|
+
'font-weight': css.fontWeight.regular
|
144
|
+
});
|
145
|
+
switch (view) {
|
146
|
+
case 'Question preview':
|
147
|
+
case 'Item preview':
|
148
|
+
case 'Item view':
|
149
|
+
case 'Item preview':
|
150
|
+
case 'Student view':
|
151
|
+
case 'Grading view':
|
152
|
+
utilities.verifyCSS(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), 1).find('.drag-icon-button path').eq(1), {
|
153
|
+
'color': css.color.secondaryBtn
|
154
|
+
});
|
155
|
+
break;
|
156
|
+
case 'Correct answer view':
|
157
|
+
break;
|
158
|
+
default:
|
159
|
+
throw new Error('Invalid view');
|
160
|
+
}
|
161
|
+
});
|
162
|
+
|
163
|
+
it('Accessibility of preview contents', { tags: 'a11y' }, () => {
|
164
|
+
cy.checkAccessibility(listOrderingPage.horizontalOptionPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
165
|
+
});
|
166
|
+
});
|
167
|
+
});
|
168
|
+
});
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { ckEditorToolbar, equationEditorFlyout } from "../../../../pages/components";
|
2
|
+
import { setPointsPopupBase } from "../../../../pages/components/setPointsPopupBase";
|
3
|
+
import { listOrderingPage } from "../../../../pages/listOrderingPage";
|
4
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
5
|
+
import utilities from "../../../../support/helpers/utilities";
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
let options = ['plant', 'flower', 'sprout', 'seed'];
|
9
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
10
|
+
|
11
|
+
describe('Create item page - List ordering: "Horizontal orientation" - Set points popup edit tab functionality', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
//Failing due to - https://redmine.zeuslearning.com/issues/571827
|
17
|
+
describe('Set points - Edit tab functionality', () => {
|
18
|
+
abortEarlySetup();
|
19
|
+
before(() => {
|
20
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
23
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
24
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
25
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
26
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(correctAnswerArray);
|
27
|
+
listOrderingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
28
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
29
|
+
});
|
30
|
+
|
31
|
+
it('When user has opened "Set points" popup and focuses in and out of the points input field then no error message should be displayed', () => {
|
32
|
+
listOrderingPage.steps.focusInAndFocusOutOfPointsInputField(0);
|
33
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('The user should be able to set points in the Set points popup points input field', () => {
|
37
|
+
setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([10]);
|
38
|
+
});
|
39
|
+
|
40
|
+
it('When user clicks on Cancel button then the popup should close and the on opening the popup again empty points fields should be displayed', () => {
|
41
|
+
setPointsPopupBase.steps.cancelSetPointsPopup();
|
42
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
43
|
+
utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
|
44
|
+
cy.log('Close the Set points popup')
|
45
|
+
setPointsPopupBase.steps.cancelSetPointsPopup();
|
46
|
+
});
|
47
|
+
|
48
|
+
it('When user deletes an option from the "Option" section then it should not be displayed in the "Set points" popup', () => {
|
49
|
+
listOrderingPage.steps.deleteOption(0);
|
50
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
51
|
+
utilities.verifyElementCount(listOrderingPage.optionWrapperSetPointsPopup(), 3);
|
52
|
+
cy.log('Close the Set points popup')
|
53
|
+
setPointsPopupBase.steps.cancelSetPointsPopup();
|
54
|
+
});
|
55
|
+
|
56
|
+
it('When user adds an option in the "Option" section then it should be displayed in the "Set points" popup with an empty points field', () => {
|
57
|
+
listOrderingPage.steps.addOption();
|
58
|
+
listOrderingPage.steps.editOptionInputField(3, options[0]);
|
59
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
60
|
+
utilities.verifyElementCount(listOrderingPage.optionWrapperSetPointsPopup(), 4);
|
61
|
+
utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('When user adds points to the options and clicks on "Save" button then the popup should close and opening the popup again the points should be prefilled', () => {
|
65
|
+
setPointsPopupBase.steps.allotPointsToSetPointsPopupPointsInputField([4.8, 3, 2.2]);
|
66
|
+
setPointsPopupBase.steps.saveSetPointsPopup();
|
67
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
68
|
+
setPointsPopupBase.steps.verifyPointsAllotedInSetPointsPopup([4.8, 3, 2.2]);
|
69
|
+
cy.log('Close the Set points popup')
|
70
|
+
setPointsPopupBase.steps.cancelSetPointsPopup();
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When user tries to add alternative accordion without adding points to all options field, then an alternative accordion should get added. The added alternative accordion should be in expanded state', () => {
|
74
|
+
listOrderingPage.steps.addAlternativeAnswerAccordion(1);
|
75
|
+
listOrderingPage.steps.verifyAlternateAnswerAccordionIsExpanded(0);
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When user clicks on the "Set points" button of the alternative accordion then options should be displayed with empty points field', () => {
|
79
|
+
listOrderingPage.steps.clickOnSetPointsButton();
|
80
|
+
utilities.verifyInnerText(listOrderingPage.pointsInputField(), '');
|
81
|
+
});
|
82
|
+
});
|
83
|
+
});
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import { dialogBoxBase, listOrderingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
5
|
+
|
6
|
+
describe('Create item page - List ordering: Specify correct answer, Alternative correct answer', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Specify correct answer section - Header and \'Correct\' accordion', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
17
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
18
|
+
});
|
19
|
+
|
20
|
+
listOrderingPage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('list ordering');
|
21
|
+
|
22
|
+
it('By default, 4 options should be displayed with Drag handle in the correct accordion', () => {
|
23
|
+
utilities.verifyElementCount(listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection(), 4);
|
24
|
+
options.forEach((optionText, index) => {
|
25
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInSpecifyCorrectAnswerSection(optionText, index);
|
26
|
+
});
|
27
|
+
});
|
28
|
+
|
29
|
+
listOrderingPage.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty('Correct');
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('Specify correct answer section - \'Alternative\' accordion', () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
before(() => {
|
35
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
36
|
+
cy.barsPreLoaderWait();
|
37
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
38
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
39
|
+
});
|
40
|
+
|
41
|
+
listOrderingPage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation('list ordering');
|
42
|
+
|
43
|
+
it('When user tries to \'+Add alternative answer\' after allotting points without re-ordering the options then the warning popup should appear and on closing the warning popup, an error message should be displayed in the \'Specify correct answer\' section', () => {
|
44
|
+
listOrderingPage.steps.clickOnAddAlternativeAnswerButton();
|
45
|
+
dialogBoxBase.steps.closeWarningPopup();
|
46
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
47
|
+
utilities.verifyInnerText(listOrderingPage.errorMessage(), 'Error: The correct answer sequence matches the option sequence. Please either rearrange the options or select \'Randomize options\' to continue.');
|
48
|
+
utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
|
49
|
+
listOrderingPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
|
50
|
+
});
|
51
|
+
|
52
|
+
listOrderingPage.tests.verifyErrorMessageCSSAndA11y();
|
53
|
+
|
54
|
+
it('When the user checks \'Randomize options\' then the error message should disappear', () => {
|
55
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox();
|
56
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
57
|
+
listOrderingPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('When the user unchecks the \'Randomize options\' checkbox and clicks on \'+Add alternative answer\' the error message should be displayed and on re-ordering the options the error message should disappear', () => {
|
61
|
+
listOrderingPage.steps.uncheckRandomizeOptionsCheckbox();
|
62
|
+
listOrderingPage.steps.clickOnAddAlternativeAnswerButton();
|
63
|
+
dialogBoxBase.steps.closeWarningPopup();
|
64
|
+
utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
|
65
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
66
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
67
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
|
68
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
69
|
+
});
|
70
|
+
|
71
|
+
it('When the user has allotted points to the \'Correct accordion\' and has set correct answer order, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
|
72
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
73
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
74
|
+
listOrderingPage.steps.addAlternativeAnswerAccordion(1);
|
75
|
+
});
|
76
|
+
|
77
|
+
it('When user has added an alternative answer accordion, then the newly added alternative answer accordion should be in expanded state and the correct answer accordion should be in collapsed state', () => {
|
78
|
+
listOrderingPage.steps.verifyCorrectAnswerAccordionIsCollapsed();
|
79
|
+
listOrderingPage.steps.verifyAlternateAnswerAccordionIsExpanded(0);
|
80
|
+
});
|
81
|
+
|
82
|
+
it('By default, 4 options should be displayed with Drag handle in the correct accordion', () => {
|
83
|
+
utilities.verifyElementCount(listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection(), 4);
|
84
|
+
options.forEach((optionText, index) => {
|
85
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInSpecifyCorrectAnswerSection(optionText, index);
|
86
|
+
});
|
87
|
+
});
|
88
|
+
|
89
|
+
it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
|
90
|
+
cy.log('Set correct answer and points in alternative 1 accordion');
|
91
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 2);
|
92
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 3);
|
93
|
+
listOrderingPage.steps.allotPoints(5);
|
94
|
+
listOrderingPage.steps.addAlternativeAnswerAccordion(2);
|
95
|
+
});
|
96
|
+
|
97
|
+
listOrderingPage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
|
98
|
+
|
99
|
+
it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
|
100
|
+
cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
|
101
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 2);
|
102
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 3);
|
103
|
+
listOrderingPage.steps.allotPoints(5);
|
104
|
+
listOrderingPage.steps.deleteAlternativeAnswerAccordion(1);
|
105
|
+
listOrderingPage.steps.verifyAlternativeAnswerAccordionNotExists(2);
|
106
|
+
listOrderingPage.steps.verifyAlternativeAnswerAccordionLabel(0);
|
107
|
+
});
|
108
|
+
|
109
|
+
it('When correct answers and points are set in alternative answer and user clicks on correct answer accordion, then correct answer accordion should be expanded and the alternative answer accordion should be collapsed', () => {
|
110
|
+
listOrderingPage.steps.expandCorrectAnswerAccordion();
|
111
|
+
listOrderingPage.steps.verifyAlternateAnswerAccordionIsCollapsed(0);
|
112
|
+
});
|
113
|
+
});
|
114
|
+
});
|
@@ -0,0 +1,179 @@
|
|
1
|
+
|
2
|
+
import { listOrderingPage } from "../../../../pages";
|
3
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
7
|
+
|
8
|
+
describe('Create Item page - List ordering : Student view settings for "Horizontal" option orientation', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Randomize options : Edit tab', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('list ordering');
|
19
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
20
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
21
|
+
listOrderingPage.steps.allotPoints(5);
|
22
|
+
});
|
23
|
+
|
24
|
+
it('When the \'Randomize options\' functionality is disabled, the options in the specify correct answer section should be displayed in the order in which the user has set them in the \'Options\' section', () => {
|
25
|
+
listOrderingPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
|
26
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(options);
|
27
|
+
});
|
28
|
+
|
29
|
+
it('When the user enables the \'Randomize options\' functionality, then the options in the specify correct answer section should be in the order in which the user has set them in the \'Options\' section', () => {
|
30
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox();
|
31
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection(options);
|
32
|
+
});
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Randomize options : Preview tab', () => {
|
36
|
+
let optionsArray = [];
|
37
|
+
abortEarlySetup();
|
38
|
+
before(() => {
|
39
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
40
|
+
cy.barsPreLoaderWait();
|
41
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
42
|
+
listOrderingPage.steps.allotPoints(5);
|
43
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the \'Randomize options\' functionality is disabled, options in the preview tab should be displayed in the order in which the user has set them in the \'Draggable options\' section', () => {
|
47
|
+
listOrderingPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
|
48
|
+
listOrderingPage.steps.switchToPreviewTab();
|
49
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInPreviewTab(options);
|
50
|
+
});
|
51
|
+
|
52
|
+
it('When the user enables the \'Randomize options\' functionality, then options in preview tab should be displayed in a random order', () => {
|
53
|
+
listOrderingPage.steps.switchToEditTab();
|
54
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox();
|
55
|
+
listOrderingPage.steps.switchToPreviewTab();
|
56
|
+
listOrderingPage.steps.verifyRandomizeHorizontalOptionOrder(options);
|
57
|
+
optionsArray = listOrderingPage.steps.getHorizontalOptionsArray();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the options should not change in the preview tab', () => {
|
61
|
+
listOrderingPage.steps.resetQuestionPreview();
|
62
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInPreviewTab(optionsArray);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the options should change from the previous random order', () => {
|
66
|
+
listOrderingPage.steps.switchToEditTab();
|
67
|
+
listOrderingPage.steps.allotPoints(12);
|
68
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('Question');
|
69
|
+
listOrderingPage.steps.switchToPreviewTab();
|
70
|
+
listOrderingPage.steps.verifyRandomizeHorizontalOptionOrder(options);
|
71
|
+
listOrderingPage.steps.verifyHorizontalOptionsAreReRandomized(optionsArray);
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When the user disables the \'Randomize options\' functionality, then the options in the preview tab should be displayed in the order in which the user has set them in the edit tab', () => {
|
75
|
+
listOrderingPage.steps.switchToEditTab()
|
76
|
+
listOrderingPage.steps.uncheckRandomizeOptionsCheckbox();
|
77
|
+
listOrderingPage.steps.switchToPreviewTab();
|
78
|
+
listOrderingPage.steps.verifyHorizontalOptionsOrderInPreviewTab(options);
|
79
|
+
});
|
80
|
+
});
|
81
|
+
|
82
|
+
//Failing due to https://redmine.zeuslearning.com/issues/571731
|
83
|
+
describe('Enable outer border for question: Preview tab', () => {
|
84
|
+
abortEarlySetup();
|
85
|
+
before(() => {
|
86
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
87
|
+
cy.barsPreLoaderWait();
|
88
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('list ordering');
|
89
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
90
|
+
listOrderingPage.steps.switchToPreviewTab();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('When the \'Enable outer border for question\' checkbox is in checked state, an outer border over the question preview should be visible', () => {
|
94
|
+
listOrderingPage.steps.verifyOuterBorderOfQuestionPreview();
|
95
|
+
});
|
96
|
+
|
97
|
+
it('CSS of the outer border', { tags: 'css' }, () => {
|
98
|
+
utilities.verifyCSS(listOrderingPage.questionBorderPreviewTab(), {
|
99
|
+
'border': `1px solid ${css.color.draggableOptionsContainerBorder}`
|
100
|
+
});
|
101
|
+
});
|
102
|
+
|
103
|
+
it('When the user unchecks the \'Enable outer border for question\' checkbox, then the outer border over the question preview should not be displayed', () => {
|
104
|
+
listOrderingPage.steps.switchToEditTab();
|
105
|
+
listOrderingPage.steps.uncheckEnableOuterBorderCheckbox();
|
106
|
+
listOrderingPage.steps.switchToPreviewTab()
|
107
|
+
listOrderingPage.steps.verifyOuterBorderOfQuestionPreviewNotExists();
|
108
|
+
});
|
109
|
+
});
|
110
|
+
|
111
|
+
//Failing due to https://redmine.zeuslearning.com/issues/571732
|
112
|
+
describe('Allow students to check answer: Preview tab', () => {
|
113
|
+
abortEarlySetup();
|
114
|
+
before(() => {
|
115
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
116
|
+
cy.barsPreLoaderWait();
|
117
|
+
listOrderingPage.steps.addTextInQuestionInstructionsInputField('list ordering');
|
118
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
119
|
+
listOrderingPage.steps.selectOptionOrientation('Horizontal');
|
120
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('seed', 0);
|
121
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection('sprout', 1);
|
122
|
+
listOrderingPage.steps.allotPoints(5);
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When the user set correct answer order and allotted points then on checking the \'Allow students to check answer\' checkbox the Check answer button should be displayed in the preview tab', () => {
|
126
|
+
listOrderingPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
127
|
+
listOrderingPage.steps.switchToPreviewTab();
|
128
|
+
utilities.verifyInnerText(listOrderingPage.checkAnswerButton(), 'Check answer');
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When the user attempts the question and clicks on the \'Check answer\' button, then correct/incorrect icons should be displayed beside the options and the check answer button should be in enabled state', () => {
|
132
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
133
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('plant', 0);
|
134
|
+
listOrderingPage.steps.checkAnswer();
|
135
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('plant');
|
136
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('sprout');
|
137
|
+
listOrderingPage.steps.verifyIncorrectOptionIconHorizontalOrientation('seed');
|
138
|
+
listOrderingPage.steps.verifyCorrectOptionIconHorizontalOrientation('flower');
|
139
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When the user selects an option from the Maximum check answer attempts dropdown then the user should be able to check answer only those many times in the preview tab', () => {
|
143
|
+
listOrderingPage.steps.switchToEditTab();
|
144
|
+
listOrderingPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
145
|
+
listOrderingPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('1');
|
146
|
+
listOrderingPage.steps.switchToPreviewTab();
|
147
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
148
|
+
listOrderingPage.steps.checkAnswer();
|
149
|
+
listOrderingPage.steps.verifyCheckAnswerButtonDisabled();
|
150
|
+
});
|
151
|
+
|
152
|
+
listOrderingPage.tests.verifyDisabledCheckAnswerButtonWithCSSAndA11y();
|
153
|
+
|
154
|
+
it('When the user updates the value of \'Maximum check answer attempts\' dropdown, it should get reflected on the Preview tab', () => {
|
155
|
+
listOrderingPage.steps.switchToEditTab();
|
156
|
+
listOrderingPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
157
|
+
listOrderingPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('3');
|
158
|
+
listOrderingPage.steps.switchToPreviewTab();
|
159
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
160
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
161
|
+
listOrderingPage.steps.checkAnswer();
|
162
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
163
|
+
});
|
164
|
+
|
165
|
+
it('When the user selects \'No limit\' option from the dropdown then user should be able to check answer multiple times', () => {
|
166
|
+
listOrderingPage.steps.switchToEditTab();
|
167
|
+
listOrderingPage.steps.expandMaxCheckAnswerAttemptsDropdown();
|
168
|
+
listOrderingPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('0');
|
169
|
+
listOrderingPage.steps.switchToPreviewTab();
|
170
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
171
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
172
|
+
listOrderingPage.steps.checkAnswer();
|
173
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
174
|
+
listOrderingPage.steps.clickAndReorderHorizontalOptionInPreviewTab('flower', 3);
|
175
|
+
listOrderingPage.steps.checkAnswer();
|
176
|
+
listOrderingPage.steps.verifyCheckAnswerButtonEnabled();
|
177
|
+
});
|
178
|
+
});
|
179
|
+
});
|