itemengine-cypress-automation 1.0.585-IEI-7055-cypress-9249eaa.0 → 1.0.586-IEI-7161-main-9f0d20f.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/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +0 -69
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +0 -69
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +0 -69
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +1 -69
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +0 -81
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +0 -69
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +0 -240
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +0 -235
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +3 -77
- package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +55 -1
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +182 -9
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +2 -2
- package/cypress/e2e/ILC/UploadResponse/uploadedFileProperties.js +5 -4
- package/cypress/pages/numberLineLabelPage.js +6 -7
- package/cypress/pages/numberLinePage.js +10 -15
- package/cypress/pages/uploadResponsePage.js +165 -6
- package/package.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
2
|
-
import { uploadResponsePage } from "../../../pages";
|
|
2
|
+
import { uploadResponsePage, itemPreviewPage } from "../../../pages";
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
|
6
|
+
const views = utilities.getViews(correctAnswerViews);
|
|
7
|
+
let itemReferenceID = "";
|
|
5
8
|
|
|
6
|
-
const labels =[uploadResponsePage.allowStudentToAddFileDescriptionLabel, uploadResponsePage.allowStudentToEditFileNameLabel, uploadResponsePage.displayPerFileSizeLimitToStudentLabel];
|
|
9
|
+
const labels = [uploadResponsePage.allowStudentToAddFileDescriptionLabel, uploadResponsePage.allowStudentToEditFileNameLabel, uploadResponsePage.displayPerFileSizeLimitToStudentLabel];
|
|
7
10
|
|
|
8
11
|
describe('Create question page - Upload Response: Additional Settings', () => {
|
|
9
12
|
before(() => {
|
|
@@ -43,7 +46,7 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
43
46
|
uploadResponsePage.steps.uncheckDisplayPerFileSizeLimitToStudentCheckbox();
|
|
44
47
|
});
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
it('\'Allow student to edit file name\' label and checkbox should be displayed and by default checkbox should be checked', () => {
|
|
47
50
|
utilities.verifyInnerText(uploadResponsePage.allowStudentToEditFileNameLabel(), 'Allow student to edit file name');
|
|
48
51
|
utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToEditFileNameLabel(), 'visible');
|
|
49
52
|
utilities.verifyElementVisibilityState(uploadResponsePage.allowStudentToEditFileNameCheckbox(), 'exist');
|
|
@@ -87,7 +90,7 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
87
90
|
|
|
88
91
|
it('Accessibility of \'Student view settings\' section', { tags: 'a11y' }, () => {
|
|
89
92
|
cy.checkAccessibility(uploadResponsePage.uploadControlsLabel().parents('.student-view-settings-container'))
|
|
90
|
-
})
|
|
93
|
+
});
|
|
91
94
|
});
|
|
92
95
|
|
|
93
96
|
describe('Upload controls - Preview tab', () => {
|
|
@@ -150,7 +153,7 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
150
153
|
});
|
|
151
154
|
});
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
describe('Allow student to edit file name - Preview tab', () => {
|
|
154
157
|
abortEarlySetup();
|
|
155
158
|
before(() => {
|
|
156
159
|
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
|
@@ -170,9 +173,9 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
170
173
|
uploadResponsePage.steps.uncheckAllowStudentToEditFileNameCheckbox();
|
|
171
174
|
uploadResponsePage.steps.switchToPreviewTab();
|
|
172
175
|
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
173
|
-
utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), '
|
|
176
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), 'notExist');
|
|
174
177
|
});
|
|
175
|
-
})
|
|
178
|
+
});
|
|
176
179
|
|
|
177
180
|
describe('Allow student to add file description - Preview tab', () => {
|
|
178
181
|
abortEarlySetup();
|
|
@@ -180,9 +183,9 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
180
183
|
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
|
181
184
|
cy.barsPreLoaderWait();
|
|
182
185
|
});
|
|
183
|
-
|
|
186
|
+
|
|
184
187
|
it('When the \'Allow student to add file description\' checkbox is checked then in the preview tab, then add description icon should be displayed', () => {
|
|
185
|
-
uploadResponsePage.steps.
|
|
188
|
+
uploadResponsePage.steps.verifyAllowStudentToAddFileDescriptionCheckboxChecked();
|
|
186
189
|
uploadResponsePage.steps.switchToPreviewTab();
|
|
187
190
|
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
188
191
|
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'visible');
|
|
@@ -197,4 +200,174 @@ describe('Create question page - Upload Response: Additional Settings', () => {
|
|
|
197
200
|
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'notExist');
|
|
198
201
|
});
|
|
199
202
|
});
|
|
203
|
+
|
|
204
|
+
views.forEach((view) => {
|
|
205
|
+
describe(`${view}: Student view settings default state`, () => {
|
|
206
|
+
abortEarlySetup();
|
|
207
|
+
before(() => {
|
|
208
|
+
switch (view) {
|
|
209
|
+
case 'Question preview':
|
|
210
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
|
211
|
+
cy.barsPreLoaderWait();
|
|
212
|
+
uploadResponsePage.steps.addTextInQuestionInstructionsInputField('upload response instructions.');
|
|
213
|
+
uploadResponsePage.steps.verifyAllowStudentToEditFileNameCheckboxChecked();
|
|
214
|
+
uploadResponsePage.steps.verifyAllowStudentToAddFileDescriptionCheckboxChecked();
|
|
215
|
+
uploadResponsePage.steps.verifyDisplayPerFileSizeLimitToStudentCheckboxChecked();
|
|
216
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
|
217
|
+
break;
|
|
218
|
+
case 'Item preview':
|
|
219
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
220
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
221
|
+
break;
|
|
222
|
+
case 'Student view':
|
|
223
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
224
|
+
break;
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
beforeEach(() => {
|
|
229
|
+
switch (view) {
|
|
230
|
+
case 'Question preview':
|
|
231
|
+
break;
|
|
232
|
+
case 'Item preview':
|
|
233
|
+
break;
|
|
234
|
+
case 'Student view':
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
if (view === 'Question preview') {
|
|
240
|
+
after(() => {
|
|
241
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
|
242
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
243
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
it(`When the 'Allow student to edit file name' checkbox ,then edit icon should be displayed in the ${view}`, () => {
|
|
248
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
249
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(uploadResponsePage.editDisplayTextIcon(), 0), 'visible');
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it(`When the 'Allow student to add file description' checkbox is checked, then add description icon should be displayed in the ${view}`, () => {
|
|
253
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
254
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'visible');
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it(`When the 'Display per file size limit to student' checkbox is checked then, then 'Maximum file size: #MB' should be displayed in the ${view}`, () => {
|
|
258
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.maximumFileSize(), 'visible');
|
|
259
|
+
uploadResponsePage.steps.verifyMaximumFileSizePreviewTab('20MB');
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('When the \'Capture photos\' option is selected then in the preview tab, the upload response area text should have \'Capture an image\' option', () => {
|
|
263
|
+
uploadResponsePage.steps.verifyUploadOptionVisibleInUploadResponseArea('Capture photo');
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('When the \'Drag and drop files\' option is selected then in the preview tab, the upload response area text should be \'Drag and drop files here\'', () => {
|
|
267
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadCloudIcon(), 'visible');
|
|
268
|
+
utilities.verifyInnerText(uploadResponsePage.dragAndDropFilesText(), 'Drag & Drop files here');
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('When the user clicks on the link text \'capture an image\' a \'Capture image\' popup should open', () => {
|
|
272
|
+
uploadResponsePage.steps.captureImage();
|
|
273
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'visible');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('On \'Capture image\' popup following should be displayed - \'Capture image\' title text, Camera preview, Capture and Cancel buttons', () => {
|
|
277
|
+
uploadResponsePage.steps.verifyCaptureImagePopup();
|
|
278
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.acceptButton(), 'visible');
|
|
279
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.cancelButton(), 'visible');
|
|
280
|
+
utilities.verifyInnerText(uploadResponsePage.cancelButton(), 'Cancel');
|
|
281
|
+
utilities.verifyInnerText(uploadResponsePage.acceptButton(), 'Capture');
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('When the user clicks on \'Cancel\' button the \'Capture image\' popup should close', () => {
|
|
285
|
+
uploadResponsePage.steps.clickCancelButtonInPopup();
|
|
286
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.dialogBox(), 'notExist');
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('When the user clicks on \'Capture\' button, then an image should get captured and a preview of the captured image should be displayed in place of the camera preview and also two buttons \'Retake\' and \'Save\' should be displayed in the popup and \'Cancel\' and \'Capture\' buttons should not be displayed in the popup', () => {
|
|
290
|
+
uploadResponsePage.steps.captureImage();
|
|
291
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
|
292
|
+
utilities.verifyInnerText(uploadResponsePage.cancelButton(), 'Retake');
|
|
293
|
+
utilities.verifyInnerText(uploadResponsePage.acceptButton(), 'Save');
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('When the user clicks on \'Save\' button, it should upload the captured image in the response', () => {
|
|
297
|
+
uploadResponsePage.steps.clickAcceptButtonInPopup();
|
|
298
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadingProgressBar(), 'notExist');
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
views.forEach((view) => {
|
|
304
|
+
describe.only(`${view}: Student view settings modified state`, () => {
|
|
305
|
+
abortEarlySetup();
|
|
306
|
+
before(() => {
|
|
307
|
+
switch (view) {
|
|
308
|
+
case 'Question preview':
|
|
309
|
+
uploadResponsePage.steps.navigateToCreateQuestion('upload response');
|
|
310
|
+
cy.barsPreLoaderWait();
|
|
311
|
+
uploadResponsePage.steps.addTextInQuestionInstructionsInputField('upload response instructions.');
|
|
312
|
+
uploadResponsePage.steps.uncheckAllowStudentToEditFileNameCheckbox();
|
|
313
|
+
uploadResponsePage.steps.uncheckAllowStudentToAddFileDescriptionCheckbox();
|
|
314
|
+
uploadResponsePage.steps.uncheckDisplayPerFileSizeLimitToStudentCheckbox();
|
|
315
|
+
uploadResponsePage.steps.unselectUploadControlsOption(0);
|
|
316
|
+
uploadResponsePage.steps.unselectUploadControlsOption(1);
|
|
317
|
+
uploadResponsePage.steps.switchToPreviewTab();
|
|
318
|
+
break;
|
|
319
|
+
case 'Item preview':
|
|
320
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
321
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
322
|
+
break;
|
|
323
|
+
case 'Student view':
|
|
324
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
325
|
+
break;
|
|
326
|
+
};
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
beforeEach(() => {
|
|
330
|
+
switch (view) {
|
|
331
|
+
case 'Question preview':
|
|
332
|
+
break;
|
|
333
|
+
case 'Item preview':
|
|
334
|
+
break;
|
|
335
|
+
case 'Student view':
|
|
336
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
if (view === 'Question preview') {
|
|
342
|
+
after(() => {
|
|
343
|
+
uploadResponsePage.steps.clickOnSaveQuestionButton();
|
|
344
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
345
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
it(`When the user unchecks \'Allow student to edit file name\' checkbox, then edit icon should be not be displayed in the ${view}`, () => {
|
|
350
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
351
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), 'notExist');
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it(`When the user unchecks 'Allow student to add file description' checkbox, then in the Preview tab add description icon should be not be displayed in the ${view}`, () => {
|
|
355
|
+
uploadResponsePage.steps.uploadFile('uploads/highlightImage.jpg');
|
|
356
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'notExist');
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
it(`When the user unchecks 'Display per file size limit to student' checkbox, then in the Preview tab Maximum file size: #MB should not be displayed in the ${view}`, () => {
|
|
360
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.maximumFileSize(), 'notExist');
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
it(`When the user unselects the 'Capture photos' option, then the upload response area text should not have 'capture an image' option in the ${view}`, () => {
|
|
364
|
+
uploadResponsePage.steps.verifyUploadOptionNotVisibleInUploadResponseArea('Capture photo');
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it(`When the user unselects the 'Drag and drop files' option, then the upload response area text should be 'Upload file here' in the ${view}`, () => {
|
|
368
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadCloudIcon(), 'visible');
|
|
369
|
+
utilities.verifyInnerText(uploadResponsePage.dragAndDropFilesText(), 'Upload file here');
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
});
|
|
200
373
|
});
|
|
@@ -22,7 +22,7 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it('CSS of uploaded file wrapper contents', { tags: 'css' }, () => {
|
|
25
|
-
utilities.verifyCSS(uploadResponsePage.
|
|
25
|
+
utilities.verifyCSS(uploadResponsePage.uploadedFileDownloadLinkText(), {
|
|
26
26
|
'color': css.color.linkText,
|
|
27
27
|
'font-size': css.fontSize.default,
|
|
28
28
|
'font-weight': css.fontWeight.regular
|
|
@@ -105,7 +105,7 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
|
105
105
|
|
|
106
106
|
it('On clicking on the file name, user should be able to download the file', () => {
|
|
107
107
|
uploadResponsePage.steps.uploadFile('uploads/image.png');
|
|
108
|
-
|
|
108
|
+
uploadResponsePage.steps.verifyDownloadedFilename('image.png', 0);
|
|
109
109
|
cy.wait(5000);
|
|
110
110
|
});
|
|
111
111
|
});
|
|
@@ -67,9 +67,10 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
|
67
67
|
utilities.verifyInnerText(commonComponents.tooltipText(), 'Add file description');
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
it('When the user clicks on the \'Add file description\' icon button, an input area should be displayed along with a
|
|
70
|
+
it('When the user clicks on the \'Add file description\' icon button, an input area should be displayed along with a label text: \'Add file description\'', () => {
|
|
71
71
|
uploadResponsePage.steps.clickOnAddFileDescriptionIcon();
|
|
72
|
-
uploadResponsePage.
|
|
72
|
+
utilities.verifyInnerText(uploadResponsePage.addFileDescriptionLabel(), 'Add file description');
|
|
73
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionInput(), 'visible');
|
|
73
74
|
});
|
|
74
75
|
|
|
75
76
|
it('CSS of \'Add file description\' input field', { tags: 'css' }, () => {
|
|
@@ -81,7 +82,7 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
|
81
82
|
});
|
|
82
83
|
|
|
83
84
|
it('Accessibility of \'Add file description\' input field', { tags: 'a11y' }, () => {
|
|
84
|
-
cy.checkAccessibility(uploadResponsePage.addFileDescriptionInput()
|
|
85
|
+
cy.checkAccessibility(uploadResponsePage.addFileDescriptionInput());
|
|
85
86
|
});
|
|
86
87
|
|
|
87
88
|
it('User should be able to add description text for uploaded file', () => {
|
|
@@ -244,7 +245,7 @@ describe('Create question page - Upload Response: Preview', () => {
|
|
|
244
245
|
});
|
|
245
246
|
|
|
246
247
|
it('If the user tries to download file after renaming, the file should get downloaded with the original name', () => {
|
|
247
|
-
|
|
248
|
+
uploadResponsePage.steps.verifyDownloadedFilename('imageEdited.png', 0);
|
|
248
249
|
});
|
|
249
250
|
});
|
|
250
251
|
});
|
|
@@ -40,7 +40,7 @@ const selectors = {
|
|
|
40
40
|
correctIncorrectStatusMessageText: () => cy.get('[class*="NumberLinestyles__CorrectIncorrectWrapper"]'),
|
|
41
41
|
|
|
42
42
|
//Correct answer section
|
|
43
|
-
numberLineCorrectAnswerSection: (
|
|
43
|
+
numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(2),
|
|
44
44
|
numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').last().find('svg ellipse[display="inline"]')
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -440,7 +440,7 @@ const steps = {
|
|
|
440
440
|
clickAndDropLabelOnNumberLinePreviewTab: (label, orientation, range, coordinate) => {
|
|
441
441
|
numberLineLabelPage.draggableLabelsPreviewTab()
|
|
442
442
|
.contains(label)
|
|
443
|
-
.click(
|
|
443
|
+
.click();
|
|
444
444
|
numberLineLabelPage.numberLinePreviewTab()
|
|
445
445
|
.then(($graphElement) => {
|
|
446
446
|
if (orientation === 'horizontal') {
|
|
@@ -462,7 +462,7 @@ const steps = {
|
|
|
462
462
|
const originY = graphHeight / 2;
|
|
463
463
|
const yPixel = originY - coordinate * (graphHeight / range);
|
|
464
464
|
numberLineLabelPage.numberLinePreviewTab()
|
|
465
|
-
.
|
|
465
|
+
.click(originX, yPixel, { force: true });
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
});
|
|
@@ -612,17 +612,16 @@ const steps = {
|
|
|
612
612
|
* @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
|
|
613
613
|
* @param {number} range - range of x coordinate
|
|
614
614
|
*/
|
|
615
|
-
verifyCorrectResponseOnNumberLineCorrectAnswerSection: (label, range, coordinate
|
|
616
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
615
|
+
verifyCorrectResponseOnNumberLineCorrectAnswerSection: (label, range, coordinate) => {
|
|
617
616
|
numberLineLabelPage.numberLineCorrectAnswerSection()
|
|
618
617
|
.then(($graphElement) => {
|
|
619
618
|
let graphWidth = $graphElement[0].clientWidth;
|
|
620
619
|
const originX = graphWidth / 2 + tolerance / 2;
|
|
621
620
|
const xPixel = originX + coordinate * ((graphWidth - tolerance) / range);
|
|
622
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
621
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][display="inline"]:visible`)
|
|
623
622
|
.should('have.css', 'fill', css.color.correctAnswer);
|
|
624
623
|
});
|
|
625
|
-
numberLineLabelPage.numberLineCorrectAnswerSection(
|
|
624
|
+
numberLineLabelPage.numberLineCorrectAnswerSection()
|
|
626
625
|
.parents('.ngie-jxgbox')
|
|
627
626
|
.within(() => {
|
|
628
627
|
numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
|
|
@@ -607,8 +607,7 @@ const steps = {
|
|
|
607
607
|
* @param {number} coordinates[].x - x coordinate to be plotted on the graph
|
|
608
608
|
* @param {number} coordinates[].xRange - range of x coordinate
|
|
609
609
|
*/
|
|
610
|
-
verifyCorrectPointsOnNumberLineCorrectAnswerSection: (range, coordinates
|
|
611
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
610
|
+
verifyCorrectPointsOnNumberLineCorrectAnswerSection: (range, coordinates) => {
|
|
612
611
|
coordinates.forEach(x => {
|
|
613
612
|
numberLinePage.numberLineCorrectAnswerSection()
|
|
614
613
|
.then(($graphElement) => {
|
|
@@ -617,7 +616,7 @@ const steps = {
|
|
|
617
616
|
const originX = graphWidth / 2 + tolerance / 2;
|
|
618
617
|
const originY = graphHeight / 2;
|
|
619
618
|
const xPixel = originX + x * ((graphWidth - tolerance) / range);
|
|
620
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
619
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][display="inline"]`)
|
|
621
620
|
.should('have.css', 'stroke', css.color.correctAnswer);
|
|
622
621
|
});
|
|
623
622
|
});
|
|
@@ -671,8 +670,7 @@ const steps = {
|
|
|
671
670
|
* @param {number} range - The uniform range of coordinates.
|
|
672
671
|
* @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
|
|
673
672
|
*/
|
|
674
|
-
verifyCorrectLineSegmentOnNumberLineCorrectAnswerSection: (range, coordinates
|
|
675
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
673
|
+
verifyCorrectLineSegmentOnNumberLineCorrectAnswerSection: (range, coordinates) => {
|
|
676
674
|
coordinates.forEach(({ x1, x2 }) => {
|
|
677
675
|
numberLinePage.numberLineCorrectAnswerSection()
|
|
678
676
|
.then(($graphElement) => {
|
|
@@ -682,7 +680,7 @@ const steps = {
|
|
|
682
680
|
const originY = graphHeight / 2;
|
|
683
681
|
const x1Pixel = originX + x1 * ((graphWidth - tolerance) / range);
|
|
684
682
|
const x2Pixel = originX + x2 * ((graphWidth - tolerance) / range);
|
|
685
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
683
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
|
|
686
684
|
.should('have.css', 'stroke', css.color.correctAnswer);
|
|
687
685
|
});
|
|
688
686
|
});
|
|
@@ -694,8 +692,7 @@ const steps = {
|
|
|
694
692
|
* @param {number} range - The range of the number line.
|
|
695
693
|
* @param {number} startingPoint - It representing the starting point of the ray.
|
|
696
694
|
*/
|
|
697
|
-
verifyCorrectRayOnNumberLineCorrectAnswerSection: (direction, range, startingPoint
|
|
698
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
695
|
+
verifyCorrectRayOnNumberLineCorrectAnswerSection: (direction, range, startingPoint) => {
|
|
699
696
|
numberLinePage.numberLineCorrectAnswerSection()
|
|
700
697
|
.then(($graphElement) => {
|
|
701
698
|
const graphWidth = $graphElement[0].clientWidth;
|
|
@@ -705,7 +702,7 @@ const steps = {
|
|
|
705
702
|
const x1Pixel = originX + startingPoint * ((graphWidth - tolerance) / range);
|
|
706
703
|
const rayArrowWidth = 18;
|
|
707
704
|
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
|
708
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
705
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
|
|
709
706
|
.should('have.css', 'stroke', css.color.correctAnswer);
|
|
710
707
|
});
|
|
711
708
|
},
|
|
@@ -952,8 +949,7 @@ const steps = {
|
|
|
952
949
|
* @param {number} range - The range of the number line.
|
|
953
950
|
* @param {number[]} coordinates - The y-coordinates of the points.
|
|
954
951
|
*/
|
|
955
|
-
verifyCorrectPointsOnVerticalNumberLineCorrectAnswerSection: (range, coordinates
|
|
956
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
952
|
+
verifyCorrectPointsOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
|
957
953
|
coordinates.forEach(y => {
|
|
958
954
|
numberLinePage.numberLineCorrectAnswerSection()
|
|
959
955
|
.then(($graphElement) => {
|
|
@@ -962,7 +958,7 @@ const steps = {
|
|
|
962
958
|
const originX = graphWidth / 2;
|
|
963
959
|
const originY = graphHeight / 2 - tolerance / 2;
|
|
964
960
|
const yPixel = originY - y * ((graphHeight - tolerance) / range);
|
|
965
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
961
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][display="inline"]`)
|
|
966
962
|
.should('have.css', 'stroke', css.color.correctAnswer);
|
|
967
963
|
});
|
|
968
964
|
});
|
|
@@ -1113,8 +1109,7 @@ const steps = {
|
|
|
1113
1109
|
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
|
1114
1110
|
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
|
1115
1111
|
*/
|
|
1116
|
-
verifyCorrectLineSegmentOnVerticalNumberLineCorrectAnswerSection: (range, coordinates
|
|
1117
|
-
let index = isAlternativeAnswer ? 2 : 1;
|
|
1112
|
+
verifyCorrectLineSegmentOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
|
1118
1113
|
coordinates.forEach(({ y1, y2 }) => {
|
|
1119
1114
|
numberLinePage.numberLineCorrectAnswerSection()
|
|
1120
1115
|
.then(($graphElement) => {
|
|
@@ -1124,7 +1119,7 @@ const steps = {
|
|
|
1124
1119
|
const originY = graphHeight / 2 - tolerance / 2;
|
|
1125
1120
|
const y1Pixel = originY - y1 * ((graphHeight - tolerance) / range);
|
|
1126
1121
|
const y2Pixel = originY - y2 * ((graphHeight - tolerance) / range);
|
|
1127
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(
|
|
1122
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
|
1128
1123
|
.should('have.css', 'stroke', css.color.correctAnswer);
|
|
1129
1124
|
});
|
|
1130
1125
|
});
|