itemengine-cypress-automation 1.0.592-IEI-7055-cypress-8ac4da8.0 → 1.0.593-IEI-7195-92ba6d8.0

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.
@@ -4,6 +4,7 @@ import utilities from "../../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
6
  let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
7
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === true;
7
8
  const views = utilities.getViews(gradingAndCorrectAnsView);
8
9
  let itemReferenceID = "";
9
10
  const barBackgroundColor = ['rgb(46, 169, 89)', 'rgb(6, 117, 244)', 'rgb(219, 124, 0)', 'rgb(156, 105, 39)', 'rgb(219, 60, 0)'];
@@ -103,10 +104,12 @@ describe('Create item page - Charts - Bar horizontal orientation: Grading view,
103
104
  }
104
105
  });
105
106
 
106
- it('Correct answer label should be displayed', () => {
107
- utilities.verifyInnerText(chartsBarPage.correctAnswersLabel(), 'Correct answers');
108
- utilities.verifyElementVisibilityState(chartsBarPage.correctAnswersLabel(), 'visible');
109
- });
107
+ if (!alternativeAnswerCheck) {
108
+ it('Correct answer label should be displayed', () => {
109
+ utilities.verifyInnerText(chartsBarPage.correctAnswersLabel(), 'Correct answers');
110
+ utilities.verifyElementVisibilityState(chartsBarPage.correctAnswersLabel(), 'visible');
111
+ });
112
+ }
110
113
 
111
114
  it('Correct answer should be displayed in the correct answer section', () => {
112
115
  chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 0, barValue: 2, range: 20 });
@@ -1,6 +1,8 @@
1
1
  import { chartsBarPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
 
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
5
+
4
6
  describe('Create Item page - Charts Bar', () => {
5
7
  before(() => {
6
8
  cy.loginAs('admin');
@@ -27,7 +29,11 @@ describe('Create Item page - Charts Bar', () => {
27
29
  chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 3, range: 10 });
28
30
  chartsBarPage.steps.switchToGradingView();
29
31
  chartsBarPage.steps.verifyAnswerStatusBannerExist();
30
- chartsBarPage.steps.verifyCorrectAnswerSectionExist();
32
+ if (!alternativeAnswerCheck) {
33
+ chartsBarPage.steps.verifyCorrectAnswerSectionExist();
34
+ } else {
35
+ chartsBarPage.steps.verifyAlternateAnswerSectionExist();
36
+ }
31
37
  });
32
38
  });
33
39
  });
@@ -4,6 +4,7 @@ import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
6
  let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
7
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
7
8
  const views = utilities.getViews(gradingAndCorrectAnsView);
8
9
  let itemReferenceID = "";
9
10
  const barBackgroundColor = ['rgb(46, 169, 89)', 'rgb(6, 117, 244)', 'rgb(219, 124, 0)', 'rgb(156, 105, 39)', 'rgb(219, 60, 0)'];
@@ -102,10 +103,12 @@ describe('Create item page - Charts - Bar: Grading view, Correct answer view con
102
103
  }
103
104
  });
104
105
 
105
- it('Correct answer label should be displayed', () => {
106
- utilities.verifyInnerText(chartsBarPage.correctAnswersLabel(), 'Correct answers');
107
- utilities.verifyElementVisibilityState(chartsBarPage.correctAnswersLabel(), 'visible');
108
- });
106
+ if (!alternativeAnswerCheck) {
107
+ it('Correct answer label should be displayed', () => {
108
+ utilities.verifyInnerText(chartsBarPage.correctAnswersLabel(), 'Correct answers');
109
+ utilities.verifyElementVisibilityState(chartsBarPage.correctAnswersLabel(), 'visible');
110
+ });
111
+ }
109
112
 
110
113
  it('Charts bar: Vertical - Correct answer should be displayed in the correct answer section', () => {
111
114
  chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 0, barValue: 2, range: 20 });
@@ -4,6 +4,7 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  const css = Cypress.env('css');
5
5
  const barBackgroundColor = ['rgb(46, 169, 89)', 'rgb(6, 117, 244)', 'rgb(219, 124, 0)'];
6
6
  const barLabels = ['Bar 1', 'Bar 2', 'Bar 3']
7
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === true;
7
8
 
8
9
  describe('Select chart type - Chart', () => {
9
10
  before(() => {
@@ -339,10 +340,12 @@ describe('Select chart type - Chart', () => {
339
340
  chartsBarPage.steps.verifyBarHeightInSelectChartType({ barIndex: 2, barValue: 0, range: 20 });
340
341
  });
341
342
 
342
- it('When user sets a bar and does not lock the bar then it should not be reflected in specify correct answer section', () => {
343
- chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 2, value: 2, range: 20 });
344
- chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 2, barValue: 0, range: 20 });
345
- });
343
+ if (!alternativeAnswerCheck) {
344
+ it('When user sets a bar and does not lock the bar then it should not be reflected in specify correct answer section', () => {
345
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 2, value: 2, range: 20 });
346
+ chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 2, barValue: 0, range: 20 });
347
+ });
348
+ }
346
349
 
347
350
  //Bar label
348
351
  it('When user clicks on bar label button then popup should be displayed with title \'Bar label\' and \'Add label\' label with input field should be displayed along with \'Save\' and \'Cancel\' button', () => {
@@ -5,6 +5,7 @@ const css = Cypress.env('css');
5
5
 
6
6
  let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
7
7
  const views = utilities.getViews(gradingAndCorrectAnsView);
8
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
8
9
  let itemReferenceID = "";
9
10
 
10
11
 
@@ -101,10 +102,12 @@ describe('Create item page - Charts - Line: Grading view, Correct answer view co
101
102
  chartsLinePage.steps.verifyPointValueInPreviewTab({ pointIndex: 1, value: 2, range: 20 });
102
103
  });
103
104
 
104
- it('Correct answer label should be displayed', () => {
105
- utilities.verifyInnerText(chartsLinePage.correctAnswersLabel(), 'Correct answers');
106
- utilities.verifyElementVisibilityState(chartsLinePage.correctAnswersLabel(), 'visible');
107
- });
105
+ if (!alternativeAnswerCheck) {
106
+ it('Correct answer label should be displayed', () => {
107
+ utilities.verifyInnerText(chartsLinePage.correctAnswersLabel(), 'Correct answers');
108
+ utilities.verifyElementVisibilityState(chartsLinePage.correctAnswersLabel(), 'visible');
109
+ });
110
+ }
108
111
 
109
112
  it('Correct answer should be displayed in the correct answer section', () => {
110
113
  chartsLinePage.steps.verifyPointValueInCorrectAnswerSection({ pointIndex: 0, value: 2, range: 20 });
@@ -1373,6 +1373,11 @@ const steps = {
1373
1373
  .should('be.visible');
1374
1374
  },
1375
1375
 
1376
+ verifyAlternateAnswerSectionExist: () => {
1377
+ chartsBarPage.correctAnswerlabelWrapper()
1378
+ .should('be.visible');
1379
+ },
1380
+
1376
1381
  verifyCorrectAnswerSectionNotExist: () => {
1377
1382
  chartsBarPage.correctAnswersLabel()
1378
1383
  .should('not.exist');
@@ -39,6 +39,7 @@ const selectors = {
39
39
 
40
40
  //correct answer section
41
41
  correctAnswersLabel: () => cy.get('[class*="CorrectAnswerHeader"]:visible'),
42
+ correctAnswerlabelWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]'),
42
43
  correctIcon: () => cy.get('.icon-correct'),
43
44
  incorrectIcon: () => cy.get('.icon-incorrect'),
44
45
  correctIncorrectAnswerTextWrapper: () => cy.get('[class*="AnswerStatusWrapper"]'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.592-IEI-7055-cypress-8ac4da8.0",
3
+ "version": "1.0.593-IEI-7195-92ba6d8.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {