itemengine-cypress-automation 1.0.579-IEI-7178-6f40615.0 → 1.0.579-IEI-7193-main-6a7df51.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.
Files changed (28) hide show
  1. package/cypress/config-files/ilprod.json +2 -1
  2. package/cypress/config-files/ilqa.json +2 -1
  3. package/cypress/config-files/ilstage.json +2 -1
  4. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +17 -0
  5. package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +18 -0
  6. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
  7. package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +18 -0
  8. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -11
  9. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +2 -11
  10. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -11
  11. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingWeightsBasic.js +7 -7
  12. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +3 -3
  13. package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +18 -0
  14. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
  15. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +17 -0
  16. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +16 -0
  17. package/cypress/e2e/ILC/dataApi/fetchQuestion.js +39 -0
  18. package/cypress/e2e/ILC/dataApi/saveQuestions.js +53 -0
  19. package/cypress/pages/components/ckEditorToolbar.js +20 -0
  20. package/cypress/pages/components/draggableOptionContainer.js +14 -0
  21. package/cypress/pages/components/gridQuestionCommonComponent.js +17 -1
  22. package/cypress/pages/components/optionsWrapperComponent.js +33 -2
  23. package/cypress/pages/components/questionInputFieldComponent.js +18 -2
  24. package/cypress/pages/matchingPage.js +18 -0
  25. package/cypress/pages/numberLineLabelPage.js +1 -0
  26. package/cypress/pages/shortTextResponsePage.js +7 -35
  27. package/cypress/pages/textSelectionPage.js +17 -1
  28. package/package.json +1 -1
@@ -13,6 +13,7 @@
13
13
  "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
14
  "migration_usernme": "ilc-prod-content-user",
15
15
  "migration_password": "Oj2kTWQM7ZRmegmS",
16
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false"
16
+ "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false",
17
+ "ENABLE_EXPAND_IMAGE_ENHANCEMENT": "false"
17
18
  }
18
19
  }
@@ -13,6 +13,7 @@
13
13
  "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
14
  "migration_usernme": "demo-technical-tester",
15
15
  "migration_password": "SXYeokWOoTuwEg2w",
16
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "true"
16
+ "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "true",
17
+ "ENABLE_EXPAND_IMAGE_ENHANCEMENT": "true"
17
18
  }
18
19
  }
@@ -11,6 +11,7 @@
11
11
  "admin_username": "demouser-ilc",
12
12
  "admin_password": "T6b9FK0pC6Tg8wDz",
13
13
  "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false"
14
+ "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false",
15
+ "ENABLE_EXPAND_IMAGE_ENHANCEMENT": "false"
15
16
  }
16
17
  }
@@ -3,6 +3,7 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
  const promptArray = ['Land pollution', 'Water pollution', 'Air pollution'];
6
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
6
7
 
7
8
  describe('Create Item page - Matching : Question Instructions and prompt section', () => {
8
9
  before(() => {
@@ -272,6 +273,22 @@ describe('Create Item page - Matching : Question Instructions and prompt section
272
273
  utilities.verifyElementVisibilityState(matchingPage.dropzoneColumnAndPromptHeaderWrapperPreviewTab(), 'notExist');
273
274
  });
274
275
 
276
+ if (imageExpandEnhancement === 'true') {
277
+ it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
278
+ matchingPage.steps.switchToEditTab();
279
+ matchingPage.steps.clearPromptInputField(0);
280
+ matchingPage.steps.focusInPromptInputField(0);
281
+ matchingPage.steps.selectImageOptionFromCKEditorToolbar();
282
+ matchingPage.steps.addImageToInputField();
283
+ matchingPage.steps.switchToPreviewTab();
284
+ matchingPage.steps.verifyExpandIconInImage();
285
+ matchingPage.steps.clickExpandIconInImage();
286
+ utilities.verifyInnerText(matchingPage.closeImagePopup(), 'Close');
287
+ matchingPage.steps.closeImagePopup();
288
+ matchingPage.steps.verifyExpandIconInImage();
289
+ });
290
+ }
291
+
275
292
  it('CSS of added prompt in \'Preview\' tab table', { tags: 'css' }, () => {
276
293
  utilities.verifyCSS(matchingPage.promptContainerPreviewTab().find('.question-text-wrapper'), {
277
294
  'color': css.color.text,
@@ -6,6 +6,7 @@ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Stu
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  var itemReferenceID = "";
8
8
  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'];
9
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
10
 
10
11
  describe('Create item page - Multiple selection: Preview contents', () => {
11
12
  before(() => {
@@ -91,6 +92,23 @@ describe('Create item page - Multiple selection: Preview contents', () => {
91
92
  multipleSelectionPage.steps.verifyEquationTextInPreviewTab(2);
92
93
  cy.eyesCheckWindow(`Multiple selection - ${view} - Image, Bold Text, and Equation Display`);
93
94
  });
95
+ if (imageExpandEnhancement === 'true') {
96
+ it('Image expand icon should be visible on the image in option', () => {
97
+ multipleSelectionPage.steps.verifyImageInPreviewTab(0);
98
+ multipleSelectionPage.steps.verifyExpandIconInImage();
99
+ });
100
+
101
+ it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
102
+ multipleSelectionPage.steps.verifyImageInPreviewTab(0);
103
+ multipleSelectionPage.steps.clickExpandIconInImage();
104
+ utilities.verifyInnerText(multipleSelectionPage.closeImagePopup(), 'Close');
105
+ });
106
+
107
+ it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
108
+ multipleSelectionPage.steps.closeImagePopup();
109
+ multipleSelectionPage.steps.verifyExpandIconInImage();
110
+ });
111
+ }
94
112
 
95
113
  if (view !== 'Grading view' && view !== 'Correct answer view') {
96
114
  it(`All the options should be in unchecked state`, () => {
@@ -6,6 +6,7 @@ const css = Cypress.env('css');
6
6
  let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
7
7
  const views = utilities.getViews(previewContentViews);
8
8
  var itemReferenceID = "";
9
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
10
 
10
11
  describe('Create item page - Multiple selection grid: Preview contents', () => {
11
12
  before(() => {
@@ -94,6 +95,24 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
94
95
  utilities.verifyInnerText(multipleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
95
96
  utilities.verifyElementVisibilityState(multipleSelectionGridPage.questionInstructionsText(), 'visible');
96
97
  });
98
+
99
+ if (imageExpandEnhancement === 'true') {
100
+ it('Image expand icon should be visible on the image in option', () => {
101
+ multipleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
102
+ multipleSelectionGridPage.steps.verifyExpandIconInImage();
103
+ });
104
+
105
+ it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
106
+ multipleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
107
+ multipleSelectionGridPage.steps.clickExpandIconInImage();
108
+ utilities.verifyInnerText(multipleSelectionGridPage.closeImagePopup(), 'Close');
109
+ });
110
+
111
+ it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
112
+ multipleSelectionGridPage.steps.closeImagePopup();
113
+ multipleSelectionGridPage.steps.verifyExpandIconInImage();
114
+ });
115
+ }
97
116
 
98
117
  it(`Multiple selection grid - The question grid as set by the user should be displayed in the ${view}`, () => {
99
118
  multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
@@ -3,6 +3,7 @@ import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
6
7
  const labels = ['Label 1', 'Label 2', 'Label 3']
7
8
  describe('Create Item page - Number line label : Question instructions and label section', () => {
8
9
  before(() => {
@@ -41,6 +42,23 @@ describe('Create Item page - Number line label : Question instructions and label
41
42
  utilities.verifyTextContent(numberLineLabelPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
42
43
  });
43
44
 
45
+ if (imageExpandEnhancement === 'true') {
46
+ it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
47
+ numberLineLabelPage.steps.switchToEditTab();
48
+ numberLineLabelPage.steps.clearQuestionInstructionsInputField();
49
+ numberLineLabelPage.steps.focusInQuestionInstructionsInputField();
50
+ numberLineLabelPage.steps.selectImageOptionFromCKEditorToolbar();
51
+ numberLineLabelPage.steps.addImageToInputField();
52
+ numberLineLabelPage.steps.focusOutQuestionInstructionsInputField();
53
+ numberLineLabelPage.steps.switchToPreviewTab();
54
+ numberLineLabelPage.steps.verifyExpandIconInImage();
55
+ numberLineLabelPage.steps.clickExpandIconInImage();
56
+ utilities.verifyInnerText(numberLineLabelPage.closeImagePopup(), 'Close');
57
+ numberLineLabelPage.steps.closeImagePopup();
58
+ numberLineLabelPage.steps.verifyExpandIconInImage();
59
+ });
60
+ }
61
+
44
62
  //Need to remove this comment once https://redmine.zeuslearning.com/issues/578531 is resolved
45
63
  // numberLineLabelPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
46
64
  });
@@ -1,7 +1,6 @@
1
1
  import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  const css = Cypress.env('css');
4
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
5
4
 
6
5
  describe('Create item page - Short text response: All or nothing with alternative answer', () => {
7
6
  before(() => {
@@ -25,11 +24,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
25
24
  it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and answer input field should have incorrect answer border and correct answer section should be displayed below response input field', () => {
26
25
  shortTextResponsePage.steps.switchToGradingView();
27
26
  shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
28
- if (alternativeAnswerCheck) {
29
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Fossil fuel combustion', 20, 'Buildings', 10);
30
- } else {
31
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
32
- }
27
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
33
28
  shortTextResponsePage.steps.switchToStudentView();
34
29
  });
35
30
 
@@ -61,11 +56,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
61
56
  shortTextResponsePage.steps.switchToGradingView();
62
57
  shortTextResponsePage.steps.verifyIncorrectIcon();
63
58
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
64
- if (alternativeAnswerCheck) {
65
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Fossil fuel combustion', 20, 'Buildings', 10);
66
- } else {
67
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
68
- }
59
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
69
60
  shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
70
61
  });
71
62
  });
@@ -1,7 +1,6 @@
1
1
  import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  const css = Cypress.env('css');
4
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
5
4
 
6
5
  describe('Create item page - Short text response: All or nothing with alternative answer', () => {
7
6
  before(() => {
@@ -25,11 +24,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
25
24
  it('When the user switches to \'Grading\' view without attempting the question, then incorrect border and correct answer section should be displayed', () => {
26
25
  shortTextResponsePage.steps.switchToGradingView();
27
26
  shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
28
- if (alternativeAnswerCheck) {
29
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Buildings', 20, 'Fossil fuel combustion', 20);
30
- } else {
31
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
32
- }
27
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
33
28
  shortTextResponsePage.steps.switchToStudentView();
34
29
  });
35
30
 
@@ -61,11 +56,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
61
56
  shortTextResponsePage.steps.switchToGradingView();
62
57
  shortTextResponsePage.steps.verifyIncorrectIcon();
63
58
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
64
- if (alternativeAnswerCheck) {
65
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Buildings', 20, 'Fossil fuel combustion', 20);
66
- } else {
67
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
68
- }
59
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
69
60
  shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
70
61
  });
71
62
  });
@@ -1,7 +1,6 @@
1
1
  import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  const css = Cypress.env('css');
4
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
5
4
 
6
5
  describe('Create item page - Short text response: All or nothing with alternative answer', () => {
7
6
  before(() => {
@@ -26,11 +25,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
26
25
  shortTextResponsePage.steps.switchToGradingView();
27
26
  shortTextResponsePage.steps.verifyCorrectIncorrectIconNotVisibleGradingView();
28
27
  shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
29
- if (alternativeAnswerCheck) {
30
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Buildings', 20, 'Fossil fuel combustion', 10);
31
- } else {
32
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
33
- }
28
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
34
29
  shortTextResponsePage.steps.switchToStudentView();
35
30
  });
36
31
 
@@ -66,11 +61,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
66
61
  shortTextResponsePage.steps.switchToGradingView();
67
62
  shortTextResponsePage.steps.verifyIncorrectIcon();
68
63
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
69
- if (alternativeAnswerCheck) {
70
- shortTextResponsePage.steps.verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper('Buildings', 20, 'Fossil fuel combustion', 10);
71
- } else {
72
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
73
- }
64
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
74
65
  });
75
66
 
76
67
  shortTextResponsePage.tests.verifyIncorrectAnswerLabelAndBorderCSSAndA11y('short text response');
@@ -21,7 +21,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
21
21
  it('When the user switches to \'Grading\' view without attempting the question, then incorrect border and correct answer section should not be displayed', () => {
22
22
  shortTextResponsePage.steps.switchToGradingView();
23
23
  shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
24
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
24
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
25
25
  shortTextResponsePage.steps.switchToStudentView();
26
26
  });
27
27
 
@@ -42,7 +42,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
42
42
  shortTextResponsePage.steps.switchToGradingView();
43
43
  shortTextResponsePage.steps.verifyIncorrectIcon();
44
44
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
45
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
45
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
46
46
  shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
47
47
  });
48
48
  });
@@ -67,7 +67,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
67
67
  shortTextResponsePage.steps.switchToGradingView();
68
68
  shortTextResponsePage.steps.verifyIncorrectIcon();
69
69
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
70
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
70
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
71
71
 
72
72
  });
73
73
 
@@ -80,7 +80,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
80
80
  shortTextResponsePage.steps.switchToGradingView();
81
81
  shortTextResponsePage.steps.verifyIncorrectIcon();
82
82
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
83
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
83
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
84
84
  });
85
85
 
86
86
  it('When the user attempts the question correctly, then the user should be awarded 20 points and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed in question preview', () => {
@@ -112,7 +112,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
112
112
  shortTextResponsePage.steps.verifyPreviewScore(5, 20);
113
113
  shortTextResponsePage.steps.switchToGradingView();
114
114
  shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
115
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
115
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
116
116
  });
117
117
 
118
118
  it('When the user sets minimum scoring to \'Award minimum score\', allots minimum points and attempts the question incorrectly, then the user should be awarded with minimum points', () => {
@@ -121,7 +121,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
121
121
  shortTextResponsePage.steps.switchToGradingView();
122
122
  shortTextResponsePage.steps.verifyIncorrectIcon();
123
123
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
124
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
124
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
125
125
  });
126
126
 
127
127
  it('When the user sets minimum scoring to \'Award minimum score\', allots minimum points and attempts the question correctly, then the user should be awarded with 20 points', () => {
@@ -149,7 +149,7 @@ describe('Create item page - Short text response: All or nothing with alternativ
149
149
  shortTextResponsePage.steps.switchToGradingView();
150
150
  shortTextResponsePage.steps.verifyIncorrectIcon();
151
151
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
152
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
152
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
153
153
  });
154
154
 
155
155
  it('When the user sets minimum scoring to \'Award minimum score only if attempted\', allots minimum points and attempts the question correctly, then the user should be awarded with 20 points', () => {
@@ -7,7 +7,6 @@ let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
7
  const views = utilities.getViews(correctAnswerViews);
8
8
  const css = Cypress.env('css');
9
9
  var itemReferenceID = "";
10
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
11
10
 
12
11
  describe('Create item page - Short text response: All or nothing', () => {
13
12
  before(() => {
@@ -111,7 +110,7 @@ describe('Create item page - Short text response: All or nothing', () => {
111
110
  }
112
111
  //Need to remove comment once https://redmine.zeuslearning.com/issues/576511 is resolved
113
112
  // shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
114
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
113
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
115
114
  });
116
115
 
117
116
  it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed besides incorrect response, incorrect answer border around response field and correct answer should be displayed in the question preview', () => {
@@ -121,7 +120,7 @@ describe('Create item page - Short text response: All or nothing', () => {
121
120
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
122
121
  studentViewPage.steps.clickOnGoToGradingViewButton()
123
122
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
124
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings', 20);
123
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
125
124
  }
126
125
  if (view === 'Question preview' || view === 'Item preview') {
127
126
  shortTextResponsePage.steps.switchToGradingView();
@@ -282,6 +281,7 @@ describe('Create item page - Short text response: All or nothing', () => {
282
281
  shortTextResponsePage.steps.checkNonScoredScoringLabel();
283
282
  shortTextResponsePage.steps.switchToGradingView();
284
283
  };
284
+ utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
285
285
  shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Urbanization');
286
286
  });
287
287
 
@@ -6,6 +6,7 @@ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Stu
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  var itemReferenceID = "";
8
8
  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'];
9
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
9
10
 
10
11
  describe('Create item page - Single selection: Preview contents', () => {
11
12
  before(() => {
@@ -94,6 +95,23 @@ describe('Create item page - Single selection: Preview contents', () => {
94
95
  singleSelectionPage.steps.verifyEquationTextInPreviewTab(3);
95
96
  cy.eyesCheckWindow(`Single selection - ${view} - Options with image, equation, bold text, and link`);
96
97
  });
98
+ if (imageExpandEnhancement === 'true') {
99
+ it('Image expand icon should be visible on the image in option', () => {
100
+ singleSelectionPage.steps.verifyImageInPreviewTab(0);
101
+ singleSelectionPage.steps.verifyExpandIconInImage();
102
+ });
103
+
104
+ it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
105
+ singleSelectionPage.steps.verifyImageInPreviewTab(0);
106
+ singleSelectionPage.steps.clickExpandIconInImage();
107
+ utilities.verifyInnerText(singleSelectionPage.closeImagePopup(), 'Close');
108
+ });
109
+
110
+ it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
111
+ singleSelectionPage.steps.closeImagePopup();
112
+ singleSelectionPage.steps.verifyExpandIconInImage();
113
+ });
114
+ }
97
115
 
98
116
  if (view !== 'Grading view' && view !== 'Correct answer view') {
99
117
  it(`All the options should be in unchecked state`, () => {
@@ -5,6 +5,7 @@ import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
6
  let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
7
7
  const views = utilities.getViews(previewContentViews);
8
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
8
9
  var itemReferenceID = "";
9
10
  describe('Create item page - Single selection grid: Preview contents', () => {
10
11
  before(() => {
@@ -93,6 +94,24 @@ describe('Create item page - Single selection grid: Preview contents', () => {
93
94
  utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
94
95
  utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsText(), 'visible');
95
96
  });
97
+
98
+ if (imageExpandEnhancement === 'true') {
99
+ it('Image expand icon should be visible on the image in option', () => {
100
+ singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
101
+ singleSelectionGridPage.steps.verifyExpandIconInImage();
102
+ });
103
+
104
+ it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
105
+ singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
106
+ singleSelectionGridPage.steps.clickExpandIconInImage();
107
+ utilities.verifyInnerText(singleSelectionGridPage.closeImagePopup(), 'Close');
108
+ });
109
+
110
+ it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
111
+ singleSelectionGridPage.steps.closeImagePopup();
112
+ singleSelectionGridPage.steps.verifyExpandIconInImage();
113
+ });
114
+ }
96
115
 
97
116
  it(`Single selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
98
117
  singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
@@ -3,6 +3,7 @@ import { commonComponents } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const css = Cypress.env('css');
6
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
6
7
 
7
8
  describe('Create item page - Text entry math: Question instructions, Add structure - Question input field', () => {
8
9
  before(() => {
@@ -197,6 +198,22 @@ describe('Create item page - Text entry math: Question instructions, Add structu
197
198
  textEntryMathPage.steps.switchToPreviewTab();
198
199
  utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), 1);
199
200
  });
201
+
202
+ if (imageExpandEnhancement === 'true') {
203
+ it('When user add large image in question input field, user should be able to expand the image in preview tab', () => {
204
+ textEntryMathPage.steps.switchToEditTab();
205
+ textEntryMathPage.steps.focusInQuestionInputField();
206
+ textEntryMathPage.steps.selectImageOptionFromCKEditorToolbar();
207
+ textEntryMathPage.steps.addImageToInputField();
208
+ textEntryMathPage.steps.switchToPreviewTab();
209
+ textEntryMathPage.steps.verifyExpandIconInImage();
210
+ textEntryMathPage.steps.clickExpandIconInImage();
211
+ utilities.verifyInnerText(textEntryMathPage.closeImagePopup(), 'Close');
212
+ textEntryMathPage.steps.closeImagePopup();
213
+ textEntryMathPage.steps.verifyExpandIconInImage();
214
+
215
+ });
216
+ }
200
217
  });
201
218
 
202
219
  describe('User should be able to edit incomplete authored question', () => {
@@ -3,6 +3,7 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
  const grepTags = Cypress.env('grepTags');
6
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
6
7
 
7
8
  describe('Create Item page - Text selection: Question Instructions and Question section', () => {
8
9
  before(() => {
@@ -191,6 +192,21 @@ describe('Create Item page - Text selection: Question Instructions and Question
191
192
  textSelectionPage.steps.verifyBoldTextInPreviewTab();
192
193
  textSelectionPage.steps.verifyLinkInPreviewTab();
193
194
  });
195
+ if (imageExpandEnhancement === 'true') {
196
+ it('Image expand icon should be visible on the image in option', () => {
197
+ textSelectionPage.steps.verifyExpandIconInImage();
198
+ });
199
+
200
+ it('When the user clicks on the expand button then the image should be expanded and a close button should be displayed', () => {
201
+ textSelectionPage.steps.clickExpandIconInImage();
202
+ utilities.verifyInnerText(textSelectionPage.closeImagePopup(), 'Close');
203
+ });
204
+
205
+ it('When the user clicks on the close button the expanded option should be minimized and the expand icon should be displayed on image again in the option', () => {
206
+ textSelectionPage.steps.closeImagePopup();
207
+ textSelectionPage.steps.verifyExpandIconInImage();
208
+ });
209
+ }
194
210
 
195
211
  //Failing due to https://redmine.zeuslearning.com/issues/537907
196
212
  it('CSS of \'Preview tab\' when image, equation, bold text and link are added', { tags: 'css' }, () => {
@@ -402,4 +402,43 @@ describe('Get Question Data API cases', () => {
402
402
  .eq(1)
403
403
  .should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": 0,\n \"next_token\": null,\n \"timestamp\": ${timestamp}\n },\n \"data\": []\n}\n`);
404
404
  });
405
+
406
+ it('Entering a request for a text selection question type', () => {
407
+ cy.get('textarea[class="body-param__text"]')
408
+ .clear()
409
+ .fill(`{\n "item_references": [],\n "references": [],\n "types": ["text selection"],\n "limit": 1,\n "sort_field": "created",\n "sort": "desc"\n}\n`);
410
+ cy.get('.execute')
411
+ .click();
412
+ cy.wait(2000);
413
+ cy.get('.loading-container')
414
+ .should('not.exist');
415
+ cy.get('td[class="response-col_status"]')
416
+ .eq(0)
417
+ .should('have.text', '200');
418
+ cy.get('td.response-col_description')
419
+ .find('code.language-json')
420
+ .eq(0)
421
+ .invoke('text')
422
+ .then((text) => {
423
+ const jsonResponse = JSON.parse(text);
424
+ expect(jsonResponse.data[0]).to.include.keys(
425
+ 'reference',
426
+ 'type',
427
+ 'content',
428
+ 'correct_answer',
429
+ 'scoring',
430
+ 'settings',
431
+ );
432
+
433
+ expect(jsonResponse.data[0].settings).to.include.keys(
434
+ 'additional_settings',
435
+ 'print_layout_settings',
436
+ 'student_view_settings',
437
+ 'style_and_layout_customize_settings',
438
+ 'tool_settings',
439
+ );
440
+
441
+ expect(jsonResponse.data[0].type).to.equal('text selection');
442
+ });
443
+ });
405
444
  });
@@ -235,4 +235,57 @@ describe('Set Question Data API cases', () => {
235
235
  .eq(7)
236
236
  .should('have.text',"true");
237
237
  });
238
+
239
+ it('Creating text selection question and resource from save API', () => {
240
+ unique_reference_id_1 = uuid();
241
+ unique_reference_id_2 = uuid();
242
+ cy.visit('/item-engine/data-api/item-bank/save-questions');
243
+ cy.get('.try-out__btn')
244
+ .click();
245
+ cy.get('textarea[class="body-param__text"]')
246
+ .clear()
247
+ .fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken0","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
248
+ cy.get('.execute')
249
+ .click();
250
+ cy.wait(2000);
251
+ cy.get('.loading-container')
252
+ .should('not.exist');
253
+ cy.visit('/item-engine/data-api/item-bank/save-resources');
254
+ cy.get('.try-out__btn')
255
+ .click();
256
+ cy.get('textarea[class="body-param__text"]')
257
+ .clear()
258
+ .fill(`{\n "resources": [\n {\n "type": 1,\n "data": {\n "type": "Passage",\n "heading": "Passage created via save resources data API",\n "content": "This is content of the passage"\n },\n "reference": "${unique_reference_id_2}"\n }\n ],\n "organisation_id": "${Cypress.env('organisation_id')}",\n "meta": {\n "user": {\n "id": "dfbb6366-d88d-416d-9d9c-7ee6420817b3",\n "first_name": "fname",\n "last_name": "lname",\n "email": "user@demo.com"\n }\n }\n}\n`);
259
+ cy.get('.execute')
260
+ .click();
261
+ cy.wait(2000);
262
+ cy.get('.loading-container')
263
+ .should('not.exist');
264
+ });
265
+
266
+ it('Throw validation error while creating text selection question', () => {
267
+ unique_reference_id_1 = uuid();
268
+ cy.visit('/item-engine/data-api/item-bank/save-questions');
269
+ cy.get('.try-out__btn')
270
+ .click();
271
+ cy.get('textarea[class="body-param__text"]')
272
+ .clear()
273
+ .fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken6","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
274
+ cy.get('.execute')
275
+ .click();
276
+ cy.wait(2000);
277
+ cy.get('.loading-container')
278
+ .should('not.exist');
279
+ cy.get('td[class="response-col_status"]')
280
+ .eq(0)
281
+ .should('have.text', '200');
282
+ cy.get('td.response-col_description')
283
+ .find('code.language-json')
284
+ .eq(0)
285
+ .invoke('text')
286
+ .then((text) => {
287
+ const jsonResponse = JSON.parse(text);
288
+ expect(jsonResponse.meta.message).to.equal('Invalid answer "optiontoken6" in question 1. Must match one of the token IDs.');
289
+ });
290
+ });
238
291
  });
@@ -1,4 +1,5 @@
1
1
  import constants from "../../fixtures/constants";
2
+ import utilities from "../../support/helpers/utilities";
2
3
 
3
4
  const selectors = {
4
5
  imageIcon: () => cy.get('a[title="Insert Image"]:visible'),
@@ -26,9 +27,28 @@ const selectors = {
26
27
  linkDialogboxURLInputField: () => cy.get('input[class*="cke_dialog_ui_input_text"]:visible').eq(1),
27
28
  sourceIcon: () => cy.get('a[title="Source"]:visible'),
28
29
  sourceTextArea: () => cy.get('textarea.cke_source'),
30
+ expandIconButton: () => cy.get('.expand-image-btn'),
31
+ closeImagePopup: () => cy.get('.close-popup-btn'),
29
32
  }
30
33
 
31
34
  const steps = {
35
+ verifyExpandIconInImage: () => {
36
+ utilities.verifyElementVisibilityState(ckEditorToolbar.expandIconButton(), 'visible');
37
+ },
38
+
39
+ clickExpandIconInImage: () => {
40
+ ckEditorToolbar.expandIconButton()
41
+ .first()
42
+ .scrollIntoView()
43
+ .realClick();
44
+ },
45
+
46
+ closeImagePopup: () => {
47
+ ckEditorToolbar.closeImagePopup()
48
+ .click();
49
+ },
50
+
51
+
32
52
  selectBoldOptionFromCKEditorToolbar: () => {
33
53
  ckEditorToolbar.boldIcon()
34
54
  .click();
@@ -3,6 +3,7 @@ import { commonComponents } from "./commonComponents";
3
3
  import { createQuestionBasePage } from "./createQuestionBasePage";
4
4
  import { draggableOptionsSectionComponent } from "./draggableOptionsSectionComponent";
5
5
  import { optionsWrapperComponent } from "./optionsWrapperComponent";
6
+ import { ckEditorToolbar } from "./ckEditorToolbar";
6
7
  const css = Cypress.env('css');
7
8
  const options = ['option 1', 'option 2'];
8
9
  const threeOptions = ['option 1', 'option 2', 'option 3'];
@@ -453,6 +454,19 @@ const tests = {
453
454
  createQuestionBasePage.steps.switchToPreviewTab();
454
455
  draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(optionsAfterDeleting);
455
456
  });
457
+ it('When user add large image in option, the option container should have expand icon', () => {
458
+ createQuestionBasePage.steps.switchToEditTab();
459
+ optionsWrapperComponent.steps.addOption();
460
+ optionsWrapperComponent.steps.focusInOptionsInputField(2)
461
+ ckEditorToolbar.steps.selectImageOptionFromCKEditorToolbar()
462
+ ckEditorToolbar.steps.addImageToInputField();
463
+ createQuestionBasePage.steps.switchToPreviewTab();
464
+ optionsWrapperComponent.steps.verifyExpandIconInImage();
465
+ optionsWrapperComponent.steps.clickExpandIconInImage();
466
+ utilities.verifyInnerText(optionsWrapperComponent.closeImagePopup(), 'Close');
467
+ optionsWrapperComponent.steps.closeImagePopup();
468
+ optionsWrapperComponent.steps.verifyExpandIconInImage();
469
+ });
456
470
  },
457
471
 
458
472
  verifyDraggableOptionsForGroupedLayoutInSpecifyCorrectAnswerSection: () => {
@@ -158,10 +158,26 @@ const selectors = {
158
158
  colorBlock: () => cy.get('.color-grid-wrapper .color-picker-block'),
159
159
  editColorButton: () => cy.get('button[aria-label="edit color"]'),
160
160
  colorBlockSelectedIcon: () => cy.get('[class*="BtnSelectionWrapper"] svg'),
161
- optionsInputFieldInQuestionPreviewTab: () => cy.get('.cell-content-text')
161
+ optionsInputFieldInQuestionPreviewTab: () => cy.get('.cell-content-text'),
162
+ expandIconButton: () => cy.get('.expand-image-btn'),
163
+ closeImagePopup: () => cy.get('.close-popup-btn')
162
164
  }
163
165
 
164
166
  const steps = {
167
+ verifyExpandIconInImage: () => {
168
+ utilities.verifyElementVisibilityState(gridQuestionCommonComponent.expandIconButton(), 'visible');
169
+ },
170
+
171
+ clickExpandIconInImage: () => {
172
+ gridQuestionCommonComponent.expandIconButton()
173
+ .click();
174
+ },
175
+
176
+ closeImagePopup: () => {
177
+ gridQuestionCommonComponent.closeImagePopup()
178
+ .click();
179
+ },
180
+
165
181
  /**
166
182
  * Modifies the property of a table cell at the specified row and column.
167
183
  * @param {Object} position - The position of the table cell to modify.
@@ -2,8 +2,10 @@ import constants from "../../fixtures/constants";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { ckEditorToolbar } from "./ckEditorToolbar";
4
4
  import { commonComponents } from "./commonComponents";
5
+ import { createQuestionBasePage } from "./createQuestionBasePage";
5
6
  import { equationEditorFlyout } from "./equationEditorFlyout";
6
7
  const css = Cypress.env('css');
8
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
7
9
 
8
10
  const selectors = {
9
11
  optionsLabel: () => cy.get('.options-label-wrapper .options-label'),
@@ -13,7 +15,9 @@ const selectors = {
13
15
  deleteOptionButton: () => cy.get('.ngie-button[aria-label*="Delete option"]'),
14
16
  optionsInputField: () => cy.get('.option-component [role="textbox"]'),
15
17
  //TODO: Need to update this in all TEI
16
- optionNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]')
18
+ optionNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
19
+ expandIconButton: () => cy.get('.expand-image-container .expand-image-btn[aria-label="expand image button"]'),
20
+ closeImagePopup: () => cy.get('.close-popup-btn')
17
21
  }
18
22
 
19
23
  const steps = {
@@ -300,7 +304,23 @@ const steps = {
300
304
 
301
305
  verifyOptionCount: (count) => {
302
306
  utilities.verifyElementCount(optionsWrapperComponent.optionsInputField(), count);
303
- }
307
+ },
308
+
309
+ verifyExpandIconInImage: () => {
310
+ utilities.verifyElementVisibilityState(optionsWrapperComponent.expandIconButton(), 'visible');
311
+ },
312
+
313
+ clickExpandIconInImage: () => {
314
+ optionsWrapperComponent.expandIconButton()
315
+ .first()
316
+ .scrollIntoView()
317
+ .realClick();
318
+ },
319
+
320
+ closeImagePopup: () => {
321
+ optionsWrapperComponent.closeImagePopup()
322
+ .click();
323
+ }
304
324
  }
305
325
 
306
326
  const tests = {
@@ -387,6 +407,17 @@ const tests = {
387
407
  ckEditorToolbar.steps.addImageToInputField();
388
408
  optionsWrapperComponent.steps.verifyImageAndAltTextInOptionsInputField(inputFieldIndex);
389
409
  });
410
+ if (imageExpandEnhancement === 'true') {
411
+ it('When user add large image in options input field, user should be able to expand the image in preview tab', () => {
412
+ createQuestionBasePage.steps.switchToPreviewTab();
413
+ ckEditorToolbar.steps.verifyExpandIconInImage();
414
+ ckEditorToolbar.steps.clickExpandIconInImage();
415
+ utilities.verifyInnerText(ckEditorToolbar.closeImagePopup(), 'Close');
416
+ ckEditorToolbar.steps.closeImagePopup();
417
+ ckEditorToolbar.steps.verifyExpandIconInImage();
418
+ createQuestionBasePage.steps.switchToEditTab();
419
+ });
420
+ }
390
421
  },
391
422
 
392
423
  /**
@@ -10,7 +10,9 @@ const selectors = {
10
10
  responseAreaNumeration: () => cy.get('marker'),
11
11
  responseAreaResponseLabel: () => cy.get('content'),
12
12
  questionContainerPreviewTab: () => cy.get('.preview-question-text-wrapper'),
13
- responseAreaSettingsButton: () => cy.get('.add_response_settings_btn')
13
+ responseAreaSettingsButton: () => cy.get('.add_response_settings_btn'),
14
+ expandIconButton: () => cy.get('.expand-image-btn'),
15
+ closeImagePopup: () => cy.get('.close-popup-btn'),
14
16
  }
15
17
 
16
18
  const steps = {
@@ -145,7 +147,21 @@ const steps = {
145
147
  utilities.getNthElement(questionInputFieldComponent.responseArea(), responseAreaIndex)
146
148
  .find('.add_response_element')
147
149
  .should('have.css', 'height', height);
148
- }
150
+ },
151
+
152
+ verifyExpandIconInImage: () => {
153
+ utilities.verifyElementVisibilityState(questionInputFieldComponent.expandIconButton(), 'visible');
154
+ },
155
+
156
+ clickExpandIconInImage: () => {
157
+ questionInputFieldComponent.expandIconButton()
158
+ .click();
159
+ },
160
+
161
+ closeImagePopup: () => {
162
+ questionInputFieldComponent.closeImagePopup()
163
+ .click();
164
+ }
149
165
  }
150
166
 
151
167
  const tests = {
@@ -5,6 +5,7 @@ import { createItemPage } from "./createItemPage";
5
5
  const css = Cypress.env('css');
6
6
  const options = ['option 1', 'option 2', 'option 3'];
7
7
  const fourOptions = ['option 1', 'option 2', 'option 3', 'option 4'];
8
+ const imageExpandEnhancement = Cypress.env('ENABLE_EXPAND_IMAGE_ENHANCEMENT');
8
9
 
9
10
  const selectors = {
10
11
  ...correctIncorrectAnswerLabelComponent,
@@ -24,6 +25,7 @@ const selectors = {
24
25
  ...scoringSectionBaseEditTab,
25
26
  ...additionalSettingsPanel,
26
27
  ...connectorStyleStyleAndLayoutCustomizationComponent,
28
+ ...ckEditorToolbar,
27
29
  //Edit tab
28
30
  promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
29
31
  promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper .edit-mcq-option-wrapper'),
@@ -2864,6 +2866,22 @@ const tests = {
2864
2866
  createQuestionBasePage.steps.switchToPreviewTab();
2865
2867
  draggableOptionContainer.steps.verifyDraggableOptionsInOptionsContainerPreviewTab(optionsAfterDeleting);
2866
2868
  });
2869
+ if (imageExpandEnhancement === 'true') {
2870
+ it('When user add large image in question instruction, user should be able to expand the image in preview tab', () => {
2871
+ createQuestionBasePage.steps.switchToEditTab();
2872
+ optionsWrapperComponent.steps.addOption();
2873
+ matchingPage.steps.focusInOptionsInputField(3);
2874
+ matchingPage.steps.selectImageOptionFromCKEditorToolbar();
2875
+ matchingPage.steps.addImageToInputField();
2876
+ // matchingPage.steps.focusOutOptionsInputField(3);
2877
+ createQuestionBasePage.steps.switchToPreviewTab();
2878
+ matchingPage.steps.verifyExpandIconInImage();
2879
+ matchingPage.steps.clickExpandIconInImage();
2880
+ utilities.verifyInnerText(matchingPage.closeImagePopup(), 'Close');
2881
+ matchingPage.steps.closeImagePopup();
2882
+ matchingPage.steps.verifyExpandIconInImage();
2883
+ });
2884
+ }
2867
2885
  },
2868
2886
 
2869
2887
  //Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
@@ -15,6 +15,7 @@ const selectors = {
15
15
  ...autoScoredScoringPreviewTab,
16
16
  ...randomizeOptionsComponent,
17
17
  ...additionalSettingsPanel,
18
+ ...ckEditorToolbar,
18
19
  partialEqualWeightsPointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
19
20
  snapToTicksCheckbox: () => cy.get('[data-ngie-testid="snap-to-grid-nodes-checkbox"] input'),
20
21
  snapToTicksLabel: () => cy.get('[data-ngie-testid="snap-to-grid-nodes-checkbox"] .MuiFormControlLabel-label'),
@@ -1,9 +1,8 @@
1
- import { createQuestionBasePage, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInstructionsComponent, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, additionalSettingsPanel, acceptedStudentInputComponent, studentViewSettingsLabelComponent, customizeSpecialCharacterComponent, studentResponseAndLayoutComponent, printPreviewComponent, showAlternativeAnswersComponent } from "./components/";
1
+ import { createQuestionBasePage, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInstructionsComponent, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, additionalSettingsPanel, acceptedStudentInputComponent, studentViewSettingsLabelComponent, customizeSpecialCharacterComponent, studentResponseAndLayoutComponent, printPreviewComponent } from "./components/";
2
2
  import { dialogBoxBase } from "./dialogBoxBase";
3
3
  import utilities from "../support/helpers/utilities";
4
4
  import { createItemPage } from "./createItemPage";
5
5
  const css = Cypress.env('css');
6
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
7
6
 
8
7
  const selectors = {
9
8
  ...questionInstructionsComponent,
@@ -19,7 +18,6 @@ const selectors = {
19
18
  ...createQuestionBasePage,
20
19
  ...printPreviewComponent,
21
20
  ...autoScoredScoringSectionMultiResponseType,
22
- ...showAlternativeAnswersComponent,
23
21
 
24
22
  answerLabelSpecifyCorrectAnswerSection: () => cy.get('.answer-label'),
25
23
  displayCharacterCountLabel: () => cy.get('[data-ngie-testid="display-character-count-checkbox"] .MuiFormControlLabel-label'),
@@ -67,13 +65,7 @@ const selectors = {
67
65
  //Preview tab
68
66
  previewTabResponseField: () => cy.get('.input-field input:visible'),
69
67
  previewTabResponseFieldWrapper: () => cy.get('.input-wrapper:visible'),
70
- previewTabCorrectAnswerWrapper: () => {
71
- if (alternativeAnswerCheck) {
72
- return cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"]');
73
- } else {
74
- return cy.get('[class*="ShortTextResponsestyles__CorrectAnswerWrapper"]');
75
- }
76
- },
68
+ previewTabCorrectAnswerWrapper: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerWrapper"]'),
77
69
  previewTabCorrectAnswerLabel: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerLabel"]'),
78
70
  previewTabCorrectAnswerResponse: () => cy.get('[class*="ShortTextResponsestyles__CorrectAnswerValueWrapper"]'),
79
71
  responseFieldCountPreviewTab: () => cy.get('[class*="InputLimitLabelWrapper"]'),
@@ -135,7 +127,6 @@ const steps = {
135
127
  ...createItemPage.steps,
136
128
  ...printPreviewComponent.steps,
137
129
  ...autoScoredScoringSectionMultiResponseType.steps,
138
- ...showAlternativeAnswersComponent.steps,
139
130
 
140
131
  verifyCorrectIcon: () => {
141
132
  utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
@@ -158,7 +149,7 @@ const steps = {
158
149
 
159
150
  verifyIncorrectAttemptBorder: () => {
160
151
  utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
161
- 'border': `0.8px solid ${css.color.incorrectAnswer}`
152
+ 'border': `1px solid ${css.color.incorrectAnswer}`
162
153
  });
163
154
  },
164
155
 
@@ -174,33 +165,14 @@ const steps = {
174
165
  * @param {String} correctAnswer correct answer in correct answer wrapper present in grading view
175
166
  * @description function verifies correct answer wrapper in grading view
176
167
  */
177
- verifyCorrectAnswerResponseInCorrectAnswerWrapper: (correctAnswer, correctAnswerPoints = '') => {
178
- if (alternativeAnswerCheck) {
179
- utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
180
- (correctAnswerPoints !== '') && shortTextResponsePage.steps.verifyCorrectAnswersLabelAndPointVisible(`(${correctAnswerPoints} points)`);
181
- } else {
182
- utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
183
- utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
184
- utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'visible');
185
- }
168
+ verifyCorrectAnswerResponseInCorrectAnswerWrapper: (correctAnswer) => {
169
+ utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
170
+ utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
171
+ utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'visible');
186
172
  utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerResponse(), correctAnswer);
187
173
  utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerResponse(), 'visible');
188
174
  },
189
175
 
190
- verifyCorrectAnswerAndAlternateAnswerInCorrectAnswerWrapper: (correctAnswer, correctAnswerPoints, alternateAnswer, alternateAnswerPoints) => {
191
- utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerWrapper(), 'visible');
192
- utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerResponse().eq(0), correctAnswer);
193
- utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabCorrectAnswerResponse().eq(0), 'visible');
194
- shortTextResponsePage.steps.verifyCorrectAnswersLabelAndPointVisible(`(${correctAnswerPoints} points)`);
195
- shortTextResponsePage.steps.verifyShowAlternativeAnswersToggleExists();
196
- shortTextResponsePage.steps.disableShowAlternativeAnswersToggle();
197
- shortTextResponsePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
198
- shortTextResponsePage.steps.verifyAlternativeAnswersSectionNotExist();
199
- shortTextResponsePage.steps.clickShowAlternativeAnswersToggle();
200
- shortTextResponsePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, `(${alternateAnswerPoints} points)`);
201
- utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerResponse().eq(1), alternateAnswer);
202
- },
203
-
204
176
  enterTextInShortTextResponseInputField: (correctAnswer) => {
205
177
  shortTextResponsePage.setCorrectAnswerResponseField()
206
178
  .type(correctAnswer)
@@ -102,6 +102,8 @@ const selectors = {
102
102
  optionsInputFieldInQuestionPreviewTab: () => cy.get('[class*="word-span highlight_option"]'),
103
103
  questionInstructionsPrintViewText: () => cy.get('.question-text-wrapper').eq(0),
104
104
  questionTextPrintViewParagraphs: () => cy.get('#nextgen-assess-print-view [data-testid="question-instruction-element"] p'),
105
+ expandIconButton: () => cy.get('.expand-image-btn'),
106
+ closeImagePopup: () => cy.get('.close-popup-btn'),
105
107
  }
106
108
 
107
109
  const steps = {
@@ -1379,7 +1381,21 @@ const steps = {
1379
1381
  textSelectionPage.questionTextPrintViewParagraphs().each(($el, index) => {
1380
1382
  utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.questionTextPrintViewParagraphs(), index), `${paragraphTextArray[index]}`);
1381
1383
  });
1382
- }
1384
+ },
1385
+
1386
+ verifyExpandIconInImage: () => {
1387
+ utilities.verifyElementVisibilityState(textSelectionPage.expandIconButton(), 'visible');
1388
+ },
1389
+
1390
+ clickExpandIconInImage: () => {
1391
+ textSelectionPage.expandIconButton()
1392
+ .click();
1393
+ },
1394
+
1395
+ closeImagePopup: () => {
1396
+ textSelectionPage.closeImagePopup()
1397
+ .click();
1398
+ },
1383
1399
  }
1384
1400
 
1385
1401
  const tests = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.579-IEI-7178-6f40615.0",
3
+ "version": "1.0.579-IEI-7193-main-6a7df51.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {