itemengine-cypress-automation 1.0.250 → 1.0.251

Sign up to get free protection for your applications and to get access to all the features.
@@ -329,7 +329,7 @@ describe('Create item page - Charts - Bar: Partial equal weights scoring with al
329
329
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 5, range: 10 });
330
330
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 4, range: 10 });
331
331
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 6, range: 10 });
332
- chartsBarPage.steps.verifyPreviewScore(12.5, 20);
332
+ chartsBarPage.steps.verifyPreviewScore(12.5, 50);
333
333
  chartsBarPage.steps.switchToGradingView();
334
334
  chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
335
335
  chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
@@ -328,7 +328,7 @@ describe('Create item page - Charts - Bar: Partial equal weights scoring with al
328
328
 
329
329
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 8, range: 10 });
330
330
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 6, range: 10 });
331
- chartsBarPage.steps.verifyPreviewScore(12.5, 20);
331
+ chartsBarPage.steps.verifyPreviewScore(12.5, 50);
332
332
  chartsBarPage.steps.switchToGradingView();
333
333
  chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
334
334
  chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
@@ -595,6 +595,8 @@ describe('Create item page - Drawing response: Customize special characters, Cus
595
595
  });
596
596
 
597
597
  it('When the user adds upto 10 color blocks, then the add[+] color block should get disabled when 10 blocks have been added.', () => {
598
+ //Need to remove this once https://redmine.zeuslearning.com/issues/577356 is resolved
599
+ drawingResponsePage.steps.expandCustomizeToolbarOptionsAndControlsAccordion();
598
600
  for (let i = 0; i < 6; i++) {
599
601
  drawingResponsePage.steps.clickOnAddColorBlockInDefaultFontStrokeColorBlockSection();
600
602
  drawingResponsePage.steps.clickOnEditTabColorPaletteOkButton();
@@ -861,6 +861,8 @@ describe('Preview tab contents - primary toolbar options, secondary toolbar opti
861
861
 
862
862
  it(`When \'Fill color picker\' additional option is selected in edit tab, then in preview tab the ${drawingToolbarOptionsAndAdditionalOptions.drawingToolbarOptions[9].secondaryToolbarOptions[0]} secondary toolbar option popup should display color picker and its related components`, () => {
863
863
  drawingResponsePage.steps.switchToEditTab();
864
+ //Need to remove this once https://redmine.zeuslearning.com/issues/577356 is resolved
865
+ drawingResponsePage.steps.expandCustomizeToolbarOptionsAndControlsAccordion();
864
866
  drawingResponsePage.steps.selectOptionsTiles([`${drawingToolbarOptionsAndAdditionalOptions.additionalOptions[6]}`]);
865
867
  drawingResponsePage.steps.switchToPreviewTab();
866
868
  drawingResponsePage.steps.selectPreviewTabToolbarOption(drawingToolbarOptionsAndAdditionalOptions.drawingToolbarOptions[9].displayName);
@@ -87,7 +87,7 @@ describe('Create item page - Fill in the gaps drop down: Drop down alternate ans
87
87
  });
88
88
 
89
89
  it('When the user clicks on \'Cancel\' button, then popup should be closed and the changes made by the user should not be saved', () => {
90
- fillInTheGapsDropdownPage.steps.CancelDropdownAlternateAnswersPopup();
90
+ fillInTheGapsDropdownPage.steps.cancelDropdownAlternateAnswersPopup();
91
91
  utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.alternateAnswerPopup(), 'notExist');
92
92
  });
93
93
 
@@ -149,14 +149,13 @@ describe('Create item page - Fill in the gaps drop down: Drop down alternate ans
149
149
  });
150
150
 
151
151
  it('When user opens the alternate answer popup for another drop down, then alternate answer popup with the title and options as per the corresponding drop down should be displayed', () => {
152
- fillInTheGapsDropdownPage.steps.CancelDropdownAlternateAnswersPopup();
153
152
  fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
154
153
  fillInTheGapsDropdownPage.steps.clickOnAddAlternateButton(2);
155
154
  utilities.verifyInnerText(fillInTheGapsDropdownPage.alternateAnswerPopupTitle(), 'Dropzone 2 alternate answer(s)');
156
155
  utilities.verifyInnerText(fillInTheGapsDropdownPage.alternateAnswerPopupHelpText(), 'Select alternate answer(s).');
157
156
  fillInTheGapsDropdownPage.steps.verifyDropdownAlternateAnswerPopupOptions(['Leaves', 'Stem', 'Seed']);
158
157
  cy.log('Post-step: Close the alternate answers popup');
159
- fillInTheGapsDropdownPage.steps.CancelDropdownAlternateAnswersPopup();
158
+ fillInTheGapsDropdownPage.steps.cancelDropdownAlternateAnswersPopup();
160
159
  });
161
160
  });
162
161
  });
@@ -40,7 +40,7 @@ describe('Create item page - Fill in the gaps over image with text: Supported fi
40
40
 
41
41
  it('When the user tries to uploads an image with unsupported file type, then an error message, "Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.", should be displayed', () => {
42
42
  fillInTheGapsOverImageTextPage.steps.uploadFile('sample.heic');
43
- utilities.verifyTextContent(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.');
43
+ utilities.verifyTextContent(fillInTheGapsOverImageTextPage.errorMessage(), 'Error: The file type is not supported. Please upload a file with the following supported formats: JPG, PNG, GIF, SVG.');
44
44
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'visible');
45
45
  fillInTheGapsOverImageTextPage.steps.verifyCanvasImageNotExist();
46
46
  });
@@ -164,7 +164,7 @@ describe('Create Item page - Highlight image: Tools functionality edit tab', ()
164
164
  it('When the user clicks on the \'Clear all\' tool, then a popup should be displayed with \'Are you sure you want to clear the canvas?\' with \'Delete\' and \'Cancel\' buttons', () => {
165
165
  imageHighlightPage.steps.clickOnClearAllTool();
166
166
  utilities.verifyInnerText(imageHighlightPage.clearAllPopupHeading(), 'Clear all');
167
- utilities.verifyInnerText(imageHighlightPage.clearAllPopupDescription(), 'Are you sure you want to clear the canvas?');
167
+ utilities.verifyInnerText(imageHighlightPage.clearAllPopupDescription(), 'Are you sure you want to clear all highlights from the canvas?');
168
168
  utilities.verifyInnerText(imageHighlightPage.clearAllButton(), 'Clear all');
169
169
  utilities.verifyInnerText(imageHighlightPage.cancelButton(), 'Cancel');
170
170
  });
@@ -36,7 +36,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
36
36
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
37
37
  cy.barsPreLoaderWait();
38
38
  textEntryMathPage.steps.expandAdditionalSettings();
39
- // textEntryMathPage.steps.selectModalVisibilityTypeButton();
39
+ // textEntryMathPage.steps.selectModalVisibilityTypeButton();
40
40
  });
41
41
 
42
42
  it('By default \'Add structure\' tab will have active selection', () => {
@@ -92,7 +92,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
92
92
  textEntryMathPage.steps.switchToEditTab();
93
93
  textEntryMathPage.steps.deleteAResponseArea(0);
94
94
  textEntryMathPage.steps.deleteAResponseArea(0);
95
- utilities.verifyElementVisibilityState(textEntryMathPage.errorMessage(), 'notExist');
95
+ utilities.verifyElementVisibilityState(textEntryMathPage.errorMessage(), 'exist');
96
96
  });
97
97
 
98
98
  textEntryMathPage.tests.verifyErrorMessageCSSAndA11y();
@@ -110,7 +110,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
110
110
  textEntryMathPage.steps.addResponseArea();
111
111
  textEntryMathPage.steps.addResponseArea();
112
112
  textEntryMathPage.steps.expandAdditionalSettings();
113
- // textEntryMathPage.steps.selectModalVisibilityTypeButton();
113
+ // textEntryMathPage.steps.selectModalVisibilityTypeButton();
114
114
  });
115
115
 
116
116
  it('For the two response token in question input field, two response accordions \'Response 1\' and \'Response 2\' should be present in collapsed state in the \'Specify correct answer section\'', () => {
@@ -145,7 +145,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
145
145
  textEntryMathPage.steps.addResponseArea();
146
146
  textEntryMathPage.steps.addResponseArea();
147
147
  textEntryMathPage.steps.expandAdditionalSettings();
148
- // textEntryMathPage.steps.selectModalVisibilityTypeButton();
148
+ // textEntryMathPage.steps.selectModalVisibilityTypeButton();
149
149
  });
150
150
 
151
151
  it('For the two response token in question input field, in additional settings accordion, two \'ARIA label for text containers\'input fields should be displayed', () => {
@@ -169,7 +169,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
169
169
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
170
170
  cy.barsPreLoaderWait();
171
171
  textEntryMathPage.steps.expandAdditionalSettings();
172
- // textEntryMathPage.steps.selectModalVisibilityTypeButton();
172
+ // textEntryMathPage.steps.selectModalVisibilityTypeButton();
173
173
  textEntryMathPage.steps.switchToPreviewTab();
174
174
  });
175
175
 
@@ -316,15 +316,9 @@ const tests = {
316
316
  .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
317
317
  });
318
318
 
319
- it('If user has not selected correct answer in the correct accordion, then the Add alternative answer button should be in disabled state', () => {
320
- utilities.verifyElementDisabled(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
321
- });
322
-
323
- it('When user hovers over the disabled \'Add alternative answer\' button then \'Please set a correct answer\' message should be displayed in a tooltip', () => {
324
- autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
325
- .realHover();
326
- utilities.verifyInnerText(commonComponents.tooltipText(), 'Please set a correct answer');
327
- utilities.hoverAwayFromElement(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
319
+ it('If user has not selected correct answer in the correct accordion, the user should get a warning popup', () => {
320
+ autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
321
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
328
322
  });
329
323
 
330
324
  it('CSS of warning popup', { tags: 'css' }, () => {
@@ -346,14 +340,38 @@ const tests = {
346
340
  it('Accessibility of warning popup', { tags: 'a11y' }, () => {
347
341
  cy.checkAccessibility(dialogBoxBase.dialogBox());
348
342
  });
343
+
344
+ it('Warning popup should close on clicking the Close icon button', () => {
345
+ dialogBoxBase.steps.closeWarningPopup();
346
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
347
+ });
348
+
349
+ it('\'Error: Please set a correct answer.\' validation error messages should be displayed in the correct accordion, points error message should not be displayed', () => {
350
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
351
+ .within(() => {
352
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
353
+ });
354
+ scoringSectionBaseEditTab.pointsWrapper()
355
+ .within(() => {
356
+ utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
357
+ });
358
+ if (questionType != 'list ordering' && questionType != 'short text response' && questionType != 'text entry math' && questionType != 'text selection' && questionType != 'fill in the gaps with text' && questionType != 'fill in the gaps over image text') {
359
+ steps.verifySpecifyCorrectAnswerErrorMessage();
360
+ }
361
+ else if (questionType === 'short text response' || questionType === 'fill in the gaps with text' || questionType === 'fill in the gaps over image text' || questionType === 'text entry math') {
362
+ utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), -1), 'Error: Answer is required.');
363
+ } else if (questionType === 'text selection') {
364
+ utilities.verifyInnerText(commonComponents.alertMessage(), 'Error: Please set a correct answer.');
365
+ }
366
+ });
349
367
  },
350
368
 
351
369
  verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion: () => {
352
370
  it('When user tries to expand correct accordion when all the mandatory fields are not filled in the alternative accordion, then a warning popup should be displayed and on closing the popup, alternative 2 accordion should be in expanded state', () => {
353
371
  autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
354
372
  .click();
355
- //TODO: Need to add error message according to question types
356
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
373
+ dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
374
+ dialogBoxBase.steps.closeWarningPopup();
357
375
  autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
358
376
  .eq(1)
359
377
  .should('have.attr', 'aria-expanded', 'true');
@@ -754,7 +754,7 @@ const tests = {
754
754
  //Note: the expand and close dropdown does not work hence selecting one option here, the error message appears
755
755
  it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should not be displayed', () => {
756
756
  fillInTheGapsDropdownCommonComponent.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, 'Flower');
757
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
757
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'exist');
758
758
  });
759
759
 
760
760
  it('When the user selects any option from the dropdown, then error message should disappear and that option should be displayed on the dropdown', () => {
@@ -1237,7 +1237,8 @@ const tests = {
1237
1237
 
1238
1238
  it('When user focuses in and out of the response accordion \'Answer\' input field, \'Error: Answer is required.\' error message should be displayed', () => {
1239
1239
  fillInTheGapsTextCommonComponent.steps.focusInAndFocusOutOfResponseAnswerInputFieldSpecifyCorrectAnswer(0, 0);
1240
- commonComponents.steps.verifyErrorMessageIsNotDisplayed();
1240
+ commonComponents.errorMessage()
1241
+ .should('have.text', 'Error: Answer is required.');
1241
1242
  });
1242
1243
 
1243
1244
  it('When gives an input to \'Answer\' input field, then error message should disappear', () => {
@@ -78,7 +78,7 @@ const steps = {
78
78
  .eq(index)
79
79
  .within(() => {
80
80
  commonComponents.errorMessage()
81
- .should('not.exist');
81
+ .should('have.text', 'Error: Option is required.');
82
82
  });
83
83
  },
84
84
 
@@ -183,7 +183,7 @@ const steps = {
183
183
  .eq(index)
184
184
  .find('[data-widget="ngie_equation"]')
185
185
  .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
186
- // .contains(constants.CKEditorInputFieldEnteredEquationText); ;
186
+ // .contains(constants.CKEditorInputFieldEnteredEquationText); ;
187
187
  },
188
188
 
189
189
  /**
@@ -1009,23 +1009,23 @@ const tests = {
1009
1009
  * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
1010
1010
  * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
1011
1011
  */
1012
- verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
1012
+ zverifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
1013
1013
  it(`The user should be able to drop option in the dropzone in the ${accordionName} accordion`, () => {
1014
1014
  fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
1015
1015
  });
1016
1016
 
1017
1017
  it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion, 'Error: Please set a correct answer.' error message should be thrown along with an error icon on the '${accordionName}' accordion`, () => {
1018
1018
  fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
1019
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist')
1019
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible')
1020
1020
  if (accordionName == 'Correct') {
1021
1021
  autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
1022
1022
  .within(() => {
1023
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
1023
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
1024
1024
  });
1025
1025
  } else {
1026
1026
  autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
1027
1027
  .within(() => {
1028
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
1028
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
1029
1029
  });
1030
1030
  };
1031
1031
  });
@@ -246,7 +246,7 @@ const steps = {
246
246
  .click();
247
247
  },
248
248
 
249
- CancelDropdownAlternateAnswersPopup: () => {
249
+ cancelDropdownAlternateAnswersPopup: () => {
250
250
  fillInTheGapsDropdownPage.alternateAnswerPopupCancelButton()
251
251
  .click();
252
252
  },
@@ -2708,7 +2708,7 @@ const tests = {
2708
2708
  .eq(inputFieldIndex)
2709
2709
  .click()
2710
2710
  .blur();
2711
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
2711
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'exist');
2712
2712
  });
2713
2713
 
2714
2714
  it('User should be able to enter text in options input field', () => {
@@ -708,7 +708,7 @@ const tests = {
708
708
 
709
709
  it('On deleting correct answer option(s), \'Error: Please set a correct answer.\' validation error message should be thrown along with an error icon on the \'Correct\' tab', () => {
710
710
  singleSelectionPage.steps.deleteOption(1);
711
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
711
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'exist');
712
712
  autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
713
713
  });
714
714
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.250",
3
+ "version": "1.0.251",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {