itemengine-cypress-automation 1.0.12 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettings.js +2 -487
  2. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettingsBasic.js +336 -0
  3. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseConditionalCheckboxes.js +154 -0
  4. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseContainsConditionalRadioButton.js +166 -0
  5. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseCustomSpecialCharacters.js +167 -0
  6. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseExactConditionalRadioButton.js +157 -0
  7. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +2 -1
  8. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseSetCorrectAnswerSection.js +137 -0
  9. package/cypress/pages/audioPlayerPage.js +2 -2
  10. package/cypress/pages/audioResponsePage.js +3 -3
  11. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  12. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  13. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -1
  14. package/cypress/pages/components/browseItemsPage.js +53 -0
  15. package/cypress/pages/components/createQuestionBasePage.js +32 -2
  16. package/cypress/pages/components/customizeHighlightPropertiesComponent.js +1 -1
  17. package/cypress/pages/components/dragAndDropResponseOptions.js +3 -2
  18. package/cypress/pages/components/draggableOptionsContainer.js +1 -0
  19. package/cypress/pages/components/figOverImageCommonComponent.js +198 -10
  20. package/cypress/pages/components/fillInTheGapsCommonComponents.js +4 -4
  21. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +54 -1
  22. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +3 -3
  23. package/cypress/pages/components/gridCommonComponents.js +3 -2
  24. package/cypress/pages/components/index.js +2 -1
  25. package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
  26. package/cypress/pages/components/questionInstructionsComponent.js +7 -3
  27. package/cypress/pages/components/uploadImageSectionComponent.js +2 -0
  28. package/cypress/pages/createItemPage.js +35 -2
  29. package/cypress/pages/dialogBoxBase.js +2 -2
  30. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +4 -4
  31. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +2 -0
  32. package/cypress/pages/dragAndDropIntoCategoriesPage.js +7 -10
  33. package/cypress/pages/essayResponseBasicPage.js +2 -2
  34. package/cypress/pages/essayResponseMathPage.js +3 -2
  35. package/cypress/pages/essayResponsePage.js +1 -1
  36. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +74 -7
  37. package/cypress/pages/fillInTheGapsTextPage.js +1 -1
  38. package/cypress/pages/highlightImagePage.js +12 -10
  39. package/cypress/pages/highlightPage.js +29 -5
  40. package/cypress/pages/listMatchingPage.js +205 -17
  41. package/cypress/pages/listMatchingScoring.js +0 -1
  42. package/cypress/pages/passagePage.js +3 -3
  43. package/cypress/pages/readingRulerPage.js +1 -1
  44. package/cypress/pages/shortTextResponsePage.js +1 -1
  45. package/cypress/pages/videoResponsePage.js +7 -7
  46. package/package.json +1 -1
  47. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +0 -587
  48. package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +0 -18
  49. package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +0 -18
  50. package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +0 -18
@@ -533,7 +533,8 @@ const steps = {
533
533
  .eq(columnIndex)
534
534
  .clear()
535
535
  .type(points, { delay: 0 })
536
- .should('have.value', points);
536
+ .should('have.value', points)
537
+ .blur();
537
538
  });
538
539
  },
539
540
 
@@ -895,7 +896,7 @@ const tests = {
895
896
  .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.regular);
896
897
  });
897
898
  gridCommonComponents.addOptionButton()
898
- .verifyCSS(css.color.secondaryBtnActive, css.fontSize.normal, css.fontWeight.medium);
899
+ .verifyCSS(css.color.secondaryBtnActive, css.fontSize.default, css.fontWeight.medium);
899
900
  });
900
901
  },
901
902
 
@@ -35,4 +35,5 @@ export * from './fillInTheGapsDropdownCommonComponent';
35
35
  export * from './figOverImageCommonComponent';
36
36
  export * from './uploadImageSectionComponent';
37
37
  export * from './colorPopupComponent';
38
- export * from './customizeHighlightPropertiesComponent';
38
+ export * from './customizeHighlightPropertiesComponent';
39
+ export * from './browseItemsPage';
@@ -246,7 +246,7 @@ const tests = {
246
246
  utilities.verifyCSS(optionsWrapperComponent.addOptionButton(), {
247
247
  'color': css.color.secondaryBtnActive,
248
248
  'font-size': css.fontSize.default,
249
- 'font-weight': css.fontWeight.regular
249
+ 'font-weight': css.fontWeight.medium
250
250
  });
251
251
  });
252
252
 
@@ -5,7 +5,7 @@ const css = Cypress.env('css');
5
5
  const selectors = {
6
6
  questionInstructionsLabelEditTab: () => cy.get('.edit-question-instruction-label'),
7
7
  questionInstructionsInputField: () => cy.get('[title="Question Instructions"]'),
8
- questionInstructionsText: () => cy.get('.edit-question-preview-wrapper .question-instruction.question-text-wrapper'),
8
+ questionInstructionsText: () => cy.get('.edit-question-preview-wrapper .question-instruction'),
9
9
  }
10
10
 
11
11
  const steps = {
@@ -31,6 +31,11 @@ const steps = {
31
31
  commonComponents.errorMessage()
32
32
  .verifyInnerText('Error: Question instructions are required.');
33
33
  });
34
+ },
35
+
36
+ verifyQuestionInstructionsText: () => {
37
+ questionInstructionsComponent.questionInstructionsText()
38
+ .should('have.text', 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
34
39
  }
35
40
  }
36
41
 
@@ -99,8 +104,7 @@ const tests = {
99
104
  questionInstructionsComponent.steps.addQuestionInstructions()
100
105
  cy.log('Switching to Preview Tab')
101
106
  createQuestionBasePage.steps.switchToPreviewTab();
102
- questionInstructionsComponent.questionInstructionsText()
103
- .should('have.text', 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
107
+ steps.verifyQuestionInstructionsText();
104
108
  });
105
109
  }
106
110
  };
@@ -222,6 +222,8 @@ const steps = {
222
222
  uploadImageSectionComponent.imagePopupImagePreview()
223
223
  .find('img')
224
224
  .should('have.attr', 'src', sourceUrl);
225
+ uploadImageSectionComponent.imagePopupImagePreview()
226
+ .click();
225
227
  },
226
228
 
227
229
  clickOnEditImageButton: () => {
@@ -7,7 +7,12 @@ const selectors = {
7
7
  previewTab: () => cy.get('[data-ngie-testid="preview-tab"]'),
8
8
  editTab: () => cy.get('[data-ngie-testid="edit-tab"]'),
9
9
  settingsButton: () => cy.get('.settingsBtn '),
10
- viewAllQuestionsButton: () => cy.get('.view-question-resource-button-wrapper')
10
+ viewAllQuestionsButton: () => cy.get('.view-question-resource-button-wrapper'),
11
+ createItemContainer: () => cy.get('.edit-wrapper'),
12
+ referenceId: () => cy.get('.edit-item-reference-id'),
13
+ itemTitle: () => cy.get('.ItemLevel-Header'),
14
+ tagsButton: () => cy.get('.ngie-button').contains('Tags'),
15
+ tagsInputField: () => cy.get('.tags-chip-container')
11
16
  }
12
17
 
13
18
  const steps = {
@@ -15,10 +20,38 @@ const steps = {
15
20
  createItemPage.addQuestionButton()
16
21
  .click();
17
22
  },
18
-
23
+
19
24
  clickOnAddResource: () => {
20
25
  createItemPage.addResourceAndToolsButton()
21
26
  .click();
27
+ },
28
+
29
+ navigateToCreateItemPage: () => {
30
+ cy.visit('/item-engine/demo/create-item');
31
+ },
32
+
33
+ verifyCreateItemContainerIsVisible: () => {
34
+ createItemPage.createItemContainer()
35
+ .should('be.visible');
36
+ },
37
+
38
+ verifyAddQuestionButtonIsVisible: () => {
39
+ createItemPage.addQuestionButton()
40
+ .should('be.visible');
41
+ },
42
+
43
+ clickOnTagsButton: () => {
44
+ createItemPage.tagsButton()
45
+ .click();
46
+ },
47
+
48
+ /**
49
+ * @param {string[]} arrayOfTags of text displayed in tags input field
50
+ * @description Verify the text in tags input field
51
+ */
52
+ verifyTagsInInputField: (arrayOfTags) => {
53
+ createItemPage.tagsInputField()
54
+ .should('have.text', arrayOfTags.sort().join(''));
22
55
  }
23
56
  }
24
57
 
@@ -3,8 +3,8 @@ import { createQuestionBasePage } from "./components";
3
3
  const css = Cypress.env('css');
4
4
 
5
5
  const selectors = {
6
- dialogBox: () => cy.get('[aria-describedby="alert-dialog-description"]'),
7
- dialogBoxTitle: () => cy.get('#alert-dialog-title'),
6
+ dialogBox: () => cy.get('[role="dialog"]'),
7
+ dialogBoxTitle: () => cy.get('.dialog-title'),
8
8
  dialogBoxContent: () => cy.get('div[id="alert-dialog-description"]'),
9
9
  buttonReject: () => cy.get('.action-btn-wrapper button').eq(0),
10
10
  buttonAccept: () => cy.get('.action-btn-wrapper button').eq(1),
@@ -106,8 +106,8 @@ const tests = {
106
106
  dragAndDropIntoCategoriesPage.steps.verifyNumerationOfCategoryCellsInQuestionPreview(cellNumerationArray);
107
107
  dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
108
108
  dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
109
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(2);
110
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
109
+ dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
110
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(3);
111
111
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectAttemptBorder();
112
112
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectCellBorderNotExists();
113
113
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
@@ -119,8 +119,8 @@ const tests = {
119
119
  autoScoredPreviewBase.steps.checkAnswer();
120
120
  dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
121
121
  dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
122
- dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(2);
123
- dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(3);
122
+ dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
123
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(3);
124
124
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectAttemptBorder();
125
125
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectCellBorderNotExists();
126
126
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
@@ -1,6 +1,8 @@
1
1
  import { autoScoredPreviewBase, previewScoringAndShowCorrectAnswerComponent } from "./components";
2
2
  import { dragAndDropIntoCategoriesPage } from "./dragAndDropIntoCategoriesPage";
3
3
  const cellNumerationArray = ['1', '2', '3', '4'];
4
+ const correctTabAnswerArray = [['Bat'], ['Eagle', 'Parrot'], ['Platypus', 'Whale'], ['Ostrich']];
5
+
4
6
  const tests = {
5
7
  verifyScoringForEachCell: (scoringSubtype) => {
6
8
  it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, 0 points should be provided, red cross-mark should be displayed besides incorrect answer responses, incorrect cell border and red cross-mark should be displayed for incorrect cells and the correct answer section should display the incorrect/not attempted options from the correct tab along with category cell numeration', () => {
@@ -57,7 +57,7 @@ const selectors = {
57
57
  setCorrectAnswerSectionCategoryGrid: () => cy.get('[class*="DragAndDropMatrixstyles__TableWrapper"]'),
58
58
  previewTabCategoryGrid: () => cy.get('.edit-question-preview-wrapper [class*="DragAndDropMatrixstyles__TableWrapper"]'),
59
59
  //Additional settings
60
- rowHeadingLabel: () => cy.get('[class*="Classificationstyle__RowResponseWrapper"] .inline-text-property-label').eq(0),
60
+ rowHeadingLabel: () => cy.get('[class*="RowResponseWrapper"] .text-label '),
61
61
  rowHeadingInputField: () => cy.get('input[aria-label="Row heading"]'),
62
62
  rowHeadingSetCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__RowTitleCell"]'),
63
63
  rowHeadingPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="DragAndDropMatrixstyles__RowTitleCell"]'),
@@ -786,7 +786,7 @@ const steps = {
786
786
  .contains(optionName)
787
787
  .click();
788
788
  draggableOptionsContainer.setCorrectAnswerDraggableOptionsWrapper('drag and drop into categories')
789
- .find('[class*="DragAndDropMatrixstyles__DroppableWrapper"]')
789
+ .find('[class*="DroppableWrapper"]')
790
790
  .click({ force: true });
791
791
  },
792
792
 
@@ -802,7 +802,7 @@ const steps = {
802
802
  .click();
803
803
  });
804
804
  draggableOptionsContainer.previewTabDraggableOptionsWrapper('drag and drop into categories')
805
- .find('[class*="DragAndDropMatrixstyles__DroppableWrapper"]')
805
+ .find('[class*="DroppableWrapper"]')
806
806
  .click({ force: true });
807
807
  },
808
808
 
@@ -1066,7 +1066,7 @@ const steps = {
1066
1066
  */
1067
1067
  enterTextInRowTitleWidthInputField: (text) => {
1068
1068
  dragAndDropIntoCategoriesPage.rowTitleWidthInputField()
1069
- .type(text, { delay: 0 })
1069
+ .type(text)
1070
1070
  .blur();
1071
1071
  },
1072
1072
 
@@ -1092,7 +1092,7 @@ const steps = {
1092
1092
  */
1093
1093
  enterTextInRowMinHeightInputField: (text) => {
1094
1094
  dragAndDropIntoCategoriesPage.rowMinHeightInputField()
1095
- .type(text, { delay: 0 })
1095
+ .type(text)
1096
1096
  .blur();
1097
1097
  },
1098
1098
 
@@ -1206,7 +1206,8 @@ const steps = {
1206
1206
 
1207
1207
  clearMaxResponsePerCellInputField: () => {
1208
1208
  dragAndDropIntoCategoriesPage.maxResponsePerCellInputField()
1209
- .clear();
1209
+ .clear()
1210
+ .blur();
1210
1211
  },
1211
1212
 
1212
1213
  /**
@@ -1537,10 +1538,6 @@ const tests = {
1537
1538
  });
1538
1539
  },
1539
1540
 
1540
- /**
1541
- * @param {string[]} numerationArray array of the numeration displayed with options numbers| lowercase| uppercase
1542
- * @description this function checks the numeration displayed for the options and correct answer container options when check answer is selected
1543
- */
1544
1541
  verifyCategoryCellsNumerationNotDisplayedWhenCheckAnswerIsSelected: () => {
1545
1542
  it('When user clicks on \'Check answer\' button then the numeration should not be displayed in the category cells', () => {
1546
1543
  autoScoredPreviewBase.steps.checkAnswer()
@@ -13,8 +13,8 @@ const selectors = {
13
13
  copyCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="copy-toggle-button"]`),
14
14
  pasteCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="paste-toggle-button"]`),
15
15
  specialCharacterCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="special-characters-toggle-button"]`),
16
- customizeFormattingOptionsLabel: () => cy.get('.customized_button_label'),
17
- customizeFormattingOptionsIcon: () => cy.get('.audio_icon_wrapper'),
16
+ customizeFormattingOptionsLabel: () => cy.get('.ngie-toggle-button-label'),
17
+ customizeFormattingOptionsIcon: () => cy.get('.ngie-toggle-button-icon svg'),
18
18
  customizeFormattingOptionsWrapper: () => cy.get('.customize-essay-formatting-options'),
19
19
  };
20
20
 
@@ -12,8 +12,9 @@ const selectors = {
12
12
  textToNotBeRenderedAsLaTextInputFieldWrapper: (inputfieldNumber) => cy.get('.text-not-to-be-rendered-input').eq(inputfieldNumber),
13
13
  textToNotBeRenderedAsLaTextInputField: () => cy.get('[aria-label="Text to not be rendered as LaTex"]'),
14
14
  textToNotBeRenderedAsLaTextInputFieldCount: () => cy.get('.start-adornment'),
15
- addTextButton: () => cy.get('.text-not-latex-wrapper .add-option'),
16
- inputFieldLatexCharacter: () => cy.get('var[mathquill-command-id]')
15
+ addTextButton: () => cy.get('.text-not-latex-wrapper .ngie-icon-with-label-btn'),
16
+ inputFieldLatexCharacter: () => cy.get('var[mathquill-command-id]'),
17
+ deleteButton: () => cy.get('.icon-button-wrapper button')
17
18
  }
18
19
 
19
20
  const steps = {
@@ -351,7 +351,7 @@ const tests = {
351
351
  cy.log('Adding a space and inserting more symbols in the response field.');
352
352
  essayResponsePage.responseField()
353
353
  .click()
354
- .type(' ');
354
+ .type(' ');
355
355
  essayResponsePage.previewTabToolbarOption(`${specialOrMathCharacters[popupType].popupTitle}`)
356
356
  .click();
357
357
  essayResponsePage.specialAndMathCharacterPopupSymbols()
@@ -1,12 +1,15 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { createQuestionBasePage, figOverImageCommonComponent, fillInTheGapsDropdownCommonComponent, commonComponents, uploadImageSectionComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredSetCorrectAnswerSection, scoringSectionBase, autoScoredScoringSectionMultipleResponsesType, autoScoredScoringSection, previewScoringAndShowCorrectAnswerComponent, additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, questionInstructionsComponent } from "./components"
2
+ import { createQuestionBasePage, figOverImageCommonComponent, fillInTheGapsDropdownCommonComponent, commonComponents, uploadImageSectionComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredSetCorrectAnswerSection, scoringSectionBase, autoScoredScoringSectionMultipleResponsesType, autoScoredScoringSection, previewScoringAndShowCorrectAnswerComponent, additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, questionInstructionsComponent, answerNumerationComponent } from "./components"
3
3
 
4
4
  const selectors = {
5
5
  ...figOverImageCommonComponent,
6
6
  ...fillInTheGapsDropdownCommonComponent,
7
7
  ...questionInstructionsComponent,
8
+ ...answerNumerationComponent,
9
+ ...additionalSettingsPanel,
8
10
  responseDropdownPreviewTab: () => cy.get('[class*="ImageWithDropdownPreviewstyles__DraggableInput"] [class*="icon-chevron"]'),
9
- responseDropdownWrapperPreviewTab: () => cy.get('[class*="ImageWithDropdownPreviewstyles__IconDiv"]'),
11
+ responseDropdownWrapperPreviewTab: () => cy.get('.response-dropdown-wrapper'),
12
+ responseDropdownContainerWrapperPreviewTab: () => cy.get('[class*="ImageWithDropdownPreviewstyles__IconDiv"]'),
10
13
  //Correct answer container
11
14
  previewTabCorrectAnswerContainer: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
12
15
  previewTabCorrectAnswerLabel: () => cy.get('.cloze-with-text-correct-answer-label'),
@@ -31,7 +34,7 @@ const steps = {
31
34
  ...autoScoredPreviewBase.steps,
32
35
  ...autoScoredScoringSection.steps,
33
36
  ...questionInstructionsComponent.steps,
34
-
37
+ ...answerNumerationComponent.steps,
35
38
  /**
36
39
  * @param {number} responseContainerIndex Index of response container
37
40
  * @param {number[]} responseContainerPositionCoordinates Position coordinates of the response container
@@ -128,7 +131,7 @@ const steps = {
128
131
  * @description Verify that the incorrect option at the specified index has a cross-mark icon and is visible.
129
132
  */
130
133
  verifyIncorrectOptionCrossmarkIcon: (index) => {
131
- fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
134
+ fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
132
135
  .eq(index)
133
136
  .find('.tick-icon-wrapper')
134
137
  .should('have.class', 'icon-incorrect')
@@ -140,7 +143,7 @@ const steps = {
140
143
  * @description Verify that the correct option at the specified index has a check-mark icon and is visible.
141
144
  */
142
145
  verifyCorrectOptionCheckmarkIcon: (index) => {
143
- fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
146
+ fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
144
147
  .eq(index)
145
148
  .find('.tick-icon-wrapper')
146
149
  .should('have.class', 'icon-correct')
@@ -152,7 +155,7 @@ const steps = {
152
155
  * @description Verify that the option at the specified index does not have a check-mark or cross-mark.
153
156
  */
154
157
  verifyCheckmarkOrCrossmarkNotVisible: (index) => {
155
- utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab().eq(index).find('.tick-icon-wrapper'), 'notExist');
158
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab().eq(index).find('.tick-icon-wrapper'), 'notExist');
156
159
  },
157
160
 
158
161
  /**
@@ -194,7 +197,68 @@ const steps = {
194
197
  let responseVerticalCoordinate = coordinatesArray[1].trim();
195
198
  expect(responseVerticalCoordinate).to.be.eq(verticalCoordinate);
196
199
  });
200
+ },
201
+
202
+ /**
203
+ * @param {number} responseDropdownIndex Index of response dropdown
204
+ * @description Verify placeholder for response dropdown in preview tab does not exist
205
+ */
206
+ verifyPlaceholderAttributeInPreviewTabDropdownNotExists: (responseDropdownIndex) => {
207
+ fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
208
+ .eq(responseDropdownIndex)
209
+ .within(() => {
210
+ utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), 'notExist');
211
+ });
212
+ },
213
+
214
+ /**
215
+ * @param {number} responseDropdownIndex Index of response dropdown
216
+ * @param {*} placeholderText Placeholder for dropdown
217
+ * @description Verify placeholder text displayed for response dropdown in preview tab
218
+ */
219
+ verifyPlaceholderAttributeInPreviewTabDropdown: (responseDropdownIndex, placeholderText) => {
220
+ fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
221
+ .eq(responseDropdownIndex)
222
+ .within(() => {
223
+ utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), placeholderText);
224
+ });
225
+ },
226
+
227
+ /**
228
+ * @param {number} responseDropdownIndex Index of response dropdown
229
+ * @param {number} height Height of response dropdown in preview tab
230
+ * @description Verify height of response dropdown in preview tab
231
+ */
232
+ verifyDropdownHeightPreviewTab: (responseDropdownIndex, height) => {
233
+ fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
234
+ .eq(responseDropdownIndex)
235
+ .should('have.attr', 'height', `${height}px`);
236
+ },
237
+
238
+ /**
239
+ * @param {number} responseDropdownIndex Index of response dropdown
240
+ * @param {number} width Width of response dropdown in preview tab
241
+ * @description Verify width of response dropdown in preview tab
242
+ */
243
+ verifyDropdownWidthPreviewTab: (responseDropdownIndex, width) => {
244
+ fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
245
+ .eq(responseDropdownIndex)
246
+ .should('have.attr', 'width', `${width}px`);
247
+ },
248
+
249
+ /**
250
+ * Verify the numeration of response fields in the Preview Tab.
251
+ * @param {string[]} optionNumerationArray - An array of expected numeration strings to verify.
252
+ */
253
+ verifyResponseDropdownNumeration: (optionNumerationArray) => {
254
+ fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
255
+ optionNumerationArray.forEach((optionNumeration, count) => {
256
+ fillInTheGapsOverImageDropdownPage.responseNumeration()
257
+ .eq(count)
258
+ .should('have.text', `${optionNumeration}`);
259
+ });
197
260
  }
261
+
198
262
  }
199
263
 
200
264
  const tests = {
@@ -206,8 +270,11 @@ const tests = {
206
270
  ...autoScoredScoringSection.tests,
207
271
  ...commonComponents.tests,
208
272
  ...previewScoringAndShowCorrectAnswerComponent.tests,
273
+ ...answerNumerationComponent.tests,
274
+ ...additionalSettingsPanel.tests,
275
+ ...autoScoredAdditionalSettings.tests,
209
276
  ...questionInstructionsComponent.tests,
210
-
277
+ ...createQuestionBasePage.tests,
211
278
  /**
212
279
  * @param {number} minimumScoreIfAttemptedPoints - The minimum score awarded if attempted.
213
280
  * @param {number} allocatedPoints - The expected allocated points for the question.
@@ -59,7 +59,7 @@ const steps = {
59
59
  expandResponseAccordion: (responseIndex) => {
60
60
  fillInTheGapsTextPage.responseAccordionWrapper()
61
61
  .eq(responseIndex)
62
- .find('.additional-settings-panel')
62
+ .find('[role="button"]')
63
63
  .should('have.attr', 'aria-expanded', 'false')
64
64
  .click()
65
65
  .should('have.attr', 'aria-expanded', 'true');
@@ -37,13 +37,11 @@ const selectors = {
37
37
  highlighImageCanvasWrapper: () => cy.get('.drawing-tool__wrapper .drawing-tool__canvas'),
38
38
  highlighImageCanvas: () => cy.get('.drawing-tool__wrapper .upper-canvas'),
39
39
  setCorrectAnswerSectionHighlight: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a'),
40
- setCorrectAnswerSectionHighlightActivePattern: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPattern-"]'),
41
40
  setCorrectAnswerSectionHighlightFillColor: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
42
41
  setCorrectAnswerSectionHighlightPolygon: () => cy.get('[class*="HighlightImageControlstyles__PolygonWrapper"]'),
43
42
  highlightNumeration: () => cy.get('[class*="styles__TextWrapper"]'),
44
43
  setCorrectAnswerSectionImage: () => cy.get('.highlight-svg-responseive image'),
45
44
  previewTabHighlight: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a'),
46
- previewTabHighlightActivePattern: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPattern-"]'),
47
45
  previewTabHighlightFillColor: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
48
46
  previewTabHighlightPolygon: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__PolygonWrapper"]'),
49
47
  multipleSelectionCheckboxLabel: () => cy.get('[data-ngie-testid="multiple-selection-checkbox"] .MuiFormControlLabel-label'),
@@ -486,14 +484,14 @@ const steps = {
486
484
 
487
485
  clickOnUndoTool: () => {
488
486
  highlightImagePage.undoTool()
489
- .click()
490
- .blur();
487
+ .click();
488
+ steps.clickOnPenTool();
491
489
  },
492
490
 
493
491
  clickOnRedoTool: () => {
494
492
  highlightImagePage.redoTool()
495
- .click()
496
- .blur();
493
+ .click();
494
+ steps.clickOnPenTool();
497
495
  },
498
496
 
499
497
  clickOnClearAllTool: () => {
@@ -1150,8 +1148,9 @@ const steps = {
1150
1148
  * @description this function verifies that active pattern is displayed on the highlight region in Set correct answer section
1151
1149
  */
1152
1150
  verifyActivePatternIsDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
1153
- highlightImagePage.setCorrectAnswerSectionHighlightActivePattern()
1151
+ highlightImagePage.setCorrectAnswerSectionHighlight()
1154
1152
  .eq(index)
1153
+ .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1155
1154
  .should('exist');
1156
1155
  },
1157
1156
 
@@ -1160,8 +1159,9 @@ const steps = {
1160
1159
  * @description this function verifies that active pattern is displayed on the highlight region in Preview tab
1161
1160
  */
1162
1161
  verifyActivePatternIsDisplayedOnHighlightRegionInPreviewTab: (index) => {
1163
- highlightImagePage.previewTabHighlightActivePattern()
1162
+ highlightImagePage.previewTabHighlight()
1164
1163
  .eq(index)
1164
+ .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1165
1165
  .should('exist');
1166
1166
  },
1167
1167
 
@@ -1170,8 +1170,9 @@ const steps = {
1170
1170
  * @description this function verifies that active pattern is not displayed on the highlight region in Set correct answer section
1171
1171
  */
1172
1172
  verifyActivePatternIsNotDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
1173
- highlightImagePage.setCorrectAnswerSectionHighlightActivePattern()
1173
+ highlightImagePage.setCorrectAnswerSectionHighlight()
1174
1174
  .eq(index)
1175
+ .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1175
1176
  .should('not.exist');
1176
1177
  },
1177
1178
 
@@ -1180,8 +1181,9 @@ const steps = {
1180
1181
  * @description this function verifies that active pattern is not displayed on the highlight region in Preview Tab
1181
1182
  */
1182
1183
  verifyActivePatternIsNotDisplayedOnHighlightRegionInPreviewTab: (index) => {
1183
- highlightImagePage.previewTabHighlightActivePattern()
1184
+ highlightImagePage.previewTabHighlight()
1184
1185
  .eq(index)
1186
+ .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1185
1187
  .should('not.exist');
1186
1188
  }
1187
1189
  }
@@ -50,12 +50,13 @@ const selectors = {
50
50
  setCorrectAnswerSpans: () => cy.get('[class*="Highlightstyles__Wrapper"] span'),
51
51
  setCorrectAnswerOption: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
52
52
  setPointsButton: () => cy.get('[class*="Highlightstyles__SetPointsPopupWrapper"] button'),
53
- setPointsPopupSaveButton: () => cy.get('.compact-popup-accept-button'),
54
- setPointsPopupCancelButton: () => cy.get('.compact-popup-reject-button'),
53
+ setPointsPopupSaveButton: () => cy.get('.popup-button-wrapper button').eq(1),
54
+ setPointsPopupCancelButton: () => cy.get('.popup-button-wrapper button').eq(0),
55
55
  setPointsPopupOptions: () => cy.get('[class*="SetPointsPopupstyle__MappedAnswer"]'),
56
56
  setPointsPopupPointsLabel: () => cy.get('[class*="SetPointsPopupstyle__PointLabel"]'),
57
57
  //Check this after https://redmine.zeuslearning.com/issues/542344 is fixed
58
- pointsPerResponseLabelAndScore: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseLabel"]'),
58
+ pointsPerResponseLabel: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseLabel"]'),
59
+ pointsPerResponseScore: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseValue"]'),
59
60
  //preview tab
60
61
  previewTabQuestionContainer: () => cy.get('.highlight-preview-wrapper'),
61
62
  previewTabParagraphs: () => cy.get('.highlight-preview-wrapper p'),
@@ -64,6 +65,7 @@ const selectors = {
64
65
  //additional settings
65
66
  maximumNumberOfAnswersLabel: () => cy.get('.maximum-answers'),
66
67
  maximumAnswersInputField: () => cy.get('[class*="StudentResponseComponentstyle__OptionWrapper"] input'),
68
+ setCorrectAnswerErrorMessage: () => cy.get('[class*="ErrorMessageContainer"]')
67
69
  }
68
70
 
69
71
  const steps = {
@@ -232,6 +234,12 @@ const steps = {
232
234
  .click();
233
235
  },
234
236
 
237
+ verifySetCorrectAnswerSectionErrorMessage: () => {
238
+ highlightPage.setCorrectAnswerErrorMessage()
239
+ .eq(1)
240
+ .verifyInnerText('Error: Please set a correct answer.');
241
+ },
242
+
235
243
  verifyResetPopupForClearingOptionSelection: () => {
236
244
  utilities.verifyElementVisibilityState(highlightPage.dialogBox(), 'visible');
237
245
  utilities.verifyInnerText(highlightPage.dialogBoxTitle(), 'Reset');
@@ -622,7 +630,7 @@ const steps = {
622
630
  * @description Verify the points per response score
623
631
  */
624
632
  verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
625
- utilities.verifyInnerText(highlightPage.pointsPerResponseLabelAndScore(), `Points per response: ${points}`);
633
+ utilities.verifyInnerText(highlightPage.pointsPerResponseScore(), `${points}`);
626
634
  },
627
635
 
628
636
  clickOnClearHighlightButtonInHighlightOptionsSection: () => {
@@ -630,7 +638,7 @@ const steps = {
630
638
  .click();
631
639
  },
632
640
 
633
- verifyDefaultSetPointsButtonLabelAndDisabledState: () => {
641
+ verifyDefaultSetPointsButtonLabelAndDisabledState: () => {
634
642
  utilities.verifyInnerText(highlightPage.setPointsButton(), 'Set points');
635
643
  utilities.verifyElementVisibilityState(highlightPage.setPointsButton(), 'visible');
636
644
  utilities.verifyElementVisibilityState(highlightPage.setPointsButton().find('svg'), 'exist');
@@ -810,6 +818,21 @@ const steps = {
810
818
  .should('exist')
811
819
  .should('have.text', 'This is Bold text input.lorem');
812
820
  },
821
+
822
+ verifyHighlightOptionsFieldErrorMessage: () => {
823
+ highlightPage.highlightOptionsTextFieldWrapper()
824
+ .next()
825
+ .should('have.text', 'Error: Minimum one highlight option is required.');
826
+ },
827
+
828
+ //TODO- Update after https://redmine.zeuslearning.com/issues/548968 is resolved
829
+ verifySetCorrectAnswerErrorMessage: () => {
830
+ highlightPage.setCorrectAnswerLabel()
831
+ .parents('.highlight-set-correct-wrapper')
832
+ .within(() => {
833
+ utilities.verifyTextContent(highlightPage.errorMessage().eq(1), 'Error: Please set a correct answer.')
834
+ });
835
+ }
813
836
  }
814
837
 
815
838
  const tests = {
@@ -823,6 +846,7 @@ const tests = {
823
846
  ...additionalSettingsPanel.tests,
824
847
  ...studentResponseAndLayoutComponent.tests,
825
848
  ...autoScoredAdditionalSettings.tests,
849
+ ...createQuestionBasePage.tests,
826
850
 
827
851
  /**
828
852
  * @param {number} totalPoints Maximum total points set for the question