itemengine-cypress-automation 1.0.48 → 1.0.51
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsAllOrNothingAlternatePointsGreaterThanCorrectPoints.js +28 -0
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsAllOrNothingCorrectPointsEqualToAlternatePoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js → Scoring/groupedOptionsAllOrNothingCorrectPointsGreaterThanAlternatePoints.js} +5 -7
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsAllOrNothingScoring.js → Scoring/groupedOptionsAllOrNothingScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsManualAndNonScoredScoring.js → Scoring/groupedOptionsManualAndNonScoredScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsPartialDifferentScorings.js → Scoring/groupedOptionsPartialDifferentWeightsScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsPartialDifferrentWeightsAlternatePointsGreaterThanCorrectPoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js → Scoring/groupedOptionsPartialDifferrentWeightsCorrectPointsEqualToAlternatePoints.js} +6 -6
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsPartialDifferrentWeightsCorrectPointsGreaterThanAlternatePoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsPartialEqualWeightsAlternatePointsGreaterThanCorrectPoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js → Scoring/groupedOptionsPartialEqualWeightsCorrectPointsEqualToAlternatePoints.js} +6 -6
- package/cypress/e2e/ILC/ListMatching/Scoring/groupedOptionsPartialEqualWeightsCorrectPointsGreaterThanAlternatePoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingGroupedOptionsPartialEqualWeightsScoring.js → Scoring/groupedOptionsPartialEqualWeightsScorings.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsAllOrNothingAlternatePointsGreaterThanCorrectPoints.js +28 -0
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsAllOrNothingCorrectPointsEqualToAlternatePoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js → Scoring/standardOptionsAllOrNothingCorrectPointsGreaterThanAlternatePoints.js} +5 -7
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsAllOrNothingScoring.js → Scoring/standardOptionsAllOrNothingScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsManualAndNonScoredScoring.js → Scoring/standardOptionsManualAndNonScoredScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsPartialDifferentWeightsAlternatePointsGreaterThanCorrectPoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js → Scoring/standardOptionsPartialDifferentWeightsCorrectPointsEqualToAlternatePoints.js} +6 -6
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsPartialDifferentWeightsCorrectPointsGreaterThanAlternatePoints.js +30 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsPartialDIfferentScoring.js → Scoring/standardOptionsPartialDifferentWeightsScoring.js} +2 -2
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsPartialEqualWeightsAlternatePointsMoreThanCorrectPoints.js +29 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js → Scoring/standardOptionsPartialEqualWeightsCorrectPointsEqualToAlternatePoints.js} +6 -6
- package/cypress/e2e/ILC/ListMatching/Scoring/standardOptionsPartialEqualWeightsCorrectPointsMoreThanAlternatePoints.js +29 -0
- package/cypress/e2e/ILC/ListMatching/{listMatchingStandardOptionsPartialEqualScoring.js → Scoring/standardOptionsPartialEqualWeightsScoring.js} +2 -2
- package/cypress/e2e/ILC/ListOrdering/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +246 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingAllOrNothingScoring.js → Scoring/allOrNothingScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/{listOrderingManuallyAndNonScoredScoring.js → Scoring/manuallyAndNonScoredScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialDifferentWeightsAlternatePointsGreaterThanCorrectPoints.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternatePoints.js +287 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternatePoints.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingPartialDifferentWeightsScoring.js → Scoring/partialDifferentWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialEqualWeightsAlternatePointsGreaterThanCorrectPoints.js +286 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialEqualWeightsCorrectPointsEqualToAlternatePoints.js +258 -0
- package/cypress/e2e/ILC/ListOrdering/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternatePoints.js +287 -0
- package/cypress/e2e/ILC/ListOrdering/{listOrderingPartialEqualWeightsScoring.js → Scoring/partialEqualWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +261 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingAllOrNothingScoring.js → Scoring/allOrNothingScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/{listSortingManuallyAndNonScoredScoring.js → Scoring/manuallyAndNonScoredScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/Scoring/partialDifferentWeightsAlternatePointsGreaterThanCorrectPoints.js +338 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternatePoints.js +303 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternatePoints.js +337 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingPartialDifferentWeightsScoring.js → Scoring/partialDifferentWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/ListSorting/Scoring/partialEqualWeightsAlternatePointsGreaterThanCorrectPoints.js +307 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/partialEqualWeightsCorrectPointsEqualToAlternatePoints.js +272 -0
- package/cypress/e2e/ILC/ListSorting/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternatePoints.js +307 -0
- package/cypress/e2e/ILC/ListSorting/{listSortingPartialEqualWeightsScoring.js → Scoring/partialEqualWeightsScoring.js} +3 -3
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
- package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
- package/cypress/pages/listMatchingScoring.js +16 -105
- package/package.json +1 -1
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +0 -712
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +0 -895
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +0 -807
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoringWithAlternateAnswer.js +0 -759
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +0 -952
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +0 -860
@@ -0,0 +1,307 @@
|
|
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
|
+
let alternateCorrectAnswerArray = ['seed', 'flower', 'sprout', 'plant'];
|
8
|
+
|
9
|
+
describe('Create item page - List sorting: Partial equal weights scoring with alternate answer - When correct answer points are more than alternate answer points', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Question Preview: AutoScored - Partial equal weights with alternate answer: When correct answer points are more than alternate answer points', () => {
|
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 Partial equal weights 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.selectPartialEqualWeightsCheckbox();
|
28
|
+
listSortingPage.steps.allotPoints('20');
|
29
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
30
|
+
listSortingPage.steps.clickOnAddAlternateAnswerButton();
|
31
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
32
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 1);
|
33
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 2);
|
34
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 3);
|
35
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(alternateCorrectAnswerArray);
|
36
|
+
listSortingPage.steps.allotPoints('12');
|
37
|
+
listSortingPage.steps.uncheckRoundDownScoreCheckbox();
|
38
|
+
listSortingPage.steps.expandAdditonalSettings();
|
39
|
+
listSortingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
40
|
+
listSortingPage.steps.switchToPreviewTab();
|
41
|
+
});
|
42
|
+
|
43
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question then correct/incorrect icons should not be displayed, correct/incorrect answer label and border should not be displayed and the correct tab order should be displayed in the correct answers container', () => {
|
44
|
+
cy.log('Total points displayed besides Show correct answer checkbox should be of Correct Answer points')
|
45
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 20);
|
46
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
47
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
48
|
+
listSortingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
49
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
50
|
+
cy.log('Post step: Unchecking the show correct answer checkbox')
|
51
|
+
listSortingPage.steps.uncheckShowCorrectAnswerCheckbox();
|
52
|
+
});
|
53
|
+
|
54
|
+
it('When the user attempts the question according to the correct tab then user should be awarded with full points and on selecting \'Show correct answer\' checkbox green check-mark icons should be displayed beside all the options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
55
|
+
listSortingPage.steps.resetQuestionPreview();
|
56
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
57
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
58
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
59
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
60
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
|
61
|
+
listSortingPage.steps.verifyPreviewTabScoreText(20, 20);
|
62
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
63
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
64
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
65
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
66
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
67
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
68
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
69
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
70
|
+
|
71
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
72
|
+
|
73
|
+
cy.log('When the user attempts the question according to the correct tab then on selecting \'Check answer\' button green check-mark icons should be displayed beside all the options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
74
|
+
listSortingPage.steps.checkAnswer()
|
75
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
76
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
77
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
78
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
79
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
80
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
81
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When the user attempts the question according to the alternate tab then user should be awarded with points of the alternate tab(less than full points) and on selecting \'Show correct answer\' checkbox green check-mark icons should be displayed beside all the options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
85
|
+
listSortingPage.steps.resetQuestionPreview();
|
86
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
87
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 1);
|
88
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
89
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 3);
|
90
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(alternateCorrectAnswerArray);
|
91
|
+
listSortingPage.steps.verifyPreviewTabScoreText(12, 20);
|
92
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
93
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
94
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
95
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
96
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
97
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
98
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
99
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
100
|
+
|
101
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
102
|
+
|
103
|
+
cy.log('When the user attempts the question according to the alternate tab then on selecting \'Check answer\' button green check-mark icons should be displayed beside all the options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
104
|
+
listSortingPage.steps.checkAnswer()
|
105
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
106
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
107
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
108
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
109
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
110
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
111
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
112
|
+
});
|
113
|
+
|
114
|
+
it('When the user attempts the question partially correct exclusively according to the correct tab then points of the correctly ordered options should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons should be displayed beside the options at the correct position with respect to the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted options, the correct answers container should contain the correct answers of the incorrectly attempted options from the correct tab with numeration and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
115
|
+
listSortingPage.steps.resetQuestionPreview();
|
116
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
117
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
118
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
119
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
120
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['flower', 'sprout', 'plant', 'seed']);
|
121
|
+
listSortingPage.steps.verifyPreviewTabScoreText(10, 20);
|
122
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
123
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
124
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
125
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
126
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
127
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'flower'], ['1', '4']);
|
128
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
129
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
130
|
+
|
131
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
132
|
+
|
133
|
+
cy.log('When the user attempts the question partially correct exclusively according to the correct tab then on selecting \'Check answer\' button green check-mark icons should be displayed beside the options at the correct position with respect to the correct tab and red cross-mark icons should be displayed beside the incorrectly attempted options,the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
134
|
+
listSortingPage.steps.checkAnswer()
|
135
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
136
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
137
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
138
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
139
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
140
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
141
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user attempts the question partially correct exclusively according to the alternate tab then points of the correctly ordered options should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons should be displayed beside the options at the correct position with respect to the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted options, the correct answers container should contain the correct answers of the incorrectly attempted options from the correct tab with numeration and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
145
|
+
listSortingPage.steps.resetQuestionPreview();
|
146
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 0);
|
147
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 1);
|
148
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
149
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
150
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', 'flower', 'sprout', 'seed']);
|
151
|
+
listSortingPage.steps.verifyPreviewTabScoreText(6, 20);
|
152
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
153
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
154
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
155
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
156
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
157
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '4']);
|
158
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
159
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
160
|
+
|
161
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
162
|
+
|
163
|
+
cy.log('When the user attempts the question partially correct exclusively according to the alternate tab then on selecting \'Check answer\' button green check-mark icons should be displayed beside the options at the correct position with respect to the alternate tab and red cross-mark icons should be displayed beside the incorrectly attempted options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
164
|
+
listSortingPage.steps.checkAnswer()
|
165
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
166
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
167
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
168
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
169
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
170
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
171
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
172
|
+
});
|
173
|
+
|
174
|
+
it('When the user attempts the question partially correct with equal number of correct options order form the correct and alternate tab then user should be awarded with points of the tab with more points i.e. in this case correct tab and on selecting the \'Show correct answer\' checkbox the green check-mark icons should be displayed beside the options ordered according to the correct tab and red cross-mark icons should be displayed beside the options ordered according to the alternate tab, the correct answers container should have correct options of the incorrectly ordered options from the correct tab with numeration and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
175
|
+
listSortingPage.steps.resetQuestionPreview();
|
176
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
177
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
178
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
179
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 3);
|
180
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'sprout', 'flower', 'plant']);
|
181
|
+
listSortingPage.steps.verifyPreviewTabScoreText(10, 20);
|
182
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
183
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
184
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
185
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
186
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
187
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['plant', 'flower'], ['3', '4']);
|
188
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
189
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
190
|
+
|
191
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
192
|
+
|
193
|
+
cy.log('When the user attempts the question partially correct with equal number of correct options order form the correct and alternate tab then on selecting the \'Check answer\' button the green check-mark icons should be displayed beside the options ordered according to the correct tab and red cross-mark icons should be displayed beside the options ordered according to the alternate tab, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
194
|
+
listSortingPage.steps.checkAnswer()
|
195
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
196
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
197
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
198
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
199
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
200
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
201
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
202
|
+
});
|
203
|
+
|
204
|
+
it('Race condition: When the user attempts the question with the common option between correct tab and alternate tab then user should be awarded with points of the tab with more points i.e. in this case correct tab and on selecting the \'Show correct answer\' checkbox the green check-mark icon should be displayed beside the common option and red cross-marks should be displayed beside the incorrectly ordered options, the correct answers container should have correct options of the incorrectly ordered options from the correct tab with numeration and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
205
|
+
listSortingPage.steps.resetQuestionPreview();
|
206
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
207
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
208
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
209
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 3);
|
210
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'plant', 'flower', 'sprout']);
|
211
|
+
listSortingPage.steps.verifyPreviewTabScoreText(5, 20);
|
212
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
213
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
214
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
215
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
216
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
217
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['sprout', 'plant', 'flower'], ['2', '3', '4']);
|
218
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
219
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
220
|
+
|
221
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
222
|
+
|
223
|
+
cy.log('Race condition: When the user attempts the question with the common option between correct tab and alternate tab then on selecting the \'Check answer\' button the green check-mark icon should be displayed beside the common option and red cross-marks should be displayed beside the incorrectly ordered options, the correct answers container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
224
|
+
listSortingPage.steps.checkAnswer();
|
225
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
226
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
227
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
228
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
229
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
230
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
231
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
232
|
+
});
|
233
|
+
|
234
|
+
it('When user attempts the question incorrectly and selects \'Show correct answer\' checkbox, then user should be awarded 0 points and red cross-mark icons should be displayed beside all the incorrect options, the correct answer container with all correct answers from the correct tab along with numeration should be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview', () => {
|
235
|
+
listSortingPage.steps.resetQuestionPreview();
|
236
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
237
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
238
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2);
|
239
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 3);
|
240
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
|
241
|
+
listSortingPage.steps.verifyPreviewTabScoreText(0, 20);
|
242
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
243
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
244
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
245
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
246
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
247
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
248
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
249
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
250
|
+
|
251
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
252
|
+
|
253
|
+
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 the incorrect options, the correct answer container should not be displayed and correct/incorrect answer label and border for the question should not be displayed below the question preview')
|
254
|
+
listSortingPage.steps.checkAnswer();
|
255
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
256
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
257
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
258
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
259
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
260
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
261
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
262
|
+
});
|
263
|
+
|
264
|
+
it('Overachiever case: When the user attempts the question with more number of correct options from the alternate tab than the correct tab but the score of the individual response selected from the correct tab overpowers the combined score of the alternate tab answers then green checkmark icons should be displayed for the correct tab option, red crossmark icon should be displayed for the alternate tab options and points awarded should be of the correct tab, the correct answers container should have answers of the correct tab for the incorrectly ordered options and correct/incorrect answer label and its border should not be displayed', () => {
|
265
|
+
cy.log('(Overachiever case) Prestep: Switching to Edit tab and alloting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal')
|
266
|
+
listSortingPage.steps.switchToEditTab();
|
267
|
+
listSortingPage.steps.deleteAlternateTab();
|
268
|
+
listSortingPage.steps.addAlternateTab(1);
|
269
|
+
listSortingPage.steps.allotPoints('10');
|
270
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 0);
|
271
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 1);
|
272
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 2);
|
273
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 3);
|
274
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['plant', 'flower', 'sprout', 'seed']);
|
275
|
+
listSortingPage.steps.navigateToCorrectTab();
|
276
|
+
listSortingPage.steps.allotPoints('50');
|
277
|
+
listSortingPage.steps.switchToPreviewTab();
|
278
|
+
|
279
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
280
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 1);
|
281
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
282
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 3);
|
283
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'flower', 'sprout', 'plant']);
|
284
|
+
listSortingPage.steps.verifyPreviewTabScoreText(12.5, 50);
|
285
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
286
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
287
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
288
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
289
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
290
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['sprout', 'plant', 'flower'], ['2', '3', '4']);
|
291
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
292
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
293
|
+
|
294
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
295
|
+
|
296
|
+
cy.log('Overachiever case: When the user clicks on \'Check answer\' button, green checkmark icons should be displayed for the correct tab option, red crossmark icon should be displayed for the alternate tab options, correct answers container should not be displayed and correct/incorrect answer label and its border should not be displayed')
|
297
|
+
listSortingPage.steps.checkAnswer()
|
298
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
299
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
300
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
301
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
302
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
303
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
|
304
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
305
|
+
});
|
306
|
+
});
|
307
|
+
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { listSortingPage } from "
|
2
|
-
import abortEarlySetup from "
|
3
|
-
import utilities from "
|
1
|
+
import { listSortingPage } from "../../../../pages/listSortingPage";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../../support/helpers/utilities";
|
4
4
|
|
5
5
|
let options = ['plant', 'sprout', 'flower', 'seed'];
|
6
6
|
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
@@ -0,0 +1,242 @@
|
|
1
|
+
import { passagePage } from "../../../pages";
|
2
|
+
import { commonComponents } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
describe('Create Item page - Passage: Heading Section, Content section, Body section', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Enable multi-page content-Edit tab', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
cy.log('Navigating to passage resource type');
|
16
|
+
passagePage.steps.navigateToCreateResource('passage');
|
17
|
+
});
|
18
|
+
|
19
|
+
it('\'Content\' label should be displayed', () => {
|
20
|
+
utilities.verifyTextContent(passagePage.contentLabel(), 'Content');
|
21
|
+
utilities.verifyElementVisibilityState(passagePage.contentLabel(), 'visible');
|
22
|
+
});
|
23
|
+
|
24
|
+
it('\'Enable multi-page content\' label and checkbox should be displayed and by default the checkbox should be unchecked', () => {
|
25
|
+
utilities.verifyTextContent(passagePage.enableMultipageContentLabel(), 'Enable multi-page content');
|
26
|
+
utilities.verifyElementVisibilityState(passagePage.enableMultipageContentLabel(), 'visible');
|
27
|
+
passagePage.steps.verifyEnableMultiPageContentCheckboxUnchecked();
|
28
|
+
});
|
29
|
+
|
30
|
+
it('When the user checks the \'Enable multi-page content\' checkbox then 1 \'Body\' input fields should be displayed with placeholder text and numeration, Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
|
31
|
+
passagePage.steps.checkMultipageContentCheckbox();
|
32
|
+
utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
|
33
|
+
passagePage.steps.verifyBodyContents(0)
|
34
|
+
utilities.verifyElementCount(passagePage.bodyInputField(), 1);
|
35
|
+
});
|
36
|
+
|
37
|
+
it('CSS of Checked Multi-page checkbox', { tags: 'css' }, () => {
|
38
|
+
utilities.verifyCSS(passagePage.enableMultipageContentLabelCheckbox().parents('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
|
39
|
+
'fill': css.color.activeButtons
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
43
|
+
it('Accessbility of checked Multi-page checkbox', { tags: 'a11y' }, () => {
|
44
|
+
cy.checkAccessibility(passagePage.enableMultipageContentLabelCheckbox().parents('[data-ngie-testid="enable-multi-page-content-checkbox"]'));
|
45
|
+
});
|
46
|
+
|
47
|
+
it('When body input fields are less than 2 then drag handle and Delete page button should be in disabled state', () => {
|
48
|
+
passagePage.steps.verifyDeletePageButtonDisabled();
|
49
|
+
passagePage.steps.verifyDragHandleButtonDisabled();
|
50
|
+
});
|
51
|
+
|
52
|
+
it('CSS of disabled delete and Drag handle button', { tags: 'css' }, () => {
|
53
|
+
passagePage.deletePageButton()
|
54
|
+
.verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
|
55
|
+
utilities.verifyCSS(passagePage.deletePageButton(), {
|
56
|
+
'opacity': '0.5'
|
57
|
+
})
|
58
|
+
utilities.verifyCSS(passagePage.dragHandleButton(), {
|
59
|
+
'opacity': '0.5'
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Accessbility of disabled delete and Drag handle button', { tags: 'a11y' }, () => {
|
64
|
+
cy.checkAccessibility(passagePage.deletePageButton());
|
65
|
+
cy.checkAccessibility(passagePage.dragHandleButton());
|
66
|
+
});
|
67
|
+
|
68
|
+
it('When the user hovers over the disabled \'Delete\' icon buttons then, \'Minimum one page is required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
|
69
|
+
passagePage.steps.verifyDisabledDeletePageButtonTooltip();
|
70
|
+
});
|
71
|
+
|
72
|
+
it('\'Add page\' button should be present', () => {
|
73
|
+
utilities.verifyTextContent(passagePage.addPageButton(), 'Add page');
|
74
|
+
utilities.verifyElementVisibilityState(passagePage.addPageButton(), 'visible');
|
75
|
+
});
|
76
|
+
|
77
|
+
it('When user adds a page using the \'Add page\' button then added page should be displayed with drag handle, placeholder text, body numeration and delete button', () => {
|
78
|
+
passagePage.steps.addPage();
|
79
|
+
for (let index = 0; index < 2; index++) {
|
80
|
+
passagePage.steps.verifyBodyContents(index)
|
81
|
+
}
|
82
|
+
utilities.verifyElementCount(passagePage.bodyInputField(), 2);
|
83
|
+
});
|
84
|
+
|
85
|
+
it('When body input fields are more than one then drag handle and Delete page button should be in displayed in enabled state', () => {
|
86
|
+
passagePage.steps.verifyDeletePageButtonEnabled();
|
87
|
+
passagePage.steps.verifyDragHandleButtonEnabled();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('CSS of Body input field', { tags: 'css' }, () => {
|
91
|
+
utilities.verifyCSS(passagePage.dragHandleButton().eq(0), {
|
92
|
+
'color': css.color.secondaryBtnActive,
|
93
|
+
'font-size': css.fontSize.normal,
|
94
|
+
'font-weight': css.fontWeight.regular
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(passagePage.deletePageButton().eq(0), {
|
97
|
+
'opacity': '1'
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(passagePage.bodyInputField(), {
|
100
|
+
'color': css.color.text,
|
101
|
+
'font-size': css.fontSize.default,
|
102
|
+
'font-weight': css.fontWeight.regular
|
103
|
+
});
|
104
|
+
utilities.verifyCSS(passagePage.bodyNumeration().eq(0), {
|
105
|
+
'color': css.color.labels,
|
106
|
+
'font-size': css.fontSize.default,
|
107
|
+
'font-weight': css.fontWeight.semibold
|
108
|
+
});
|
109
|
+
utilities.verifyCSS(passagePage.addPageButton(), {
|
110
|
+
'color': css.color.secondaryBtnActive,
|
111
|
+
'font-size': css.fontSize.default,
|
112
|
+
'font-weight': css.fontWeight.medium
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When the user hovers over the drag handle of the body field, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
|
117
|
+
passagePage.steps.verifyDragHandleButtonTooltip();
|
118
|
+
});
|
119
|
+
|
120
|
+
it('When the user hovers over the enabled \'Delete\' icon buttons then, \'Delete page\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
|
121
|
+
passagePage.steps.verifyDeletePageButtonTooltip();
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When user clicks on the \'Delete\' page button then the respective body input field should get deleted, body numeration should change accordingly', () => {
|
125
|
+
passagePage.steps.deletePage(0);
|
126
|
+
passagePage.steps.verifyDeletePageButtonDisabled();
|
127
|
+
passagePage.steps.verifyBodyContents(0)
|
128
|
+
utilities.verifyElementCount(passagePage.bodyInputField(), 1);
|
129
|
+
});
|
130
|
+
|
131
|
+
it('When user focus in and out of any of the \'Body\' input field without typing anything, an error message \'Error: Body is required.\' should be displayed', () => {
|
132
|
+
passagePage.steps.focusInBodyInputField(0);
|
133
|
+
passagePage.steps.focusOutOfBodyInputField(0);
|
134
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Body is required.');
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When user enters text in body input field the error message should disappear', () => {
|
138
|
+
passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized']);
|
139
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user enters text in Body input field, the placeholder text should disappear ', () => {
|
143
|
+
passagePage.steps.verifyBodyPlaceholderTextNotExist();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('When user adds an image to the body input field then it should be displayed in the body input field', () => {
|
147
|
+
cy.log('Clear Body field')
|
148
|
+
passagePage.steps.clearBodyInputField();
|
149
|
+
passagePage.steps.focusInBodyInputField(0);
|
150
|
+
passagePage.steps.selectImageOptionFromCKEditorToolbar();
|
151
|
+
passagePage.steps.addImageToInputField();
|
152
|
+
passagePage.steps.verifyImageAndAltTextInBodyInputField(0);
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When user adds an equation to the body input field then it should be displayed in the body input field', () => {
|
156
|
+
cy.log('Add page');
|
157
|
+
passagePage.steps.addPage();
|
158
|
+
passagePage.steps.focusInBodyInputField(1);
|
159
|
+
passagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
160
|
+
passagePage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
161
|
+
passagePage.steps.verifyEquationInBodyInputField(1);
|
162
|
+
});
|
163
|
+
|
164
|
+
it('When user adds a link to the body input field then it should be displayed in the body input field', () => {
|
165
|
+
cy.log('Add page');
|
166
|
+
passagePage.steps.addPage();
|
167
|
+
passagePage.steps.focusInBodyInputField(2);
|
168
|
+
passagePage.steps.selectLinkOptionFromCKEditorToolbar();
|
169
|
+
passagePage.steps.addLinkToInputField();
|
170
|
+
passagePage.steps.verifyLinkInBodyInputField(2);
|
171
|
+
});
|
172
|
+
|
173
|
+
it('When user adds bold text to the body input field then it should be displayed in the body input field', () => {
|
174
|
+
cy.log('Add page');
|
175
|
+
passagePage.steps.addPage();
|
176
|
+
passagePage.steps.focusInBodyInputField(3);
|
177
|
+
passagePage.steps.selectBoldOptionFromCKEditorToolbar();
|
178
|
+
passagePage.steps.addBoldTextInputToBodyInputField(3);
|
179
|
+
passagePage.steps.verifyBoldTextInBodyInputField(3);
|
180
|
+
});
|
181
|
+
|
182
|
+
it('CSS of \'Body\' input field when image, equation, text and link are added', { tags: 'css' }, () => {
|
183
|
+
utilities.verifyCSS(passagePage.bodyInputField().eq(0).find('img'), {
|
184
|
+
'color': css.color.text,
|
185
|
+
'font-size': css.fontSize.default,
|
186
|
+
'font-weight': css.fontWeight.regular
|
187
|
+
});
|
188
|
+
utilities.verifyCSS(passagePage.bodyInputField().eq(1), {
|
189
|
+
'color': css.color.text,
|
190
|
+
'font-size': css.fontSize.default,
|
191
|
+
'font-weight': css.fontWeight.regular
|
192
|
+
});
|
193
|
+
utilities.verifyCSS(passagePage.bodyInputField().eq(2).find('a'), {
|
194
|
+
'color': css.color.linkText,
|
195
|
+
'font-size': css.fontSize.default,
|
196
|
+
'font-weight': css.fontWeight.regular
|
197
|
+
});
|
198
|
+
utilities.verifyCSS(passagePage.bodyInputField().eq(3), {
|
199
|
+
'color': css.color.text,
|
200
|
+
'font-size': css.fontSize.default,
|
201
|
+
'font-weight': css.fontWeight.regular
|
202
|
+
});
|
203
|
+
});
|
204
|
+
|
205
|
+
it('Accessbility of\' Body input\' field when image, equation, text and link are added', { tags: 'a11y' }, () => {
|
206
|
+
cy.checkAccessibility(passagePage.bodyWrapper().parents('[data-rbd-droppable-id="assessment-option-item-options"]'));
|
207
|
+
});
|
208
|
+
});
|
209
|
+
|
210
|
+
describe('Enable multi-page content: Check & Uncheck functionality-Edit tab', () => {
|
211
|
+
abortEarlySetup();
|
212
|
+
before(() => {
|
213
|
+
cy.log('Navigating to passage resource type');
|
214
|
+
passagePage.steps.navigateToCreateResource('passage');
|
215
|
+
cy.log('check the \'Enable multi-page content\' checkbox');
|
216
|
+
passagePage.steps.checkMultipageContentCheckbox();
|
217
|
+
utilities.verifyElementVisibilityState(passagePage.bodyInputField(), 'exist');
|
218
|
+
cy.log('Add 1 page to body input field');
|
219
|
+
passagePage.steps.addPage();
|
220
|
+
});
|
221
|
+
|
222
|
+
it('When user adds text input to all the \'Body \' input fields then the added text should be displayed in input fields', () => {
|
223
|
+
passagePage.steps.focusInBodyInputField(0);
|
224
|
+
passagePage.steps.addInputTextToBodyInputField(['It simply means the act of being globalized', 'Globalization is a serious issue']);
|
225
|
+
});
|
226
|
+
|
227
|
+
it('When user unchecks the \'Enable multi-page content\' checkbox then all the input fields should be combined and displayed in a single \'Body\' input field', () => {
|
228
|
+
passagePage.steps.uncheckMultipageContentCheckbox();
|
229
|
+
passagePage.steps.verifyTextInBodyInputField(0, 'It simply means the act of being globalizedGlobalization is a serious issue');
|
230
|
+
});
|
231
|
+
|
232
|
+
it('\'Body\' input field should be displayed without numeration, Drag handle and Delete option icon ', () => {
|
233
|
+
utilities.verifyElementVisibilityState(passagePage.bodyWrapper(), 'notExist');
|
234
|
+
});
|
235
|
+
|
236
|
+
it('When user checks the \'Enable multi-page content\' checkbox again then the added content should be displayed in a single body field', () => {
|
237
|
+
passagePage.steps.checkMultipageContentCheckbox();
|
238
|
+
passagePage.steps.verifyTextInBodyInputField(0, 'It simply means the act of being globalizedGlobalization is a serious issue');
|
239
|
+
});
|
240
|
+
});
|
241
|
+
});
|
242
|
+
|