itemengine-cypress-automation 1.0.579-IEI-7046-a317a6b.0 → 1.0.580-IEI-7040-1e744fc.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.
- package/cypress/config-files/ilprod.json +2 -1
- package/cypress/config-files/ilqa.json +2 -1
- package/cypress/config-files/ilstage.json +2 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +8 -123
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +14 -131
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +10 -153
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +9 -138
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +136 -9
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +7 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +116 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +136 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +21 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +190 -2
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +17 -0
- package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +18 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
- package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +18 -0
- package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +18 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +17 -0
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +16 -0
- package/cypress/pages/components/ckEditorToolbar.js +20 -0
- package/cypress/pages/components/draggableOptionContainer.js +14 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +17 -1
- package/cypress/pages/components/optionsWrapperComponent.js +33 -2
- package/cypress/pages/components/questionInputFieldComponent.js +18 -2
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -38
- package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
- package/cypress/pages/matchingPage.js +18 -0
- package/cypress/pages/numberLineLabelPage.js +1 -0
- package/cypress/pages/textSelectionPage.js +17 -1
- package/package.json +1 -1
|
@@ -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' }, () => {
|
|
@@ -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 = {
|
|
@@ -39,7 +39,6 @@ const selectors = {
|
|
|
39
39
|
dropzoneCellPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="CellDropZonestyles__CellContainer"][class*="dropzone-cell"],[class*="question-preview-wrapper"] [class*="DropzoneCellstyles__StyledCell"]'),
|
|
40
40
|
dropzoneCellNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
41
41
|
correctAnswerDropzoneCell: () => cy.get('[class*="Matrixstyles__AnswerCell"]'),
|
|
42
|
-
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
43
42
|
correctAnswerDropzoneCellTickIcon: () => cy.get('[class*="Matrixstyles__GreenBlock"]'),
|
|
44
43
|
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
|
45
44
|
correctAnswerOption: () => cy.get('[class*="Matrixstyles__AnswerWrapper"]'),
|
|
@@ -515,43 +514,6 @@ const steps = {
|
|
|
515
514
|
});
|
|
516
515
|
},
|
|
517
516
|
|
|
518
|
-
/**
|
|
519
|
-
* Verifies the content of each correct-answer dropzone in the Alternate Answer section.
|
|
520
|
-
*
|
|
521
|
-
* For every entry in `correctAnswersArray`, this function:
|
|
522
|
-
* - Iterates through each set of correct answers assigned to a dropzone.
|
|
523
|
-
* - Confirms that the dropzone displays the expected cell numeration.
|
|
524
|
-
* - Verifies each answer option inside the dropzone.
|
|
525
|
-
* - Validates that the points label for the group matches the expected value.
|
|
526
|
-
*
|
|
527
|
-
* @param {Object[]} correctAnswersArray - An array where each object represents
|
|
528
|
-
* a group of correct answers and its metadata.
|
|
529
|
-
* @param {string[][]} correctAnswersArray[].correctAnswers - A list of answer-option groups for each dropzone.
|
|
530
|
-
* @param {number[]} correctAnswersArray[].cellIndexArray - Expected numeration values for corresponding dropzones.
|
|
531
|
-
* @param {string} correctAnswersArray[].pointsText - Expected points label for this group of dropzones.
|
|
532
|
-
*/
|
|
533
|
-
verifyCorrectAnswerResponsesInAlternateAnswerSection: (correctAnswersArray) => {
|
|
534
|
-
let dropzoneCellIndex = 0;
|
|
535
|
-
correctAnswersArray.forEach(({
|
|
536
|
-
correctAnswers,
|
|
537
|
-
pointsText,
|
|
538
|
-
}, index) => {
|
|
539
|
-
correctAnswers.forEach((correctAnswer) => {
|
|
540
|
-
dragAndDropIntoCategoriesPage.correctAnswerDropzoneCell()
|
|
541
|
-
.eq(dropzoneCellIndex)
|
|
542
|
-
.within(() => {
|
|
543
|
-
correctAnswer.forEach((answerOption, optionIndex) => {
|
|
544
|
-
utilities.verifyTextContent(utilities.getNthElement(dragAndDropIntoCategoriesPage.correctAnswerOption(), optionIndex), answerOption);
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
dropzoneCellIndex += 1;
|
|
548
|
-
});
|
|
549
|
-
dragAndDropIntoCategoriesPage.correctAnswerPointsLabel()
|
|
550
|
-
.eq(index)
|
|
551
|
-
.should('have.text', pointsText);
|
|
552
|
-
});
|
|
553
|
-
},
|
|
554
|
-
|
|
555
517
|
/**
|
|
556
518
|
* Verifies the presence of an incorrect option icon for a specified option in the Preview Tab.
|
|
557
519
|
* @param {number} optionIndex - The index of the option to verify.
|
|
@@ -2,6 +2,7 @@ import utilities from "../support/helpers/utilities";
|
|
|
2
2
|
import { autoScoredScoringPreviewTab, createQuestionBasePage, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, questionInputFieldComponent, commonComponents, additionalSettingsPanel, optionsWrapperComponent, randomizeOptionsComponent, studentViewSettingsLabelComponent, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
5
6
|
|
|
6
7
|
const selectors = {
|
|
7
8
|
...questionInstructionsComponent,
|
|
@@ -25,8 +26,8 @@ const selectors = {
|
|
|
25
26
|
...figCommonStyleAndLayoutComponent,
|
|
26
27
|
dropdownWrapperPreviewTab: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper'),
|
|
27
28
|
correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
|
28
|
-
correctAnswerResponseWrapper: () => cy.get('.answer-block'),
|
|
29
|
-
correctAnswerResponse: () => cy.get('.numeration-wrapper'),
|
|
29
|
+
correctAnswerResponseWrapper: () => alternativeAnswerCheck ? cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]') : cy.get('.answer-block'),
|
|
30
|
+
correctAnswerResponse: () => alternativeAnswerCheck ? cy.get('[class*="AnswerWrapperForLabel"]') : cy.get('.numeration-wrapper'),
|
|
30
31
|
setForAllDropdownsLabel: () => cy.get('[data-ngie-testid="set-for-all-dropdowns-checkbox"] .MuiFormControlLabel-label'),
|
|
31
32
|
setForAllDropdownsCheckbox: () => cy.get('[data-ngie-testid="set-for-all-dropdowns-checkbox"] input'),
|
|
32
33
|
correctAnswerSectionWithoutEnumerationWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper .preview-question-text-wrapper'),
|
|
@@ -41,6 +42,8 @@ const selectors = {
|
|
|
41
42
|
alternateAnswerPopupSaveButton: () => cy.get('[class*="AlternateOptionstyle__ButtonWrapper"] button').eq(1),
|
|
42
43
|
selectedAlternateAnswerCountSpecifyCorrectAnswer: () => cy.get('.selected-option-wrapper'),
|
|
43
44
|
answerStatusBanner: () => cy.get('[class*="AnswerStatusWrapper"]'),
|
|
45
|
+
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
46
|
+
alternativeAnswersSection: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(4), // Alternative answer is typically the second wrapper
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
const steps = {
|
|
@@ -128,6 +131,41 @@ const steps = {
|
|
|
128
131
|
});
|
|
129
132
|
},
|
|
130
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Verify correct answer section with alternate answers.
|
|
136
|
+
*
|
|
137
|
+
* @param {Object[]} correctAnswerArray - An array of objects representing the expected correct answers and their corresponding points.
|
|
138
|
+
* @param {string[][]} correctAnswerArray[].correctAnswers - A nested array of correct answer text values.
|
|
139
|
+
* Each inner array represents a group of alternate correct answers for a particular text container.
|
|
140
|
+
* @param {string[]} correctAnswerArray[].points - An array of point label strings associated with each correct answer group.
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
verifyCorrectAnswerSectionWithAlternateAnswer: (correctAnswerArray) => {
|
|
145
|
+
let responseIndex = 0;
|
|
146
|
+
let pointsLabelIndex = 0;
|
|
147
|
+
correctAnswerArray.forEach(({correctAnswers, points}) => {
|
|
148
|
+
correctAnswers.forEach((textContainers, index) => {
|
|
149
|
+
textContainers.forEach((correctAnswer) => {
|
|
150
|
+
fillInTheGapsDropdownPage.correctAnswerResponseWrapper()
|
|
151
|
+
.eq(responseIndex)
|
|
152
|
+
.within(() => {
|
|
153
|
+
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
|
154
|
+
fillInTheGapsDropdownPage.correctAnswerResponse()
|
|
155
|
+
.should('have.text', correctAnswer);
|
|
156
|
+
});
|
|
157
|
+
responseIndex += 1;
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
points.forEach((pointsText) => {
|
|
161
|
+
fillInTheGapsDropdownPage.correctAnswerPointsLabel()
|
|
162
|
+
.eq(pointsLabelIndex)
|
|
163
|
+
.should('have.text', pointsText);
|
|
164
|
+
pointsLabelIndex += 1;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
|
|
131
169
|
verifyCorrectAnswerSectionNotExists: () => {
|
|
132
170
|
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.correctAnswerSectionWrapper(), 'notExist');
|
|
133
171
|
},
|
|
@@ -334,6 +372,13 @@ const steps = {
|
|
|
334
372
|
fillInTheGapsDropdownPage.answerStatusBanner()
|
|
335
373
|
.should('be.visible');
|
|
336
374
|
},
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Verifies that the alternative answers section does not exist
|
|
378
|
+
*/
|
|
379
|
+
verifyAlternativeAnswersSectionNotExist: () => {
|
|
380
|
+
fillInTheGapsDropdownPage.alternativeAnswersSection().should('not.exist');
|
|
381
|
+
},
|
|
337
382
|
}
|
|
338
383
|
|
|
339
384
|
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'),
|
|
@@ -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 = {
|