itemengine-cypress-automation 1.0.492-IEI-3121-b7f4a95.0 → 1.0.492-IEI-6793-f686b40.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.
@@ -2,13 +2,8 @@ import utilities from "../../support/helpers/utilities";
|
|
2
2
|
import { createQuestionBasePage } from "./createQuestionBasePage";
|
3
3
|
import { layoutSectionComponent } from "./layoutSectionComponent";
|
4
4
|
import { commonComponents } from "./commonComponents";
|
5
|
-
const lineSettingsOptions = ['Decimals', 'Fractions', 'Mixed fractions'
|
5
|
+
const lineSettingsOptions = ['Integers', 'Decimals', 'Fractions', 'Mixed fractions'];
|
6
6
|
const numbers = ['-9.50', "-\n19\n2", "-9\n1\n2"]
|
7
|
-
const thousandsSeparatorOptions = ['Comma', 'Space', 'None'];
|
8
|
-
const decimalValues =['6,000.5', '6 000.5', '6000.5']
|
9
|
-
const fractionValues =['12001\n2', '12001\n2', '12001\n2']
|
10
|
-
const mixedFractionValues =['6,000\n1\n2', '6 000\n1\n2', '6000\n1\n2']
|
11
|
-
const wholeNumberValues =['1,000.5', '1 000.5', '1000.5']
|
12
7
|
|
13
8
|
const selectors = {
|
14
9
|
...layoutSectionComponent,
|
@@ -35,13 +30,6 @@ const selectors = {
|
|
35
30
|
// toleranceThresholdInputField: () => cy.get('[class*="AllocatedPointsstyles__PointsWrapper"] input'),
|
36
31
|
pointsInputField: () => cy.get('.ngie-accordion-detail .points-input-field input[type="text"]'),
|
37
32
|
pointsInputFieldForManualScoring: () => cy.get('.points-input-field input[type="text"]'),
|
38
|
-
|
39
|
-
//thousand separator section
|
40
|
-
thousandSeparatorLabel: () => cy.get('.number-line-grid-setting .single-select-toggle-group-title').eq(2),
|
41
|
-
thousandSeparatorToggleButtonContainer: () => cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(2),
|
42
|
-
thousandSeparatorToggleButton: (ariaLabel) => {
|
43
|
-
return cy.get(`div[role="group"] button[aria-label="Thousands separator ${ariaLabel}"]`);
|
44
|
-
},
|
45
33
|
}
|
46
34
|
|
47
35
|
const steps = {
|
@@ -404,123 +392,6 @@ const steps = {
|
|
404
392
|
.blur();
|
405
393
|
},
|
406
394
|
|
407
|
-
/**
|
408
|
-
* Verifies that the toggle button with the specified ARIA label is selected.
|
409
|
-
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
410
|
-
*/
|
411
|
-
verifyThousandSeparatorToggleButtonSelected: (ariaLabel) => {
|
412
|
-
numberLineCommonComponent.thousandSeparatorToggleButton(ariaLabel)
|
413
|
-
.should('have.attr', 'aria-pressed', 'true');
|
414
|
-
},
|
415
|
-
|
416
|
-
/**
|
417
|
-
* Selects the toggle button with the specified ARIA label.
|
418
|
-
* @param {string} ariaLabel - The ARIA label of the toggle button to select.
|
419
|
-
*/
|
420
|
-
selectThousandSeparatorToggleButton: (ariaLabel) => {
|
421
|
-
numberLineCommonComponent.thousandSeparatorToggleButton(ariaLabel)
|
422
|
-
.click();
|
423
|
-
},
|
424
|
-
|
425
|
-
/**
|
426
|
-
* Verifies the label on the number line.
|
427
|
-
* @param {Array} values - An array of objects containing the value and index of each label.
|
428
|
-
*/
|
429
|
-
verifyThousandSeparatorLabelOnNumberLineNumberLineSection: (values) => {
|
430
|
-
values.forEach(({ value, index }) => {
|
431
|
-
utilities.verifyInnerText(numberLineCommonComponent.numberLineNumberLineSection()
|
432
|
-
.parents('.ngie-jxgbox')
|
433
|
-
.find('.number-line-tick-font')
|
434
|
-
.eq(index)
|
435
|
-
, value
|
436
|
-
);
|
437
|
-
});
|
438
|
-
},
|
439
|
-
|
440
|
-
/**
|
441
|
-
* Verifies the label on the number line PreviewTab.
|
442
|
-
* @param {Array} values - An array of objects containing the value and index of each label.
|
443
|
-
*/
|
444
|
-
verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab: (values) => {
|
445
|
-
values.forEach(({ value, index }) => {
|
446
|
-
utilities.verifyInnerText(numberLineCommonComponent.numberLinePreviewTab()
|
447
|
-
.parents('.ngie-jxgbox')
|
448
|
-
.find('.number-line-tick-font')
|
449
|
-
.eq(index)
|
450
|
-
, value
|
451
|
-
);
|
452
|
-
});
|
453
|
-
},
|
454
|
-
|
455
|
-
/**
|
456
|
-
* Verifies the label on the number line in specify correct answer section.
|
457
|
-
* @param {Array} values - An array of objects containing the value and index of each label.
|
458
|
-
*/
|
459
|
-
verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection: (values) => {
|
460
|
-
values.forEach(({ value, index }) => {
|
461
|
-
utilities.verifyInnerText(numberLineCommonComponent.numberLineSpecifyCorrectAnswer()
|
462
|
-
.parents('.ngie-jxgbox')
|
463
|
-
.find('.number-line-tick-font')
|
464
|
-
.eq(index)
|
465
|
-
, value
|
466
|
-
);
|
467
|
-
});
|
468
|
-
},
|
469
|
-
|
470
|
-
/**
|
471
|
-
* Returns the value and its corresponding index on the number line
|
472
|
-
* based on the selected line settings option and inner index.
|
473
|
-
*
|
474
|
-
* @param {string} option - The selected line settings option ('Decimals', 'Fractions', etc.).
|
475
|
-
* @param {number} innerIndex - The index used to retrieve the correct value from the data array.
|
476
|
-
* @returns {{ value: string, index: number } | null} An object containing the value and index, or null if option is unrecognized.
|
477
|
-
*/
|
478
|
-
getThousandSeparatorValue:(option, innerIndex) =>{
|
479
|
-
switch (option) {
|
480
|
-
case 'Whole numbers':
|
481
|
-
return { value: wholeNumberValues[innerIndex], index: 0 };
|
482
|
-
case 'Decimals':
|
483
|
-
return { value: decimalValues[innerIndex], index: 10 };
|
484
|
-
case 'Fractions':
|
485
|
-
return { value: fractionValues[innerIndex], index: 10 };
|
486
|
-
case 'Mixed fractions':
|
487
|
-
return { value: mixedFractionValues[innerIndex], index: 10 };
|
488
|
-
default:
|
489
|
-
console.log(`Unrecognized option: ${option}`);
|
490
|
-
}
|
491
|
-
},
|
492
|
-
|
493
|
-
/**
|
494
|
-
* Verifies the presence of the correct thousand separator label in one or more UI sections
|
495
|
-
* based on the selected line settings option and inner index.
|
496
|
-
*
|
497
|
-
* @param {string} option - The selected line settings option ('Decimals', 'Fractions', etc.).
|
498
|
-
* @param {number} innerIndex - The index used to retrieve the correct value from the data array.
|
499
|
-
* @param {string[]} sections - The list of sections to perform verification in.
|
500
|
-
* Valid values: ['preview', 'numberLine', 'correctAnswer']
|
501
|
-
*/
|
502
|
-
verifyThousandSeparatorForSections: (option, innerIndex, sections = []) => {
|
503
|
-
const valueObj = numberLineCommonComponent.steps.getThousandSeparatorValue(option, innerIndex);
|
504
|
-
if (!valueObj) return;
|
505
|
-
|
506
|
-
sections.forEach((section) => {
|
507
|
-
switch (section) {
|
508
|
-
case 'preview':
|
509
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab([valueObj]);
|
510
|
-
break;
|
511
|
-
case 'numberLine':
|
512
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSection([valueObj]);
|
513
|
-
break;
|
514
|
-
case 'correctAnswer':
|
515
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection([valueObj]);
|
516
|
-
break;
|
517
|
-
default:
|
518
|
-
console.log(`Unknown verification section: ${section}`);
|
519
|
-
break;
|
520
|
-
}
|
521
|
-
});
|
522
|
-
},
|
523
|
-
|
524
395
|
}
|
525
396
|
|
526
397
|
const tests = {
|
@@ -887,7 +758,7 @@ const tests = {
|
|
887
758
|
});
|
888
759
|
|
889
760
|
it('When user enters value in Display specific annotation (use semicolons to separate) input field then it should be displayed on number line in Number line section and Specify correct answer section', () => {
|
890
|
-
numberLineCommonComponent.steps.selectLineSettingsToggleButton(lineSettingsOptions[
|
761
|
+
numberLineCommonComponent.steps.selectLineSettingsToggleButton(lineSettingsOptions[1]);
|
891
762
|
numberLineCommonComponent.steps.enterTextInDisplaySpecificAnnotationInputField('-9.25;');
|
892
763
|
numberLineCommonComponent.steps.verifyTextInDisplaySpecificAnnotationInputField('-9.25;');
|
893
764
|
cy.wait(200);
|
@@ -918,7 +789,7 @@ const tests = {
|
|
918
789
|
|
919
790
|
it('When user enters value in Display specific annotation (use semicolons to separate) input field then it should be displayed on number line in preview tab', () => {
|
920
791
|
numberLineCommonComponent.steps.switchToEditTab();
|
921
|
-
numberLineCommonComponent.steps.selectLineSettingsToggleButton(lineSettingsOptions[
|
792
|
+
numberLineCommonComponent.steps.selectLineSettingsToggleButton(lineSettingsOptions[1]);
|
922
793
|
numberLineCommonComponent.steps.enterTextInDisplaySpecificAnnotationInputField('-9.25;');
|
923
794
|
numberLineCommonComponent.steps.verifyTextInDisplaySpecificAnnotationInputField('-9.25;');
|
924
795
|
numberLineCommonComponent.steps.switchToPreviewTab();
|
@@ -948,49 +819,6 @@ const tests = {
|
|
948
819
|
// numberLineCommonComponent.steps.setToleranceThresholdValue(2);
|
949
820
|
// });
|
950
821
|
// }
|
951
|
-
|
952
|
-
verifyThousandSeparatorContent: () => {
|
953
|
-
it(`Thousand separator label and 3 options ${thousandsSeparatorOptions} should be displayed and by default ${thousandsSeparatorOptions[0]} should be selected`, () => {
|
954
|
-
utilities.verifyInnerText(numberLineCommonComponent.thousandSeparatorLabel(), 'Thousands separator');
|
955
|
-
utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorLabel(), 'visible');
|
956
|
-
utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorToggleButtonContainer(), 'visible');
|
957
|
-
thousandsSeparatorOptions.forEach((label) => {
|
958
|
-
utilities.verifyInnerText(numberLineCommonComponent.thousandSeparatorToggleButton(label), label);
|
959
|
-
utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorToggleButton(label), 'visible');
|
960
|
-
});
|
961
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsSeparatorOptions[2]);
|
962
|
-
});
|
963
|
-
},
|
964
|
-
|
965
|
-
verifyThousandSeparatorFunctionality: () => {
|
966
|
-
lineSettingsOptions.forEach((option, index) => {
|
967
|
-
thousandsSeparatorOptions.forEach((thousandsOption, innerIndex) => {
|
968
|
-
it(`When user selects ${option} in line settings section and selects ${thousandsOption} in thousands separator section, then number displayed on number line should be updated to ${thousandsOption} in number line section and specify correct answer section`, () => {
|
969
|
-
numberLineCommonComponent.steps.selectLineSettingsToggleButton(option);
|
970
|
-
numberLineCommonComponent.steps.verifyLineSettingsToggleButtonSelected(option);
|
971
|
-
numberLineCommonComponent.steps.selectThousandSeparatorToggleButton(thousandsOption);
|
972
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsOption);
|
973
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorForSections(option, innerIndex, ['numberLine', 'correctAnswer']);
|
974
|
-
});
|
975
|
-
});
|
976
|
-
});
|
977
|
-
},
|
978
|
-
|
979
|
-
verifyThousandSeparatorPreviewTabFunctionality: () => {
|
980
|
-
lineSettingsOptions.forEach((option, index) => {
|
981
|
-
thousandsSeparatorOptions.forEach((thousandsOption, innerIndex) => {
|
982
|
-
it(`When user selects ${option} in line settings section and selects ${thousandsOption} in thousands separator section, then number displayed on number line should be updated to ${thousandsOption} in preview tab`, () => {
|
983
|
-
numberLineCommonComponent.steps.switchToEditTab();
|
984
|
-
numberLineCommonComponent.steps.selectLineSettingsToggleButton(option);
|
985
|
-
numberLineCommonComponent.steps.verifyLineSettingsToggleButtonSelected(option);
|
986
|
-
numberLineCommonComponent.steps.selectThousandSeparatorToggleButton(thousandsOption);
|
987
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsOption);
|
988
|
-
numberLineCommonComponent.steps.switchToPreviewTab();
|
989
|
-
numberLineCommonComponent.steps.verifyThousandSeparatorForSections(option, innerIndex, ['preview']);
|
990
|
-
});
|
991
|
-
});
|
992
|
-
});
|
993
|
-
}
|
994
822
|
}
|
995
823
|
|
996
824
|
export const numberLineCommonComponent = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.492-IEI-
|
3
|
+
"version": "1.0.492-IEI-6793-f686b40.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -39,12 +39,14 @@
|
|
39
39
|
"dependencies": {
|
40
40
|
"@cypress/grep": "^3.1.5",
|
41
41
|
"axe-core": "^4.7.1",
|
42
|
+
"axios": "^1.12.2",
|
42
43
|
"cy-verify-downloads": "^0.1.11",
|
43
44
|
"cy2": "^4.0.9",
|
44
45
|
"cypress": "^12.17.2",
|
45
46
|
"cypress-axe": "^1.4.0",
|
46
47
|
"cypress-file-upload": "^5.0.8",
|
47
48
|
"cypress-real-events": "^1.7.6",
|
49
|
+
"dotenv": "^17.2.2",
|
48
50
|
"node-fetch": "^3.3.2",
|
49
51
|
"react-uuid": "^2.0.0",
|
50
52
|
"typescript": "^5.6.3"
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import { numberLinePage } from "../../../pages";
|
2
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
-
|
4
|
-
describe('Create item - Number line : Thousands separator section', () => {
|
5
|
-
|
6
|
-
before(() => {
|
7
|
-
cy.loginAs('admin');
|
8
|
-
});
|
9
|
-
|
10
|
-
describe('Thousands separator - Edit tab content', () => {
|
11
|
-
abortEarlySetup();
|
12
|
-
before(() => {
|
13
|
-
numberLinePage.steps.navigateToCreateQuestion('Number line');
|
14
|
-
cy.barsPreLoaderWait();
|
15
|
-
numberLinePage.steps.addTextInQuestionInstructionsInputField('Plot points on the number line');
|
16
|
-
});
|
17
|
-
|
18
|
-
numberLinePage.tests.verifyThousandSeparatorContent();
|
19
|
-
});
|
20
|
-
|
21
|
-
describe('Thousands separator - Edit tab functionality', () => {
|
22
|
-
abortEarlySetup();
|
23
|
-
before(() => {
|
24
|
-
numberLinePage.steps.navigateToCreateQuestion('Number line');
|
25
|
-
cy.barsPreLoaderWait();
|
26
|
-
numberLinePage.steps.addTextInQuestionInstructionsInputField('Plot points on the number line');
|
27
|
-
numberLinePage.steps.enterTextInIntervalInputField(500);
|
28
|
-
numberLinePage.steps.enterTextInAnnotateEveryInputField(10);
|
29
|
-
numberLinePage.steps.enterTextInMinInputField(1000.5);
|
30
|
-
numberLinePage.steps.enterTextInMaxInputField(10000.5);
|
31
|
-
});
|
32
|
-
|
33
|
-
numberLinePage.tests.verifyThousandSeparatorFunctionality();
|
34
|
-
});
|
35
|
-
|
36
|
-
describe('Thousands separator - Preview tab functionality', () => {
|
37
|
-
abortEarlySetup();
|
38
|
-
before(() => {
|
39
|
-
numberLinePage.steps.navigateToCreateQuestion('Number line');
|
40
|
-
cy.barsPreLoaderWait();
|
41
|
-
numberLinePage.steps.addTextInQuestionInstructionsInputField('Plot points on the number line');
|
42
|
-
numberLinePage.steps.enterTextInIntervalInputField(500);
|
43
|
-
numberLinePage.steps.enterTextInAnnotateEveryInputField(10);
|
44
|
-
numberLinePage.steps.enterTextInMinInputField(1000.5);
|
45
|
-
numberLinePage.steps.enterTextInMaxInputField(10000.5);
|
46
|
-
numberLinePage.steps.switchToPreviewTab();
|
47
|
-
});
|
48
|
-
|
49
|
-
numberLinePage.tests.verifyThousandSeparatorPreviewTabFunctionality();
|
50
|
-
});
|
51
|
-
});
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import { numberLineLabelPage } from "../../../pages";
|
2
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
-
|
4
|
-
describe('Create item - Number line : Thousands separator section', () => {
|
5
|
-
|
6
|
-
before(() => {
|
7
|
-
cy.loginAs('admin');
|
8
|
-
});
|
9
|
-
|
10
|
-
describe('Thousands separator - Edit tab content', () => {
|
11
|
-
abortEarlySetup();
|
12
|
-
before(() => {
|
13
|
-
numberLineLabelPage.steps.navigateToCreateQuestion('Number line');
|
14
|
-
cy.barsPreLoaderWait();
|
15
|
-
numberLineLabelPage.steps.navigateToLabelNumberLineTab();
|
16
|
-
numberLineLabelPage.steps.addTextInQuestionInstructionsInputField('Label on the number line');
|
17
|
-
});
|
18
|
-
|
19
|
-
numberLineLabelPage.tests.verifyThousandSeparatorContent();
|
20
|
-
});
|
21
|
-
|
22
|
-
describe('Thousands separator - Edit tab functionality', () => {
|
23
|
-
abortEarlySetup();
|
24
|
-
before(() => {
|
25
|
-
numberLineLabelPage.steps.navigateToCreateQuestion('Number line');
|
26
|
-
cy.barsPreLoaderWait();
|
27
|
-
numberLineLabelPage.steps.navigateToLabelNumberLineTab();
|
28
|
-
numberLineLabelPage.steps.addTextInQuestionInstructionsInputField('Label on the number line');
|
29
|
-
numberLineLabelPage.steps.enterTextInIntervalInputField(500);
|
30
|
-
numberLineLabelPage.steps.enterTextInAnnotateEveryInputField(10);
|
31
|
-
numberLineLabelPage.steps.enterTextInMinInputField(1000.5);
|
32
|
-
numberLineLabelPage.steps.enterTextInMaxInputField(10000.5);
|
33
|
-
});
|
34
|
-
|
35
|
-
numberLineLabelPage.tests.verifyThousandSeparatorFunctionality();
|
36
|
-
});
|
37
|
-
|
38
|
-
describe('Thousands separator - Preview tab functionality', () => {
|
39
|
-
abortEarlySetup();
|
40
|
-
before(() => {
|
41
|
-
numberLineLabelPage.steps.navigateToCreateQuestion('Number line');
|
42
|
-
cy.barsPreLoaderWait();
|
43
|
-
numberLineLabelPage.steps.navigateToLabelNumberLineTab();
|
44
|
-
numberLineLabelPage.steps.addTextInQuestionInstructionsInputField('Label on the number line');
|
45
|
-
numberLineLabelPage.steps.enterTextInIntervalInputField(500);
|
46
|
-
numberLineLabelPage.steps.enterTextInAnnotateEveryInputField(10);
|
47
|
-
numberLineLabelPage.steps.enterTextInMinInputField(1000.5);
|
48
|
-
numberLineLabelPage.steps.enterTextInMaxInputField(10000.5);
|
49
|
-
numberLineLabelPage.steps.switchToPreviewTab();
|
50
|
-
});
|
51
|
-
|
52
|
-
numberLineLabelPage.tests.verifyThousandSeparatorPreviewTabFunctionality();
|
53
|
-
});
|
54
|
-
});
|