itemengine-cypress-automation 1.0.293-e2eUpdates5thFeb-7e9457e.0 → 1.0.294

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.
@@ -34,9 +34,9 @@ describe('Edit item - Drag and drop into categories', () => {
34
34
  it('User should be able to edit options and save the question', () => {
35
35
  dragAndDropIntoCategoriesPage.steps.editItem();
36
36
  dragAndDropIntoCategoriesPage.steps.clearTextInOptionInputField(0);
37
- dragAndDropIntoCategoriesPage.steps.enterTextInOptionInputField(0, 'Birds');
37
+ dragAndDropIntoCategoriesPage.steps.editOptionInputField(0, 'Birds');
38
38
  dragAndDropIntoCategoriesPage.steps.clearTextInOptionInputField(1);
39
- dragAndDropIntoCategoriesPage.steps.enterTextInOptionInputField(1, 'Insects');
39
+ dragAndDropIntoCategoriesPage.steps.editOptionInputField(1, 'Insects');
40
40
  dragAndDropIntoCategoriesPage.steps.saveAQuestionAndVerifySnackbar();
41
41
  dragAndDropIntoCategoriesPage.steps.verifyOptionFieldTextInOptionsSection(options);
42
42
  });
@@ -1,5 +1,6 @@
1
1
  import { dragAndDropIntoCategoriesPage } from "../../../pages/dragAndDropIntoCategoriesPage";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
3
4
  let animals = [['Bat', 'Platypus', 'Panda', 'Zebra'],
4
5
  ['Peacock', 'Falcon', 'Eagle', 'Tiger'],
5
6
  ['Parrot', 'Lion', 'Whale', 'Elephant'],
@@ -108,6 +109,7 @@ describe('Create Item page - drag and drop into categories: Student view setting
108
109
  before(() => {
109
110
  dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
110
111
  cy.barsPreLoaderWait();
112
+ utilities.verifyElementCount(dragAndDropIntoCategoriesPage.optionsInputField(), 2);
111
113
  dragAndDropIntoCategoriesPage.steps.expandDraggableOptionsLayoutDropdown();
112
114
  dragAndDropIntoCategoriesPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
113
115
  dragAndDropIntoCategoriesPage.steps.addGroupTitle(groupTitles[0]);
@@ -159,6 +161,7 @@ describe('Create Item page - drag and drop into categories: Student view setting
159
161
  before(() => {
160
162
  dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
161
163
  cy.barsPreLoaderWait();
164
+ utilities.verifyElementCount(dragAndDropIntoCategoriesPage.optionsInputField(), 2);
162
165
  dragAndDropIntoCategoriesPage.steps.expandDraggableOptionsLayoutDropdown();
163
166
  dragAndDropIntoCategoriesPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
164
167
  dragAndDropIntoCategoriesPage.steps.addGroupTitle(groupTitles[0]);
@@ -212,6 +215,7 @@ describe('Create Item page - drag and drop into categories: Student view setting
212
215
  before(() => {
213
216
  dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
214
217
  cy.barsPreLoaderWait();
218
+ utilities.verifyElementCount(dragAndDropIntoCategoriesPage.optionsInputField(), 2);
215
219
  dragAndDropIntoCategoriesPage.steps.expandDraggableOptionsLayoutDropdown();
216
220
  dragAndDropIntoCategoriesPage.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped');
217
221
  dragAndDropIntoCategoriesPage.steps.addGroupTitle(groupTitles[0]);
@@ -19,7 +19,7 @@ describe('Edit Question and edit item', () => {
19
19
  });
20
20
 
21
21
  it('When user edits the question instructions, then the changes should be saved correctly', () => {
22
- multipleSelectionPage.steps.editItem(1);
22
+ multipleSelectionPage.steps.editItem();
23
23
  multipleSelectionPage.steps.clearQuestionInstructionsInputField();
24
24
  multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Edit question instructions');
25
25
  multipleSelectionPage.steps.clickOnSaveQuestionButton();
@@ -27,7 +27,7 @@ describe('Edit Question and edit item', () => {
27
27
  });
28
28
 
29
29
  it('When user edits the options, then the changes should be saved correctly', () => {
30
- multipleSelectionPage.steps.editItem(1);
30
+ multipleSelectionPage.steps.editItem();
31
31
  multipleSelectionPage.steps.editOptionInputField(0, 'Edit option input field');
32
32
  multipleSelectionPage.steps.clickOnSaveQuestionButton();
33
33
  multipleSelectionPage.steps.verifyOptionInputFieldText(0, 'Edit option input field');
@@ -37,14 +37,14 @@ describe('Edit Question and edit item', () => {
37
37
  });
38
38
 
39
39
  it('When user edits the points, then the changes should be saved correctly', () => {
40
- multipleSelectionPage.steps.editItem(1);
40
+ multipleSelectionPage.steps.editItem();
41
41
  multipleSelectionPage.steps.allotPoints(10);
42
42
  multipleSelectionPage.steps.clickOnSaveQuestionButton();
43
43
  multipleSelectionPage.steps.verifyPointsValue('10');
44
44
  });
45
45
 
46
46
  it('When user edits the correct answers, then the changes should be saved correctly', () => {
47
- multipleSelectionPage.steps.editItem(1);
47
+ multipleSelectionPage.steps.editItem();
48
48
  multipleSelectionPage.steps.uncheckOptionsCheckboxInSpecifyCorrectAnswerSection(0);
49
49
  multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(2);
50
50
  multipleSelectionPage.steps.clickOnSaveQuestionButton();
@@ -84,7 +84,7 @@ describe('Edit Question and edit item', () => {
84
84
  });
85
85
 
86
86
  it('When user edits the resource, then the changes should be saved correctly', () => {
87
- readingRulerPage.steps.editItem(0);
87
+ readingRulerPage.steps.editItem();
88
88
  readingRulerPage.steps.checkVisibleOnLandingCheckbox();
89
89
  readingRulerPage.steps.selectColorBlock(1);
90
90
  readingRulerPage.steps.addInputToDefaultNumberOfLinesInputField(2);
@@ -115,7 +115,7 @@ describe('Edit Question and edit item', () => {
115
115
  });
116
116
 
117
117
  it('The user should be able to edit the item', () => {
118
- singleSelectionPage.steps.editItem(0);
118
+ singleSelectionPage.steps.editItem();
119
119
  singleSelectionPage.steps.clearQuestionInstructionsInputField();
120
120
  singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Edit question instructions');
121
121
  singleSelectionPage.steps.clickOnSaveQuestionButton();
@@ -123,7 +123,7 @@ describe('Edit Question and edit item', () => {
123
123
  });
124
124
 
125
125
  it('User should be able to edit the resource', () => {
126
- singleSelectionPage.steps.editItem(2);
126
+ singleSelectionPage.steps.editItem(1);
127
127
  readingRulerPage.steps.checkVisibleOnLandingCheckbox();
128
128
  readingRulerPage.steps.clickOnSaveQuestionButton();
129
129
  readingRulerPage.steps.verifyReadingRulerExistInPreviewTab();
@@ -34,9 +34,9 @@ describe('Edit item - fill in the gaps with drag and drop', () => {
34
34
  it('User should be able to edit options and save the question', () => {
35
35
  fillInTheGapsDragAndDropPage.steps.editItem();
36
36
  fillInTheGapsDragAndDropPage.steps.clearTextInOptionInputField(0);
37
- fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(0, 'Birds');
37
+ fillInTheGapsDragAndDropPage.steps.editOptionInputField(0, 'Birds');
38
38
  fillInTheGapsDragAndDropPage.steps.clearTextInOptionInputField(1);
39
- fillInTheGapsDragAndDropPage.steps.enterTextInOptionInputField(1, 'Insects');
39
+ fillInTheGapsDragAndDropPage.steps.editOptionInputField(1, 'Insects');
40
40
  fillInTheGapsDragAndDropPage.steps.saveAQuestionAndVerifySnackbar();
41
41
  fillInTheGapsDragAndDropPage.steps.verifyOptionFieldTextInOptionsSection(options);
42
42
  });
@@ -38,9 +38,9 @@ describe('Edit item - fill in the gaps over image with drag and drop', () => {
38
38
  it('User should be able to edit options and save the question', () => {
39
39
  fillInTheGapsOverImageDragAndDropPage.steps.editItem();
40
40
  fillInTheGapsOverImageDragAndDropPage.steps.clearTextInOptionInputField(0);
41
- fillInTheGapsOverImageDragAndDropPage.steps.enterTextInOptionInputField(0, 'Birds');
41
+ fillInTheGapsOverImageDragAndDropPage.steps.editOptionInputField(0, 'Birds');
42
42
  fillInTheGapsOverImageDragAndDropPage.steps.clearTextInOptionInputField(1);
43
- fillInTheGapsOverImageDragAndDropPage.steps.enterTextInOptionInputField(1, 'Insects');
43
+ fillInTheGapsOverImageDragAndDropPage.steps.editOptionInputField(1, 'Insects');
44
44
  fillInTheGapsOverImageDragAndDropPage.steps.saveAQuestionAndVerifySnackbar();
45
45
  fillInTheGapsOverImageDragAndDropPage.steps.verifyOptionFieldTextInOptionsSection(options);
46
46
  });
@@ -153,6 +153,7 @@ const steps = {
153
153
  }
154
154
 
155
155
  const tests = {
156
+ //Note: need to fix this function once save as you go is available for all question types
156
157
  verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet: () => {
157
158
  it('When the user has not set correct answer option(s) and alloted points, \'Student view\' radio button should be checked, \'Grading view\' button should not be checked, 0 points should be displayed and no correct or incorrect icons should be displayed in the preview tab', () => {
158
159
  utilities.verifyInnerText(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), 'Student view');
@@ -211,7 +211,7 @@ const steps = {
211
211
  utilities.getNthElement(gridQuestionCommonComponent.editCellPropertyRow(), row).within(() => {
212
212
  utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column).within(() => {
213
213
  gridQuestionCommonComponent.cellPropertyInputField()
214
- .focus();
214
+ .click();
215
215
  gridQuestionCommonComponent.cellPropertyInputField()
216
216
  .clear()
217
217
  .type(text)
@@ -2071,6 +2071,44 @@ const steps = {
2071
2071
  }
2072
2072
 
2073
2073
  const tests = {
2074
+ //Note: need to remove this as change the global function once save as you go is available for all question types
2075
+ verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet: () => {
2076
+ it('When the user has not set correct answer option(s) and alloted points, \'Student view\' radio button should be checked, \'Grading view\' button should not be checked, 0 points should be displayed and no correct or incorrect icons should be displayed in the preview tab', () => {
2077
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), 'Student view');
2078
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), 'Grading view');
2079
+ autoScoredScoringPreviewTab.studentViewRadioButton()
2080
+ .should('be.checked');
2081
+ autoScoredScoringPreviewTab.gradingViewRadioButton()
2082
+ .should('not.be.checked');
2083
+ autoScoredScoringPreviewTab.steps.checkManuallyScoredScoringLabel();
2084
+ autoScoredScoringPreviewTab.steps.verifyCorrectIncorrectIconsNotExist();
2085
+ });
2086
+
2087
+ it('CSS of Preview mode contents', { tags: 'css' }, () => {
2088
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), {
2089
+ 'color': css.color.labelText,
2090
+ 'font-size': css.fontSize.normal,
2091
+ 'font-weight': css.fontWeight.regular
2092
+ });
2093
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), {
2094
+ 'color': css.color.labelText,
2095
+ 'font-size': css.fontSize.normal,
2096
+ 'font-weight': css.fontWeight.regular
2097
+ });
2098
+ utilities.verifyCSS(autoScoredScoringPreviewTab.scoreLabelPreviewTab(), {
2099
+ 'color': css.color.codeBlockText,
2100
+ 'font-size': css.fontSize.default,
2101
+ 'font-weight': css.fontWeight.bold
2102
+ });
2103
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButton().parent().find('svg'), {
2104
+ 'fill': css.color.activeButtons
2105
+ });
2106
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButton().parent().find('svg path'), {
2107
+ 'fill': css.color.uncheckedCheckbox
2108
+ });
2109
+ });
2110
+ },
2111
+
2074
2112
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
2075
2113
  it(`When the user selects any scoring type except for manual scored, then the question grid should be displayed in the specify correct answer section`, () => {
2076
2114
  gridQuestionCommonComponent.steps.verifyTableCellPropertySpecifyCorrectAnswerSection({ row: 0, column: 0 }, 'None');
@@ -237,9 +237,6 @@ const steps = {
237
237
  enterTextInOptionInputField: (index, textContent) => {
238
238
  optionsWrapperComponent.optionsSectionWrapper()
239
239
  .within(() => {
240
- optionsWrapperComponent.optionsInputField()
241
- .eq(index)
242
- .clear()
243
240
  optionsWrapperComponent.optionsInputField()
244
241
  .eq(index)
245
242
  .type(textContent)
@@ -31,7 +31,7 @@ const selectors = {
31
31
  sectionsNumber1Label: () => cy.get('.tablist-numbered-label').eq(0),
32
32
  sectionsNumber2Label: () => cy.get('.tablist-numbered-label').eq(1),
33
33
  noPreviewText: () => cy.get('[class*="__NoPreview"]'),
34
- editItemButton: () => cy.get('.icon-pencil'),
34
+ editItemButton: () => cy.get('.column-component-column .icon-pencil'),
35
35
  pointsValue: () => cy.get('[class*="PreviewTabstyles__PointsValue"]'),
36
36
  moreActionsButton: () => cy.get('[class*="MoreActionMenuButton"] [type="button"]'),
37
37
  deleteItemButton: () => cy.get('[aria-label="Delete Button"]')
@@ -587,7 +587,7 @@ const steps = {
587
587
  * @param {number} index of the question
588
588
  * @description this function is used to click on edit item button
589
589
  */
590
- editItem: (index) => {
590
+ editItem: (index = 0) => {
591
591
  createItemPage.editItemButton()
592
592
  .eq(index)
593
593
  .click();
@@ -8,7 +8,7 @@ import { ckEditorInsertImageComponent } from "./components/ckEditorInsertImageCo
8
8
  import { ckEditorLinkComponent } from "../pages/components/ckEditorLinkComponent"
9
9
  import { createItemPage } from "./createItemPage";
10
10
  import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
11
- import {audioPlayerPage} from "./audioPlayerPage";
11
+ import { audioPlayerPage } from "./audioPlayerPage";
12
12
  const css = Cypress.env('css');
13
13
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
14
14
 
@@ -914,6 +914,44 @@ const tests = {
914
914
  ...ckEditorInsertTableComponent.tests,
915
915
  ...ckEditorInsertImageComponent.tests,
916
916
  ...ckEditorLinkComponent.tests,
917
+ //Note: need to remove this as change the global function once save as you go is available for all question types
918
+ verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet: () => {
919
+ it('When the user has not set correct answer option(s) and alloted points, \'Student view\' radio button should be checked, \'Grading view\' button should not be checked, 0 points should be displayed and no correct or incorrect icons should be displayed in the preview tab', () => {
920
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), 'Student view');
921
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), 'Grading view');
922
+ autoScoredScoringPreviewTab.studentViewRadioButton()
923
+ .should('be.checked');
924
+ autoScoredScoringPreviewTab.gradingViewRadioButton()
925
+ .should('not.be.checked');
926
+ autoScoredScoringPreviewTab.steps.checkManuallyScoredScoringLabel();
927
+ autoScoredScoringPreviewTab.steps.verifyCorrectIncorrectIconsNotExist();
928
+ });
929
+
930
+ it('CSS of Preview mode contents', { tags: 'css' }, () => {
931
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), {
932
+ 'color': css.color.labelText,
933
+ 'font-size': css.fontSize.normal,
934
+ 'font-weight': css.fontWeight.regular
935
+ });
936
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), {
937
+ 'color': css.color.labelText,
938
+ 'font-size': css.fontSize.normal,
939
+ 'font-weight': css.fontWeight.regular
940
+ });
941
+ utilities.verifyCSS(autoScoredScoringPreviewTab.scoreLabelPreviewTab(), {
942
+ 'color': css.color.codeBlockText,
943
+ 'font-size': css.fontSize.default,
944
+ 'font-weight': css.fontWeight.bold
945
+ });
946
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButton().parent().find('svg'), {
947
+ 'fill': css.color.activeButtons
948
+ });
949
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButton().parent().find('svg path'), {
950
+ 'fill': css.color.uncheckedCheckbox
951
+ });
952
+ });
953
+ },
954
+
917
955
  /**
918
956
  * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
919
957
  * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
@@ -248,7 +248,7 @@ const steps = {
248
248
  singleSelectionPage.correctAnswerSectionWrapper()
249
249
  .should('be.visible');
250
250
  },
251
-
251
+
252
252
  verifyAnswerBannerNotExist: () => {
253
253
  singleSelectionPage.answerStatusBanner()
254
254
  .should('not.exist');
@@ -719,6 +719,44 @@ const tests = {
719
719
  ...autoScoredStudentViewSettings.tests,
720
720
  ...additionalSettingsAccessibilitySectionComponent.tests,
721
721
  ...mcqAdditionalSettingsBase.tests,
722
+ //Note: need to remove this as change the global function once save as you go is available for all question types
723
+ verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet: () => {
724
+ it('When the user has not set correct answer option(s) and alloted points, \'Student view\' radio button should be checked, \'Grading view\' button should not be checked, 0 points should be displayed and no correct or incorrect icons should be displayed in the preview tab', () => {
725
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), 'Student view');
726
+ utilities.verifyInnerText(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), 'Grading view');
727
+ autoScoredScoringPreviewTab.studentViewRadioButton()
728
+ .should('be.checked');
729
+ autoScoredScoringPreviewTab.gradingViewRadioButton()
730
+ .should('not.be.checked');
731
+ autoScoredScoringPreviewTab.steps.checkManuallyScoredScoringLabel();
732
+ autoScoredScoringPreviewTab.steps.verifyCorrectIncorrectIconsNotExist();
733
+ });
734
+
735
+ it('CSS of Preview mode contents', { tags: 'css' }, () => {
736
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButtonLabel(), {
737
+ 'color': css.color.labelText,
738
+ 'font-size': css.fontSize.normal,
739
+ 'font-weight': css.fontWeight.regular
740
+ });
741
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButtonLabel(), {
742
+ 'color': css.color.labelText,
743
+ 'font-size': css.fontSize.normal,
744
+ 'font-weight': css.fontWeight.regular
745
+ });
746
+ utilities.verifyCSS(autoScoredScoringPreviewTab.scoreLabelPreviewTab(), {
747
+ 'color': css.color.codeBlockText,
748
+ 'font-size': css.fontSize.default,
749
+ 'font-weight': css.fontWeight.bold
750
+ });
751
+ utilities.verifyCSS(autoScoredScoringPreviewTab.studentViewRadioButton().parent().find('svg'), {
752
+ 'fill': css.color.activeButtons
753
+ });
754
+ utilities.verifyCSS(autoScoredScoringPreviewTab.gradingViewRadioButton().parent().find('svg path'), {
755
+ 'fill': css.color.uncheckedCheckbox
756
+ });
757
+ });
758
+ },
759
+
722
760
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
723
761
  it('In the \'Correct\' accordion, all options with checkboxes should be displayed', () => {
724
762
  utilities.verifyElementCount(singleSelectionPage.optionWrapperSpecifyCorrectAnswerSection(), 4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.293-e2eUpdates5thFeb-7e9457e.0",
3
+ "version": "1.0.294",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {