itemengine-cypress-automation 1.0.370-IEI-5718-and-IEI-5740-manualAndNonscoredScript-d0c51ae.0 → 1.0.370

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.
@@ -224,6 +224,7 @@ describe('Create item page - Multiple selection: Scoring section', () => {
224
224
  before(() => {
225
225
  multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
226
226
  cy.barsPreLoaderWait();
227
+ multipleSelectionPage.steps.addInputToOptionsInputField(options);
227
228
  });
228
229
 
229
230
  it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
@@ -237,6 +237,9 @@ describe('Create item page - Multiple selection grid: Scoring section', () => {
237
237
  before(() => {
238
238
  multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
239
239
  cy.barsPreLoaderWait();
240
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
241
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
242
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
240
243
  });
241
244
 
242
245
  it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
@@ -263,6 +266,9 @@ describe('Create item page - Multiple selection grid: Scoring section', () => {
263
266
  before(() => {
264
267
  multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
265
268
  cy.barsPreLoaderWait();
269
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
270
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
271
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
266
272
  });
267
273
 
268
274
  it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
@@ -1,5 +1,6 @@
1
1
  import { singleSelectionPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ 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'];
3
4
 
4
5
  describe('Create Item page - Single selection', () => {
5
6
  before(() => {
@@ -64,6 +65,7 @@ describe('Create Item page - Single selection', () => {
64
65
  before(() => {
65
66
  singleSelectionPage.steps.navigateToCreateQuestion('single selection');
66
67
  cy.barsPreLoaderWait();
68
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
67
69
  });
68
70
 
69
71
  it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
@@ -4,106 +4,112 @@ import utilities from "../../../support/helpers/utilities";
4
4
 
5
5
  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'];
6
6
 
7
- describe('Question Preview: Manually Scored', () => {
8
- abortEarlySetup();
7
+ describe('Create Item page - Single selection', () => {
9
8
  before(() => {
10
- cy.log('Adding question instructions and options, select Manually Scored scoring type and add points for the question');
11
- singleSelectionPage.steps.navigateToCreateQuestion('single selection');
12
- singleSelectionPage.steps.addQuestionInstructions();
13
- singleSelectionPage.steps.addInputToOptionsInputField(options);
14
- singleSelectionPage.steps.expandScoringTypeDropdown();
15
- singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
16
- singleSelectionPage.steps.switchToPreviewTab();
9
+ cy.loginAs('admin');
17
10
  });
18
11
 
19
- it('In Preview tab, Question Instructions and options should be displayed along with radio button', () => {
20
- singleSelectionPage.steps.verifyQuestionInstructionsText();
21
- options.forEach((optionsText, count) => {
22
- utilities.verifyInnerText(utilities.getNthElement(singleSelectionPage.optionTextPreviewTab(), count), optionsText);
12
+ describe('Question Preview: Manually Scored', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Adding question instructions and options, select Manually Scored scoring type and add points for the question');
16
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
17
+ singleSelectionPage.steps.addQuestionInstructions();
18
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
19
+ singleSelectionPage.steps.expandScoringTypeDropdown();
20
+ singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
21
+ singleSelectionPage.steps.switchToPreviewTab();
23
22
  });
24
- });
25
23
 
26
- singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored')
24
+ it('In Preview tab, Question Instructions and options should be displayed along with radio button', () => {
25
+ singleSelectionPage.steps.verifyQuestionInstructionsText();
26
+ options.forEach((optionsText, count) => {
27
+ utilities.verifyInnerText(utilities.getNthElement(singleSelectionPage.optionTextPreviewTab(), count), optionsText);
28
+ });
29
+ });
27
30
 
28
- it('User should able to save question with manually scored scoring type', () => {
29
- singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
30
- });
31
- });
31
+ singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Manually scored')
32
32
 
33
- describe('Question Preview: Non Scored', () => {
34
- abortEarlySetup();
35
- before(() => {
36
- cy.log('Adding question instructions and options, select Non Scored scoring type and set correct answer');
37
- singleSelectionPage.steps.navigateToCreateQuestion('single selection');
38
- singleSelectionPage.steps.addQuestionInstructions();
39
- singleSelectionPage.steps.addInputToOptionsInputField(options);
40
- singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
41
- singleSelectionPage.steps.expandScoringTypeDropdown();
42
- singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
43
- //singleSelectionPage.steps.checkAllowStudentToCheckAnswerCheckbox();
44
- singleSelectionPage.steps.switchToPreviewTab();
33
+ it('User should able to save question with manually scored scoring type', () => {
34
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
35
+ });
45
36
  });
46
37
 
47
- singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
38
+ describe('Question Preview: Non Scored', () => {
39
+ abortEarlySetup();
40
+ before(() => {
41
+ cy.log('Adding question instructions and options, select Non Scored scoring type and set correct answer');
42
+ singleSelectionPage.steps.navigateToCreateQuestion('single selection');
43
+ singleSelectionPage.steps.addQuestionInstructions();
44
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
45
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
46
+ singleSelectionPage.steps.expandScoringTypeDropdown();
47
+ singleSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
48
+ //singleSelectionPage.steps.checkAllowStudentToCheckAnswerCheckbox();
49
+ singleSelectionPage.steps.switchToPreviewTab();
50
+ });
48
51
 
49
- it('When the user selects \'Grading\' view without attempting the question, no icons should be displayed besides the unattempted options, correct answer label and border should not be displayed and correct answer section should be displayed with correct answer', () => {
50
- singleSelectionPage.steps.switchToGradingView();
51
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
52
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
53
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
54
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
55
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
56
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
57
- //correct answer section
58
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
59
- singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
60
- });
52
+ singleSelectionPage.tests.verifyGradingStudentViewRadioButtonAndScoringTypeInPreviewTab('Non scored');
61
53
 
62
- it('When the user attempts the question incorrectly, then on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icons should be displayed besides unattempted options, incorrect answer border and label should not be displayed below the question preview and correct anser section should be displayed with correct answer', () => {
63
- singleSelectionPage.steps.checkOptionInPreviewTab(2);
64
- singleSelectionPage.steps.switchToGradingView();
65
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
66
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
67
- singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
68
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
69
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
70
- //correct answer section
71
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
72
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
73
- singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
74
- /*cy.log('When the user has attempted the question incorrectly clicks on \'Check answer\' button, then correct icons should be displayed besides correct response and incorrect icon should be displayed beside incorrect option, incorrect answer border and a label should not be displayed below the question preview')
75
- singleSelectionPage.steps.checkAnswer();
76
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
77
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
78
- singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
79
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
80
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
81
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
82
- });
54
+ it('When the user selects \'Grading\' view without attempting the question, no icons should be displayed besides the unattempted options, correct answer label and border should not be displayed and correct answer section should be displayed with correct answer', () => {
55
+ singleSelectionPage.steps.switchToGradingView();
56
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
57
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
58
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
59
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
60
+ singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
61
+ singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
62
+ //correct answer section
63
+ singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
64
+ singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
65
+ });
83
66
 
84
- it('When user attempts the question correctly, then on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, no icons should be displayed besides unattempted responses, correct answer border, a label and correct answer section should not be displayed below the question preview', () => {
85
- singleSelectionPage.steps.resetQuestionPreview();
86
- singleSelectionPage.steps.checkOptionInPreviewTab(1);
87
- singleSelectionPage.steps.switchToGradingView();
88
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
89
- singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
90
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
91
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
92
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
93
- singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
94
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
95
- singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
96
- /*cy.log('When the user has attempted the question with correct responses and clicks on \'Check answer\' button, then correct icon should be displayed besides correct response, correct answer border and a label should not be displayed below the question preview')
97
- singleSelectionPage.steps.checkAnswer();
98
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
99
- singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
100
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
101
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
102
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
103
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
104
- });
67
+ it('When the user attempts the question incorrectly, then on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icons should be displayed besides unattempted options, incorrect answer border and label should not be displayed below the question preview and correct anser section should be displayed with correct answer', () => {
68
+ singleSelectionPage.steps.checkOptionInPreviewTab(2);
69
+ singleSelectionPage.steps.switchToGradingView();
70
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
71
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
72
+ singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
73
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
74
+ singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
75
+ //correct answer section
76
+ singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
77
+ singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
78
+ singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
79
+ /*cy.log('When the user has attempted the question incorrectly clicks on \'Check answer\' button, then correct icons should be displayed besides correct response and incorrect icon should be displayed beside incorrect option, incorrect answer border and a label should not be displayed below the question preview')
80
+ singleSelectionPage.steps.checkAnswer();
81
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
82
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
83
+ singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
84
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
85
+ singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
86
+ singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
87
+ });
105
88
 
106
- it('User should able to save question with non scored scoring type', () => {
107
- singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
89
+ it('When user attempts the question correctly, then on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, no icons should be displayed besides unattempted responses, correct answer border, a label and correct answer section should not be displayed below the question preview', () => {
90
+ singleSelectionPage.steps.resetQuestionPreview();
91
+ singleSelectionPage.steps.checkOptionInPreviewTab(1);
92
+ singleSelectionPage.steps.switchToGradingView();
93
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
94
+ singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
95
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
96
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
97
+ singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
98
+ singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
99
+ singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
100
+ singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+ /*cy.log('When the user has attempted the question with correct responses and clicks on \'Check answer\' button, then correct icon should be displayed besides correct response, correct answer border and a label should not be displayed below the question preview')
102
+ singleSelectionPage.steps.checkAnswer();
103
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
104
+ singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
105
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
106
+ singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
107
+ singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
108
+ singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();*/
109
+ });
110
+
111
+ it('User should able to save question with non scored scoring type', () => {
112
+ singleSelectionPage.steps.saveAQuestionAndVerifySnackbar();
113
+ });
108
114
  });
109
115
  });
@@ -58,12 +58,16 @@ describe('Create Item page - Single selection grid', () => {
58
58
  singleSelectionGridPage.steps.verifyCorrectAnswerSectionExist();
59
59
  })
60
60
  });
61
-
61
+
62
62
  describe('Question Preview: Non Scored - Save as you go', () => {
63
63
  abortEarlySetup();
64
64
  before(() => {
65
65
  singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
66
66
  cy.barsPreLoaderWait();
67
+ singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
68
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
69
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
70
+ singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
67
71
  });
68
72
 
69
73
  it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
@@ -23,8 +23,8 @@ const selectors = {
23
23
  return cy.get('[aria-labelledby*="Font-Size-dropdown-label"] [role="option"]')
24
24
  }
25
25
  },
26
- fontSizeListOptionLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label"] li[role="option"] .dropdown-label-text'),
27
- fontSizesLabels: () => cy.get('[aria-labelledby="Font-Size-dropdown-label"] li[role="option"] .dropdown-post-label-text'),
26
+ fontSizeListOptionLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-label-text'),
27
+ fontSizesLabels: () => cy.get('[aria-labelledby*="Font-Size-dropdown-label"] li[role="option"] .dropdown-post-label-text'),
28
28
  }
29
29
 
30
30
  const steps = {
@@ -147,6 +147,7 @@ const steps = {
147
147
 
148
148
  expandRoundingDropdown: () => {
149
149
  autoScoredScoringSectionMultiResponseType.roundingDropdown()
150
+ .trigger('mouseover')
150
151
  .click();
151
152
  },
152
153
 
@@ -63,6 +63,7 @@ const steps = {
63
63
 
64
64
  expandOptionNumerationDropdown: () => {
65
65
  mcqAdditionalSettingsBase.optionNumerationDropdown()
66
+ .trigger('mouseover')
66
67
  .click();
67
68
  },
68
69
 
@@ -81,7 +81,6 @@ const steps = {
81
81
  scoringSectionBaseEditTab.scoringTypeDropdownListOptions(convertedString)
82
82
  .should('be.visible') // Ensure the dropdown option is visible
83
83
  .click();
84
- cy.wait(2000); // Wait for the dropdown to close
85
84
  utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
86
85
  },
87
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.370-IEI-5718-and-IEI-5740-manualAndNonscoredScript-d0c51ae.0",
3
+ "version": "1.0.370",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -52,4 +52,4 @@
52
52
  "devDependencies": {
53
53
  "@applitools/eyes-cypress": "^3.47.0"
54
54
  }
55
- }
55
+ }