itemengine-cypress-automation 1.0.85 → 1.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/Dockerfile +2 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
  3. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  4. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
  5. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
  6. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
  7. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
  8. package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
  9. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
  10. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
  11. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
  12. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  13. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
  14. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
  22. package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
  23. package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
  24. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
  25. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
  26. package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
  27. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
  28. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
  29. package/cypress/e2e/ILC/TextEntryMath/evaluationMethods2.js +217 -0
  30. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
  31. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
  32. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
  33. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
  34. package/cypress/fixtures/theme/ilc.json +3 -0
  35. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
  36. package/cypress/pages/components/colorPopupComponent.js +26 -3
  37. package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
  38. package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
  39. package/cypress/pages/components/equationEditorFlyout.js +124 -0
  40. package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
  41. package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
  42. package/cypress/pages/components/index.js +3 -1
  43. package/cypress/pages/components/opacityComponent.js +31 -4
  44. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
  45. package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
  46. package/cypress/pages/drawingResponsePage.js +33 -138
  47. package/cypress/pages/essayResponsePage.js +612 -26
  48. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
  49. package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
  50. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
- import { createQuestionBasePage, questionInstructionsComponent, uploadImageSectionComponent, scoringSectionBaseEditTab, optionsWrapperComponent, equationEditorFlyout, ckEditorToolbar, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, maximumCapacityPerDropzoneComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, figOverImageCanvasComponent, backgroundImageUploadComponent, correctIncorrectAnswerLabelComponent, draggableOptionsSectionComponent, draggableOptionContainer, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, opacityComponent, imageActionsComponent } from "./components";
3
+ import { createQuestionBasePage, questionInstructionsComponent, uploadImageSectionComponent, scoringSectionBaseEditTab, optionsWrapperComponent, equationEditorFlyout, ckEditorToolbar, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, maximumCapacityPerDropzoneComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, figOverImageCanvasComponent, backgroundImageUploadComponent, correctIncorrectAnswerLabelComponent, draggableOptionsSectionComponent, draggableOptionContainer, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, opacityComponent, imageActionsComponent, colorPopupComponent } from "./components";
4
4
  import { dialogBoxBase } from "./dialogBoxBase";
5
5
  const css = Cypress.env('css');
6
6
 
@@ -28,6 +28,7 @@ const selectors = {
28
28
  ...opacityComponent,
29
29
  ...uploadImageSectionComponent,
30
30
  ...imageActionsComponent,
31
+ ...colorPopupComponent,
31
32
  dropzonePreviewTab: () => cy.get('.drag-and-drop-canvas [class*="__DraggableWrapper"]'),
32
33
  dropzoneContainerPreviewTab: () => cy.get('[class*="Canvasstyle__DropzoneWrapper"]'),
33
34
  optionContainerOptionsPreviewTab: () => cy.get('.item-list .draggable-options-item:visible'),
@@ -49,6 +50,10 @@ const selectors = {
49
50
  dropzoneLabelSpecifyCorrectAnswerSection: () => cy.get('.dropzone-and-label-wrapper .title-casing'),
50
51
  questionBorderPreviewTab: () => cy.get('.label-image-with-dnd-canvas-wrapper [class*="DragDropContextLayoutWrapper"]'),
51
52
  maxLimitInEachDropzoneHelpText: () => cy.get('[class*="Canvasstyle__LimitWrapper"]'),
53
+ penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
54
+ specifyPointsForEachIncorrectDropzoneRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
55
+ textAreaImageCanvas: () => cy.get('.drag-and-drop-canvas textarea'),
56
+ textAreaPreviewTab: () => cy.get('.drag-and-drop-layout-wrapper textarea'),
52
57
  penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]')
53
58
  }
54
59
 
@@ -79,7 +84,7 @@ const steps = {
79
84
  ...additionalSettingsPanel.steps,
80
85
  ...opacityComponent.steps,
81
86
  ...imageActionsComponent.steps,
82
-
87
+ ...colorPopupComponent.steps,
83
88
  /**
84
89
  * @description Verifies the text content of a specific preview tab dropzone element.
85
90
  * @param {number} count - The index of the preview tab dropzone element to verify (zero-based).
@@ -385,6 +390,11 @@ const steps = {
385
390
  .blur();
386
391
  },
387
392
 
393
+ selectPenaltyPointsForEachIncorrectDropzone: () => {
394
+ fillInTheGapsOverImageDragAndDropPage.specifyPointsForEachIncorrectDropzoneRadioButton()
395
+ .click();
396
+ },
397
+
388
398
  verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection: () => {
389
399
  fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection()
390
400
  .should('not.have.class', 'dragging-over');
@@ -491,12 +501,33 @@ const steps = {
491
501
  },
492
502
 
493
503
  /**
494
- * Sets options in dropzone in the Preview Tab based on the provided optionsObject.
495
- * @param {Object[]} responses - An array of objects containing the responseIndex, responseText and dropzone index
496
- * @param {number} responses[].groupIndex - The index of the group
497
- * @param {string} responses[].responseText - The text of the option
498
- * @param {string} responses[].dropzoneIndex - The index of the dropzone
504
+ * @param {string} text text to be entered in the text area
505
+ * @description this function adds input to the text area
499
506
  */
507
+ enterTextInTextArea: (text) => {
508
+ fillInTheGapsOverImageDragAndDropPage.textAreaImageCanvas()
509
+ .type(text)
510
+ .blur();
511
+ fillInTheGapsOverImageDragAndDropPage.textAreaImageCanvas()
512
+ .should('have.text', text);
513
+ },
514
+
515
+ /**
516
+ * @param {string} text text to be verified in the preview tab text area
517
+ * @description this function verifies input in the text area
518
+ */
519
+ verifyTextInTextAreaPreviewTab: (text) => {
520
+ fillInTheGapsOverImageDragAndDropPage.textAreaPreviewTab()
521
+ .should('have.text', text);
522
+ },
523
+
524
+ /**
525
+ * Sets options in dropzone in the Preview Tab based on the provided optionsObject.
526
+ * @param {Object[]} responses - An array of objects containing the responseIndex, responseText and dropzone index
527
+ * @param {number} responses[].groupIndex - The index of the group
528
+ * @param {string} responses[].responseText - The text of the option
529
+ * @param {string} responses[].dropzoneIndex - The index of the dropzone
530
+ */
500
531
  clickAndDropOptionFromNthGroupInDropzonePreviewTab: (responses) => {
501
532
  responses.forEach(({ responseText, groupIndex, dropzoneIndex }) => {
502
533
  draggableOptionContainer.groupedOptionsContainerPreviewTab()
@@ -511,6 +542,14 @@ const steps = {
511
542
  .eq(dropzoneIndex)
512
543
  .click({ force: true });
513
544
  });
545
+ },
546
+
547
+ /**
548
+ * @param {number} count count of dropzones in specify correct answer section
549
+ * @description verifies count of dropzones in specify correct answer section
550
+ */
551
+ verifyDropzoneCountInSpecifyCorrectAnswerSection: (count) => {
552
+ utilities.verifyElementCount(fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection(), count);
514
553
  }
515
554
  }
516
555
 
@@ -531,6 +570,8 @@ const tests = {
531
570
  ...createQuestionBasePage.tests,
532
571
  ...commonComponents.tests,
533
572
  ...additionalSettingsPanel.tests,
573
+ ...colorPopupComponent.tests,
574
+ ...opacityComponent.tests,
534
575
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
535
576
  it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
536
577
  utilities.verifyElementCount(fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(), 3);
@@ -1,5 +1,6 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, backgroundImageUploadComponent, optionsWrapperComponent, figOverImageCanvasComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent } from "./components";
2
+ import { questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, commonComponents, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, backgroundImageUploadComponent, optionsWrapperComponent, figOverImageCanvasComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, acceptedStudentInputComponent, customizeSpecialCharacterComponent } from "./components";
3
+ import { dialogBoxBase } from "./dialogBoxBase";
3
4
  const css = Cypress.env('css');
4
5
 
5
6
  const selectors = {
@@ -7,30 +8,58 @@ const selectors = {
7
8
  ...figOverImageCanvasComponent,
8
9
  ...commonComponents,
9
10
  ...correctIncorrectAnswerLabelComponent,
11
+ ...customizeSpecialCharacterComponent,
10
12
  ...autoScoredScoringSectionMultiResponseType,
11
13
  ...autoScoredSpecifyCorrectAnswerSection,
14
+ ...autoScoredStudentViewSettings,
15
+ ...autoScoredScoringPreviewTab,
12
16
 
13
17
  //TODO: Update below selectors after https://redmine.zeuslearning.com/issues/557945 is resolved
14
18
  //response accordion
15
19
  responseAccordion: () => cy.get('.response-text-accordion'),
16
20
  responseAccordionLabel: () => cy.get('[class*="ResponseComponentstyles__Label"]'),
17
- responseAccordionAnswerInputField: () => cy.get('.label-image-text-answer-label input'),
21
+ responseAccordionAnswersLabel: () => cy.get('.correct-response-answer-wrapper-cls .points-label'),
22
+ responseAccordionAnswerInputFieldWrapper: () => cy.get('.label-image-text-answer-label'),
23
+ responseAccordionAnswerNumeration: () => cy.get('.additional-option-placeholder-input .start-adornment'),
24
+ responseAccordionAnswerDeleteButton: () => cy.get('.delete-button'),
18
25
  responseAccordionPointsWrapper: () => cy.get('[class*="ResponseComponentstyles__PointsDiv"]'),
19
26
  responseAccordionPointsLabel: () => cy.get('[class*="ResponseComponentstyles__PointsLabel"]'),
20
27
  responseAccordionPointsScore: () => cy.get('[class*="ResponseComponentstyles__Points-"]'),
21
28
  responseAccordionPointsInputFieldWrapper: () => cy.get('[class*="ResponseComponentstyles__PointsWrapper"]'),
22
29
  responseAccordionAddAlternateButton: () => cy.get('.add-alternate-btn'),
23
-
30
+ responseAccordionAddAlternateButtonLabel: () => cy.get('.add-alternate-btn p'),
31
+ responseAreaNumeration: () => cy.get('.response-input-adornment'),
32
+
24
33
  answerInputFieldSpecifyCorrectAnswerSection: () => cy.get('.label-image-text-inline-text-field input'),
25
34
  answerInputFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field input'),
26
35
  correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
27
- correctAnswersLabel: () => cy.get('.label-image-with-text-correct-answer-label'),
28
- responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper'),
36
+ correctAnswersLabel: () => cy.get('.correct-answers-label'),
37
+ responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
29
38
  tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
30
- responseAreaNumeration: () => cy.get('.response-input-adornment'),
31
39
  correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
32
40
  correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]'),
33
- correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]')
41
+ correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]'),
42
+ specialCharactersButtonPreviewTab: () => cy.get('.cloze-with-text-special-character-button'),
43
+
44
+ //Special characters section
45
+ specialCharactersLabel: () => cy.get('[class*="LabelImageWithTextstyles__CustomizedSpecialCharacterWrapper"]'),
46
+ enableSpecialCharactersCheckbox: () => cy.get('[data-ngie-testid="enable-special-characters-checkbox"] input'),
47
+ enableSpecialCharactersLabel: () => cy.get('[data-ngie-testid="enable-special-characters-checkbox"] [class*="MuiFormControlLabel-label"]'),
48
+
49
+ //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
50
+ //preview tab special characters
51
+ specialCharactersPopupTitlePreviewTab: () => cy.get('[class*="Popupstyles__TitleWrapper"]'),
52
+ specialCharactersPopupCategoryAccordionLabelPreviewTab: () => cy.get('[class*="ResponseInputComponentstyles__AccordionLabel"]'),
53
+ specialCharactersPopupCategoryAccordionWrapperPreviewTab: () => cy.get('.special-character-accordion'),
54
+ specialCharactersPopupSymbolPreviewTab: () => cy.get('.ngie-accordion button'),
55
+ specialCharactersPopupCategoryAccordionChevronButtonPreviewTab: () => cy.get('[class*="MuiAccordionSummary-expandIconWrapper"]'),
56
+ specialCharactersPopupCategoryAccordionCloseButtonPreviewTab: () => cy.get('[data-at="close-button"]'),
57
+ specialCharactersCustomSymbolsPreviewTab: () => cy.get('[class*="ResponseInputComponentstyles__PopupContentWrapper"] button'),
58
+
59
+ spellCheckLabel: () => cy.get('[data-ngie-testid="spell-check-checkbox"] .MuiFormControlLabel-label'),
60
+ spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input[type="checkbox"]'),
61
+ //TODO: Need to remove it from here when https://redmine.zeuslearning.com/issues/558979 is resolved
62
+ checkAnswerButton: () => cy.get('.check-answer-and-status-wrapper button').last(),
34
63
  }
35
64
 
36
65
  const steps = {
@@ -47,6 +76,9 @@ const steps = {
47
76
  ...correctIncorrectAnswerLabelComponent.steps,
48
77
  ...autoScoredStudentViewSettings.steps,
49
78
  ...acceptedStudentInputComponent.steps,
79
+ ...customizeSpecialCharacterComponent.steps,
80
+ ...autoScoredStudentViewSettings.steps,
81
+
50
82
  /**
51
83
  * Enter text in the answer input fields of the specify correct answer section.
52
84
  * @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
@@ -75,6 +107,7 @@ const steps = {
75
107
  enterTextInAnswerInputFieldsPreviewTab: (responses) => {
76
108
  responses.forEach(({ responseIndex, responseText }) => {
77
109
  utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseIndex)
110
+ .clear()
78
111
  .type(responseText)
79
112
  .blur();
80
113
  });
@@ -216,11 +249,66 @@ const steps = {
216
249
  * @param {number} answerFieldIndex answer input field index
217
250
  */
218
251
  focusInAndFocusOutOfResponseAnswerInputFieldSpecifyCorrectAnswer: (answerFieldIndex) => {
219
- utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionAnswerInputField(), answerFieldIndex)
252
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection(), answerFieldIndex)
220
253
  .click()
221
254
  .blur();
222
255
  },
223
256
 
257
+ /**
258
+ * Focus in response input field in preview tab
259
+ * @param {number} responseInputFieldIndex response input field index
260
+ */
261
+ focusInResponseInputFieldPreviewTab: (responseInputFieldIndex) => {
262
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), responseInputFieldIndex)
263
+ .click();
264
+ },
265
+
266
+ verifyEnableSpecialCharactersCheckboxUnchecked: () => {
267
+ fillInTheGapsOverImageTextPage.enableSpecialCharactersCheckbox()
268
+ .should('not.be.checked');
269
+ },
270
+
271
+ checkEnableSpecialCharactersCheckbox: () => {
272
+ fillInTheGapsOverImageTextPage.enableSpecialCharactersCheckbox()
273
+ .click()
274
+ .should('be.checked');
275
+ },
276
+
277
+ uncheckEnableSpecialCharactersCheckbox: () => {
278
+ fillInTheGapsOverImageTextPage.enableSpecialCharactersCheckbox()
279
+ .click()
280
+ .should('not.be.checked');
281
+ },
282
+
283
+ openSpecialCharactersPopupPreviewTab: () => {
284
+ fillInTheGapsOverImageTextPage.specialCharactersButtonPreviewTab()
285
+ .click();
286
+ },
287
+
288
+ /**
289
+ * @description Verify symbols displayed in for a category in special characters popup
290
+ * @param {number} categoryIndex Index of the category
291
+ * @param {string[]} categorySymbolsArray Array of the symbols of the category
292
+ */
293
+ verifySpecialCharactersPopupCategorySymbolsInPreviewTab: (categoryIndex, categorySymbolsArray) => {
294
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.specialCharactersPopupCategoryAccordionLabelPreviewTab(), categoryIndex)
295
+ .click();
296
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.specialCharactersPopupCategoryAccordionWrapperPreviewTab(), categoryIndex)
297
+ .within(() => {
298
+ categorySymbolsArray[index].forEach((symbolARIALabel, index) => {
299
+ fillInTheGapsOverImageTextPage.specialCharactersPopupSymbolPreviewTab()
300
+ .eq(index)
301
+ .find('svg')
302
+ .should('have.attr', 'aria-label', `${symbolARIALabel}`);
303
+ });
304
+ });
305
+ },
306
+
307
+ closeSpecialCharactersPopupPreviewTab: () => {
308
+ fillInTheGapsOverImageTextPage.specialCharactersPopupCategoryAccordionCloseButtonPreviewTab()
309
+ .click();
310
+ },
311
+
224
312
  /**
225
313
  * Verify the points score displayed on response accordions
226
314
  * @param {number} responseAccordionIndex index of response accordion
@@ -243,10 +331,38 @@ const steps = {
243
331
  },
244
332
 
245
333
  /**
246
- * Verify the points input field and label displayed in response accordions
247
- * @param {number} responseAccordionIndex index of response accordion
248
- * @param {number} pointsInputFieldValue Points input field value
249
- */
334
+ * Verify custom special characters displayed in special characters popup in preview tab
335
+ * @param {string[]} customSpecialCharacters Array of custom special characters
336
+ */
337
+ verifyCustomSpecialCharactersInSpecialCharactersPopupPreviewTab: (customSpecialCharacters) => {
338
+ dialogBoxBase.dialogBox()
339
+ .within(() => {
340
+ customSpecialCharacters.forEach((customSpecialCharacter, index) => {
341
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.specialCharactersCustomSymbolsPreviewTab().eq(index), `${customSpecialCharacter}`);
342
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.specialCharactersCustomSymbolsPreviewTab().eq(index), 'visible');
343
+ });
344
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.specialCharactersCustomSymbolsPreviewTab(), `${customSpecialCharacters.length}`);
345
+ });
346
+ },
347
+
348
+ /**
349
+ * click on custom special character symbol in special characters popup in preview tab
350
+ * @param {string} customSpecialCharacterSymbol custom special character symbol
351
+ */
352
+ clickOnCustomSpecialCharacterSymbolInSpecialCharactersPopupPreviewTab: (customSpecialCharacterSymbol) => {
353
+ dialogBoxBase.dialogBox()
354
+ .within(() => {
355
+ fillInTheGapsOverImageTextPage.specialCharactersCustomSymbolsPreviewTab()
356
+ .contains(customSpecialCharacterSymbol)
357
+ .click();
358
+ });
359
+ },
360
+
361
+ /**
362
+ * Verify the points input field and label displayed in response accordions
363
+ * @param {number} responseAccordionIndex index of response accordion
364
+ * @param {number} pointsInputFieldValue Points input field value
365
+ */
250
366
  verifyPointsLabelAndInputFieldInResponseAccordion: (responseAccordionIndex, pointsInputFieldValue) => {
251
367
  utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionPointsInputFieldWrapper(), responseAccordionIndex)
252
368
  .within(() => {
@@ -267,7 +383,144 @@ const steps = {
267
383
  .within(() => {
268
384
  scoringSectionBaseEditTab.steps.allotPoints(pointsInputFieldValue);
269
385
  });
270
- }
386
+ },
387
+
388
+ /**
389
+ *@description Verify text in the answer input fields of the specify correct answer section.
390
+ * @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
391
+ * @param {number} responses[].responseIndex - The index of the answer input field for each response.
392
+ * @param {string} responses[].responseText - The text to be verified for the respective answer input field.
393
+ */
394
+ verifyTextInResponseAccordionAnswerInputField: (responses) => {
395
+ responses.forEach(({ responseIndex, responseText }) => {
396
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection(), responseIndex)
397
+ .should('have.value', responseText);
398
+ });
399
+ },
400
+
401
+ /**
402
+ *@description Verify numeration text for the answer input fields of the specify correct answer section.
403
+ * @param responseAccordionIndex denotes response accordion index
404
+ */
405
+ verifyResponseAccordionAnswerInputFieldNumeration: (responseAccordionIndex) => {
406
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordion(), responseAccordionIndex)
407
+ .within(() => {
408
+ fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper()
409
+ .each(($el, index) => {
410
+ cy.wrap($el)
411
+ .within(() => {
412
+ fillInTheGapsOverImageTextPage.responseAccordionAnswerNumeration()
413
+ .should('have.text', `${index + 1}`);
414
+ });
415
+ });
416
+ });
417
+ },
418
+
419
+ /**
420
+ *@description Verify delete button for the answer input fields of the specify correct answer section.
421
+ * @param responseAccordionIndex denotes response accordion index
422
+ */
423
+ verifyResponseAccordionAnswerInputFieldDeleteButton: (responseAccordionIndex) => {
424
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordion(), responseAccordionIndex)
425
+ .within(() => {
426
+ fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper()
427
+ .each(($el) => {
428
+ cy.wrap($el)
429
+ .within(() => {
430
+ fillInTheGapsOverImageTextPage.responseAccordionAnswerDeleteButton()
431
+ .should('be.visible');
432
+ });
433
+ });
434
+ });
435
+ },
436
+
437
+ /**
438
+ *@description Clicks delete button for the answer input fields of the specify correct answer section.
439
+ * @param responseAccordionIndex denotes response accordion index
440
+ */
441
+ deleteResponseAccordionAnswerInputField: (responseAccordionIndex, responseAccordionAnswerInputFieldIndex) => {
442
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordion(), responseAccordionIndex)
443
+ .within(() => {
444
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper(), responseAccordionAnswerInputFieldIndex)
445
+ .within(() => {
446
+ fillInTheGapsOverImageTextPage.responseAccordionAnswerDeleteButton()
447
+ .click();
448
+ });
449
+ });
450
+ },
451
+
452
+ verifySpellCheckCheckboxUnchecked: () => {
453
+ fillInTheGapsOverImageTextPage.spellCheckCheckbox()
454
+ .should('not.be.checked');
455
+ },
456
+
457
+ verifySpellCheckCheckboxChecked: () => {
458
+ fillInTheGapsOverImageTextPage.spellCheckCheckbox()
459
+ .should('be.checked');
460
+ },
461
+
462
+ /**
463
+ * Verify that the spell check for a response field in the Preview Tab is disabled.
464
+ * @param {number} responseFieldIndex - The index of the response field to verify.
465
+ */
466
+ verifySpellCheckOfResponseFieldPreviewTabDisabled: (responseFieldIndex) => {
467
+ fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab()
468
+ .eq(responseFieldIndex)
469
+ .should('have.attr', 'spellcheck', 'false');
470
+ },
471
+
472
+ /**
473
+ * Verify that the spell check for a response field in the Preview Tab is enabled.
474
+ * @param {number} responseFieldIndex - The index of the response field to verify.
475
+ */
476
+ verifySpellCheckOfResponseFieldPreviewTabEnabled: (responseFieldIndex) => {
477
+ fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab()
478
+ .eq(responseFieldIndex)
479
+ .should('have.attr', 'spellcheck', 'true');
480
+ },
481
+
482
+ checkSpellCheckCheckbox: () => {
483
+ fillInTheGapsOverImageTextPage.spellCheckCheckbox()
484
+ .click()
485
+ steps.verifySpellCheckCheckboxChecked();
486
+ },
487
+
488
+ uncheckSpellCheckCheckbox: () => {
489
+ fillInTheGapsOverImageTextPage.spellCheckCheckbox()
490
+ .click();
491
+ steps.verifySpellCheckCheckboxUnchecked();
492
+ },
493
+
494
+ //TODO: Need to remove it from here when https://redmine.zeuslearning.com/issues/558979 is resolved
495
+ checkAnswer: () => {
496
+ fillInTheGapsOverImageTextPage.checkAnswerButton()
497
+ .click();
498
+ },
499
+
500
+ /**
501
+ * Verify answer input field placeholder text
502
+ * @param {number} answerFieldIndex index of answer input field
503
+ */
504
+ verifyAnswerInputFieldPlaceholder: (answerFieldIndex) => {
505
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper(), answerFieldIndex)
506
+ .within(() => {
507
+ fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection()
508
+ .should('have.attr', 'placeholder', 'Enter answer');
509
+ });
510
+ },
511
+
512
+ /**
513
+ * Clear answer input field
514
+ * @param {number} answerFieldIndex index of answer input field
515
+ */
516
+ clearAnswerInputField: (answerFieldIndex) => {
517
+ utilities.getNthElement(fillInTheGapsOverImageTextPage.responseAccordionAnswerInputFieldWrapper(), answerFieldIndex)
518
+ .within(() => {
519
+ fillInTheGapsOverImageTextPage.answerInputFieldSpecifyCorrectAnswerSection()
520
+ .clear()
521
+ .blur();
522
+ });
523
+ },
271
524
  }
272
525
 
273
526
  const tests = {
@@ -275,6 +528,7 @@ const tests = {
275
528
  ...autoScoredSpecifyCorrectAnswerSection.tests,
276
529
  ...scoringSectionBaseEditTab.tests,
277
530
  ...autoScoredScoringSectionMultiResponseType.tests,
531
+ ...autoScoredStudentViewSettings.tests,
278
532
 
279
533
  /**
280
534
  * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {