itemengine-cypress-automation 1.0.559 → 1.0.560-task-IEI-6999-74ea0db.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.
@@ -36,6 +36,7 @@ describe('Fill In the gaps with text - Additional settings', () => {
36
36
  cy.barsPreLoaderWait();
37
37
  fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
38
38
  fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
39
+ fillInTheGapsTextPage.steps.allotPoints(5);
39
40
  fillInTheGapsTextPage.steps.expandAdditionalSettings();
40
41
  });
41
42
 
@@ -65,7 +66,33 @@ describe('Fill In the gaps with text - Additional settings', () => {
65
66
  'font-size': fontSizes[option]
66
67
  });
67
68
  fillInTheGapsTextPage.steps.switchToStudentView();
69
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
70
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
71
+ // fillInTheGapsTextPage.steps.switchToGradingView();
72
+ // fillInTheGapsTextPage.steps.switchToPreviewTab();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
74
+ utilities.verifyCSS(fillInTheGapsTextPage.questionInstructionsText(), {
75
+ 'font-size': fontSizes[option]
76
+ });
77
+ utilities.verifyCSS(fillInTheGapsTextPage.answerInputFieldPreviewTab(), {
78
+ 'font-size': fontSizes[option]
79
+ });
80
+ fillInTheGapsTextPage.steps.switchToGradingView();
81
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswersLabel(), {
82
+ 'font-size': fontSizes[option]
83
+ });
84
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerResponseNumeration().find('.response-input-adornment'), {
85
+ 'font-size': fontSizes[option]
86
+ });
87
+ utilities.verifyCSS(fillInTheGapsTextPage.correctAnswerResponse(), {
88
+ 'font-size': fontSizes[option]
89
+ });
90
+ utilities.verifyCSS(fillInTheGapsTextPage.correctIncorrectStatusMessageText(), {
91
+ 'font-size': fontSizes[option]
92
+ });
68
93
  fillInTheGapsTextPage.steps.switchToEditTab();
94
+ fillInTheGapsTextPage.steps.clickOnEditQuestionButton();
95
+ fillInTheGapsTextPage.steps.expandAdditionalSettings();
69
96
  });
70
97
  });
71
98
  });
@@ -90,6 +90,7 @@ describe('Fill In the gaps with text - Additional settings : Placeholder text, G
90
90
  cy.barsPreLoaderWait();
91
91
  fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
92
92
  //fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
93
+ fillInTheGapsTextPage.steps.allotPoints(5);
93
94
  fillInTheGapsTextPage.steps.expandAdditionalSettings();
94
95
  });
95
96
 
@@ -106,11 +107,18 @@ describe('Fill In the gaps with text - Additional settings : Placeholder text, G
106
107
  });*/
107
108
 
108
109
  it(`When the user switches to the "Grading view", then the "${option}" numeration should be displayed in the answer input fields as well as correct answer options in the correct answer section`, () => {
110
+ fillInTheGapsTextPage.steps.switchToGradingView();
111
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldEnumeration(enumerationOptions[option]);
112
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesEnumeration(enumerationOptions[option]);
113
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
114
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
109
115
  fillInTheGapsTextPage.steps.switchToGradingView();
110
116
  fillInTheGapsTextPage.steps.verifyAnswerInputFieldEnumeration(enumerationOptions[option]);
111
117
  fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesEnumeration(enumerationOptions[option]);
112
118
  cy.log('Post step: Switch to Edit tab')
113
119
  fillInTheGapsTextPage.steps.switchToEditTab();
120
+ fillInTheGapsTextPage.steps.clickOnEditQuestionButton();
121
+ fillInTheGapsTextPage.steps.expandAdditionalSettings();
114
122
  });
115
123
  });
116
124
 
@@ -1,6 +1,10 @@
1
- import { fillInTheGapsTextPage } from "../../../pages";
1
+ import { fillInTheGapsTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
3
4
  const css = Cypress.env('css');
5
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(correctAnswerViews);
7
+ var itemReferenceID = "";
4
8
 
5
9
  describe('Create item page - Fill in the gaps with text: Set limit section', () => {
6
10
  before(() => {
@@ -41,7 +45,7 @@ describe('Create item page - Fill in the gaps with text: Set limit section', ()
41
45
  it('User should able to enter characters in the answer input field', () => {
42
46
  fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }]);
43
47
  });
44
-
48
+
45
49
  //Uncomment below code once https://redmine.zeuslearning.com/issues/571588 is resolved
46
50
  // fillInTheGapsTextPage.tests.verifyMaximumCharacterLimitWarningConditionsSpecifyCorrectAnswerSection();
47
51
 
@@ -76,4 +80,56 @@ describe('Create item page - Fill in the gaps with text: Set limit section', ()
76
80
 
77
81
  // fillInTheGapsTextPage.tests.verifyMinimumCharacterLimitWarningConditionsPreviewTab();
78
82
  });
83
+
84
+ views.forEach((view) => {
85
+ describe(`${view}: Maximum character limit functionality`, () => {
86
+ abortEarlySetup();
87
+ before(() => {
88
+ switch (view) {
89
+ case 'Question preview':
90
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
91
+ cy.barsPreLoaderWait();
92
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
93
+ fillInTheGapsTextPage.steps.setMaximumLimit(15);
94
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
95
+ break;
96
+ case 'Item preview':
97
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
98
+ itemPreviewPage.steps.switchToPreviewTab();
99
+ break;
100
+ case 'Grading view':
101
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
102
+ break;
103
+ };
104
+ });
105
+
106
+ beforeEach(() => {
107
+ switch (view) {
108
+ case 'Question preview':
109
+ break;
110
+ case 'Item preview':
111
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
112
+ itemPreviewPage.steps.resetQuestionPreview();
113
+ break;
114
+ case 'Student view':
115
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
116
+ break;
117
+ }
118
+ });
119
+
120
+ if (view === 'Question preview') {
121
+ after(() => {
122
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
123
+ fillInTheGapsTextPage.steps.clickOnConfirmButton();
124
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
125
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
126
+ });
127
+ };
128
+
129
+ it('When the user reaches the character limit, then the warning message \'Maximum 15 characters have been entered\' should be displayed', () => {
130
+ fillInTheGapsTextPage.steps.addTextInAnswerInputFieldsAllView(0, 'NewFlowerpotsingarden');
131
+ fillInTheGapsTextPage.steps.verifyLimitReachedWarningMessageExist('Maximum 15 characters have been entered.');
132
+ });
133
+ });
134
+ });
79
135
  });
@@ -1,11 +1,15 @@
1
1
  import { specialCharacters } from "../../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
2
- import { dialogBoxBase, fillInTheGapsTextPage } from "../../../pages";
2
+ import { dialogBoxBase, fillInTheGapsTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
6
 
7
7
  const specialCharactersCategories = Object.values(specialCharacters.map((icon) => icon.categoryName));
8
8
  const customSpecialCharacters = ['A', '1', '#'];
9
+ const specialCharactersLanguageLabel = ['French', 'Portuguese', 'Italian'];
10
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
11
+ const views = utilities.getViews(correctAnswerViews);
12
+ var itemReferenceID = "";
9
13
 
10
14
  describe('Create item page - Fill in the gaps with text - Special characters section', () => {
11
15
  before(() => {
@@ -235,4 +239,114 @@ describe('Create item page - Fill in the gaps with text - Special characters sec
235
239
  });
236
240
  });
237
241
  });
242
+
243
+ views.forEach((view) => {
244
+ describe(`${view}: Special characters section `, () => {
245
+ abortEarlySetup();
246
+ before(() => {
247
+ switch (view) {
248
+ case 'Question preview':
249
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
250
+ cy.barsPreLoaderWait();
251
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
252
+ fillInTheGapsTextPage.steps.checkEnableSpecialCharactersCheckbox();
253
+ fillInTheGapsTextPage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[0].categoryName);
254
+ fillInTheGapsTextPage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[2].categoryName);
255
+ fillInTheGapsTextPage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[4].categoryName);
256
+ fillInTheGapsTextPage.steps.clickOnSpecialCharactersCategoryTile(specialCharacters[6].categoryName);
257
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
258
+ break;
259
+ case 'Item preview':
260
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
261
+ itemPreviewPage.steps.switchToPreviewTab();
262
+ break;
263
+ case 'Grading view':
264
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
265
+ break;
266
+ };
267
+ });
268
+
269
+ beforeEach(() => {
270
+ switch (view) {
271
+ case 'Question preview':
272
+ break;
273
+ case 'Item preview':
274
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
275
+ break;
276
+ case 'Student view':
277
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
278
+ break;
279
+ }
280
+ });
281
+
282
+ if (view === 'Question preview') {
283
+ after(() => {
284
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
285
+ fillInTheGapsTextPage.steps.clickOnConfirmButton();
286
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
287
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
288
+ });
289
+ };
290
+
291
+ it(`should display the ${specialCharactersLanguageLabel} special characters language labels in the popup`, () => {
292
+ fillInTheGapsTextPage.steps.focusInResponseInputFieldPreviewTab(0);
293
+ fillInTheGapsTextPage.steps.openSpecialCharactersPopupPreviewTab();
294
+ fillInTheGapsTextPage.steps.verifySpecialCharactersLanguageLabelsInSpecialCharactersPopupPreviewTab(specialCharactersLanguageLabel);
295
+ });
296
+ });
297
+ });
298
+
299
+ views.forEach((view) => {
300
+ describe(`${view}: Custom special characters section`, () => {
301
+ abortEarlySetup();
302
+ before(() => {
303
+ switch (view) {
304
+ case 'Question preview':
305
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
306
+ cy.barsPreLoaderWait();
307
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
308
+ fillInTheGapsTextPage.steps.checkEnableSpecialCharactersCheckbox();
309
+ fillInTheGapsTextPage.steps.selectShowOnlyCustomSpecialCharactersRadioButton();
310
+ fillInTheGapsTextPage.steps.addInputToCustomSpecialCharactersInputField(`${customSpecialCharacters.join('')}`);
311
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
312
+ break;
313
+ case 'Item preview':
314
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
315
+ itemPreviewPage.steps.switchToPreviewTab();
316
+ break;
317
+ case 'Grading view':
318
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
319
+ break;
320
+ };
321
+ });
322
+
323
+ beforeEach(() => {
324
+ switch (view) {
325
+ case 'Question preview':
326
+ break;
327
+ case 'Item preview':
328
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
329
+ break;
330
+ case 'Student view':
331
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
332
+ break;
333
+ }
334
+ });
335
+
336
+ if (view === 'Question preview') {
337
+ after(() => {
338
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
339
+ fillInTheGapsTextPage.steps.clickOnConfirmButton();
340
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
341
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
342
+ });
343
+ };
344
+
345
+ it(`should display the ${customSpecialCharacters} custom special characters in the popup`, () => {
346
+ fillInTheGapsTextPage.steps.focusInResponseInputFieldPreviewTab(0);
347
+ fillInTheGapsTextPage.steps.openSpecialCharactersPopupPreviewTab();
348
+ fillInTheGapsTextPage.steps.verifyCustomSpecialCharactersInSpecialCharactersPopupPreviewTab(customSpecialCharacters);
349
+ });
350
+ });
351
+ });
238
352
  });
@@ -1,8 +1,8 @@
1
- import { fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { fillInTheGapsTextPage, gradingViewPage, itemPreviewPage, studentViewPage, dialogBoxBase } 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'];
5
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view', 'Grading view'];
6
6
  const views = utilities.getViews(correctAnswerViews);
7
7
  var itemReferenceID = "";
8
8
 
@@ -59,7 +59,7 @@ describe('Create Item page - Fill in the gaps with text: Student view settings',
59
59
  });
60
60
 
61
61
  views.forEach((view) => {
62
- describe(`${view}: student view settings`, () => {
62
+ describe(`${view}: student view settings: Spell check and auto-resize default state`, () => {
63
63
  abortEarlySetup();
64
64
  before(() => {
65
65
  switch (view) {
@@ -101,13 +101,93 @@ describe('Create Item page - Fill in the gaps with text: Student view settings',
101
101
  });
102
102
  };
103
103
 
104
- it(` 'Auto-resize response field' functionality in ${view}`, () => {
104
+ it(`When the \'Auto-resize response field\' and spell check functionality is unchecked, the response field should have \'resizetype\' attribute set as \'vertical\' and \'spellcheck\' attribute set as \'false\' in ${view}`, () => {
105
105
  if (view === 'Student view') {
106
- fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
106
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
107
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled(0);
108
+ studentViewPage.steps.submitResponse();
109
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
110
+ studentViewPage.steps.clickOnGoToGradingViewButton();
111
+ };
112
+
113
+ if (view === 'Grading view') {
114
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled(0);
115
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
116
+ };
117
+
118
+ if (view === 'Question preview' || view === 'Item preview') {
119
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
120
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
121
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled(0);
122
+ };
123
+ });
124
+
125
+ });
126
+ });
127
+
128
+ views.forEach((view) => {
129
+ describe(`${view}: student view settings: Spell check and auto-resize checked`, () => {
130
+ abortEarlySetup();
131
+ before(() => {
132
+ switch (view) {
133
+ case 'Question preview':
134
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
135
+ cy.barsPreLoaderWait();
136
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('fill in the gaps');
137
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
138
+ fillInTheGapsTextPage.steps.checkSpellCheckCheckbox();
139
+ fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
140
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
141
+ break;
142
+ case 'Item preview':
143
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
144
+ itemPreviewPage.steps.switchToPreviewTab();
145
+ break;
146
+ case 'Student view':
147
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
148
+ break;
149
+ };
150
+ });
151
+
152
+ beforeEach(() => {
153
+ switch (view) {
154
+ case 'Question preview':
155
+ break;
156
+ case 'Item preview':
157
+ break;
158
+ case 'Student view':
159
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
160
+ break;
161
+ }
162
+ });
163
+
164
+ if (view === 'Question preview') {
165
+ after(() => {
166
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
167
+ fillInTheGapsTextPage.steps.clickOnConfirmButton();
168
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
169
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
170
+ });
171
+ };
172
+
173
+ it(`When the \'Spell check\' and \'Auto-resize response field\' functionality is enabled, the response field should have \'resizetype\' attribute set as \'vertical\' and \'spellcheck\' attribute set as \'true\' in the ${view}`, () => {
174
+ if (view === 'Student view') {
175
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldAllViewEnabled(0);
176
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabEnabled(0);
177
+ studentViewPage.steps.submitResponse();
178
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
179
+ studentViewPage.steps.clickOnGoToGradingViewButton();
180
+ };
181
+
182
+ if (view === 'Grading view') {
183
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldAllViewEnabled(0);
184
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabEnabled(0);
107
185
  };
108
186
 
109
187
  if (view === 'Question preview' || view === 'Item preview') {
110
- fillInTheGapsTextPage.tests.verifyAutoResizeResponseFieldFunctionalityPreviewTab();
188
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
189
+ fillInTheGapsTextPage.steps.verifySpellCheckOfResponseFieldAllViewEnabled(0);
190
+ fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabEnabled(0);
111
191
  };
112
192
  });
113
193
  });
@@ -1,9 +1,13 @@
1
- import { dialogBoxBase, fillInTheGapsTextPage } from "../../../pages";
1
+ import { dialogBoxBase, fillInTheGapsTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
2
  import { colorPopupComponent } 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 borderStyles = ["Dashed", "Dotted", "Solid", "None"]
6
+ const borderStyles = ["Dashed", "Dotted", "Solid", "None"];
7
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
8
+ const views = utilities.getViews(correctAnswerViews);
9
+ var itemReferenceID = "";
10
+
7
11
  describe('Create Item page - Fill in the gaps with text: Style and layout customization', () => {
8
12
  before(() => {
9
13
  cy.loginAs('admin');
@@ -40,7 +44,7 @@ describe('Create Item page - Fill in the gaps with text: Style and layout custom
40
44
  fillInTheGapsTextPage.tests.verifyFillColorTooltips();
41
45
 
42
46
  fillInTheGapsTextPage.tests.verifyBorderColorTooltips();
43
-
47
+
44
48
  fillInTheGapsTextPage.tests.verifyStyleAndLayoutCustomizationAccordionContentsCSSAndA11y('Solid');
45
49
  });
46
50
 
@@ -333,4 +337,55 @@ describe('Create Item page - Fill in the gaps with text: Style and layout custom
333
337
  });
334
338
  })
335
339
  });
340
+
341
+ views.forEach((view) => {
342
+ describe(`${view}: Default border style and default border color`, () => {
343
+ abortEarlySetup();
344
+ before(() => {
345
+ switch (view) {
346
+ case 'Question preview':
347
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
348
+ cy.barsPreLoaderWait();
349
+ fillInTheGapsTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
350
+ fillInTheGapsTextPage.steps.expandStyleAndLayoutCustomizationAccordion();
351
+ fillInTheGapsTextPage.steps.allotPoints(5);
352
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
353
+ break;
354
+ case 'Item preview':
355
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
356
+ itemPreviewPage.steps.switchToPreviewTab();
357
+ break;
358
+ case 'Grading view':
359
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
360
+ break;
361
+ };
362
+ });
363
+
364
+ beforeEach(() => {
365
+ switch (view) {
366
+ case 'Question preview':
367
+ break;
368
+ case 'Item preview':
369
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
370
+ break;
371
+ case 'Student view':
372
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
373
+ break;
374
+ }
375
+ });
376
+
377
+ if (view === 'Question preview') {
378
+ after(() => {
379
+ fillInTheGapsTextPage.steps.clickOnSaveQuestionButton();
380
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
381
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
382
+ });
383
+ };
384
+
385
+ it(`when the user switches to ${view} default border style and color should be displayed`, () => {
386
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldBorderColor(0, `1px solid ${css.color.activeComponentBorder}`);
387
+ fillInTheGapsTextPage.steps.verifyAnswerInputFieldFillColor(0, css.color.optionsBg);
388
+ });
389
+ });
390
+ });
336
391
  });
@@ -90,6 +90,8 @@ const selectors = {
90
90
  spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input[type="checkbox"]'),
91
91
  correctAnswerResponseForCorrectResponse: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerWrapperForLabelImg"]').eq(0),
92
92
  correctIncorrectAnswerLabelNew: () => cy.get('[class*="ClozeWithTextPreviewstyle__AnswerStatusWrapper"]'),
93
+ answerInputFieldAllView: () => cy.get('[class*="question-preview-wrapper"] [aria-label*="Add answer for response"]'),
94
+ customSpecialCharactersButtonPreviewTab: () => cy.get('.special-character-popup-container .MuiButton-text'),
93
95
  }
94
96
 
95
97
  const steps = {
@@ -694,6 +696,16 @@ const steps = {
694
696
  .should('have.attr', 'spellcheck', 'true');
695
697
  },
696
698
 
699
+ /**
700
+ * Verify that the spell check for a response field in the Preview Tab is enabled.
701
+ * @param {number} responseFieldIndex - The index of the response field to verify.
702
+ */
703
+ verifySpellCheckOfResponseFieldAllViewEnabled: (responseFieldIndex) => {
704
+ fillInTheGapsTextCommonComponent.answerInputFieldAllView()
705
+ .eq(responseFieldIndex)
706
+ .should('have.attr', 'spellcheck', 'true');
707
+ },
708
+
697
709
  /**
698
710
  *@description Verify numeration text for the answer input fields of the specify correct answer section.
699
711
  * @param responseAccordionIndex denotes response accordion index
@@ -906,7 +918,38 @@ const steps = {
906
918
  utilities.verifyCSS(utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab().parent('.response-input-field'), responseAreaIndex), {
907
919
  'border-style': styleName
908
920
  });
909
- }
921
+ },
922
+
923
+ /**
924
+ * @param {number} responseIndex index number of text container
925
+ * @param {string} responseText text to be added in text container
926
+ * @description function enters text in the answer input fields of the preview tab
927
+ */
928
+ addTextInAnswerInputFieldsAllView: (responseIndex, responseText) => {
929
+ utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
930
+ .type(responseText)
931
+ },
932
+
933
+ /**
934
+ * @description Verify special characters language labels in the special characters popup
935
+ * @param {string[]} specialCharactersLanguageLabel Array of the language labels for the category
936
+ */
937
+ verifySpecialCharactersLanguageLabelsInSpecialCharactersPopupPreviewTab: (specialCharactersLanguageLabel) => {
938
+ specialCharactersLanguageLabel.forEach((label, index) => {
939
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsTextCommonComponent.specialCharactersPopupCategoryAccordionLabelPreviewTab(), index), label);
940
+ });
941
+ },
942
+
943
+ /**
944
+ * @description Verify custom special characters displayed in special characters popup in preview tab
945
+ * @param {string[]} customSpecialCharacters Array of the custom special characters
946
+ */
947
+ verifyCustomSpecialCharactersInSpecialCharactersPopupPreviewTab: (customSpecialCharacters) => {
948
+ customSpecialCharacters.forEach((character, index) => {
949
+ utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsTextCommonComponent.customSpecialCharactersButtonPreviewTab(), index), 'visible');
950
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsTextCommonComponent.customSpecialCharactersButtonPreviewTab(), index), character);
951
+ });
952
+ },
910
953
  }
911
954
 
912
955
  const tests = {
@@ -1056,6 +1099,11 @@ const tests = {
1056
1099
  fillInTheGapsTextCommonComponent.steps.setMinimumLimit(10);
1057
1100
  fillInTheGapsTextCommonComponent.steps.setMaximumLimit(40);
1058
1101
  });
1102
+
1103
+ it('When the user insert 100002 in maximum character limit input field, then the value should be reset to 100000', () => {
1104
+ fillInTheGapsTextCommonComponent.steps.setMaximumLimit(100002);
1105
+ fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInputField(100000);
1106
+ });
1059
1107
  },
1060
1108
 
1061
1109
  verifySetLimitSectionForNoneOption: () => {
@@ -300,11 +300,11 @@ const tests = {
300
300
  },
301
301
 
302
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', () => {
303
+ it('When the \'Auto-resize response field\' functionality is disabled, the response field should have \'resizetype\' attribute set as \'vertical\' in preview tab', () => {
304
304
  fillInTheGapsTextPage.steps.verifyAutoResizeOfResponseFieldPreviewTabDisabled(0);
305
305
  });
306
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', () => {
307
+ it('When the \'Auto-resize response field\' functionality is enabled, the response field should have \'resizetype\' attribute set as \'none\' in the preview tab', () => {
308
308
  createQuestionBasePage.steps.switchToEditTab();
309
309
  fillInTheGapsTextPage.steps.checkAutoResizeCheckbox();
310
310
  createQuestionBasePage.steps.switchToPreviewTab();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.559",
3
+ "version": "1.0.560-task-IEI-6999-74ea0db.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {