itemengine-cypress-automation 1.0.543-IEI-6999-main-04ce552.0 → 1.0.543

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.
@@ -76,18 +76,6 @@ 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
-
91
79
  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', () => {
92
80
  fillInTheGapsTextPage.steps.resetQuestionPreview();
93
81
  fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 2, responseText: 'Roots' }]);
@@ -129,5 +117,5 @@ describe('Create Item page - Fill in the gaps with text: Manually and non scored
129
117
  it('User should able to save question with manually scored scoring type', () => {
130
118
  fillInTheGapsTextPage.steps.saveAQuestionAndVerifySnackbar();
131
119
  });
132
- });
120
+ });
133
121
  });
@@ -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().find('.preview-question-text-wrapper'), {
129
129
  'color': css.color.text,
130
130
  'font-size': css.fontSize.default,
131
131
  'font-weight': css.fontWeight.regular
@@ -3,7 +3,6 @@ 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.';
7
6
 
8
7
  describe('Create item page - Fill in the gaps with text: Question instructions, question input field', () => {
9
8
  before(() => {
@@ -107,20 +106,11 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
107
106
  utilities.verifyElementVisibilityState(fillInTheGapsTextPage.errorMessage(), 'notExist')
108
107
  });
109
108
 
109
+ fillInTheGapsTextPage.tests.verifyErrorMessageCSSAndA11y();
110
+
110
111
  fillInTheGapsTextPage.tests.addResponseAreaAndVerifyMinimumOneAreaRequiredErrorMessageNotExist();
111
112
 
112
113
  fillInTheGapsTextPage.tests.verifyQuestionInputFieldPlaceholderText();
113
-
114
- it('User Should be User should be 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
- });
124
114
  });
125
115
 
126
116
  describe('Question input field - Preview tab', () => {
@@ -250,16 +240,4 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
250
240
  fillInTheGapsTextPage.steps.focusInResponseInputFieldPreviewTab(0);
251
241
  });
252
242
  });
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
- });
265
243
  });
@@ -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.regular
123
+ 'font-weight': css.fontWeight.semibold
124
124
  });
125
125
  utilities.verifyCSS(fillInTheGapsTextPage.responseAccordionPointsScore(), {
126
- 'color': css.color.labels,
127
- 'font-size': css.fontSize.normal,
128
- 'font-weight': css.fontWeight.bold
126
+ 'color': css.color.text,
127
+ 'font-size': css.fontSize.default,
128
+ 'font-weight': css.fontWeight.regular
129
129
  });
130
130
  });
131
131
  });
@@ -219,8 +219,6 @@ 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
-
224
222
  fillInTheGapsTextPage.tests.verifyPointsFieldErrorState();
225
223
 
226
224
  it('When user has selected \'Manually scored\' scoring type, then in scoring section \'Minimum scoring\' label and dropdown should be visible', () => {
@@ -240,7 +238,6 @@ describe('Create item page - Fill in the gaps with text: Scoring section', () =>
240
238
  fillInTheGapsTextPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
241
239
  });
242
240
 
243
- fillInTheGapsTextPage.tests.verifyNonScoredDefaultState();
244
241
  fillInTheGapsTextPage.tests.verifyScoringSectionContentsForNonScoredScoringType();
245
242
  });
246
243
 
@@ -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('Select Question contents', () => {
13
+ describe('Header section contents', () => {
14
14
  abortEarlySetup();
15
15
  before(() => {
16
- fillInTheGapsTextPage.steps.navigateToCreateQuestionPage();
16
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
17
17
  cy.barsPreLoaderWait();
18
18
  });
19
19
 
20
- fillInTheGapsTextPage.tests.verifySelectQuestionContents('fill in the gaps with text', 'Fill in the gaps with text');
20
+ fillInTheGapsTextPage.tests.verifyCreateQuestionPageQuestionTypeHeader('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', 'Print preview'];
4
+ const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
5
5
  const views = utilities.getViews(previewContentViews);
6
6
  var itemReferenceID = "";
7
7
  const css = Cypress.env('css');
@@ -51,9 +51,6 @@ 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;
57
54
  default:
58
55
  throw new Error('Invalid view');
59
56
  }
@@ -71,14 +68,13 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
71
68
  }
72
69
  });
73
70
 
74
- if ( view !== 'Print preview') {
75
71
  it(`Fill in the gaps text - ${view} Question instructions should be visible`, () => {
76
72
  utilities.verifyInnerText(fillInTheGapsTextPage.questionInstructionsText(), 'Fill in the gaps');
77
73
  utilities.verifyElementVisibilityState(fillInTheGapsTextPage.questionInstructionsText(), 'visible');
78
74
  cy.eyesCheckWindow(`Fill in the gaps text - ${view} - Default question state`);
79
75
  });
80
76
 
81
- if (view !== 'Grading view' && view !== 'Correct answer view' && view !== 'Print preview') {
77
+ if (view !== 'Grading view' && view !== 'Correct answer view') {
82
78
  it('The sample \'Lorem Ipsum\' text along with three answer input fields should be displayed in the question field and they should be empty.', () => {
83
79
  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​');
84
80
  utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
@@ -100,20 +96,6 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
100
96
  fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(1);
101
97
  fillInTheGapsTextPage.steps.verifyAnswerInputFieldDisabled(2);
102
98
  });
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
- });
117
99
  } else {
118
100
  it('The answer input fields should be displayed filled with correct answers', () => {
119
101
  utilities.verifyElementCount(fillInTheGapsTextPage.answerInputFieldPreviewTab(), 3);
@@ -174,7 +156,6 @@ describe('Create item page - Fill in the gaps with text - Preview contents in al
174
156
  it('Accessibility of preview tab', { tags: 'a11y' }, () => {
175
157
  cy.checkAccessibility(fillInTheGapsTextPage.answerInputFieldPreviewTab().parents('[class*="question-preview-wrapper"]'));
176
158
  });
177
- }
178
159
  });
179
160
  });
180
161
  });
@@ -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.enableSpecialCharactersCheckboxWrapper().find('rect').eq(1), {
40
+ utilities.verifyCSS(fillInTheGapsTextPage.enableSpecialCharactersCheckbox().find('rect').eq(1), {
41
41
  'fill': css.color.activeButtons
42
42
  });
43
43
  utilities.verifyCSS(fillInTheGapsTextPage.groupByLanguageLabel(), {
44
- 'color': css.color.labelText,
44
+ 'color': css.color.labels,
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.showOnlyCustomSpecialCharactersRadioButtonWrapper().find('svg'), {
49
+ utilities.verifyCSS(fillInTheGapsTextPage.showOnlyCustomSpecialCharactersRadioButton().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.customSpecialCharactersInputFieldWrapper().find('fieldset'), {
62
+ utilities.verifyCSS(fillInTheGapsTextPage.customSpecialCharactersInputField().find('fieldset'), {
63
63
  'border': `1px solid ${css.color.figDefaultComponentBorder}`
64
64
  });
65
65
  utilities.verifyCSS(fillInTheGapsTextPage.customizeSpecialCharactersPreviewButton(), {
@@ -100,10 +100,13 @@ 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.optionColor
103
+ 'fill': css.color.secondaryBtn
104
+ });
105
+ utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileSectionCategoriesDragIcon().eq(0).parent(), {
106
+ 'fill': css.color.secondaryBtn
104
107
  });
105
108
  utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileSectionCategoriesDragIcon().eq(0).parent(), {
106
- 'fill': css.color.blackText
109
+ 'fill': css.color.defaultBackground
107
110
  });
108
111
  utilities.verifyCSS(fillInTheGapsTextPage.specialCharacterTileCategoryName().eq(0), {
109
112
  'color': css.color.secondaryBtn,
@@ -119,18 +122,18 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
119
122
  utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
120
123
  'color': css.color.flyoutTitle,
121
124
  'font-size': css.fontSize.heading,
122
- 'font-weight': css.fontWeight.semibold
125
+ 'font-weight': css.fontWeight.bold
123
126
  });
124
127
  utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupCategoryLabel().eq(0), {
125
128
  'color': css.color.accordionLabel,
126
- 'font-size': css.fontSize.default,
127
- 'font-weight': css.fontWeight.bold
129
+ 'font-size': css.fontSize.normal,
130
+ 'font-weight': css.fontWeight.semibold
128
131
  });
129
132
  utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupCategoryAccordionExpandIcon().last().find('svg'), {
130
133
  'fill': css.color.activeButtons
131
134
  });
132
135
  utilities.verifyCSS(fillInTheGapsTextPage.specialCharactersPreviewPopupSymbol().eq(0).find('svg'), {
133
- 'fill': css.color.blackText
136
+ 'fill': css.color.defaultBackground
134
137
  });
135
138
  });
136
139
 
@@ -138,10 +141,10 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
138
141
  cy.checkAccessibility(dialogBoxBase.dialogBox());
139
142
  cy.log('Closing preview popup');
140
143
  dialogBoxBase.steps.closeWarningPopup();
141
- cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel());
144
+ cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel().parent());
142
145
  cy.log('Selecting show only custom special characters radio button');
143
146
  fillInTheGapsTextPage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
144
- cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel());
147
+ cy.checkAccessibility(fillInTheGapsTextPage.specialCharactersLabel().parent());
145
148
  });
146
149
  });
147
150
 
@@ -1,38 +1,22 @@
1
- import { fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { fillInTheGapsTextPage } 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 = "";
8
5
 
9
6
  describe('Create Item page - Fill in the gaps with text: Student view settings', () => {
10
7
  before(() => {
11
8
  cy.loginAs('admin');
12
9
  });
13
10
 
14
- describe('Student view settings : Edit tab contents', () => {
11
+ describe('Student view settings : Spell check - Edit tab functionality', () => {
15
12
  abortEarlySetup();
16
13
  before(() => {
17
- cy.log('Navigating to fill in the gaps with text question type');
18
14
  fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
19
15
  cy.barsPreLoaderWait();
20
16
  });
21
17
 
22
- fillInTheGapsTextPage.tests.verifyStudentViewSettingsLabelAndCSS();
23
-
24
18
  fillInTheGapsTextPage.tests.verifySpellCheckEditTabContents();
25
19
 
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
-
36
20
  fillInTheGapsTextPage.tests.verifyAllowStudentsToCheckAnswerNotExist();
37
21
  });
38
22
 
@@ -47,72 +31,6 @@ describe('Create Item page - Fill in the gaps with text: Student view settings',
47
31
  fillInTheGapsTextPage.tests.verifySpellCheckFunctionalityPreviewTab();
48
32
  });
49
33
 
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 === 'Grading view') {
106
- fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
107
- };
108
-
109
- if (view === 'Question preview' || view === 'Item preview') {
110
- fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
111
- };
112
- });
113
- });
114
- });
115
-
116
34
  /*describe('Allow students to check answer: Edit tab', () => {
117
35
  abortEarlySetup();
118
36
  before(() => {
@@ -1,10 +1,7 @@
1
- import { dialogBoxBase, fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { dialogBoxBase, fillInTheGapsTextPage } 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 = "";
8
5
 
9
6
  describe('Create item page - Fill in the gaps with text: Text container settings', () => {
10
7
  before(() => {
@@ -219,73 +216,4 @@ describe('Create item page - Fill in the gaps with text: Text container settings
219
216
  fillInTheGapsTextPage.steps.verifyAnswerInputFieldHeightPreviewTab(1, '150px');
220
217
  });
221
218
  });
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
- });
291
219
  });
@@ -22,8 +22,6 @@ 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`),
27
25
  }
28
26
 
29
27
  const steps = {
@@ -34,11 +32,6 @@ const steps = {
34
32
  selectQuestionResourceToolPage.steps.selectQuestionType(questionType);
35
33
  },
36
34
 
37
- navigateToCreateQuestionPage: () => {
38
- cy.visit('/item-engine/demo/create-item');
39
- createItemPage.steps.clickOnAddQuestion();
40
- },
41
-
42
35
  navigateToCreateResource: (resourceType) => {
43
36
  cy.visit('/item-engine/demo/create-item');
44
37
  createItemPage.steps.clickOnAddResource();
@@ -359,17 +352,6 @@ const tests = {
359
352
  .should('have.attr', 'aria-selected', 'true');
360
353
  utilities.verifyElementVisibilityState(createQuestionBasePage.editTabWrapper(), 'visible');
361
354
  });
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
- });
373
355
  }
374
356
  }
375
357
 
@@ -11,7 +11,6 @@ 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),
15
14
  showOnlyCustomSpecialCharactersLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__RadioGroupWrapper"] .ngie-radio-label').eq(1),
16
15
  selectSpecialCharacterLanguagesLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
17
16
  customizeSpecialCharactersPreviewButton: () => cy.get('[class*="CustomizedSpecialCharacterstyles__PreviewLabel"]'),
@@ -37,7 +36,6 @@ const selectors = {
37
36
  //Show only custom special characters section
38
37
  customSpecialCharactersLabel: () => cy.get('[class*="CustomizedSpecialCharacterstyles__SpecialCharLabel"]'),
39
38
  customSpecialCharactersInputField: () => cy.get('input[aria-label="Custom special characters"]'),
40
- customSpecialCharactersInputFieldWrapper: () => cy.get('.spl-char-input-field .text-input-field')
41
39
  }
42
40
 
43
41
  const steps = {
@@ -62,7 +62,6 @@ 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"]'),
66
65
 
67
66
  //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
68
67
  //preview tab special characters
@@ -914,7 +913,7 @@ const tests = {
914
913
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
915
914
  });
916
915
 
917
- // commonComponents.tests.verifyErrorMessageCSSAndA11y();
916
+ commonComponents.tests.verifyErrorMessageCSSAndA11y();
918
917
 
919
918
  it('When the user enters value in minimum character limit input field then the error message should disappear', () => {
920
919
  fillInTheGapsTextCommonComponent.steps.setMinimumLimit(0);
@@ -936,7 +935,7 @@ const tests = {
936
935
  utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
937
936
  });
938
937
 
939
- // commonComponents.tests.verifyErrorMessageCSSAndA11y();
938
+ commonComponents.tests.verifyErrorMessageCSSAndA11y();
940
939
 
941
940
  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', () => {
942
941
  fillInTheGapsTextCommonComponent.steps.setMinimumLimit(30);
@@ -70,4 +70,3 @@ export * from './connectorStyleStyleAndLayoutCustomizationComponent';
70
70
  export * from './equationEditorSectionCommonComponent';
71
71
  export * from './ckEditorAudioPlayerComponent';
72
72
  export * from './hideExpressionListComponent';
73
- export * from './printPreviewComponent';
@@ -29,7 +29,7 @@ const steps = {
29
29
  .within(() => {
30
30
  questionInputFieldComponent.responseAreaCloseButton()
31
31
  .click();
32
- cy.wait(1000)
32
+ cy.wait(1000)
33
33
  });
34
34
  },
35
35
 
@@ -76,18 +76,6 @@ 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
-
91
79
  verifyQuestionInputFieldPlaceholder: () => {
92
80
  questionInputFieldComponent.questionInputField()
93
81
  .should('have.attr', 'data-cke-editorplaceholder', 'Enter question');
@@ -252,11 +252,6 @@ 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
-
260
255
  it('CSS of \'Points\' label and input field', { tags: 'css' }, () => {
261
256
  utilities.verifyCSS(scoringSectionBaseEditTab.pointsLabel(), {
262
257
  'color': css.color.labels,
@@ -402,12 +397,6 @@ const tests = {
402
397
  });
403
398
  },
404
399
 
405
- verifyNonScoredDefaultState: () => {
406
- it('Point input field should be displayed in disabled state with prefilled 0 points', () => {
407
- scoringSectionBaseEditTab.steps.verifyNonScoredPointsField();
408
- });
409
- },
410
-
411
400
  verifyScoringSectionContentsForNonScoredScoringType: () => {
412
401
  it('When the user has selected \'Non scored\' option from the \'Scoring type\' dropdown, \'Minimum scoring\' dropdown should not be displayed', () => {
413
402
  utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.minimumScoringDropdown(), 'notExist');
@@ -1,7 +1,6 @@
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, studentViewSettingsLabelComponent, printPreviewComponent } 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 } from "./components";
3
3
  import { createItemPage } from "./createItemPage";
4
- const css = Cypress.env('css');
5
4
 
6
5
  const selectors = {
7
6
  ...questionInstructionsComponent,
@@ -22,19 +21,11 @@ const selectors = {
22
21
  ...placeholderTextSectionComponent,
23
22
  ...styleAndLayoutCustomizationAccordionComponent,
24
23
  ...figCommonStyleAndLayoutComponent,
25
- ...studentViewSettingsLabelComponent,
26
- ...printPreviewComponent,
27
24
  setForAllTextContainersLabel: () => cy.get('[data-ngie-testid="set-for-all-text-containers-checkbox"] .MuiFormControlLabel-label'),
28
25
  setForAllTextContainersCheckbox: () => cy.get('[data-ngie-testid="set-for-all-text-containers-checkbox"] input'),
29
26
  correctAnswerSectionWithoutEnumerationWrapper: () => cy.get('.no-numeration-correct-answers-wrapper .preview-question-text-wrapper'),
30
27
  answerStatusBanner: () => cy.get('[class*="AnswerStatusWrapper"]'),
31
28
  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
29
  }
39
30
 
40
31
  const steps = {
@@ -62,7 +53,6 @@ const steps = {
62
53
  ...styleAndLayoutCustomizationAccordionComponent.steps,
63
54
  ...figCommonStyleAndLayoutComponent.steps,
64
55
  ...createItemPage.steps,
65
- ...printPreviewComponent.steps,
66
56
  /**
67
57
  * Verify that the incorrect option icon is displayed for a specific answer input field.
68
58
  * @param {number} inputFieldIndex - The index of the answer input field to verify.
@@ -175,48 +165,6 @@ const steps = {
175
165
  fillInTheGapsTextPage.answerStatusBanner()
176
166
  .should('be.visible');
177
167
  },
178
-
179
- verifyAutoResizeCheckboxUnchecked: () => {
180
- fillInTheGapsTextPage.autoResizeCheckbox()
181
- .should('not.be.checked');
182
- },
183
-
184
- verifyAutoResizeCheckboxChecked: () => {
185
- fillInTheGapsTextPage.autoResizeCheckbox()
186
- .should('be.checked');
187
- },
188
-
189
- checkAutoResizeCheckbox: () => {
190
- fillInTheGapsTextPage.autoResizeCheckbox()
191
- .click()
192
- steps.verifyAutoResizeCheckboxChecked();
193
- },
194
-
195
- uncheckAutoResizeCheckbox: () => {
196
- fillInTheGapsTextPage.autoResizeCheckbox()
197
- .click();
198
- steps.verifyAutoResizeCheckboxUnchecked();
199
- },
200
-
201
- /**
202
- * Verify that the auto-resize for a response field in the Preview Tab is disabled.
203
- * @param {number} responseFieldIndex - The index of the response field to verify.
204
- */
205
- verifyAutoResizeOfResponseFieldPreviewTabDisabled: (responseFieldIndex) => {
206
- fillInTheGapsTextPage.answerInputFieldWrapperPreviewTab()
207
- .eq(responseFieldIndex)
208
- .should('have.attr', 'resizetype', 'vertical');
209
- },
210
-
211
- /**
212
- * Verify that the auto-resize for a response field in the Preview Tab is enabled.
213
- * @param {number} responseFieldIndex - The index of the response field to verify.
214
- */
215
- verifyAutoResizeOfResponseFieldPreviewTabEnabled: (responseFieldIndex) => {
216
- fillInTheGapsTextPage.answerResponseFieldPreviewTab()
217
- .eq(responseFieldIndex)
218
- .should('have.attr', 'resizetype', 'none');
219
- },
220
168
  }
221
169
 
222
170
  const tests = {
@@ -237,79 +185,7 @@ const tests = {
237
185
  ...ariaLabelSectionComponent.tests,
238
186
  ...placeholderTextSectionComponent.tests,
239
187
  ...styleAndLayoutCustomizationAccordionComponent.tests,
240
- ...figCommonStyleAndLayoutComponent.tests,
241
- ...studentViewSettingsLabelComponent.tests,
242
- ...printPreviewComponent.tests,
243
-
244
- verifyAutoResizeResponseFieldEditTabContents: () => {
245
- it('Auto-resize response field label should be displayed', () => {
246
- utilities.verifyInnerText(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), 'Auto-resize the response field');
247
- utilities.verifyElementVisibilityState(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), 'visible');
248
- });
249
-
250
- it('Auto-resize response field checkbox should be displayed and in unchecked state by default', () => {
251
- utilities.verifyElementVisibilityState(fillInTheGapsTextPage.autoResizeCheckbox(), 'exist');
252
- steps.verifyAutoResizeCheckboxUnchecked();
253
- });
254
-
255
- it('CSS of \'Auto-resize response field\' section', { tags: 'css' }, () => {
256
- utilities.verifyCSS(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), {
257
- 'color': css.color.labelText,
258
- 'font-size': css.fontSize.normal,
259
- 'font-weight': css.fontWeight.regular
260
- });
261
- });
262
-
263
- it('Accessibility of \'Auto-resize response field\' section', { tags: 'a11y' }, () => {
264
- cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
265
- });
266
-
267
- it('CSS of \'Auto-resize response field\' section - unchecked state', { tags: 'css' }, () => {
268
- utilities.verifyCSS(fillInTheGapsTextPage.autoResizeResponseFieldLabel(), {
269
- 'color': css.color.labelText,
270
- 'font-size': css.fontSize.normal,
271
- 'font-weight': css.fontWeight.regular
272
- });
273
- utilities.verifyCSS(fillInTheGapsTextPage.autoResizeCheckbox().parent().find('svg'), {
274
- 'fill': css.color.uncheckedCheckbox
275
- });
276
- });
277
-
278
- it('Accessibility of \'Auto-resize response field\' section - unchecked state', { tags: 'a11y' }, () => {
279
- cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
280
- });
281
-
282
- it('User should be able to check \'Auto-resize response field\' checkbox', () => {
283
- fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
284
- });
285
-
286
- it('CSS of \'Auto-resize response field\' section - checked state', { tags: 'css' }, () => {
287
- utilities.verifyCSS(fillInTheGapsTextPage.autoResizeCheckbox().parent('.icon-checkbox-selected').find('.checkbox-icon-border-rect'), {
288
- 'fill': css.color.activeButtons
289
- });
290
- });
291
-
292
- it('Accessibility of \'Auto-resize response field\' section - checked state', { tags: 'a11y' }, () => {
293
- cy.checkAccessibility(fillInTheGapsTextPage.autoResizeResponseFieldLabel().parents('.student-view-settings-container'));
294
- });
295
-
296
- it('User should be able to uncheck \'Auto-resize response field\' checkbox', () => {
297
- fillInTheGapsTextPage.steps.uncheckAutoResizeCheckbox();
298
- });
299
- },
300
-
301
- verifyAutoResizeResponseFieldFunctionalityPreviewTab: () => {
302
- it('When the \'Auto-resize response field\' functionality is disabled, the response field should have \'auto-resize\' attribute set as \'false\' in preview tab', () => {
303
- fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
304
- });
305
-
306
- 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', () => {
307
- createQuestionBasePage.steps.switchToEditTab();
308
- fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
309
- createQuestionBasePage.steps.switchToPreviewTab();
310
- fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabEnabled(0);
311
- });
312
- },
188
+ ...figCommonStyleAndLayoutComponent.tests
313
189
  }
314
190
 
315
191
  export const fillInTheGapsTextPage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.543-IEI-6999-main-04ce552.0",
3
+ "version": "1.0.543",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service.yaml CHANGED
@@ -38,6 +38,24 @@ deployment:
38
38
  - "*.*.mozilla.com"
39
39
  - "*.*.*.mozilla.com"
40
40
  - "cdn.jsdelivr.net"
41
+ - "unpkg.com"
42
+ - "*.learnosity.com"
43
+ - "media.wne-cdn.com"
44
+ - "*.applitools.com"
45
+ - "*.imaginelearning.com"
46
+ - "*.*.imaginelearning.com"
47
+ - "*.il-apps.com"
48
+ - "*.*.il-apps.com"
49
+ - "cdn.pixabay.com"
50
+ - "sts.amazonaws.com"
51
+ - "sqs.us-west-2.amazonaws.com"
52
+ - "sqs.us-east-2.amazonaws.com"
53
+ - "dynamodb.us-east-2.amazonaws.com"
54
+ - "*.dynamodb.us-east-2.amazonaws.com"
55
+ - "*.cloudfront.net"
56
+ - "*.amazonaws.com"
57
+ CIDRs:
58
+ - "169.254.169.254/32"
41
59
  env:
42
60
  - name: OTK_VERSION
43
61
  value: "2"
@@ -1,158 +0,0 @@
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
- printPreviewButton: () => cy.get('.print-layout-option-wrapper .print-preview-button'),
14
- questionInstructionsForPrintLabel: () => cy.get('.print-layout-option-wrapper .additional-settings-label'),
15
- questionInstructionsInputFieldForPrint: () => cy.get('.print-layout-option-wrapper [aria-label="Question instructions for print (overrides default instructions)"]'),
16
- };
17
-
18
- const steps = {
19
- expandPrintLayoutSettings: () => {
20
- printPreviewComponent.printLayoutSettingsPanel()
21
- .click();
22
- cy.log('Need this wait in order for the font size dropdown to render properly');
23
- cy.wait(2000);
24
- printPreviewComponent.printLayoutSettingsPanel()
25
- .should('have.attr', 'aria-expanded', 'true');
26
- },
27
-
28
- verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked: () => {
29
- printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
30
- .should('not.be.checked');
31
- },
32
-
33
- verifyExcludeThisQuestionWhenPrintingCheckboxChecked: () => {
34
- printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
35
- .should('be.checked');
36
- },
37
-
38
- checkExcludeThisQuestionWhenPrintingCheckbox: () => {
39
- printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
40
- .click()
41
- steps.verifyExcludeThisQuestionWhenPrintingCheckboxChecked();
42
- },
43
-
44
- uncheckExcludeThisQuestionWhenPrintingCheckbox: () => {
45
- printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox()
46
- .click();
47
- steps.verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked();
48
- },
49
-
50
- verifyPrintPreviewButtonDisabledState: () => {
51
- printPreviewComponent.printPreviewButton()
52
- .should('have.class', 'disabled-print-preview-button');
53
- },
54
-
55
- verifyQuestionInstructionsInputFieldForPrintDisabledState: () => {
56
- printPreviewComponent.questionInstructionsInputFieldForPrint()
57
- .should('have.attr', 'contenteditable', 'false');
58
- }
59
-
60
- };
61
-
62
- const tests = {
63
- verifyPrintLayoutSettingsAccordionProperties: () => {
64
- 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', () => {
65
- printPreviewComponent.printLayoutSettingsPanel()
66
- .should('have.attr', 'aria-expanded', 'false');
67
- printPreviewComponent.steps.expandPrintLayoutSettings();
68
- });
69
-
70
- it('CSS of \'Print Layout Settings\' accordion', { tags: 'css' }, () => {
71
- utilities.verifyCSS(printPreviewComponent.printLayoutSettingsPanel().find('.additional-settings'), {
72
- 'color': css.color.accordionLabel,
73
- 'font-size': css.fontSize.default,
74
- 'font-weight': css.fontWeight.bold
75
- });
76
- utilities.verifyCSS(printPreviewComponent.printLayoutSettingsPanel().find('svg'), {
77
- 'fill': css.color.activeButtons
78
- });
79
- });
80
-
81
- it('Accessibility of \'Print Layout Settings\' accordion', { tags: 'a11y' }, () => {
82
- cy.checkAccessibility(printPreviewComponent.printLayoutSettingsPanel().parents('.print-layout-settings-container'));
83
- });
84
- },
85
-
86
- verifyPrintLayoutSettingsAccordionContents: () => {
87
- it('\'Exclude this question when printing\' label should be displayed', () => {
88
- utilities.verifyInnerText(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), 'Exclude this question when printing');
89
- utilities.verifyElementVisibilityState(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), 'visible');
90
- });
91
-
92
- it('Exclude this question when printing checkbox should be displayed and in unchecked state by default', () => {
93
- utilities.verifyElementVisibilityState(printPreviewComponent.excludeThisQuestionWhenPrintingCheckbox(), 'exist');
94
- steps.verifyExcludeThisQuestionWhenPrintingCheckboxUnchecked();
95
- });
96
-
97
- it('CSS of \'Exclude this question when printing\' section', { tags: 'css' }, () => {
98
- utilities.verifyCSS(printPreviewComponent.excludeThisQuestionWhenPrintingLabel(), {
99
- 'color': css.color.labelText,
100
- 'font-size': css.fontSize.normal,
101
- 'font-weight': css.fontWeight.regular
102
- });
103
- });
104
-
105
- it('Accessibility of \'Exclude this question when printing\' section', { tags: 'a11y' }, () => {
106
- cy.checkAccessibility(printPreviewComponent.printLayoutSettingsPanel().parents('.print-layout-settings-container'));
107
- });
108
-
109
- it('User should be able to check and uncheck the \'Exclude this question when printing\' checkbox', () => {
110
- steps.checkExcludeThisQuestionWhenPrintingCheckbox();
111
- steps.uncheckExcludeThisQuestionWhenPrintingCheckbox();
112
- });
113
-
114
- it('Print preview button should be present and icon should be visible', () => {
115
- utilities.verifyElementVisibilityState(printPreviewComponent.printPreviewButton(), 'visible');
116
- utilities.verifyInnerText(printPreviewComponent.printPreviewButton(), 'Print preview');
117
- utilities.verifyElementVisibilityState(printPreviewComponent.printPreviewIcon(), 'visible');
118
- });
119
-
120
- it('CSS of Print preview button and icon', { tags: 'css' }, () => {
121
- utilities.verifyCSS(printPreviewComponent.printPreviewButton(), {
122
- 'color': css.color.codeBlockText,
123
- 'font-size': css.fontSize.normal,
124
- 'font-weight': css.fontWeight.regular,
125
- });
126
- utilities.verifyCSS(printPreviewComponent.printPreviewIcon().find('path'), {
127
- 'stroke': css.color.primaryBtnBg
128
- });
129
- });
130
-
131
- it('Accessibility of Print preview button', { tags: 'a11y' }, () => {
132
- cy.checkAccessibility(printPreviewComponent.printPreviewButton());
133
- });
134
-
135
- 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', () => {
136
- steps.checkExcludeThisQuestionWhenPrintingCheckbox();
137
- steps.verifyPrintPreviewButtonDisabledState();
138
- steps.verifyQuestionInstructionsInputFieldForPrintDisabledState();
139
- steps.uncheckExcludeThisQuestionWhenPrintingCheckbox();
140
- });
141
-
142
- it('Question instructions for print label should be displayed', () => {
143
- utilities.verifyElementVisibilityState(printPreviewComponent.questionInstructionsForPrintLabel(), 'visible');
144
- utilities.verifyInnerText(printPreviewComponent.questionInstructionsForPrintLabel(), 'Question instructions for print (overrides default instructions)');
145
- });
146
-
147
- it('Question instructions for print (overrides default instructions) input field should be present and by default it should be empty', () => {
148
- utilities.verifyElementVisibilityState(printPreviewComponent.questionInstructionsInputFieldForPrint(), 'visible');
149
- utilities.verifyTextContent(printPreviewComponent.questionInstructionsInputFieldForPrint(), '');
150
- });
151
- },
152
- };
153
-
154
- export const printPreviewComponent = {
155
- ...selectors,
156
- steps,
157
- tests
158
- };