itemengine-cypress-automation 1.0.564-IEI-7011-cf323ce.0 → 1.0.564-IEI-6998-Add-coverage-for-image-hightlight-question-type-f372002.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 +1 -2
- package/cypress/config-files/ilqa.json +1 -2
- package/cypress/config-files/ilstage.json +1 -2
- package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -86
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +0 -91
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +0 -79
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +0 -16
- package/cypress/pages/components/index.js +0 -1
- package/cypress/pages/imageHighlightPage.js +184 -7
- package/cypress/pages/itemPreviewPage.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +1 -3
- package/cypress/pages/singleSelectionPage.js +1 -5
- package/cypress/support/helpers/utilities.js +16 -0
- package/package.json +1 -1
- package/service.yaml +1 -9
- package/cypress/pages/components/showAlternativeAnswersComponent.js +0 -169
|
@@ -3,7 +3,6 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
|
3
3
|
import { dialogBoxBase, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
|
5
5
|
const grepTags = Cypress.env('grepTags');
|
|
6
|
-
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
|
|
7
6
|
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
8
7
|
const views = utilities.getViews(correctAnswerViews);
|
|
9
8
|
var itemReferenceID = "";
|
|
@@ -169,135 +168,6 @@ describe('Create Item page - Single Selection: Scoring cases', () => {
|
|
|
169
168
|
});
|
|
170
169
|
});
|
|
171
170
|
|
|
172
|
-
views.forEach((view) => {
|
|
173
|
-
describe(`Single selection: all or nothing with alternative answer - ${view}`, { tags: 'smoke' }, () => {
|
|
174
|
-
abortEarlySetup();
|
|
175
|
-
before(() => {
|
|
176
|
-
switch (view) {
|
|
177
|
-
case 'Question preview':
|
|
178
|
-
singleSelectionPage.steps.navigateToCreateQuestion('single selection');
|
|
179
|
-
cy.barsPreLoaderWait();
|
|
180
|
-
singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
|
181
|
-
singleSelectionPage.steps.allotPoints(20);
|
|
182
|
-
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
|
183
|
-
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
|
184
|
-
singleSelectionPage.steps.clickOnAddAlternativeAnswerButton();
|
|
185
|
-
singleSelectionPage.steps.allotPoints(10);
|
|
186
|
-
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
|
|
187
|
-
singleSelectionPage.steps.switchToPreviewTab();
|
|
188
|
-
break;
|
|
189
|
-
case 'Item preview':
|
|
190
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
191
|
-
itemPreviewPage.steps.switchToPreviewTab();
|
|
192
|
-
break;
|
|
193
|
-
case 'Grading view':
|
|
194
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
beforeEach(() => {
|
|
200
|
-
switch (view) {
|
|
201
|
-
case 'Question preview':
|
|
202
|
-
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
203
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
204
|
-
singleSelectionPage.steps.resetQuestionPreview();
|
|
205
|
-
break;
|
|
206
|
-
case 'Item preview':
|
|
207
|
-
itemPreviewPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
208
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
209
|
-
itemPreviewPage.steps.resetQuestionPreview();
|
|
210
|
-
break;
|
|
211
|
-
case 'Grading view':
|
|
212
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
if (view === 'Question preview') {
|
|
218
|
-
after(() => {
|
|
219
|
-
singleSelectionPage.steps.clickOnSaveQuestionButton();
|
|
220
|
-
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
221
|
-
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
it('When the user selects \'Grading\' view without attempting the question, no icons should be displayed besides responses, correct answer label and border should not be displayed and correct answer should be displayed in correct answer section', () => {
|
|
226
|
-
if (view === 'Grading view') {
|
|
227
|
-
studentViewPage.steps.submitResponse();
|
|
228
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
229
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
230
|
-
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
231
|
-
}
|
|
232
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
|
233
|
-
singleSelectionPage.steps.switchToGradingView();
|
|
234
|
-
singleSelectionPage.steps.verifyPreviewScore(0, 20);
|
|
235
|
-
}
|
|
236
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
|
237
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
|
238
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
|
239
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
|
240
|
-
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
|
241
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
242
|
-
//correct answer section
|
|
243
|
-
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
|
244
|
-
if (alternativeAnswerCheck === 'true') {
|
|
245
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides incorrect responses, no icons should be displayed besides unattempted responses, incorrect answer border and label should not be displayed below the question preview and correct answer should be displayed in correct answer section', () => {
|
|
250
|
-
singleSelectionPage.steps.checkOptionInPreviewTab(2);
|
|
251
|
-
if (view === 'Grading view') {
|
|
252
|
-
studentViewPage.steps.submitResponse();
|
|
253
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
254
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
255
|
-
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
256
|
-
}
|
|
257
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
|
258
|
-
singleSelectionPage.steps.switchToGradingView();
|
|
259
|
-
singleSelectionPage.steps.verifyPreviewScore(0, 20);
|
|
260
|
-
}
|
|
261
|
-
singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
|
|
262
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
|
263
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
|
|
264
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
|
265
|
-
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
266
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
267
|
-
//correct answer section
|
|
268
|
-
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
|
269
|
-
if (alternativeAnswerCheck === 'true') {
|
|
270
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
it(`Single selection ${view} - When user attempts the question correctly, the user should be awarded full points and on switching to 'Grading' view, then correct icons should be displayed beside all the correct responses, correct answer border and a label should not be displayed below the question preview and correct answer section should not be displayed`, () => {
|
|
275
|
-
singleSelectionPage.steps.checkOptionInPreviewTab(1);
|
|
276
|
-
if (view === 'Grading view') {
|
|
277
|
-
studentViewPage.steps.submitResponse();
|
|
278
|
-
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
279
|
-
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
280
|
-
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
|
281
|
-
}
|
|
282
|
-
if (view === 'Question preview' || view === 'Item preview') {
|
|
283
|
-
singleSelectionPage.steps.verifyPreviewScore(20, 20);
|
|
284
|
-
singleSelectionPage.steps.switchToGradingView();
|
|
285
|
-
}
|
|
286
|
-
singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
|
|
287
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
|
|
288
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
|
|
289
|
-
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
|
290
|
-
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
291
|
-
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
292
|
-
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
|
293
|
-
if (alternativeAnswerCheck === 'true') {
|
|
294
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
295
|
-
}
|
|
296
|
-
cy.eyesCheckWindow(`Single selection ${view} - Correct attempt`);
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
|
|
301
171
|
views.forEach((view) => {
|
|
302
172
|
describe(`Single selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
|
|
303
173
|
abortEarlySetup();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { singleSelectionPage } from "../../../pages/singleSelectionPage";
|
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
3
|
const css = Cypress.env('css');
|
|
4
|
-
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
|
|
5
4
|
|
|
6
5
|
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
|
7
6
|
|
|
@@ -50,9 +49,6 @@ describe('Create item page - Single selection: All or nothing with alternative a
|
|
|
50
49
|
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
51
50
|
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
52
51
|
singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
|
|
53
|
-
if (alternativeAnswerCheck === 'true') {
|
|
54
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
|
|
55
|
-
}
|
|
56
52
|
//singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
57
53
|
/*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, correct answer border and a label should not be displayed below the question preview')
|
|
58
54
|
singleSelectionPage.steps.checkAnswer();
|
|
@@ -100,10 +96,6 @@ describe('Create item page - Single selection: All or nothing with alternative a
|
|
|
100
96
|
singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(3);
|
|
101
97
|
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
102
98
|
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
103
|
-
//show alternative answers
|
|
104
|
-
if (alternativeAnswerCheck === 'true') {
|
|
105
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
|
|
106
|
-
}
|
|
107
99
|
//correct answer section
|
|
108
100
|
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
|
109
101
|
//singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
@@ -223,10 +215,6 @@ describe('Create item page - Single selection: All or nothing with alternative a
|
|
|
223
215
|
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
|
224
216
|
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
225
217
|
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
226
|
-
//show alternative answers
|
|
227
|
-
if (alternativeAnswerCheck === 'true') {
|
|
228
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
|
|
229
|
-
}
|
|
230
218
|
//correct answer section
|
|
231
219
|
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(2);
|
|
232
220
|
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
@@ -326,10 +314,6 @@ describe('Create item page - Single selection: All or nothing with alternative a
|
|
|
326
314
|
singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
|
|
327
315
|
singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
328
316
|
singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
|
|
329
|
-
//show alternative answers
|
|
330
|
-
if (alternativeAnswerCheck === 'true') {
|
|
331
|
-
singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 20);
|
|
332
|
-
}
|
|
333
317
|
//correct answer section
|
|
334
318
|
singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
|
|
335
319
|
singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
@@ -3,7 +3,6 @@ export * from './commonComponents';
|
|
|
3
3
|
export * from './additionalSettingsPanel';
|
|
4
4
|
export * from './mcqAdditionalSettingsBase';
|
|
5
5
|
export * from './questionInstructionsComponent';
|
|
6
|
-
export * from './showAlternativeAnswersComponent';
|
|
7
6
|
export * from './ckEditorToolbar';
|
|
8
7
|
export * from './essayResponseCommonComponents';
|
|
9
8
|
export * from './optionsWrapperComponent';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
2
|
import { additionalSettingsAccessibilitySectionComponent, additionalSettingsPanel, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, backgroundImageUploadComponent, commonComponents, createQuestionBasePage, enableOuterBorderComponent, gradingViewEnumerationComponent, imageActionsComponent, imageCanvasComponent, questionInstructionsComponent, scoringSectionBaseEditTab, showAvailableOptionsToStudents, showStudentMaximumNumberOfPossibleSelections, singleMultipleSelectionModeComponent, colorPopupComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
|
+
import { itemPreviewPage } from "./itemPreviewPage";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
let imageWidth = 768;
|
|
6
7
|
let imageHeight = 432;
|
|
@@ -18,6 +19,7 @@ const selectors = {
|
|
|
18
19
|
...imageActionsComponent,
|
|
19
20
|
...additionalSettingsPanel,
|
|
20
21
|
...gradingViewEnumerationComponent,
|
|
22
|
+
...itemPreviewPage,
|
|
21
23
|
|
|
22
24
|
//Image selection style section.
|
|
23
25
|
imageSelectionStyleLabel: () => cy.get('.options-label'),
|
|
@@ -110,6 +112,12 @@ const selectors = {
|
|
|
110
112
|
saturationPointer: () => cy.get('.react-colorful__pointer.react-colorful__saturation-pointer'),
|
|
111
113
|
huePointer: () => cy.get('.react-colorful__pointer.react-colorful__hue-pointer'),
|
|
112
114
|
alphaPointer: () => cy.get('.react-colorful__pointer.react-colorful__alpha-pointer'),
|
|
115
|
+
enumerationPlacementLabel: () => cy.get('[class*="options-container-cls dropzone-identifiers-wrapper"] .options-label').eq(1),
|
|
116
|
+
enumerationToggleButtonContainer: () => cy.get('[aria-label="Enumeration placement"]'),
|
|
117
|
+
enumerationPlacementTopToggleButton: () => cy.get('[data-ngie-testid="top-toggle-button"]'),
|
|
118
|
+
enumerationPlacementCenterToggleButton: () => cy.get('[data-ngie-testid="center-toggle-button"]').eq(1),
|
|
119
|
+
enumerationPlacementBottomToggleButton: () => cy.get('[data-ngie-testid="bottom-toggle-button"]'),
|
|
120
|
+
enumerationForHighlightsPreviewTab: () => cy.get('[class*="highlight-svg-responseive"] circle'),
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
const steps = {
|
|
@@ -312,7 +320,7 @@ const steps = {
|
|
|
312
320
|
* @description this function verifies height of canvas
|
|
313
321
|
*/
|
|
314
322
|
verifyCanvasHeight: (height) => {
|
|
315
|
-
const tolerance =
|
|
323
|
+
const tolerance = 10
|
|
316
324
|
imageHighlightPage.specifyPossibleOptionsImageCanvas()
|
|
317
325
|
.should('have.css', 'height')
|
|
318
326
|
.then(($cssHeight) => {
|
|
@@ -659,20 +667,20 @@ const steps = {
|
|
|
659
667
|
|
|
660
668
|
verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
|
|
661
669
|
imageHighlightPage.imagePreviewTab()
|
|
662
|
-
.should('have.
|
|
663
|
-
.and('have.
|
|
670
|
+
.should('have.attr', 'x', '0')
|
|
671
|
+
.and('have.attr', 'y', '0');
|
|
664
672
|
},
|
|
665
673
|
|
|
666
674
|
verifyCanvasImageCenterAlignedInPreviewTab: () => {
|
|
667
675
|
imageHighlightPage.imagePreviewTab()
|
|
668
|
-
.should('
|
|
669
|
-
.and('
|
|
676
|
+
.should('have.attr', 'x', '100')
|
|
677
|
+
.and('have.attr', 'y', '100');
|
|
670
678
|
},
|
|
671
679
|
|
|
672
680
|
verifyCanvasImageTopRightAlignedInPreviewTab: () => {
|
|
673
681
|
imageHighlightPage.imagePreviewTab()
|
|
674
|
-
.should('have.
|
|
675
|
-
.and('not.have.
|
|
682
|
+
.should('have.attr', 'x', '100')
|
|
683
|
+
.and('not.have.attr', 'y', '200');
|
|
676
684
|
},
|
|
677
685
|
|
|
678
686
|
/**
|
|
@@ -1144,6 +1152,20 @@ const steps = {
|
|
|
1144
1152
|
});
|
|
1145
1153
|
},
|
|
1146
1154
|
|
|
1155
|
+
/**
|
|
1156
|
+
* @param {number} index of highlight region
|
|
1157
|
+
* @description this function verifies the outLineHighlight of selected highlight in item preview tab.
|
|
1158
|
+
*/
|
|
1159
|
+
verifyOutlineHighlightRegionItemPreviewTabSection: (index) => {
|
|
1160
|
+
imageHighlightPage.itemPreviewPageWrapper()
|
|
1161
|
+
.within(() => {
|
|
1162
|
+
utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon().eq(index), {
|
|
1163
|
+
'stroke-width': '2px',
|
|
1164
|
+
'stroke': css.color.activeHighlightBorder
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1167
|
+
},
|
|
1168
|
+
|
|
1147
1169
|
/**
|
|
1148
1170
|
* @param {number} index of highlight region
|
|
1149
1171
|
* @description this function verifies the patternHighlight of selected highlight in preview tab.
|
|
@@ -1705,6 +1727,161 @@ const steps = {
|
|
|
1705
1727
|
Math.abs(ag - eg) <= tolerance &&
|
|
1706
1728
|
Math.abs(ab - eb) <= tolerance
|
|
1707
1729
|
);
|
|
1730
|
+
},
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* @param {number} width index for the border style.
|
|
1734
|
+
* @param {number} height index for the border style.
|
|
1735
|
+
* @description Verifies the height and width of image in preview tab.
|
|
1736
|
+
*/
|
|
1737
|
+
verifyImageDimensionsPreviewTab: (width, height) => {
|
|
1738
|
+
imageHighlightPage.imagePreviewTab()
|
|
1739
|
+
.should('have.css', 'width', `${width}px`)
|
|
1740
|
+
.and('have.css', 'height', `${height}px`);
|
|
1741
|
+
},
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* @description Clicks on the bottom enumeration placement button.
|
|
1745
|
+
*/
|
|
1746
|
+
selectBottomEnumerationPlacementToggle: () => {
|
|
1747
|
+
imageHighlightPage.enumerationPlacementBottomToggleButton()
|
|
1748
|
+
.click();
|
|
1749
|
+
},
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* @description Clicks on the center enumeration placement button.
|
|
1753
|
+
*/
|
|
1754
|
+
selectCenterEnumerationPlacementToggle: () => {
|
|
1755
|
+
imageHighlightPage.enumerationPlacementCenterToggleButton()
|
|
1756
|
+
.click();
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* @param {string} enumerationPlacement placement of the enumeration.
|
|
1761
|
+
* @param {number} index index of highlight region
|
|
1762
|
+
* @description Verifies the enumeration placement for highlight regions in the preview tab.
|
|
1763
|
+
*/
|
|
1764
|
+
verifyNumerationPlacementForHighlightRegionInPreviewTab: (enumerationPlacement, index) => {
|
|
1765
|
+
const tolerance = 1
|
|
1766
|
+
switch (enumerationPlacement) {
|
|
1767
|
+
case 'Top':
|
|
1768
|
+
switch (index) {
|
|
1769
|
+
case 0:
|
|
1770
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1771
|
+
.invoke('attr', 'cx')
|
|
1772
|
+
.then(actualCx => {
|
|
1773
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1774
|
+
expect(roundedCx).to.equal('307.80');
|
|
1775
|
+
});
|
|
1776
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1777
|
+
.invoke('attr', 'cy')
|
|
1778
|
+
.then(actualCx => {
|
|
1779
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1780
|
+
expect(roundedCx).to.equal('59.03');
|
|
1781
|
+
});
|
|
1782
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1783
|
+
.should('have.attr', 'r', '12');
|
|
1784
|
+
break;
|
|
1785
|
+
case 1:
|
|
1786
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1787
|
+
.invoke('attr', 'cx')
|
|
1788
|
+
.then(actualCx => {
|
|
1789
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1790
|
+
expect(roundedCx).to.equal('200.52');
|
|
1791
|
+
});
|
|
1792
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1793
|
+
.invoke('attr', 'cy')
|
|
1794
|
+
.then(actualCx => {
|
|
1795
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1796
|
+
expect(roundedCx).to.equal('213.11');
|
|
1797
|
+
});
|
|
1798
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1799
|
+
.should('have.attr', 'r', '12');
|
|
1800
|
+
break;
|
|
1801
|
+
default:
|
|
1802
|
+
throw new Error(`Unsupported index ${index} for placement 'Top'`);
|
|
1803
|
+
}
|
|
1804
|
+
break;
|
|
1805
|
+
case 'Center':
|
|
1806
|
+
switch (index) {
|
|
1807
|
+
case 0:
|
|
1808
|
+
// Match cx only up to 2 decimal places to allow minor rendering variance.
|
|
1809
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1810
|
+
.invoke('attr', 'cx')
|
|
1811
|
+
.then(actualCx => {
|
|
1812
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1813
|
+
expect(roundedCx).to.equal('365.45');
|
|
1814
|
+
});
|
|
1815
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1816
|
+
.invoke('attr', 'cy')
|
|
1817
|
+
.then(actualCy => {
|
|
1818
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1819
|
+
expect(roundedCy).to.equal('100.06');
|
|
1820
|
+
});
|
|
1821
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1822
|
+
.should('have.attr', 'r', '12');
|
|
1823
|
+
break;
|
|
1824
|
+
case 1:
|
|
1825
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1826
|
+
.invoke('attr', 'cx')
|
|
1827
|
+
.then(actualCx => {
|
|
1828
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1829
|
+
expect(roundedCx).to.equal('284.74');
|
|
1830
|
+
});
|
|
1831
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1832
|
+
.invoke('attr', 'cy')
|
|
1833
|
+
.then(actualCy => {
|
|
1834
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1835
|
+
expect(roundedCy).to.equal('238.14');
|
|
1836
|
+
});
|
|
1837
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1838
|
+
.should('have.attr', 'r', '12');
|
|
1839
|
+
break;
|
|
1840
|
+
default:
|
|
1841
|
+
throw new Error(`Unsupported index ${index} for placement 'Center'`);
|
|
1842
|
+
}
|
|
1843
|
+
break;
|
|
1844
|
+
case 'Bottom':
|
|
1845
|
+
switch (index) {
|
|
1846
|
+
case 0:
|
|
1847
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1848
|
+
.invoke('attr', 'cx')
|
|
1849
|
+
.then(actualCx => {
|
|
1850
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1851
|
+
expect(roundedCx).to.equal('307.80');
|
|
1852
|
+
});
|
|
1853
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1854
|
+
.invoke('attr', 'cy')
|
|
1855
|
+
.then(actualCy => {
|
|
1856
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1857
|
+
expect(roundedCy).to.equal('167.09');
|
|
1858
|
+
});
|
|
1859
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1860
|
+
.should('have.attr', 'r', '12');
|
|
1861
|
+
break;
|
|
1862
|
+
case 1:
|
|
1863
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1864
|
+
.invoke('attr', 'cx')
|
|
1865
|
+
.then(actualCx => {
|
|
1866
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1867
|
+
expect(roundedCx).to.equal('200.52');
|
|
1868
|
+
});
|
|
1869
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1870
|
+
.invoke('attr', 'cy')
|
|
1871
|
+
.then(actualCy => {
|
|
1872
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1873
|
+
expect(roundedCy).to.equal('289.16');
|
|
1874
|
+
});
|
|
1875
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1876
|
+
.should('have.attr', 'r', '12');
|
|
1877
|
+
break;
|
|
1878
|
+
default:
|
|
1879
|
+
throw new Error(`Unsupported index ${index} for placement 'Bottom'`);
|
|
1880
|
+
}
|
|
1881
|
+
break;
|
|
1882
|
+
default:
|
|
1883
|
+
throw new Error(`Invalid enumeration placement '${enumerationPlacement}'`);
|
|
1884
|
+
}
|
|
1708
1885
|
}
|
|
1709
1886
|
}
|
|
1710
1887
|
|
|
@@ -2,6 +2,7 @@ import { createQuestionBasePage, autoScoredScoringPreviewTab } from "./component
|
|
|
2
2
|
|
|
3
3
|
const selectors = {
|
|
4
4
|
referenceID: () => cy.get('.edit-item-reference-id'),
|
|
5
|
+
itemPreviewPageWrapper: () => cy.get('.item-layout-columns-wrapper-without-scroll'),
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
const steps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities"
|
|
3
|
-
import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent, additionalSettingsAccessibilitySectionComponent
|
|
3
|
+
import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent, additionalSettingsAccessibilitySectionComponent } from "./components"
|
|
4
4
|
import { ckEditorAudioPlayerComponent } from "../pages/components/ckEditorAudioPlayerComponent"
|
|
5
5
|
import { ckEditorEquationEditorComponent } from "../pages/components/ckEditorEquationEditorComponent"
|
|
6
6
|
import { ckEditorInsertTableComponent } from "../pages/components/ckEditorInsertTableComponent"
|
|
@@ -35,7 +35,6 @@ const selectors = {
|
|
|
35
35
|
...ckEditorLinkComponent,
|
|
36
36
|
...createItemPage,
|
|
37
37
|
...audioPlayerPage,
|
|
38
|
-
...showAlternativeAnswersComponent,
|
|
39
38
|
//Specify correct answer section
|
|
40
39
|
optionWrapperSpecifyCorrectAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
41
40
|
optionsText: () => cy.get('.mcq-label'),
|
|
@@ -112,7 +111,6 @@ const steps = {
|
|
|
112
111
|
...ckEditorAudioPlayerComponent.steps,
|
|
113
112
|
...ckEditorEquationEditorComponent.steps,
|
|
114
113
|
...ckEditorInsertTableComponent.steps,
|
|
115
|
-
...showAlternativeAnswersComponent.steps,
|
|
116
114
|
...ckEditorInsertImageComponent.steps,
|
|
117
115
|
...ckEditorLinkComponent.steps,
|
|
118
116
|
...createItemPage.steps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities";
|
|
3
|
-
import { additionalSettingsPanel, createQuestionBasePage, mcqAdditionalSettingsBase, scoringSectionBaseEditTab, autoScoredSpecifyCorrectAnswerSection, optionsWrapperComponent, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, lockUnlockOptionComponent, questionInstructionsComponent, additionalSettingsAccessibilitySectionComponent
|
|
3
|
+
import { additionalSettingsPanel, createQuestionBasePage, mcqAdditionalSettingsBase, scoringSectionBaseEditTab, autoScoredSpecifyCorrectAnswerSection, optionsWrapperComponent, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, lockUnlockOptionComponent, questionInstructionsComponent, additionalSettingsAccessibilitySectionComponent } from "./components";
|
|
4
4
|
import { createItemPage } from "./createItemPage";
|
|
5
5
|
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
|
6
6
|
const css = Cypress.env('css');
|
|
@@ -21,7 +21,6 @@ const selectors = {
|
|
|
21
21
|
...randomizeOptionsComponent,
|
|
22
22
|
...lockUnlockOptionComponent,
|
|
23
23
|
...createItemPage,
|
|
24
|
-
...showAlternativeAnswersComponent,
|
|
25
24
|
optionsRadioButton: () => cy.get('input[type="radio"]'),
|
|
26
25
|
optionsRadioButtonForSpecifyCorrectAnswer: () => cy.get('.radio-option-wrapper:visible input[type="radio"]'),
|
|
27
26
|
editTabOptionsWrapper: () => cy.get('.edit-mcq-option-wrapper'),
|
|
@@ -62,7 +61,6 @@ const steps = {
|
|
|
62
61
|
...lockUnlockOptionComponent.steps,
|
|
63
62
|
...createItemPage.steps,
|
|
64
63
|
...selectQuestionResourceToolPage.steps,
|
|
65
|
-
...showAlternativeAnswersComponent.steps,
|
|
66
64
|
/**
|
|
67
65
|
* Verifies the contents of an option wrapper in the 'Specify correct answer' section for single selection questions.
|
|
68
66
|
* @param {number} optionIndex - The index of the option wrapper to be verified.
|
|
@@ -730,8 +728,6 @@ const steps = {
|
|
|
730
728
|
singleSelectionPage.steps.setCorrectAnswer(correctAnswer);
|
|
731
729
|
singleSelectionPage.saveQuestionButton().click();
|
|
732
730
|
},
|
|
733
|
-
|
|
734
|
-
|
|
735
731
|
};
|
|
736
732
|
|
|
737
733
|
const tests = {
|
|
@@ -295,6 +295,22 @@ const utilities = {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
},
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Verifies the selected/not selected state of an element.
|
|
301
|
+
* @param {Cypress.Chainable} selector - The element containing the image
|
|
302
|
+
* @param {string} state - 'selected' | 'notSelected'
|
|
303
|
+
*/
|
|
304
|
+
verifiedElementSelectedNotSelectedState: (selector, state) => {
|
|
305
|
+
switch (state) {
|
|
306
|
+
case 'selected':
|
|
307
|
+
selector.should('have.attr', 'aria-pressed', 'true');
|
|
308
|
+
break;
|
|
309
|
+
case 'notSelected':
|
|
310
|
+
selector.should('have.attr', 'aria-pressed', 'false');
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
export default utilities
|
package/package.json
CHANGED
package/service.yaml
CHANGED
|
@@ -102,29 +102,21 @@ namespaces:
|
|
|
102
102
|
value: "dev"
|
|
103
103
|
- name: FILE_CONFIG
|
|
104
104
|
value: "dev"
|
|
105
|
-
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
106
|
-
value: "false"
|
|
107
105
|
qa:
|
|
108
106
|
env:
|
|
109
107
|
- name: STAGE
|
|
110
108
|
value: "qa"
|
|
111
109
|
- name: FILE_CONFIG
|
|
112
110
|
value: "qa"
|
|
113
|
-
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
114
|
-
value: "true"
|
|
115
111
|
staging:
|
|
116
112
|
env:
|
|
117
113
|
- name: STAGE
|
|
118
114
|
value: "stage"
|
|
119
115
|
- name: FILE_CONFIG
|
|
120
116
|
value: "stage"
|
|
121
|
-
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
122
|
-
value: "false"
|
|
123
117
|
prod:
|
|
124
118
|
env:
|
|
125
119
|
- name: STAGE
|
|
126
120
|
value: "prod"
|
|
127
121
|
- name: FILE_CONFIG
|
|
128
|
-
value: "prod"
|
|
129
|
-
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
130
|
-
value: "false"
|
|
122
|
+
value: "prod"
|