itemengine-cypress-automation 1.0.128 → 1.0.131-updateILCrepo6March-02c78d1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
- package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
- package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
- package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
- package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
- package/cypress/e2e/migration/migration.js +4 -41
- package/cypress/e2e/migration/migration10.js +6 -43
- package/cypress/e2e/migration/migration2.js +6 -43
- package/cypress/e2e/migration/migration3.js +6 -43
- package/cypress/e2e/migration/migration4.js +6 -43
- package/cypress/e2e/migration/migration5.js +6 -43
- package/cypress/e2e/migration/migration6.js +6 -43
- package/cypress/e2e/migration/migration7.js +6 -43
- package/cypress/e2e/migration/migration8.js +6 -43
- package/cypress/e2e/migration/migration9.js +6 -43
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/fixtures/theme/ilc.json +6 -1
- package/cypress/fixtures/uploadResponseFileType.js +5 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +2 -1
- package/cypress/pages/contentBlocksPage.js +515 -0
- package/cypress/pages/drawingResponsePage.js +2 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
- package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
- package/cypress/pages/fillInTheGapsTextPage.js +9 -2
- package/cypress/pages/graphingPage.js +484 -0
- package/cypress/pages/index.js +4 -1
- package/cypress/pages/simpleCalculatorPage.js +310 -0
- package/cypress/pages/uploadResponsePage.js +260 -92
- package/cypress/support/commands.js +33 -1
- package/package.json +2 -2
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
- package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,210 @@
|
|
1
|
+
import { contentBlocksPage } 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('Content blocks - Edit tab', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Header section', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
15
|
+
});
|
16
|
+
|
17
|
+
it('\'Header\' label should be displayed', () => {
|
18
|
+
utilities.verifyInnerText(contentBlocksPage.headerLabel(), 'Header');
|
19
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.headerLabel(), 'visible');
|
20
|
+
});
|
21
|
+
|
22
|
+
it('\'Title\' label and input field should be displayed and by default input field should be empty', () => {
|
23
|
+
utilities.verifyInnerText(contentBlocksPage.titleLabel(), 'Title');
|
24
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.titleLabel(), 'visible');
|
25
|
+
utilities.verifyInnerText(contentBlocksPage.titleInputField(), '');
|
26
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.titleInputField(), 'visible');
|
27
|
+
});
|
28
|
+
|
29
|
+
it('\'Title\' input field should have a placeholder text \'Enter title\'', () => {
|
30
|
+
contentBlocksPage.steps.verifyTitleInputFieldPlaceholderText();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When user enters text in \'Title\'input field then placeholder text should disappear after user enters the text in input field', () => {
|
34
|
+
contentBlocksPage.steps.enterTextInTitleInputField('Title text');
|
35
|
+
contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.titleInputField);
|
36
|
+
});
|
37
|
+
|
38
|
+
it('\'Sub title\' label and input field should be displayed and by default input field should be empty', () => {
|
39
|
+
utilities.verifyInnerText(contentBlocksPage.headerSubTitleLabel(), 'Sub title');
|
40
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.headerSubTitleLabel(), 'visible');
|
41
|
+
utilities.verifyInnerText(contentBlocksPage.headerSubTitleInputField(), '');
|
42
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.headerSubTitleInputField(), 'visible');
|
43
|
+
});
|
44
|
+
|
45
|
+
it('\'Sub title\' input field should have a placeholder text \'Enter sub title\'', () => {
|
46
|
+
contentBlocksPage.steps.verifySubTitleInputFieldPlaceholderText();
|
47
|
+
});
|
48
|
+
|
49
|
+
it('When user enters text in \'Sub title\'input field then placeholder text should disappear after user enters the text in input field', () => {
|
50
|
+
contentBlocksPage.steps.enterTextInSubTitleInputField('Sub title text');
|
51
|
+
contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.headerSubTitleInputField);
|
52
|
+
});
|
53
|
+
|
54
|
+
it('CSS of header section', { tags: 'css' }, () => {
|
55
|
+
utilities.verifyCSS(contentBlocksPage.headerLabel(), {
|
56
|
+
'color': css.color.labels,
|
57
|
+
'font-size': css.fontSize.default,
|
58
|
+
'font-weight': css.fontWeight.semibold
|
59
|
+
});
|
60
|
+
utilities.verifyCSS(contentBlocksPage.titleLabel(), {
|
61
|
+
'color': css.color.labels,
|
62
|
+
'font-size': css.fontSize.normal,
|
63
|
+
'font-weight': css.fontWeight.semibold
|
64
|
+
});
|
65
|
+
utilities.verifyCSS(contentBlocksPage.headerSubTitleLabel(), {
|
66
|
+
'color': css.color.labels,
|
67
|
+
'font-size': css.fontSize.normal,
|
68
|
+
'font-weight': css.fontWeight.semibold
|
69
|
+
});
|
70
|
+
});
|
71
|
+
|
72
|
+
it('Accessibility of header section', { tags: 'a11y' }, () => {
|
73
|
+
cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
|
74
|
+
});
|
75
|
+
});
|
76
|
+
|
77
|
+
describe('Body section', () => {
|
78
|
+
abortEarlySetup();
|
79
|
+
before(() => {
|
80
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
81
|
+
});
|
82
|
+
|
83
|
+
it('\'Body\' label should be displayed', () => {
|
84
|
+
utilities.verifyInnerText(contentBlocksPage.bodyLabel(), 'Body');
|
85
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.bodyLabel(), 'visible');
|
86
|
+
});
|
87
|
+
|
88
|
+
it('\'Text block\' label and input field should be displayed and by default input field should be empty', () => {
|
89
|
+
utilities.verifyInnerText(contentBlocksPage.textBlockLabel(), 'Text block');
|
90
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.textBlockLabel(), 'visible');
|
91
|
+
utilities.verifyInnerText(contentBlocksPage.textBlockInputField(), '\n');
|
92
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.textBlockInputField(), 'visible');
|
93
|
+
});
|
94
|
+
|
95
|
+
it('\'Text block\' input field should have a placeholder text \'Enter text block\' and numeration 1', () => {
|
96
|
+
utilities.verifyInnerText(contentBlocksPage.blockNumeration(), '1');
|
97
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.blockNumeration(), 'visible');
|
98
|
+
contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderText();
|
99
|
+
});
|
100
|
+
|
101
|
+
it('When user enters text in \'Text block\'input field then placeholder text should disappear after user enters the text in input field', () => {
|
102
|
+
contentBlocksPage.steps.enterTextInTextBlockInputField(0, 'Text block text');
|
103
|
+
contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderTextNotExist(contentBlocksPage.verifyTextBlockInputFieldPlaceholderText);
|
104
|
+
});
|
105
|
+
|
106
|
+
it('When user clears text and focuses out of text block input field, then error message \'Error: Text block is required.\' should be displayed', () => {
|
107
|
+
contentBlocksPage.steps.clearAndFocusOutOfTextBlockInputField();
|
108
|
+
utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.errorMessage(), 2), 'Error: Text block is required.');
|
109
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'visible');
|
110
|
+
});
|
111
|
+
|
112
|
+
it('When user enters text again then error message should disappear', () => {
|
113
|
+
contentBlocksPage.steps.enterTextInTextBlockInputField(0, 'Text block');
|
114
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'hidden');
|
115
|
+
});
|
116
|
+
|
117
|
+
it('When body input fields are less than 2 then drag handle and Delete page button should be in disabled state', () => {
|
118
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.dragHandleButton(), 'visible');
|
119
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.deleteButton(), 'visible');
|
120
|
+
contentBlocksPage.steps.verifyDragHandleButtonDisabled();
|
121
|
+
utilities.verifyElementDisabledClass(contentBlocksPage.deleteButton());
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When user hovers over delete button, then \'Minimum one text block is required.\' tooltip should be displayed', () => {
|
125
|
+
utilities.hoverOverElement(contentBlocksPage.deleteButton());
|
126
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.tooltipText(), 'visible');
|
127
|
+
utilities.verifyInnerText(contentBlocksPage.tooltipText(), 'Minimum one text block is required.');
|
128
|
+
});
|
129
|
+
|
130
|
+
it('\'Add group divider\', \'Add sub title\' and \'Add text block\' buttons should be displayed', () => {
|
131
|
+
utilities.verifyInnerText(contentBlocksPage.addGroupDividerButton(), 'Add group divider');
|
132
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.addGroupDividerButton(), 'visible');
|
133
|
+
utilities.verifyInnerText(contentBlocksPage.addSubTitleButton(), 'Add sub title');
|
134
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.addSubTitleButton(), 'visible');
|
135
|
+
utilities.verifyInnerText(contentBlocksPage.addTextBlockButton(), 'Add text block');
|
136
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.addTextBlockButton(), 'visible');
|
137
|
+
});
|
138
|
+
|
139
|
+
it('When user clicks on \'Add sub title\' then sub title input field should be displayed with label, placeholder text and numeration. Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
|
140
|
+
contentBlocksPage.steps.addSubTitle();
|
141
|
+
contentBlocksPage.steps.verifyBodySubTitleContent(0, '2');
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When user enters text in \'Sub title\'input field then placeholder text should disappear after user enters the text in input field', () => {
|
145
|
+
contentBlocksPage.steps.enterTextInBodySubTitleInputField(0, 'Sub title text');
|
146
|
+
contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.bodySubTitleInputField);
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When body input fields are more than one then drag handle and Delete page button should be in displayed in enabled state', () => {
|
150
|
+
utilities.verifyElementCount(contentBlocksPage.inputFieldWrapper(), 2);
|
151
|
+
contentBlocksPage.steps.verifyDragHandleButtonEnabled();
|
152
|
+
utilities.verifyElementNotDisabled(contentBlocksPage.deleteButton());
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When user clicks on \'Add text block\' then text block input field should be displayed with label, placeholder text and numeration. Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
|
156
|
+
contentBlocksPage.steps.addTextBlock();
|
157
|
+
contentBlocksPage.steps.verifyTextBlockContent(1, '3');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('When user clicks on \'Add group divider\' then group divider should be displayed with label. Drag handle and Delete option icon buttons should be displayed besides group divider', () => {
|
161
|
+
contentBlocksPage.steps.addGroupDivider();
|
162
|
+
contentBlocksPage.steps.verifyGroupDividerContent(0);
|
163
|
+
});
|
164
|
+
|
165
|
+
it('CSS of header section', { tags: 'css' }, () => {
|
166
|
+
utilities.verifyCSS(contentBlocksPage.bodyLabel(), {
|
167
|
+
'color': css.color.labels,
|
168
|
+
'font-size': css.fontSize.default,
|
169
|
+
'font-weight': css.fontWeight.semibold
|
170
|
+
});
|
171
|
+
utilities.verifyCSS(utilities.getNthElement(contentBlocksPage.textBlockLabel(), 0), {
|
172
|
+
'color': css.color.labels,
|
173
|
+
'font-size': css.fontSize.normal,
|
174
|
+
'font-weight': css.fontWeight.semibold
|
175
|
+
});
|
176
|
+
utilities.verifyCSS(utilities.getNthElement(contentBlocksPage.bodySubTitleLabel, 0), {
|
177
|
+
'color': css.color.labels,
|
178
|
+
'font-size': css.fontSize.normal,
|
179
|
+
'font-weight': css.fontWeight.semibold
|
180
|
+
});
|
181
|
+
utilities.verifyCSS(contentBlocksPage.groupDividerLabel(), {
|
182
|
+
'color': css.color.labels,
|
183
|
+
'font-size': css.fontSize.normal,
|
184
|
+
'font-weight': css.fontWeight.semibold
|
185
|
+
});
|
186
|
+
});
|
187
|
+
|
188
|
+
it('Accessibility of header section', { tags: 'a11y' }, () => {
|
189
|
+
cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
|
190
|
+
});
|
191
|
+
|
192
|
+
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', () => {
|
193
|
+
utilities.hoverOverElement(utilities.getNthElement(contentBlocksPage.dragHandleButton(), 0));
|
194
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'visible');
|
195
|
+
utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'Drag to reorder');
|
196
|
+
});
|
197
|
+
|
198
|
+
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', () => {
|
199
|
+
utilities.hoverOverElement(utilities.getNthElement(contentBlocksPage.deleteButton(), 0));
|
200
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'visible');
|
201
|
+
utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'Delete page');
|
202
|
+
});
|
203
|
+
|
204
|
+
it('When user clicks on the \'Delete\' page button then the respective body input field should get deleted, body numeration should change accordingly', () => {
|
205
|
+
contentBlocksPage.steps.deletePage(0);
|
206
|
+
contentBlocksPage.steps.verifyNumerationText(2);
|
207
|
+
utilities.verifyElementCount(contentBlocksPage.inputFieldWrapper(), 2);
|
208
|
+
});
|
209
|
+
});
|
210
|
+
});
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { contentBlocksPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
6
|
+
const views = utilities.getViews(previewContentViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Preview tab contents for all views', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
21
|
+
contentBlocksPage.steps.enterTextInTitleInputField('This is title text');
|
22
|
+
contentBlocksPage.steps.enterTextInSubTitleInputField('This is subtitle text');
|
23
|
+
contentBlocksPage.steps.enterTextInTextBlockInputField('This is text block text');
|
24
|
+
contentBlocksPage.steps.addGroupDivider();
|
25
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.groupDivider(), 'visible');
|
26
|
+
contentBlocksPage.steps.addSubTitle();
|
27
|
+
contentBlocksPage.steps.enterTextInBodySubTitleInputField('This is body subtitle text');
|
28
|
+
contentBlocksPage.steps.switchToPreviewTab();
|
29
|
+
break;
|
30
|
+
case 'Item view':
|
31
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
32
|
+
break;
|
33
|
+
case 'Item preview':
|
34
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
35
|
+
contentBlocksPage.steps.switchToPreviewTab();
|
36
|
+
break;
|
37
|
+
case 'Student view':
|
38
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
39
|
+
break;
|
40
|
+
case 'Grading view':
|
41
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
42
|
+
break;
|
43
|
+
case 'Correct answer view':
|
44
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
45
|
+
break;
|
46
|
+
default:
|
47
|
+
throw new Error('Invalid view');
|
48
|
+
}
|
49
|
+
});
|
50
|
+
|
51
|
+
after(() => {
|
52
|
+
if (view === 'Question preview') {
|
53
|
+
contentBlocksPage.steps.clickOnSaveQuestionButton();
|
54
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
55
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
56
|
+
}
|
57
|
+
if (view === 'Student view') {
|
58
|
+
studentViewPage.steps.submitResponse();
|
59
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Title and subtitle text should be displayed', () => {
|
64
|
+
utilities.verifyInnerText(contentBlocksPage.titlePreviewTab(), 'This is title text');
|
65
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.titlePreviewTab(), 'visible');
|
66
|
+
utilities.verifyInnerText(contentBlocksPage.subTitleLabelPreviewTab(), 'This is subtitle text');
|
67
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.subTitleLabelPreviewTab(), 'visible');
|
68
|
+
});
|
69
|
+
|
70
|
+
it('Text block, solid group divider and subtitle text should be displayed', () => {
|
71
|
+
utilities.verifyInnerText(contentBlocksPage.textBlockPreviewTab(), 'This is text block text');
|
72
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.textBlockPreviewTab(), 'visible');
|
73
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.groupDividerPreviewTab(), 'visible');
|
74
|
+
utilities.verifyInnerText(contentBlocksPage.bodySubTitlePreviewTab(), 'This is body subtitle text');
|
75
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.bodySubTitlePreviewTab(), 'visible');
|
76
|
+
});
|
77
|
+
|
78
|
+
it('CSS of Preview tab', { tags: 'css' }, () => {
|
79
|
+
utilities.verifyCSS(contentBlocksPage.textBlockPreviewTab(), {
|
80
|
+
'color': css.color.text,
|
81
|
+
'font-size': css.fontSize.default,
|
82
|
+
'font-weight': css.fontWeight.regular
|
83
|
+
});
|
84
|
+
});
|
85
|
+
|
86
|
+
it('Accessibility of Preview tab', { tags: 'a11y' }, () => {
|
87
|
+
cy.checkAccessibility(contentBlocksPage.textBlockPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
88
|
+
});
|
89
|
+
});
|
90
|
+
});
|
91
|
+
});
|