itemengine-cypress-automation 1.0.46 → 1.0.48
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +450 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsBasic.js +202 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsCustomSpecialCharachters.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsMultilineResponse.js +189 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsResponseAccordions.js +431 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsStudentResponseAreaAndLayout.js +262 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswer.js +613 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswerMatchFromAllResponsesTrue.js +172 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +203 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +133 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextMatchFromAllResponses.js +162 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +200 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswer.js +849 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +171 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +199 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswer.js +738 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +168 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSupportedFileTypes.js +86 -0
- package/package.json +1 -1
package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import { uploadImageSectionComponent } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
import constants from "../../../fixtures/constants";
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
describe('Create Item page - Fill in the gaps over image - text: Question instructions, image section, upload image popup and source URL popup', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question Instructions input field - Edit tab', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
17
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsOverImageTextPage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Question Instructions input field - Preview tab', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
28
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
29
|
+
cy.barsPreLoaderWait();
|
30
|
+
});
|
31
|
+
|
32
|
+
fillInTheGapsOverImageTextPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Image section contents', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
39
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
40
|
+
cy.barsPreLoaderWait();
|
41
|
+
});
|
42
|
+
|
43
|
+
it('\'Image\' title should be displayed', () => {
|
44
|
+
utilities.verifyInnerText(fillInTheGapsOverImageTextPage.imageSectionImageLabel(), 'Image');
|
45
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImageLabel(), 'visible');
|
46
|
+
});
|
47
|
+
|
48
|
+
uploadImageSectionComponent.tests.uploadImageEditTabContents();
|
49
|
+
});
|
50
|
+
|
51
|
+
describe('Upload image - device popup contents', () => {
|
52
|
+
abortEarlySetup();
|
53
|
+
before(() => {
|
54
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
55
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
56
|
+
cy.barsPreLoaderWait();
|
57
|
+
});
|
58
|
+
|
59
|
+
uploadImageSectionComponent.tests.verifyUploadImagePopupImageTitle();
|
60
|
+
|
61
|
+
uploadImageSectionComponent.tests.uploadImagePopupContents(500, 500);
|
62
|
+
|
63
|
+
uploadImageSectionComponent.tests.verifyButtonReplaceInImagePopup();
|
64
|
+
});
|
65
|
+
|
66
|
+
describe('Upload image popup contents functionality', () => {
|
67
|
+
abortEarlySetup();
|
68
|
+
before(() => {
|
69
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
70
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
71
|
+
cy.barsPreLoaderWait();
|
72
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
73
|
+
});
|
74
|
+
|
75
|
+
//Failing due to - https://redmine.zeuslearning.com/issues/547305
|
76
|
+
uploadImageSectionComponent.tests.uploadImageHeightWidthAspectRatioAndResetDimensionsFunctionality(500, 500);
|
77
|
+
|
78
|
+
uploadImageSectionComponent.tests.uploadImageReplaceButtonFunctionality();
|
79
|
+
|
80
|
+
it('When user selects the \'Cancel\' button the image should not be uploaded', () => {
|
81
|
+
uploadImageSectionComponent.steps.clickOnImagePopupCancelButton();
|
82
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'notExist');
|
83
|
+
});
|
84
|
+
|
85
|
+
it('When user uploads an image and selects \'Ok\' button the image should be displayed in the image section', () => {
|
86
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
87
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
88
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
89
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'visible');
|
90
|
+
});
|
91
|
+
});
|
92
|
+
|
93
|
+
describe('Upload image - source URL popup contents', () => {
|
94
|
+
abortEarlySetup();
|
95
|
+
before(() => {
|
96
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
97
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
98
|
+
cy.barsPreLoaderWait();
|
99
|
+
});
|
100
|
+
|
101
|
+
uploadImageSectionComponent.tests.verifyUploadImageSourceURLTitle();
|
102
|
+
|
103
|
+
uploadImageSectionComponent.tests.verifyUploadImageSourceURLDefaultLabelAndInputField();
|
104
|
+
|
105
|
+
uploadImageSectionComponent.tests.uploadImagePopupContents(650, 684);
|
106
|
+
});
|
107
|
+
|
108
|
+
describe('Upload image \'Source URL\' popup contents functionality', () => {
|
109
|
+
abortEarlySetup();
|
110
|
+
before(() => {
|
111
|
+
cy.log('Navigating to fill in the gaps over image - text question type');
|
112
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
113
|
+
cy.barsPreLoaderWait();
|
114
|
+
uploadImageSectionComponent.steps.clickOnSourceURL();
|
115
|
+
uploadImageSectionComponent.steps.uploadImageUsingSourceURL(constants.flowerImage);
|
116
|
+
});
|
117
|
+
|
118
|
+
uploadImageSectionComponent.tests.uploadImageHeightWidthAspectRatioAndResetDimensionsFunctionality(650, 684);
|
119
|
+
|
120
|
+
it('When user selects the \'Cancel\' button the image should not be uploaded', () => {
|
121
|
+
uploadImageSectionComponent.steps.clickOnImagePopupCancelButton();
|
122
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'notExist');
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When user uploads an image and selects \'Ok\' button the image should be displayed in the image section', () => {
|
126
|
+
uploadImageSectionComponent.steps.clickOnSourceURL();
|
127
|
+
uploadImageSectionComponent.steps.uploadImageUsingSourceURL(constants.flowerImage);
|
128
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
129
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
130
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'visible');
|
131
|
+
});
|
132
|
+
});
|
133
|
+
});
|
@@ -0,0 +1,227 @@
|
|
1
|
+
import { fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page - Fill in the gaps over image - text: Scoring section', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Scoring section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
15
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
18
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
19
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
20
|
+
});
|
21
|
+
|
22
|
+
fillInTheGapsOverImageTextPage.tests.verifyScoringTypeLabelAndDropdown('autoScored');
|
23
|
+
|
24
|
+
fillInTheGapsOverImageTextPage.tests.verifyAutoScoredScoringTypeSectionWithCSSAnda11y();
|
25
|
+
});
|
26
|
+
|
27
|
+
describe('Auto scored: All or nothing scoring - Edit tab', () => {
|
28
|
+
abortEarlySetup();
|
29
|
+
before(() => {
|
30
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
31
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
32
|
+
cy.barsPreLoaderWait();
|
33
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
34
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
35
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
36
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
37
|
+
});
|
38
|
+
|
39
|
+
fillInTheGapsOverImageTextPage.tests.verifyResponseContentsOfSetCorrectAnswerSection();
|
40
|
+
|
41
|
+
fillInTheGapsOverImageTextPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
|
42
|
+
|
43
|
+
fillInTheGapsOverImageTextPage.tests.verifyPointsFieldErrorState(10);
|
44
|
+
|
45
|
+
fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
46
|
+
});
|
47
|
+
|
48
|
+
describe('Auto scored: Partial - equal weights scoring - Edit tab', () => {
|
49
|
+
abortEarlySetup();
|
50
|
+
before(() => {
|
51
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
52
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
53
|
+
cy.barsPreLoaderWait();
|
54
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
55
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
56
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
57
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('User should be able to select \'Partial - equal weights\' scoring type', () => {
|
61
|
+
fillInTheGapsOverImageTextPage.steps.selectPartialEqualWeightsCheckbox();
|
62
|
+
});
|
63
|
+
|
64
|
+
fillInTheGapsOverImageTextPage.tests.verifyResponseContentsOfSetCorrectAnswerSection();
|
65
|
+
|
66
|
+
it('When the points input field is empty and the user has switched to \'Partial - equal weights\' scoring, then \'Points per response\' label should be displayed and a \'-\' should be displayed besides each response, \'Penalty points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' label and checkbox should be displayed and by default it should be checked', () => {
|
67
|
+
fillInTheGapsOverImageTextPage.steps.verifyPointsPerResponseLabel();
|
68
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('-');
|
69
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
70
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
71
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
75
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(4);
|
76
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
|
77
|
+
});
|
78
|
+
|
79
|
+
it('When user adds a response to the question, then one more response field should be displayed in the set correct answer section and points per response score should be updated accordingly', () => {
|
80
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
81
|
+
utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 3);
|
82
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(1.33);
|
83
|
+
});
|
84
|
+
|
85
|
+
it('When user removes a response from the question, then the points per response score should be updated accordingly', () => {
|
86
|
+
fillInTheGapsOverImageTextPage.steps.deleteResponseContainer(2);
|
87
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
|
88
|
+
});
|
89
|
+
|
90
|
+
it('CSS of \'Points per response\' label and its displayed score', { tags: 'css' }, () => {
|
91
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.pointsPerResponseLabel(), {
|
92
|
+
'color': css.color.labels,
|
93
|
+
'font-size': css.fontSize.normal,
|
94
|
+
'font-weight': css.fontWeight.semibold
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.partialEqualWeightsPointsPerResponseScore(), {
|
97
|
+
'color': css.color.text,
|
98
|
+
'font-size': css.fontSize.default,
|
99
|
+
'font-weight': css.fontWeight.regular
|
100
|
+
});
|
101
|
+
});
|
102
|
+
|
103
|
+
fillInTheGapsOverImageTextPage.tests.verifyCSSandA11yOfRoundDownScoreCheckboxInCheckedState();
|
104
|
+
|
105
|
+
fillInTheGapsOverImageTextPage.tests.verifyPenaltyPointsInputField();
|
106
|
+
|
107
|
+
fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedLabelAndInputField();
|
108
|
+
|
109
|
+
it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
|
110
|
+
fillInTheGapsOverImageTextPage.steps.selectAllOrNothingCheckbox();
|
111
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.pointsPerResponseLabel(), 'notExist');
|
112
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.partialEqualWeightsPointsPerResponseScore(), 'notExist');
|
113
|
+
fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(4);
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
117
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(9);
|
118
|
+
fillInTheGapsOverImageTextPage.steps.selectPartialEqualWeightsCheckbox();
|
119
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(4.5);
|
120
|
+
});
|
121
|
+
});
|
122
|
+
|
123
|
+
describe('Auto scored: Partial - different weights scoring - Edit tab', () => {
|
124
|
+
abortEarlySetup();
|
125
|
+
before(() => {
|
126
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
127
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
128
|
+
cy.barsPreLoaderWait();
|
129
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
130
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
131
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
132
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
133
|
+
});
|
134
|
+
|
135
|
+
it('User should be able to select \'Partial - different weights\' scoring', () => {
|
136
|
+
fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
|
137
|
+
});
|
138
|
+
|
139
|
+
fillInTheGapsOverImageTextPage.tests.verifyResponseContentsOfSetCorrectAnswerSection();
|
140
|
+
|
141
|
+
it('When the user has switched to \'Partial - different weights\' scoring, then \'Points per response\' label should be displayed and a points input field should be displayed besides each response option, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' checkbox should be displayed and by default it should be checked', () => {
|
142
|
+
fillInTheGapsOverImageTextPage.steps.verifyPointsPerResponseLabel();
|
143
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
|
144
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
145
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
146
|
+
fillInTheGapsOverImageTextPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
147
|
+
});
|
148
|
+
|
149
|
+
it('When the user has not set any answer in the response, then the \'Points per response\' input field should be disabled', () => {
|
150
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsDisabled();
|
151
|
+
});
|
152
|
+
|
153
|
+
it('When user gives an input to the response input field then the \'Points per response\' input field should be enabled', () => {
|
154
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Flower');
|
155
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, 'Leaf');
|
156
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEnabled(0);
|
157
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEnabled(1);
|
158
|
+
});
|
159
|
+
|
160
|
+
it('User should be able to give a score input to \'Points per response\' input fields', () => {
|
161
|
+
fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([2.3, 3.4]);
|
162
|
+
});
|
163
|
+
|
164
|
+
it('CSS of \'Points per response\' label and \'Points per response\' input fields', { tags: 'css' }, () => {
|
165
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.pointsPerResponseLabel(), {
|
166
|
+
'color': css.color.labels,
|
167
|
+
'font-size': css.fontSize.normal,
|
168
|
+
'font-weight': css.fontWeight.semibold
|
169
|
+
});
|
170
|
+
utilities.verifyCSS(fillInTheGapsOverImageTextPage.pointsInputField(), {
|
171
|
+
'color': css.color.text,
|
172
|
+
'font-size': css.fontSize.default,
|
173
|
+
'font-weight': css.fontWeight.regular
|
174
|
+
});
|
175
|
+
});
|
176
|
+
|
177
|
+
fillInTheGapsOverImageTextPage.tests.verifyCSSandA11yOfRoundDownScoreCheckboxInCheckedState();
|
178
|
+
|
179
|
+
fillInTheGapsOverImageTextPage.tests.verifyPenaltyPointsInputField();
|
180
|
+
|
181
|
+
fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedLabelAndInputField();
|
182
|
+
|
183
|
+
|
184
|
+
it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the All or nothing scoring points input field', () => {
|
185
|
+
fillInTheGapsOverImageTextPage.steps.selectAllOrNothingCheckbox();
|
186
|
+
fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(5.7);
|
187
|
+
});
|
188
|
+
|
189
|
+
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points input field displayed besides each response should be blank.', () => {
|
190
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(9);
|
191
|
+
fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
|
192
|
+
fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
|
193
|
+
});
|
194
|
+
});
|
195
|
+
|
196
|
+
describe('Manually scored scoring - Edit tab', () => {
|
197
|
+
abortEarlySetup();
|
198
|
+
before(() => {
|
199
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
200
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
201
|
+
cy.barsPreLoaderWait();
|
202
|
+
});
|
203
|
+
|
204
|
+
it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
|
205
|
+
fillInTheGapsOverImageTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
|
206
|
+
});
|
207
|
+
|
208
|
+
fillInTheGapsOverImageTextPage.tests.verifyManualScoringEditTabFunctionality();
|
209
|
+
|
210
|
+
fillInTheGapsOverImageTextPage.tests.verifyPointsFieldErrorState(10);
|
211
|
+
|
212
|
+
fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
213
|
+
});
|
214
|
+
|
215
|
+
describe('Non scored scoring - Edit tab', () => {
|
216
|
+
abortEarlySetup();
|
217
|
+
before(() => {
|
218
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
219
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
220
|
+
cy.barsPreLoaderWait();
|
221
|
+
});
|
222
|
+
|
223
|
+
fillInTheGapsOverImageTextPage.tests.verifyEditTabNonScoredScoringSectionContents();
|
224
|
+
|
225
|
+
fillInTheGapsOverImageTextPage.tests.verifyResponseContentsOfSetCorrectAnswerSection();
|
226
|
+
});
|
227
|
+
});
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsOverImageTextPage } from "../../../pages";
|
2
|
+
import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
|
6
|
+
describe('Create question page - Fill in the gaps over image - text: Header section and Saving question', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Header section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to Fill in the gaps over image - text question type');
|
15
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
16
|
+
});
|
17
|
+
|
18
|
+
fillInTheGapsOverImageTextPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Fill in the gaps over image - text');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Tabs section', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Navigating to Fill in the gaps over image - text question type');
|
25
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
26
|
+
});
|
27
|
+
|
28
|
+
fillInTheGapsOverImageTextPage.tests.verifyTabsSection();
|
29
|
+
});
|
30
|
+
|
31
|
+
//Failing due to https://redmine.zeuslearning.com/issues/547758
|
32
|
+
describe('Cancel button', () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
before(() => {
|
35
|
+
cy.log('Navigating to Fill in the gaps over image - text question type');
|
36
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
37
|
+
});
|
38
|
+
|
39
|
+
fillInTheGapsOverImageTextPage.tests.verifyCancelButton('fill in the gaps over image - text');
|
40
|
+
});
|
41
|
+
|
42
|
+
//Failing due to https://redmine.zeuslearning.com/issues/548426
|
43
|
+
//Failing due to https://redmine.zeuslearning.com/issues/548420
|
44
|
+
//Failing due to https://redmine.zeuslearning.com/issues/548383
|
45
|
+
describe('Save question button - Edit tab', () => {
|
46
|
+
abortEarlySetup();
|
47
|
+
before(() => {
|
48
|
+
cy.log('Navigating to Fill in the gaps over image - text question type');
|
49
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
50
|
+
cy.barsPreLoaderWait();
|
51
|
+
});
|
52
|
+
|
53
|
+
describe('Validation error messages', () => {
|
54
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
55
|
+
|
56
|
+
it('Validation error messages should be displayed below required input fields (Question instructions, Image section, Points input field)', () => {
|
57
|
+
fillInTheGapsOverImageTextPage.steps.verifyQuestionInstructionsErrorMessage();
|
58
|
+
fillInTheGapsOverImageTextPage.steps.verifyPointsFieldErrorMessage();
|
59
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageSectionErrorMessage();
|
60
|
+
fillInTheGapsOverImageTextPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
|
61
|
+
});
|
62
|
+
|
63
|
+
it('When the user has made no changes and switches to the preview tab and clicks on \'Save question\' button, the user should get a warning popup and on closing the warning popup, the user should be on the edit tab', () => {
|
64
|
+
fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
|
65
|
+
fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
|
66
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
67
|
+
dialogBoxBase.steps.closeWarningPopup();
|
68
|
+
fillInTheGapsOverImageTextPage.steps.verifyEditTabSelectedState();
|
69
|
+
fillInTheGapsOverImageTextPage.steps.verifyPreviewTabNotSelectedState();
|
70
|
+
});
|
71
|
+
|
72
|
+
it('When the user uploads an image, the \'Error: Image is required.\' error message should disappear and then on clicking the \'Save question\' button, \'Error: Minimum one response container is required.\' error message should appear in the set correct answer section', () => {
|
73
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
74
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
75
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
76
|
+
fillInTheGapsOverImageTextPage.steps.verifyImageSectionErrorMessageNotExists();
|
77
|
+
fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
|
78
|
+
dialogBoxBase.steps.closeWarningPopup();
|
79
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumOneResponseContainerIsRequiredErrorMessage();
|
80
|
+
});
|
81
|
+
|
82
|
+
it('When the user adds a response container, the \'Error: Minimum one response container is required.\' error message should disappear and then on clicking the \'Save question\' button, \'Error: Please set a correct answer.\' error message should appear in the set correct answer section', () => {
|
83
|
+
fillInTheGapsOverImageTextPage.steps.addResponseContainer();
|
84
|
+
fillInTheGapsOverImageTextPage.steps.verifyMinimumOneResponseContainerIsRequiredErrorMessageNotExists();
|
85
|
+
fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
|
86
|
+
dialogBoxBase.steps.closeWarningPopup();
|
87
|
+
fillInTheGapsOverImageTextPage.steps.verifySetCorrectAnswerSectionErrorMessage();
|
88
|
+
});
|
89
|
+
|
90
|
+
it('Validation error messages should disappear when all required input fields are filled', () => {
|
91
|
+
fillInTheGapsOverImageTextPage.steps.addQuestionInstructions();
|
92
|
+
fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Flower');
|
93
|
+
fillInTheGapsOverImageTextPage.steps.allotPoints(10);
|
94
|
+
fillInTheGapsOverImageTextPage.steps.verifyErrorMessageIsNotDisplayed();
|
95
|
+
fillInTheGapsOverImageTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
96
|
+
});
|
97
|
+
|
98
|
+
fillInTheGapsOverImageTextPage.tests.verifya11yOfCreateItemWrapperContents();
|
99
|
+
});
|
100
|
+
|
101
|
+
describe('Saving a question', () => {
|
102
|
+
it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
103
|
+
fillInTheGapsOverImageTextPage.steps.saveAQuestionAndVerifySnackbar();
|
104
|
+
});
|
105
|
+
|
106
|
+
fillInTheGapsOverImageTextPage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
|
107
|
+
});
|
108
|
+
});
|
109
|
+
});
|
package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
import constants from "../../../fixtures/constants";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import { dialogBoxBase, fillInTheGapsOverImageTextPage } from "../../../pages";
|
4
|
+
import { uploadImageSectionComponent } from "../../../pages/components";
|
5
|
+
import utilities from "../../../support/helpers/utilities";
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
describe('Create item page - Fill in the gaps over image - text: Image properties', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Edit image popup contents and functionality', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
17
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
18
|
+
cy.log('Uploading an image');
|
19
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
20
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
21
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
22
|
+
uploadImageSectionComponent.steps.clickOnEditImageButton();
|
23
|
+
});
|
24
|
+
|
25
|
+
uploadImageSectionComponent.tests.verifyUploadImagePopupImageTitle();
|
26
|
+
|
27
|
+
uploadImageSectionComponent.tests.uploadImagePopupContents(500, 500);
|
28
|
+
|
29
|
+
uploadImageSectionComponent.tests.verifyButtonReplaceInImagePopup();
|
30
|
+
|
31
|
+
uploadImageSectionComponent.tests.uploadImageHeightWidthAspectRatioAndResetDimensionsFunctionality(500, 500);
|
32
|
+
|
33
|
+
it('When user clicks on \'Cancel\' button the popup should close and image should not get edited', () => {
|
34
|
+
uploadImageSectionComponent.steps.clickOnImagePopupCancelButton();
|
35
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthInputFieldValue(500);
|
36
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightInputFieldValue(500);
|
37
|
+
cy.log('Post step: Clicking on edit image button')
|
38
|
+
uploadImageSectionComponent.steps.clickOnEditImageButton();
|
39
|
+
});
|
40
|
+
|
41
|
+
uploadImageSectionComponent.tests.uploadImageReplaceButtonFunctionality();
|
42
|
+
|
43
|
+
it('When user makes some edits and clicks on the \'Ok\' button the popup should close and the edited image should be uploaded', () => {
|
44
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
45
|
+
fillInTheGapsOverImageTextPage.steps.verifyWidthInputFieldValue(225);
|
46
|
+
fillInTheGapsOverImageTextPage.steps.verifyHeightInputFieldValue(225);
|
47
|
+
});
|
48
|
+
});
|
49
|
+
|
50
|
+
describe('Edit image pop up content - source URL', () => {
|
51
|
+
abortEarlySetup();
|
52
|
+
before(() => {
|
53
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
54
|
+
cy.log('Uploading an image using source url');
|
55
|
+
uploadImageSectionComponent.steps.clickOnSourceURL();
|
56
|
+
uploadImageSectionComponent.steps.uploadImageUsingSourceURL(constants.flowerImage);
|
57
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
58
|
+
uploadImageSectionComponent.steps.clickOnEditImageButton();
|
59
|
+
});
|
60
|
+
|
61
|
+
//Failing due to https://redmine.zeuslearning.com/issues/543833
|
62
|
+
uploadImageSectionComponent.tests.verifyUploadImageSourceURLTitle();
|
63
|
+
|
64
|
+
uploadImageSectionComponent.tests.verifyUploadImageSourceURLLabelAndInputFieldInEditSourceURLPopup();
|
65
|
+
|
66
|
+
uploadImageSectionComponent.tests.uploadImagePopupContents(650, 684);
|
67
|
+
});
|
68
|
+
|
69
|
+
describe('Delete image - Edit tab', () => {
|
70
|
+
abortEarlySetup();
|
71
|
+
before(() => {
|
72
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
73
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
74
|
+
cy.log('Uploading an image');
|
75
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
76
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
77
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
78
|
+
});
|
79
|
+
|
80
|
+
uploadImageSectionComponent.tests.verifyDeleteImagePopup();
|
81
|
+
|
82
|
+
it('When user clicks on \'Cancel\' button the popup should close and image should not get deleted', () => {
|
83
|
+
dialogBoxBase.steps.clickOnRejectButtonInDialogBox();
|
84
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'visible');
|
85
|
+
});
|
86
|
+
|
87
|
+
it('When user clicks on \'Delete image\' button the popup should close and image should get deleted', () => {
|
88
|
+
uploadImageSectionComponent.steps.clickOnDeleteImageButton();
|
89
|
+
dialogBoxBase.steps.clickOnAcceptButtonInDialogBox();
|
90
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'notExist')
|
91
|
+
});
|
92
|
+
});
|
93
|
+
|
94
|
+
describe('Image properties section contents', () => {
|
95
|
+
abortEarlySetup();
|
96
|
+
before(() => {
|
97
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
98
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
99
|
+
cy.barsPreLoaderWait();
|
100
|
+
});
|
101
|
+
|
102
|
+
fillInTheGapsOverImageTextPage.tests.verifyImagePropertiesSectionContents();
|
103
|
+
});
|
104
|
+
|
105
|
+
describe('Image properties - \'Image hover text\' and \'Image alternative text\' : Edit tab', () => {
|
106
|
+
abortEarlySetup();
|
107
|
+
before(() => {
|
108
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
109
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
110
|
+
cy.barsPreLoaderWait();
|
111
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
112
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
113
|
+
});
|
114
|
+
|
115
|
+
fillInTheGapsOverImageTextPage.tests.verifyImageHoverAndAlternativeTextFunctionalityInEditTab();
|
116
|
+
});
|
117
|
+
|
118
|
+
describe('Image properties - \'Image hover text\' and \'Image alternative text\' : Preview tab', () => {
|
119
|
+
abortEarlySetup();
|
120
|
+
before(() => {
|
121
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
122
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
123
|
+
cy.barsPreLoaderWait();
|
124
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
125
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
126
|
+
});
|
127
|
+
|
128
|
+
fillInTheGapsOverImageTextPage.tests.verifyImageHoverAndAlternativeTextFunctionalityInPreviewTab();
|
129
|
+
});
|
130
|
+
|
131
|
+
describe('Image properties - \'Height and width (px)\' : Edit tab', () => {
|
132
|
+
abortEarlySetup();
|
133
|
+
before(() => {
|
134
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
135
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
136
|
+
cy.barsPreLoaderWait();
|
137
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
138
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
139
|
+
});
|
140
|
+
|
141
|
+
fillInTheGapsOverImageTextPage.tests.verifyImagePropertiesHeightAndWidthInputFieldInEditTab();
|
142
|
+
});
|
143
|
+
|
144
|
+
describe('Image properties - \'Height and width (px)\' : Preview tab', () => {
|
145
|
+
abortEarlySetup();
|
146
|
+
before(() => {
|
147
|
+
cy.log('Navigate to fill in the gaps over image - text question type');
|
148
|
+
fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
|
149
|
+
cy.barsPreLoaderWait();
|
150
|
+
fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
|
151
|
+
fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
|
152
|
+
});
|
153
|
+
|
154
|
+
fillInTheGapsOverImageTextPage.tests.verifyImagePropertiesHeightAndWidthInputFieldInPreviewTab();
|
155
|
+
});
|
156
|
+
});
|