itemengine-cypress-automation 1.0.549-IEI-6994-Add-test-coverage-for-text-selection--c005683.0 → 1.0.550-IEI-6999-main-846015d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +10 -10
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +13 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +24 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +7 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +21 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +12 -15
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +84 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/textContainerSettings.js +73 -1
- package/cypress/pages/components/createQuestionBasePage.js +18 -0
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +2 -0
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +5 -2
- package/cypress/pages/components/index.js +1 -0
- package/cypress/pages/components/printPreviewComponent.js +157 -0
- package/cypress/pages/components/questionInputFieldComponent.js +13 -1
- package/cypress/pages/components/scoringSectionBaseEditTab.js +11 -0
- package/cypress/pages/fillInTheGapsTextPage.js +127 -2
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
19
19
|
fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
|
|
20
20
|
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
|
|
21
21
|
fillInTheGapsTextPage.steps.allotPoints(10);
|
|
22
|
-
|
|
22
|
+
//fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
|
23
23
|
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -32,11 +32,11 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
32
32
|
|
|
33
33
|
it('CSS of correct answer section and response area numeration', { tags: 'css' }, () => {
|
|
34
34
|
utilities.verifyCSS(fillInTheGapsTextPage.correctAnswersLabel(), {
|
|
35
|
-
'color': css.color.
|
|
35
|
+
'color': css.color.text,
|
|
36
36
|
'font-size': css.fontSize.default,
|
|
37
37
|
'font-weight': css.fontWeight.bold
|
|
38
38
|
});
|
|
39
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
39
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsTextPage.responseAreaNumerationNew(), 0), {
|
|
40
40
|
'background-color': css.color.defaultBackground,
|
|
41
41
|
'border': `1px solid ${css.color.activeComponentBorder}`
|
|
42
42
|
});
|
|
@@ -45,7 +45,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
45
45
|
'font-size': css.fontSize.default,
|
|
46
46
|
'font-weight': css.fontWeight.regular,
|
|
47
47
|
});
|
|
48
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
48
|
+
utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerResponseForCorrectResponse(), {
|
|
49
49
|
'border': `1px solid ${css.color.correctOptionBorder}`
|
|
50
50
|
});
|
|
51
51
|
});
|
|
@@ -64,7 +64,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
64
64
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
|
|
65
65
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
66
66
|
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
67
|
-
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
67
|
+
// fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
68
68
|
/*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' should be displayed above the question preview, correct answer section should not be displayed')
|
|
69
69
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
70
70
|
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
|
|
@@ -90,10 +90,10 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
90
90
|
'font-size': css.fontSize.default,
|
|
91
91
|
'font-weight': css.fontWeight.regular
|
|
92
92
|
});
|
|
93
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
93
|
+
utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerLabelNew(), {
|
|
94
94
|
'color': css.color.text,
|
|
95
95
|
'font-size': css.fontSize.default,
|
|
96
|
-
'font-weight': css.fontWeight.
|
|
96
|
+
'font-weight': css.fontWeight.regular
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
|
|
@@ -231,7 +231,7 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
231
231
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
232
232
|
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
233
233
|
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
234
|
-
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
234
|
+
// fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
235
235
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response area, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
236
236
|
fillInTheGapsTextPage.steps.checkAnswer();
|
|
237
237
|
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
|
|
@@ -253,10 +253,10 @@ describe('Create item page - Fill in the gaps with text: All or nothing with alt
|
|
|
253
253
|
'font-size': css.fontSize.default,
|
|
254
254
|
'font-weight': css.fontWeight.regular
|
|
255
255
|
});
|
|
256
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
256
|
+
utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectAnswerLabelNew(), {
|
|
257
257
|
'color': css.color.text,
|
|
258
258
|
'font-size': css.fontSize.default,
|
|
259
|
-
'font-weight': css.fontWeight.
|
|
259
|
+
'font-weight': css.fontWeight.regular
|
|
260
260
|
});
|
|
261
261
|
});
|
|
262
262
|
|
|
@@ -76,6 +76,18 @@ describe('Create Item page - Fill in the gaps with text: Manually and non scored
|
|
|
76
76
|
fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();*/
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
+
it('When the user attempts the question partially correct for correct only, then on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
80
|
+
fillInTheGapsTextPage.steps.resetQuestionPreview();
|
|
81
|
+
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
|
|
82
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
83
|
+
fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
|
|
84
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
|
|
85
|
+
fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
|
|
86
|
+
fillInTheGapsTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
87
|
+
fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
|
|
88
|
+
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
89
|
+
});
|
|
90
|
+
|
|
79
91
|
it('When the user attempts the question partially correct, then on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
80
92
|
fillInTheGapsTextPage.steps.resetQuestionPreview();
|
|
81
93
|
fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 2, responseText: 'Roots' }]);
|
|
@@ -117,5 +129,5 @@ describe('Create Item page - Fill in the gaps with text: Manually and non scored
|
|
|
117
129
|
it('User should able to save question with manually scored scoring type', () => {
|
|
118
130
|
fillInTheGapsTextPage.steps.saveAQuestionAndVerifySnackbar();
|
|
119
131
|
});
|
|
120
|
-
});
|
|
132
|
+
});
|
|
121
133
|
});
|
|
@@ -125,7 +125,7 @@ describe('Fill In the gaps with text - Additional settings : Placeholder text, G
|
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
it('CSS of correct answer section', { tags: 'css' }, () => {
|
|
128
|
-
utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerSectionWithoutEnumerationWrapper()
|
|
128
|
+
utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerSectionWithoutEnumerationWrapper(), {
|
|
129
129
|
'color': css.color.text,
|
|
130
130
|
'font-size': css.fontSize.default,
|
|
131
131
|
'font-weight': css.fontWeight.regular
|
|
@@ -3,6 +3,7 @@ import { commonComponents } from "../../../pages/components";
|
|
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
|
5
5
|
const css = Cypress.env('css');
|
|
6
|
+
const snackbarMessage = 'You have reached the maximum number of tokens that can be added.';
|
|
6
7
|
|
|
7
8
|
describe('Create item page - Fill in the gaps with text: Question instructions, question input field', () => {
|
|
8
9
|
before(() => {
|
|
@@ -106,11 +107,20 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
|
|
|
106
107
|
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.errorMessage(), 'notExist')
|
|
107
108
|
});
|
|
108
109
|
|
|
109
|
-
fillInTheGapsTextPage.tests.verifyErrorMessageCSSAndA11y();
|
|
110
|
-
|
|
111
110
|
fillInTheGapsTextPage.tests.addResponseAreaAndVerifyMinimumOneAreaRequiredErrorMessageNotExist();
|
|
112
111
|
|
|
113
112
|
fillInTheGapsTextPage.tests.verifyQuestionInputFieldPlaceholderText();
|
|
113
|
+
|
|
114
|
+
it('User should be User able to add maximum 30 text containers.', () => {
|
|
115
|
+
fillInTheGapsTextPage.steps.addMultipleResponseAreas(30);
|
|
116
|
+
utilities.verifyElementCount(fillInTheGapsTextPage.responseArea(), 30);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it(`When the user adds 30 text containers are added within question field, snackbar message should be displayed as ${snackbarMessage} and the \'add text container\' button should be in disabled state`, () => {
|
|
120
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.snackbar(), 'visible');
|
|
121
|
+
utilities.verifyInnerText(fillInTheGapsTextPage.snackbar(), snackbarMessage);
|
|
122
|
+
fillInTheGapsTextPage.steps.verifyResponseAreaButtonDisabled();
|
|
123
|
+
});
|
|
114
124
|
});
|
|
115
125
|
|
|
116
126
|
describe('Question input field - Preview tab', () => {
|
|
@@ -240,4 +250,16 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
|
|
|
240
250
|
fillInTheGapsTextPage.steps.focusInResponseInputFieldPreviewTab(0);
|
|
241
251
|
});
|
|
242
252
|
});
|
|
253
|
+
|
|
254
|
+
describe('Print layout settings accordion', () => {
|
|
255
|
+
abortEarlySetup();
|
|
256
|
+
before(() => {
|
|
257
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
258
|
+
cy.barsPreLoaderWait();
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
fillInTheGapsTextPage.tests.verifyPrintLayoutSettingsAccordionProperties();
|
|
262
|
+
|
|
263
|
+
fillInTheGapsTextPage.tests.verifyPrintLayoutSettingsAccordionContents();
|
|
264
|
+
});
|
|
243
265
|
});
|
|
@@ -120,12 +120,12 @@ describe('Create item page - Fill in the gaps with text: Scoring section', () =>
|
|
|
120
120
|
utilities.verifyCSS(fillInTheGapsTextPage.responseAccordionPointsLabel(), {
|
|
121
121
|
'color': css.color.labels,
|
|
122
122
|
'font-size': css.fontSize.normal,
|
|
123
|
-
'font-weight': css.fontWeight.
|
|
123
|
+
'font-weight': css.fontWeight.regular
|
|
124
124
|
});
|
|
125
125
|
utilities.verifyCSS(fillInTheGapsTextPage.responseAccordionPointsScore(), {
|
|
126
|
-
'color': css.color.
|
|
127
|
-
'font-size': css.fontSize.
|
|
128
|
-
'font-weight': css.fontWeight.
|
|
126
|
+
'color': css.color.labels,
|
|
127
|
+
'font-size': css.fontSize.normal,
|
|
128
|
+
'font-weight': css.fontWeight.bold
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
});
|
|
@@ -219,6 +219,8 @@ describe('Create item page - Fill in the gaps with text: Scoring section', () =>
|
|
|
219
219
|
|
|
220
220
|
fillInTheGapsTextPage.tests.verifyScoringSectionContentsForManuallyScoredScoringType();
|
|
221
221
|
|
|
222
|
+
fillInTheGapsTextPage.tests.verifyPointsLabelAndInputField();
|
|
223
|
+
|
|
222
224
|
fillInTheGapsTextPage.tests.verifyPointsFieldErrorState();
|
|
223
225
|
|
|
224
226
|
it('When user has selected \'Manually scored\' scoring type, then in scoring section \'Minimum scoring\' label and dropdown should be visible', () => {
|
|
@@ -238,6 +240,7 @@ describe('Create item page - Fill in the gaps with text: Scoring section', () =>
|
|
|
238
240
|
fillInTheGapsTextPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
|
239
241
|
});
|
|
240
242
|
|
|
243
|
+
fillInTheGapsTextPage.tests.verifyNonScoredDefaultState();
|
|
241
244
|
fillInTheGapsTextPage.tests.verifyScoringSectionContentsForNonScoredScoringType();
|
|
242
245
|
});
|
|
243
246
|
|
|
@@ -10,14 +10,14 @@ describe('Create item page - Fill in the gaps with text: Header section and savi
|
|
|
10
10
|
cy.loginAs('admin');
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
describe('
|
|
13
|
+
describe('Select Question contents', () => {
|
|
14
14
|
abortEarlySetup();
|
|
15
15
|
before(() => {
|
|
16
|
-
fillInTheGapsTextPage.steps.
|
|
16
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestionPage();
|
|
17
17
|
cy.barsPreLoaderWait();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
fillInTheGapsTextPage.tests.
|
|
20
|
+
fillInTheGapsTextPage.tests.verifySelectQuestionContents('fill in the gaps with text', 'Fill in the gaps with text');
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
describe('Tabs section', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fillInTheGapsTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
|
-
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
|
4
|
+
const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
|
|
5
5
|
const views = utilities.getViews(previewContentViews);
|
|
6
6
|
var itemReferenceID = "";
|
|
7
7
|
const css = Cypress.env('css');
|
|
@@ -51,6 +51,9 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
|
|
|
51
51
|
case 'Correct answer view':
|
|
52
52
|
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
53
53
|
break;
|
|
54
|
+
case 'Print preview':
|
|
55
|
+
cy.visit(`/item-engine/demo/render-item/print-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
56
|
+
break;
|
|
54
57
|
default:
|
|
55
58
|
throw new Error('Invalid view');
|
|
56
59
|
}
|
|
@@ -68,13 +71,14 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
|
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
|
|
74
|
+
if ( view !== 'Print preview') {
|
|
71
75
|
it(`Fill in the gaps text - ${view} Question instructions should be visible`, () => {
|
|
72
76
|
utilities.verifyInnerText(fillInTheGapsTextPage.questionInstructionsText(), 'Fill in the gaps');
|
|
73
77
|
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.questionInstructionsText(), 'visible');
|
|
74
78
|
cy.eyesCheckWindow(`Fill in the gaps text - ${view} - Default question state`);
|
|
75
79
|
});
|
|
76
80
|
|
|
77
|
-
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
|
81
|
+
if (view !== 'Grading view' && view !== 'Correct answer view' && view !== 'Print preview') {
|
|
78
82
|
it('The sample \'Lorem Ipsum\' text along with three answer input fields should be displayed in the question field and they should be empty.', () => {
|
|
79
83
|
utilities.verifyInnerText(fillInTheGapsTextPage.questionContainerPreviewTab(), 'Lorem ipsum dolor sit amet, \n\n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n\n tempus tellus dapibus.\n');
|
|
80
84
|
utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
|
|
@@ -96,6 +100,20 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
|
|
|
96
100
|
fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(1);
|
|
97
101
|
fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(2);
|
|
98
102
|
});
|
|
103
|
+
} else if (view === 'Print preview') {
|
|
104
|
+
it('Question number should be visible', () => {
|
|
105
|
+
utilities.verifyInnerText(fillInTheGapsTextPage.questionNumberPrintPreviewText(), '1');
|
|
106
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.questionNumberPrintPreviewText(), 'visible');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('Question instructions should be visible', () => {
|
|
110
|
+
utilities.verifyInnerText(fillInTheGapsTextPage.questionInstructionsPrintPreviewText(), 'Fill in the gaps');
|
|
111
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.questionInstructionsPrintPreviewText(), 'visible');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('The question content should be visible', () => {
|
|
115
|
+
utilities.verifyInnerText(fillInTheGapsTextPage.questionInstructionsPrintPreviewContent(1), 'Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus. ');
|
|
116
|
+
});
|
|
99
117
|
} else {
|
|
100
118
|
it('The answer input fields should be displayed filled with correct answers', () => {
|
|
101
119
|
utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
|
|
@@ -156,6 +174,7 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
|
|
|
156
174
|
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
|
157
175
|
cy.checkAccessibility(fillInTheGapsTextPage.answerInputFieldPreviewTab().parents('[class*="question-preview-wrapper"]'));
|
|
158
176
|
});
|
|
177
|
+
}
|
|
159
178
|
});
|
|
160
179
|
});
|
|
161
180
|
});
|
|
@@ -37,16 +37,16 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
|
|
|
37
37
|
'font-weight': css.fontWeight.semibold
|
|
38
38
|
});
|
|
39
39
|
//checked state of enable special characters checkbox
|
|
40
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
40
|
+
utilities.verifyCSS(fillInTheGapsTextPage.enableSpecialCharactersCheckboxWrapper().find('rect').eq(1), {
|
|
41
41
|
'fill': css.color.activeButtons
|
|
42
42
|
});
|
|
43
43
|
utilities.verifyCSS(fillInTheGapsTextPage.groupByLanguageLabel(), {
|
|
44
|
-
'color': css.color.
|
|
44
|
+
'color': css.color.labelText,
|
|
45
45
|
'font-size': css.fontSize.normal,
|
|
46
46
|
'font-weight': css.fontWeight.regular
|
|
47
47
|
});
|
|
48
48
|
//selected state of radio button
|
|
49
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
49
|
+
utilities.verifyCSS(fillInTheGapsTextPage.showOnlyCustomSpecialCharactersRadioButtonWrapper().find('svg'), {
|
|
50
50
|
'fill': css.color.activeButtons
|
|
51
51
|
});
|
|
52
52
|
utilities.verifyCSS(fillInTheGapsTextPage.customSpecialCharactersLabel(), {
|
|
@@ -59,7 +59,7 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
|
|
|
59
59
|
'font-size': css.fontSize.default,
|
|
60
60
|
'font-weight': css.fontWeight.regular
|
|
61
61
|
});
|
|
62
|
-
utilities.verifyCSS(fillInTheGapsTextPage.
|
|
62
|
+
utilities.verifyCSS(fillInTheGapsTextPage.customSpecialCharactersInputFieldWrapper().find('fieldset'), {
|
|
63
63
|
'border': `1px solid ${css.color.figDefaultComponentBorder}`
|
|
64
64
|
});
|
|
65
65
|
utilities.verifyCSS(fillInTheGapsTextPage.customizeSpecialCharactersPreviewButton(), {
|
|
@@ -100,13 +100,10 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
|
|
|
100
100
|
});
|
|
101
101
|
//Category tiles in de-selected state
|
|
102
102
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileIcon().eq(0).find('svg'), {
|
|
103
|
-
'fill': css.color.
|
|
104
|
-
});
|
|
105
|
-
utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileSectionCategoriesDragIcon().eq(0).parent(), {
|
|
106
|
-
'fill': css.color.secondaryBtn
|
|
103
|
+
'fill': css.color.optionColor
|
|
107
104
|
});
|
|
108
105
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileSectionCategoriesDragIcon().eq(0).parent(), {
|
|
109
|
-
'fill': css.color.
|
|
106
|
+
'fill': css.color.blackText
|
|
110
107
|
});
|
|
111
108
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileCategoryName().eq(0), {
|
|
112
109
|
'color': css.color.secondaryBtn,
|
|
@@ -122,18 +119,18 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
|
|
|
122
119
|
utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
|
|
123
120
|
'color': css.color.flyoutTitle,
|
|
124
121
|
'font-size': css.fontSize.heading,
|
|
125
|
-
'font-weight': css.fontWeight.
|
|
122
|
+
'font-weight': css.fontWeight.semibold
|
|
126
123
|
});
|
|
127
124
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupCategoryLabel().eq(0), {
|
|
128
125
|
'color': css.color.accordionLabel,
|
|
129
|
-
'font-size': css.fontSize.
|
|
130
|
-
'font-weight': css.fontWeight.
|
|
126
|
+
'font-size': css.fontSize.default,
|
|
127
|
+
'font-weight': css.fontWeight.bold
|
|
131
128
|
});
|
|
132
129
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupCategoryAccordionExpandIcon().last().find('svg'), {
|
|
133
130
|
'fill': css.color.activeButtons
|
|
134
131
|
});
|
|
135
132
|
utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupSymbol().eq(0).find('svg'), {
|
|
136
|
-
'fill': css.color.
|
|
133
|
+
'fill': css.color.blackText
|
|
137
134
|
});
|
|
138
135
|
});
|
|
139
136
|
|
|
@@ -141,10 +138,10 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
|
|
|
141
138
|
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
|
142
139
|
cy.log('Closing preview popup');
|
|
143
140
|
dialogBoxBase.steps.closeWarningPopup();
|
|
144
|
-
cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel()
|
|
141
|
+
cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel());
|
|
145
142
|
cy.log('Selecting show only custom special characters radio button');
|
|
146
143
|
fillInTheGapsTextPage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
|
|
147
|
-
cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel()
|
|
144
|
+
cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel());
|
|
148
145
|
});
|
|
149
146
|
});
|
|
150
147
|
|
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
import { fillInTheGapsTextPage } from "../../../pages";
|
|
1
|
+
import { fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
|
7
|
+
var itemReferenceID = "";
|
|
5
8
|
|
|
6
9
|
describe('Create Item page - Fill in the gaps with text: Student view settings', () => {
|
|
7
10
|
before(() => {
|
|
8
11
|
cy.loginAs('admin');
|
|
9
12
|
});
|
|
10
13
|
|
|
11
|
-
describe('Student view settings :
|
|
14
|
+
describe('Student view settings : Edit tab contents', () => {
|
|
12
15
|
abortEarlySetup();
|
|
13
16
|
before(() => {
|
|
17
|
+
cy.log('Navigating to fill in the gaps with text question type');
|
|
14
18
|
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
15
19
|
cy.barsPreLoaderWait();
|
|
16
20
|
});
|
|
17
21
|
|
|
22
|
+
fillInTheGapsTextPage.tests.verifyStudentViewSettingsLabelAndCSS();
|
|
23
|
+
|
|
18
24
|
fillInTheGapsTextPage.tests.verifySpellCheckEditTabContents();
|
|
19
25
|
|
|
26
|
+
fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldEditTabContents();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('Student view settings : Spell check - Edit tab functionality', () => {
|
|
30
|
+
abortEarlySetup();
|
|
31
|
+
before(() => {
|
|
32
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
33
|
+
cy.barsPreLoaderWait();
|
|
34
|
+
});
|
|
35
|
+
|
|
20
36
|
fillInTheGapsTextPage.tests.verifyAllowStudentsToCheckAnswerNotExist();
|
|
21
37
|
});
|
|
22
38
|
|
|
@@ -31,6 +47,72 @@ describe('Create Item page - Fill in the gaps with text: Student view settings',
|
|
|
31
47
|
fillInTheGapsTextPage.tests.verifySpellCheckFunctionalityPreviewTab();
|
|
32
48
|
});
|
|
33
49
|
|
|
50
|
+
describe('Student view settings : Auto-resize - Preview tab functionality', () => {
|
|
51
|
+
abortEarlySetup();
|
|
52
|
+
before(() => {
|
|
53
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
54
|
+
cy.barsPreLoaderWait();
|
|
55
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
views.forEach((view) => {
|
|
62
|
+
describe(`${view}: student view settings`, () => {
|
|
63
|
+
abortEarlySetup();
|
|
64
|
+
before(() => {
|
|
65
|
+
switch (view) {
|
|
66
|
+
case 'Question preview':
|
|
67
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
68
|
+
cy.barsPreLoaderWait();
|
|
69
|
+
fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('fill in the gaps');
|
|
70
|
+
fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
|
|
71
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
|
72
|
+
break;
|
|
73
|
+
case 'Item preview':
|
|
74
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
75
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
76
|
+
break;
|
|
77
|
+
case 'Student view':
|
|
78
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
79
|
+
break;
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
switch (view) {
|
|
85
|
+
case 'Question preview':
|
|
86
|
+
break;
|
|
87
|
+
case 'Item preview':
|
|
88
|
+
break;
|
|
89
|
+
case 'Student view':
|
|
90
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (view === 'Question preview') {
|
|
96
|
+
after(() => {
|
|
97
|
+
fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
|
|
98
|
+
fillInTheGapsTextPage.steps.clickOnConfirmButton();
|
|
99
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
100
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
it(` 'Auto-resize response field' functionality in ${view}`, () => {
|
|
105
|
+
if (view === 'Student view') {
|
|
106
|
+
fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
110
|
+
fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
34
116
|
/*describe('Allow students to check answer: Edit tab', () => {
|
|
35
117
|
abortEarlySetup();
|
|
36
118
|
before(() => {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { dialogBoxBase, fillInTheGapsTextPage } from "../../../pages";
|
|
1
|
+
import { dialogBoxBase, fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
2
|
import utilities from "../../../support/helpers/utilities";
|
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
|
7
|
+
var itemReferenceID = "";
|
|
5
8
|
|
|
6
9
|
describe('Create item page - Fill in the gaps with text: Text container settings', () => {
|
|
7
10
|
before(() => {
|
|
@@ -216,4 +219,73 @@ describe('Create item page - Fill in the gaps with text: Text container settings
|
|
|
216
219
|
fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(1, '150px');
|
|
217
220
|
});
|
|
218
221
|
});
|
|
222
|
+
|
|
223
|
+
views.forEach((view) => {
|
|
224
|
+
describe(`${view}: Text container settings - Width and Height input field functionality`, () => {
|
|
225
|
+
abortEarlySetup();
|
|
226
|
+
before(() => {
|
|
227
|
+
switch (view) {
|
|
228
|
+
case 'Question preview':
|
|
229
|
+
fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
|
|
230
|
+
cy.barsPreLoaderWait();
|
|
231
|
+
fillInTheGapsTextPage.steps.clickOnResponseAreaSettingsButton(0);
|
|
232
|
+
fillInTheGapsTextPage.steps.addInputToHeightInputField(100);
|
|
233
|
+
fillInTheGapsTextPage.steps.addInputToWidthInputField(100);
|
|
234
|
+
fillInTheGapsTextPage.steps.clickOnResponseAreaSettingsOkButton();
|
|
235
|
+
fillInTheGapsTextPage.steps.switchToPreviewTab();
|
|
236
|
+
break;
|
|
237
|
+
case 'Item preview':
|
|
238
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
239
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
240
|
+
break;
|
|
241
|
+
case 'Grading view':
|
|
242
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
243
|
+
break;
|
|
244
|
+
};
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
beforeEach(() => {
|
|
248
|
+
switch (view) {
|
|
249
|
+
case 'Question preview':
|
|
250
|
+
break;
|
|
251
|
+
case 'Item preview':
|
|
252
|
+
fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
253
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
254
|
+
break;
|
|
255
|
+
case 'Grading view':
|
|
256
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
if (view === 'Question preview') {
|
|
262
|
+
after(() => {
|
|
263
|
+
fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
|
|
264
|
+
fillInTheGapsTextPage.steps.clickOnConfirmButton();
|
|
265
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
266
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
it('When user updates the width and height input field value, then dimensions of all answer input fields should be updated', () => {
|
|
271
|
+
if (view === 'Grading view') {
|
|
272
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(0, '100px');
|
|
273
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldWidthPreviewTab(0, '100px');
|
|
274
|
+
studentViewPage.steps.submitResponse();
|
|
275
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
276
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
277
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(0, '100px');
|
|
278
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldWidthPreviewTab(0, '100px');
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
282
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(0, '100px');
|
|
283
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldWidthPreviewTab(0, '100px');
|
|
284
|
+
fillInTheGapsTextPage.steps.switchToGradingView();
|
|
285
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(0, '100px');
|
|
286
|
+
fillInTheGapsTextPage.steps.verifyAnswerInputFieldWidthPreviewTab(0, '100px');
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
});
|
|
219
291
|
});
|
|
@@ -22,6 +22,8 @@ const selectors = {
|
|
|
22
22
|
editButton: () => cy.get('[aria-label="Edit"]'),
|
|
23
23
|
questionPreviewPoint: () => cy.get('[class*="PreviewTabstyles__PointsValue"]'),
|
|
24
24
|
confirmButton: () => cy.get('[data-testid="accept-button"]'),
|
|
25
|
+
questionLabel: (type) => cy.get(`[aria-label*="${type}"] .widget-card-label`),
|
|
26
|
+
questionIcon: (type) => cy.get(`[aria-label*="${type}"] svg`),
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
const steps = {
|
|
@@ -32,6 +34,11 @@ const steps = {
|
|
|
32
34
|
selectQuestionResourceToolPage.steps.selectQuestionType(questionType);
|
|
33
35
|
},
|
|
34
36
|
|
|
37
|
+
navigateToCreateQuestionPage: () => {
|
|
38
|
+
cy.visit('/item-engine/demo/create-item');
|
|
39
|
+
createItemPage.steps.clickOnAddQuestion();
|
|
40
|
+
},
|
|
41
|
+
|
|
35
42
|
navigateToCreateResource: (resourceType) => {
|
|
36
43
|
cy.visit('/item-engine/demo/create-item');
|
|
37
44
|
createItemPage.steps.clickOnAddResource();
|
|
@@ -352,6 +359,17 @@ const tests = {
|
|
|
352
359
|
.should('have.attr', 'aria-selected', 'true');
|
|
353
360
|
utilities.verifyElementVisibilityState(createQuestionBasePage.editTabWrapper(), 'visible');
|
|
354
361
|
});
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
verifySelectQuestionContents: (questionType, LabelText) => {
|
|
365
|
+
it(`Question label ${LabelText} should be displayed`, () => {
|
|
366
|
+
utilities.verifyElementVisibilityState(createQuestionBasePage.questionLabel(questionType), 'visible');
|
|
367
|
+
utilities.verifyInnerText(createQuestionBasePage.questionLabel(questionType), LabelText);
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
it('Question icon should be displayed ', () => {
|
|
371
|
+
utilities.verifyElementVisibilityState(createQuestionBasePage.questionIcon(questionType), 'visible');
|
|
372
|
+
});
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
375
|
|
|
@@ -11,6 +11,7 @@ const selectors = {
|
|
|
11
11
|
groupByLanguageRadioButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-btn input').eq(0),
|
|
12
12
|
groupByLanguageLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-label').eq(0),
|
|
13
13
|
showOnlyCustomSpecialCharactersRadioButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-btn input').eq(1),
|
|
14
|
+
showOnlyCustomSpecialCharactersRadioButtonWrapper: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-btn').eq(1),
|
|
14
15
|
showOnlyCustomSpecialCharactersLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-label').eq(1),
|
|
15
16
|
selectSpecialCharacterLanguagesLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
|
|
16
17
|
customizeSpecialCharactersPreviewButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__PreviewLabel"]'),
|
|
@@ -36,6 +37,7 @@ const selectors = {
|
|
|
36
37
|
//Show only custom special characters section
|
|
37
38
|
customSpecialCharactersLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
|
|
38
39
|
customSpecialCharactersInputField: () => cy.get('input[aria-label="Custom special characters"]'),
|
|
40
|
+
customSpecialCharactersInputFieldWrapper: () => cy.get('.spl-char-input-field .text-input-field')
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const steps = {
|
|
@@ -62,6 +62,7 @@ const selectors = {
|
|
|
62
62
|
specialCharactersPopupCharacterSymbol: () => cy.get('.characters-button'),
|
|
63
63
|
specialCharactersPopupCategoryTitle: () => cy.get('.char-accordion-label'),
|
|
64
64
|
specialCharactersPopupCategoryAccordionIcon: () => cy.get('.special-math-content [class*="expandIconWrapper"]'),
|
|
65
|
+
enableSpecialCharactersCheckboxWrapper: () => cy.get('[data-ngie-testid="enable-special-characters-checkbox"]'),
|
|
65
66
|
|
|
66
67
|
//TODO: Shift all preview tab special characters popup related selectors/steps to a common component file once https://redmine.zeuslearning.com/issues/559296 is resolved
|
|
67
68
|
//preview tab special characters
|
|
@@ -87,6 +88,8 @@ const selectors = {
|
|
|
87
88
|
//Student view settings
|
|
88
89
|
spellCheckLabel: () => cy.get('[data-ngie-testid="spell-check-checkbox"] .MuiFormControlLabel-label'),
|
|
89
90
|
spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input[type="checkbox"]'),
|
|
91
|
+
correctAnswerResponseForCorrectResponse: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerWrapperForLabelImg"]').eq(0),
|
|
92
|
+
correctIncorrectAnswerLabelNew: () => cy.get('[class*="ClozeWithTextPreviewstyle__AnswerStatusWrapper"]'),
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
const steps = {
|
|
@@ -913,7 +916,7 @@ const tests = {
|
|
|
913
916
|
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
|
|
914
917
|
});
|
|
915
918
|
|
|
916
|
-
commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
|
919
|
+
// commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
|
917
920
|
|
|
918
921
|
it('When the user enters value in minimum character limit input field then the error message should disappear', () => {
|
|
919
922
|
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(0);
|
|
@@ -935,7 +938,7 @@ const tests = {
|
|
|
935
938
|
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
|
|
936
939
|
});
|
|
937
940
|
|
|
938
|
-
commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
|
941
|
+
// commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
|
939
942
|
|
|
940
943
|
it('When the user sets minimum limit input field value less than or equal to maximum limit input field value then error message should disappear', () => {
|
|
941
944
|
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(30);
|
|
@@ -70,3 +70,4 @@ export * from './connectorStyleStyleAndLayoutCustomizationComponent';
|
|
|
70
70
|
export * from './equationEditorSectionCommonComponent';
|
|
71
71
|
export * from './ckEditorAudioPlayerComponent';
|
|
72
72
|
export * from './hideExpressionListComponent';
|
|
73
|
+
export * from './printPreviewComponent';
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
|
2
|
+
import { commonComponents } from "./commonComponents";
|
|
3
|
+
import { createQuestionBasePage } from "./createQuestionBasePage";
|
|
4
|
+
const css = Cypress.env('css');
|
|
5
|
+
|
|
6
|
+
const selectors = {
|
|
7
|
+
questionInstructionsLabelEditTab: () => cy.get('.edit-question-instruction-label'),
|
|
8
|
+
excludeThisQuestionWhenPrintingLabel: () => cy.get('.print-layout-option-wrapper .MuiFormControlLabel-label'),
|
|
9
|
+
excludeThisQuestionWhenPrintingCheckbox: () => cy.get('.print-layout-option-wrapper .MuiCheckbox-root input'),
|
|
10
|
+
printLayoutSettingsPanel: () => cy.get('.print-layout-settings-container .MuiAccordionSummary-root'),
|
|
11
|
+
printPreviewIcon: () => cy.get('.icon-print-preview svg'),
|
|
12
|
+
printPreviewButton: () => cy.get('.print-layout-option-wrapper .print-preview-button'),
|
|
13
|
+
questionInstructionsForPrintLabel: () => cy.get('.print-layout-option-wrapper .additional-settings-label'),
|
|
14
|
+
questionInstructionsInputFieldForPrint: () => cy.get('.print-layout-option-wrapper [aria-label="Question instructions for print (overrides default instructions)"]'),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const steps = {
|
|
18
|
+
expandPrintLayoutSettings: () => {
|
|
19
|
+
printPreviewComponent.printLayoutSettingsPanel()
|
|
20
|
+
.click();
|
|
21
|
+
cy.log('Need this wait in order for the font size dropdown to render properly');
|
|
22
|
+
cy.wait(2000);
|
|
23
|
+
printPreviewComponent.printLayoutSettingsPanel()
|
|
24
|
+
.should('have.attr', 'aria-expanded', 'true');
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked: () => {
|
|
28
|
+
printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
|
|
29
|
+
.should('not.be.checked');
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
verifyExcludeThisQuestionWhenPrintingCheckboxChecked: () => {
|
|
33
|
+
printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
|
|
34
|
+
.should('be.checked');
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
checkExcludeThisQuestionWhenPrintingCheckbox: () => {
|
|
38
|
+
printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
|
|
39
|
+
.click()
|
|
40
|
+
steps.verifyExcludeThisQuestionWhenPrintingCheckboxChecked();
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
uncheckExcludeThisQuestionWhenPrintingCheckbox: () => {
|
|
44
|
+
printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
|
|
45
|
+
.click();
|
|
46
|
+
steps.verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked();
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
verifyPrintPreviewButtonDisabledState: () => {
|
|
50
|
+
printPreviewComponent.printPreviewButton()
|
|
51
|
+
.should('have.class', 'disabled-print-preview-button');
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
verifyQuestionInstructionsInputFieldForPrintDisabledState: () => {
|
|
55
|
+
printPreviewComponent.questionInstructionsInputFieldForPrint()
|
|
56
|
+
.should('have.attr', 'contenteditable', 'false');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const tests = {
|
|
62
|
+
verifyPrintLayoutSettingsAccordionProperties: () => {
|
|
63
|
+
it('By default \'Print Layout Settings\' accordion should be collapsed and by clicking on the \'Print Layout Settings\' accordion, user should be able to expand the accordion', () => {
|
|
64
|
+
printPreviewComponent.printLayoutSettingsPanel()
|
|
65
|
+
.should('have.attr', 'aria-expanded', 'false');
|
|
66
|
+
printPreviewComponent.steps.expandPrintLayoutSettings();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('CSS of \'Print Layout Settings\' accordion', { tags: 'css' }, () => {
|
|
70
|
+
utilities.verifyCSS(printPreviewComponent.printLayoutSettingsPanel().find('.additional-settings'), {
|
|
71
|
+
'color': css.color.accordionLabel,
|
|
72
|
+
'font-size': css.fontSize.default,
|
|
73
|
+
'font-weight': css.fontWeight.bold
|
|
74
|
+
});
|
|
75
|
+
utilities.verifyCSS(printPreviewComponent.printLayoutSettingsPanel().find('svg'), {
|
|
76
|
+
'fill': css.color.activeButtons
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('Accessibility of \'Print Layout Settings\' accordion', { tags: 'a11y' }, () => {
|
|
81
|
+
cy.checkAccessibility(printPreviewComponent.printLayoutSettingsPanel().parents('.print-layout-settings-container'));
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
verifyPrintLayoutSettingsAccordionContents: () => {
|
|
86
|
+
it('\'Exclude this question when printing\' label should be displayed', () => {
|
|
87
|
+
utilities.verifyInnerText(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), 'Exclude this question when printing');
|
|
88
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), 'visible');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('Exclude this question when printing checkbox should be displayed and in unchecked state by default', () => {
|
|
92
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox(), 'exist');
|
|
93
|
+
steps.verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('CSS of \'Exclude this question when printing\' section', { tags: 'css' }, () => {
|
|
97
|
+
utilities.verifyCSS(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), {
|
|
98
|
+
'color': css.color.labelText,
|
|
99
|
+
'font-size': css.fontSize.normal,
|
|
100
|
+
'font-weight': css.fontWeight.regular
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('Accessibility of \'Exclude this question when printing\' section', { tags: 'a11y' }, () => {
|
|
105
|
+
cy.checkAccessibility(printPreviewComponent.printLayoutSettingsPanel().parents('.print-layout-settings-container'));
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('User should be able to check and uncheck the \'Exclude this question when printing\' checkbox', () => {
|
|
109
|
+
steps.checkExcludeThisQuestionWhenPrintingCheckbox();
|
|
110
|
+
steps.uncheckExcludeThisQuestionWhenPrintingCheckbox();
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('Print preview button should be present and icon should be visible', () => {
|
|
114
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.printPreviewButton(), 'visible');
|
|
115
|
+
utilities.verifyInnerText(printPreviewComponent.printPreviewButton(), 'Print preview');
|
|
116
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.printPreviewIcon(), 'visible');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('CSS of Print preview button and icon', { tags: 'css' }, () => {
|
|
120
|
+
utilities.verifyCSS(printPreviewComponent.printPreviewButton(), {
|
|
121
|
+
'color': css.color.codeBlockText,
|
|
122
|
+
'font-size': css.fontSize.normal,
|
|
123
|
+
'font-weight': css.fontWeight.regular,
|
|
124
|
+
});
|
|
125
|
+
utilities.verifyCSS(printPreviewComponent.printPreviewIcon().find('path'), {
|
|
126
|
+
'stroke': css.color.primaryBtnBg
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('Accessibility of Print preview button', { tags: 'a11y' }, () => {
|
|
131
|
+
cy.checkAccessibility(printPreviewComponent.printPreviewButton());
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('When the user check the \'Exclude this question when printing\' checkbox, then Print preview button should be disabled and instructions input field for print should not be editable', () => {
|
|
135
|
+
steps.checkExcludeThisQuestionWhenPrintingCheckbox();
|
|
136
|
+
steps.verifyPrintPreviewButtonDisabledState();
|
|
137
|
+
steps.verifyQuestionInstructionsInputFieldForPrintDisabledState();
|
|
138
|
+
steps.uncheckExcludeThisQuestionWhenPrintingCheckbox();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('Question instructions for print label should be displayed', () => {
|
|
142
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.questionInstructionsForPrintLabel(), 'visible');
|
|
143
|
+
utilities.verifyInnerText(printPreviewComponent.questionInstructionsForPrintLabel(), 'Question instructions for print (overrides default instructions)');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('Question instructions for print (overrides default instructions) input field should be present and by default it should be empty', () => {
|
|
147
|
+
utilities.verifyElementVisibilityState(printPreviewComponent.questionInstructionsInputFieldForPrint(), 'visible');
|
|
148
|
+
utilities.verifyTextContent(printPreviewComponent.questionInstructionsInputFieldForPrint(), '');
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const printPreviewComponent = {
|
|
154
|
+
...selectors,
|
|
155
|
+
steps,
|
|
156
|
+
tests
|
|
157
|
+
};
|
|
@@ -29,7 +29,7 @@ const steps = {
|
|
|
29
29
|
.within(() => {
|
|
30
30
|
questionInputFieldComponent.responseAreaCloseButton()
|
|
31
31
|
.click();
|
|
32
|
-
|
|
32
|
+
cy.wait(1000)
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
35
|
|
|
@@ -76,6 +76,18 @@ const steps = {
|
|
|
76
76
|
cy.wait(1000);
|
|
77
77
|
},
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @description Add multiple response areas
|
|
81
|
+
* @param {number} count Number of response areas to add
|
|
82
|
+
*/
|
|
83
|
+
addMultipleResponseAreas: (count) => {
|
|
84
|
+
for (let i = 0; i < count; i++) {
|
|
85
|
+
questionInputFieldComponent.addResponseAreaButton()
|
|
86
|
+
.click();
|
|
87
|
+
cy.wait(1000);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
79
91
|
verifyQuestionInputFieldPlaceholder: () => {
|
|
80
92
|
questionInputFieldComponent.questionInputField()
|
|
81
93
|
.should('have.attr', 'data-cke-editorplaceholder', 'Enter question');
|
|
@@ -252,6 +252,11 @@ const tests = {
|
|
|
252
252
|
scoringSectionBaseEditTab.steps.verifyDefaultPointsLabelAndInputField();
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
+
it('By default, the points input field should be empty', () => {
|
|
256
|
+
scoringSectionBaseEditTab.steps.focusInAndFocusOutOfPointsInputField(0);
|
|
257
|
+
scoringSectionBaseEditTab.steps.verifyPointsFieldValue('');
|
|
258
|
+
});
|
|
259
|
+
|
|
255
260
|
it('CSS of \'Points\' label and input field', { tags: 'css' }, () => {
|
|
256
261
|
utilities.verifyCSS(scoringSectionBaseEditTab.pointsLabel(), {
|
|
257
262
|
'color': css.color.labels,
|
|
@@ -397,6 +402,12 @@ const tests = {
|
|
|
397
402
|
});
|
|
398
403
|
},
|
|
399
404
|
|
|
405
|
+
verifyNonScoredDefaultState: () => {
|
|
406
|
+
it('Point input field should be displayed in disabled state with prefilled 0 points', () => {
|
|
407
|
+
scoringSectionBaseEditTab.steps.verifyNonScoredPointsField();
|
|
408
|
+
});
|
|
409
|
+
},
|
|
410
|
+
|
|
400
411
|
verifyScoringSectionContentsForNonScoredScoringType: () => {
|
|
401
412
|
it('When the user has selected \'Non scored\' option from the \'Scoring type\' dropdown, \'Minimum scoring\' dropdown should not be displayed', () => {
|
|
402
413
|
utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.minimumScoringDropdown(), 'notExist');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
|
-
import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent, customizeSpecialCharacterComponent, fillInTheGapsTextCommonComponent, questionInputFieldComponent, additionalSettingsPanel, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent } from "./components";
|
|
2
|
+
import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent, customizeSpecialCharacterComponent, fillInTheGapsTextCommonComponent, questionInputFieldComponent, additionalSettingsPanel, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, studentViewSettingsLabelComponent, printPreviewComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
|
+
const css = Cypress.env('css');
|
|
4
5
|
|
|
5
6
|
const selectors = {
|
|
6
7
|
...questionInstructionsComponent,
|
|
@@ -21,11 +22,20 @@ const selectors = {
|
|
|
21
22
|
...placeholderTextSectionComponent,
|
|
22
23
|
...styleAndLayoutCustomizationAccordionComponent,
|
|
23
24
|
...figCommonStyleAndLayoutComponent,
|
|
25
|
+
...studentViewSettingsLabelComponent,
|
|
26
|
+
...printPreviewComponent,
|
|
24
27
|
setForAllTextContainersLabel: () => cy.get('[data-ngie-testid="set-for-all-text-containers-checkbox"] .MuiFormControlLabel-label'),
|
|
25
28
|
setForAllTextContainersCheckbox: () => cy.get('[data-ngie-testid="set-for-all-text-containers-checkbox"] input'),
|
|
26
29
|
correctAnswerSectionWithoutEnumerationWrapper: () => cy.get('.no-numeration-correct-answers-wrapper .preview-question-text-wrapper'),
|
|
27
30
|
answerStatusBanner: () => cy.get('[class*="AnswerStatusWrapper"]'),
|
|
28
31
|
correctAnswerSectionWrapper: () => cy.get('[class*="label-image-with-text-correct-answer-wrapper"]'),
|
|
32
|
+
//Student view settings
|
|
33
|
+
autoResizeResponseFieldLabel: () => cy.get('[data-ngie-testid="auto-resize-the-response-field-checkbox"] .MuiFormControlLabel-label'),
|
|
34
|
+
autoResizeCheckbox: () => cy.get('[data-ngie-testid="auto-resize-the-response-field-checkbox"] input[type="checkbox"]'),
|
|
35
|
+
answerResponseFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-multiline-input-field'),
|
|
36
|
+
questionInstructionsPrintPreviewContent: (number) => cy.get('[data-testid="question-instruction-element"]').eq(number),
|
|
37
|
+
questionNumberPrintPreviewText: () => cy.get('[class*="ClozeWithTextPreviewstyle__QuestionNumber"]'),
|
|
38
|
+
responseAreaNumerationNew: () => cy.get('.answer-numeration-number-box'),
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
const steps = {
|
|
@@ -53,6 +63,7 @@ const steps = {
|
|
|
53
63
|
...styleAndLayoutCustomizationAccordionComponent.steps,
|
|
54
64
|
...figCommonStyleAndLayoutComponent.steps,
|
|
55
65
|
...createItemPage.steps,
|
|
66
|
+
...printPreviewComponent.steps,
|
|
56
67
|
/**
|
|
57
68
|
* Verify that the incorrect option icon is displayed for a specific answer input field.
|
|
58
69
|
* @param {number} inputFieldIndex - The index of the answer input field to verify.
|
|
@@ -165,6 +176,48 @@ const steps = {
|
|
|
165
176
|
fillInTheGapsTextPage.answerStatusBanner()
|
|
166
177
|
.should('be.visible');
|
|
167
178
|
},
|
|
179
|
+
|
|
180
|
+
verifyAutoResizeCheckboxUnchecked: () => {
|
|
181
|
+
fillInTheGapsTextPage.autoResizeCheckbox()
|
|
182
|
+
.should('not.be.checked');
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
verifyAutoResizeCheckboxChecked: () => {
|
|
186
|
+
fillInTheGapsTextPage.autoResizeCheckbox()
|
|
187
|
+
.should('be.checked');
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
checkAutoResizeCheckbox: () => {
|
|
191
|
+
fillInTheGapsTextPage.autoResizeCheckbox()
|
|
192
|
+
.click()
|
|
193
|
+
steps.verifyAutoResizeCheckboxChecked();
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
uncheckAutoResizeCheckbox: () => {
|
|
197
|
+
fillInTheGapsTextPage.autoResizeCheckbox()
|
|
198
|
+
.click();
|
|
199
|
+
steps.verifyAutoResizeCheckboxUnchecked();
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Verify that the auto-resize for a response field in the Preview Tab is disabled.
|
|
204
|
+
* @param {number} responseFieldIndex - The index of the response field to verify.
|
|
205
|
+
*/
|
|
206
|
+
verifyAutoResizeOfResponseFieldPreviewTabDisabled: (responseFieldIndex) => {
|
|
207
|
+
fillInTheGapsTextPage.answerInputFieldWrapperPreviewTab()
|
|
208
|
+
.eq(responseFieldIndex)
|
|
209
|
+
.should('have.attr', 'resizetype', 'vertical');
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Verify that the auto-resize for a response field in the Preview Tab is enabled.
|
|
214
|
+
* @param {number} responseFieldIndex - The index of the response field to verify.
|
|
215
|
+
*/
|
|
216
|
+
verifyAutoResizeOfResponseFieldPreviewTabEnabled: (responseFieldIndex) => {
|
|
217
|
+
fillInTheGapsTextPage.answerResponseFieldPreviewTab()
|
|
218
|
+
.eq(responseFieldIndex)
|
|
219
|
+
.should('have.attr', 'resizetype', 'none');
|
|
220
|
+
},
|
|
168
221
|
}
|
|
169
222
|
|
|
170
223
|
const tests = {
|
|
@@ -185,7 +238,79 @@ const tests = {
|
|
|
185
238
|
...ariaLabelSectionComponent.tests,
|
|
186
239
|
...placeholderTextSectionComponent.tests,
|
|
187
240
|
...styleAndLayoutCustomizationAccordionComponent.tests,
|
|
188
|
-
...figCommonStyleAndLayoutComponent.tests
|
|
241
|
+
...figCommonStyleAndLayoutComponent.tests,
|
|
242
|
+
...studentViewSettingsLabelComponent.tests,
|
|
243
|
+
...printPreviewComponent.tests,
|
|
244
|
+
|
|
245
|
+
verifyAutoResizeResponseFieldEditTabContents: () => {
|
|
246
|
+
it('Auto-resize response field label should be displayed', () => {
|
|
247
|
+
utilities.verifyInnerText(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), 'Auto-resize the response field');
|
|
248
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), 'visible');
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('Auto-resize response field checkbox should be displayed and in unchecked state by default', () => {
|
|
252
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextPage.autoResizeCheckbox(), 'exist');
|
|
253
|
+
steps.verifyAutoResizeCheckboxUnchecked();
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('CSS of \'Auto-resize response field\' section', { tags: 'css' }, () => {
|
|
257
|
+
utilities.verifyCSS(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), {
|
|
258
|
+
'color': css.color.labelText,
|
|
259
|
+
'font-size': css.fontSize.normal,
|
|
260
|
+
'font-weight': css.fontWeight.regular
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
it('Accessibility of \'Auto-resize response field\' section', { tags: 'a11y' }, () => {
|
|
265
|
+
cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('CSS of \'Auto-resize response field\' section - unchecked state', { tags: 'css' }, () => {
|
|
269
|
+
utilities.verifyCSS(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), {
|
|
270
|
+
'color': css.color.labelText,
|
|
271
|
+
'font-size': css.fontSize.normal,
|
|
272
|
+
'font-weight': css.fontWeight.regular
|
|
273
|
+
});
|
|
274
|
+
utilities.verifyCSS(fillInTheGapsTextPage.autoResizeCheckbox().parent().find('svg'), {
|
|
275
|
+
'fill': css.color.uncheckedCheckbox
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('Accessibility of \'Auto-resize response field\' section - unchecked state', { tags: 'a11y' }, () => {
|
|
280
|
+
cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('User should be able to check \'Auto-resize response field\' checkbox', () => {
|
|
284
|
+
fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it('CSS of \'Auto-resize response field\' section - checked state', { tags: 'css' }, () => {
|
|
288
|
+
utilities.verifyCSS(fillInTheGapsTextPage.autoResizeCheckbox().parent('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
|
|
289
|
+
'fill': css.color.activeButtons
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('Accessibility of \'Auto-resize response field\' section - checked state', { tags: 'a11y' }, () => {
|
|
294
|
+
cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it('User should be able to uncheck \'Auto-resize response field\' checkbox', () => {
|
|
298
|
+
fillInTheGapsTextPage.steps.uncheckAutoResizeCheckbox();
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
verifyAutoResizeResponseFieldFunctionalityPreviewTab: () => {
|
|
303
|
+
it('When the \'Auto-resize response field\' functionality is disabled, the response field should have \'auto-resize\' attribute set as \'false\' in preview tab', () => {
|
|
304
|
+
fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it('When the \'Auto-resize response field\' functionality is enabled, the response field should have \'auto-resize\' attribute set as \'true\' in the preview tab', () => {
|
|
308
|
+
createQuestionBasePage.steps.switchToEditTab();
|
|
309
|
+
fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
|
|
310
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
|
311
|
+
fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabEnabled(0);
|
|
312
|
+
});
|
|
313
|
+
},
|
|
189
314
|
}
|
|
190
315
|
|
|
191
316
|
export const fillInTheGapsTextPage = {
|