itemengine-cypress-automation 1.0.484-IEI-6793-de92626.0 → 1.0.485-IEI-3121-c55fa67.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.
@@ -0,0 +1,51 @@
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
+ });
@@ -0,0 +1,54 @@
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
+ });
@@ -4,6 +4,12 @@ import { layoutSectionComponent } from "./layoutSectionComponent";
4
4
  import { commonComponents } from "./commonComponents";
5
5
  const lineSettingsOptions = ['Whole numbers', 'Decimals', 'Fractions', 'Mixed fractions'];
6
6
  const numbers = ['-9.50', "-\n19\n2", "-9\n1\n2"]
7
+ const lineSettingsOption = ['Decimals', 'Fractions', 'Mixed fractions', 'Whole numbers'];
8
+ const thousandsSeparatorOptions = ['Comma', 'Space', 'None'];
9
+ const decimalValues =['6,000.5', '6 000.5', '6000.5']
10
+ const fractionValues =['12001\n2', '12001\n2', '12001\n2']
11
+ const mixedFractionValues =['6,000\n1\n2', '6 000\n1\n2', '6000\n1\n2']
12
+ const wholeNumberValues =['1,000.5', '1 000.5', '1000.5']
7
13
 
8
14
  const selectors = {
9
15
  ...layoutSectionComponent,
@@ -30,6 +36,13 @@ const selectors = {
30
36
  // toleranceThresholdInputField: () => cy.get('[class*="AllocatedPointsstyles__PointsWrapper"] input'),
31
37
  pointsInputField: () => cy.get('.ngie-accordion-detail .points-input-field input[type="text"]'),
32
38
  pointsInputFieldForManualScoring: () => cy.get('.points-input-field input[type="text"]'),
39
+
40
+ //thousand separator section
41
+ thousandSeparatorLabel: () => cy.get('.number-line-grid-setting .single-select-toggle-group-title').eq(2),
42
+ thousandSeparatorToggleButtonContainer: () => cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(2),
43
+ thousandSeparatorToggleButton: (ariaLabel) => {
44
+ return cy.get(`div[role="group"] button[aria-label="Thousands separator ${ariaLabel}"]`);
45
+ },
33
46
  }
34
47
 
35
48
  const steps = {
@@ -392,6 +405,69 @@ const steps = {
392
405
  .blur();
393
406
  },
394
407
 
408
+ /**
409
+ * Verifies that the toggle button with the specified ARIA label is selected.
410
+ * @param {string} ariaLabel - The ARIA label of the toggle button to verify.
411
+ */
412
+ verifyThousandSeparatorToggleButtonSelected: (ariaLabel) => {
413
+ numberLineCommonComponent.thousandSeparatorToggleButton(ariaLabel)
414
+ .should('have.attr', 'aria-pressed', 'true');
415
+ },
416
+
417
+ /**
418
+ * Selects the toggle button with the specified ARIA label.
419
+ * @param {string} ariaLabel - The ARIA label of the toggle button to select.
420
+ */
421
+ selectThousandSeparatorToggleButton: (ariaLabel) => {
422
+ numberLineCommonComponent.thousandSeparatorToggleButton(ariaLabel)
423
+ .click();
424
+ },
425
+
426
+ /**
427
+ * Verifies the label on the number line.
428
+ * @param {Array} values - An array of objects containing the value and index of each label.
429
+ */
430
+ verifyThousandSeparatorLabelOnNumberLineNumberLineSection: (values) => {
431
+ values.forEach(({ value, index }) => {
432
+ utilities.verifyInnerText(numberLineCommonComponent.numberLineNumberLineSection()
433
+ .parents('.ngie-jxgbox')
434
+ .find('.number-line-tick-font')
435
+ .eq(index)
436
+ , value
437
+ );
438
+ });
439
+ },
440
+
441
+ /**
442
+ * Verifies the label on the number line PreviewTab.
443
+ * @param {Array} values - An array of objects containing the value and index of each label.
444
+ */
445
+ verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab: (values) => {
446
+ values.forEach(({ value, index }) => {
447
+ utilities.verifyInnerText(numberLineCommonComponent.numberLinePreviewTab()
448
+ .parents('.ngie-jxgbox')
449
+ .find('.number-line-tick-font')
450
+ .eq(index)
451
+ , value
452
+ );
453
+ });
454
+ },
455
+
456
+ /**
457
+ * Verifies the label on the number line in specify correct answer section.
458
+ * @param {Array} values - An array of objects containing the value and index of each label.
459
+ */
460
+ verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection: (values) => {
461
+ values.forEach(({ value, index }) => {
462
+ utilities.verifyInnerText(numberLineCommonComponent.numberLineSpecifyCorrectAnswer()
463
+ .parents('.ngie-jxgbox')
464
+ .find('.number-line-tick-font')
465
+ .eq(index)
466
+ , value
467
+ );
468
+ });
469
+ },
470
+
395
471
  }
396
472
 
397
473
  const tests = {
@@ -819,6 +895,75 @@ const tests = {
819
895
  // numberLineCommonComponent.steps.setToleranceThresholdValue(2);
820
896
  // });
821
897
  // }
898
+
899
+ verifyThousandSeparatorContent: () => {
900
+ it(`Thousand separator label and 3 options ${thousandsSeparatorOptions} should be displayed and by default ${thousandsSeparatorOptions[0]} should be selected`, () => {
901
+ utilities.verifyInnerText(numberLineCommonComponent.thousandSeparatorLabel(), 'Thousands separator');
902
+ utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorLabel(), 'visible');
903
+ utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorToggleButtonContainer(), 'visible');
904
+ thousandsSeparatorOptions.forEach((label) => {
905
+ utilities.verifyInnerText(numberLineCommonComponent.thousandSeparatorToggleButton(label), label);
906
+ utilities.verifyElementVisibilityState(numberLineCommonComponent.thousandSeparatorToggleButton(label), 'visible');
907
+ });
908
+ numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsSeparatorOptions[2]);
909
+ });
910
+ },
911
+
912
+ verifyThousandSeparatorFunctionality: () => {
913
+ lineSettingsOption.forEach((option, index) => {
914
+ thousandsSeparatorOptions.forEach((thousandsOption, innerIndex) => {
915
+ 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`, () => {
916
+ numberLineCommonComponent.steps.selectLineSettingsToggleButton(option);
917
+ numberLineCommonComponent.steps.verifyLineSettingsToggleButtonSelected(option);
918
+ numberLineCommonComponent.steps.selectThousandSeparatorToggleButton(thousandsOption);
919
+ numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsOption);
920
+ if (option === 'Decimals') {
921
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSection([{ value: decimalValues[innerIndex], index: 10 }]);
922
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: decimalValues[innerIndex], index: 10 }]);
923
+ }
924
+ else if (option === 'Fractions') {
925
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSection([{ value: fractionValues[innerIndex], index: 10 }]);
926
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: fractionValues[innerIndex], index: 10 }]);
927
+ }
928
+ else if (option === 'Mixed fractions') {
929
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSection([{ value: mixedFractionValues[innerIndex], index: 10 }]);
930
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: mixedFractionValues[innerIndex], index: 10 }]);
931
+ }
932
+ else {
933
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSection([{ value: wholeNumberValues[innerIndex], index: 0 }]);
934
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: wholeNumberValues[innerIndex], index: 0 }]);
935
+ }
936
+ });
937
+ });
938
+ });
939
+ },
940
+
941
+ verifyThousandSeparatorPreviewTabFunctionality: () => {
942
+ lineSettingsOption.forEach((option, index) => {
943
+ thousandsSeparatorOptions.forEach((thousandsOption, innerIndex) => {
944
+ 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`, () => {
945
+ numberLineCommonComponent.steps.switchToEditTab();
946
+ numberLineCommonComponent.steps.selectLineSettingsToggleButton(option);
947
+ numberLineCommonComponent.steps.verifyLineSettingsToggleButtonSelected(option);
948
+ numberLineCommonComponent.steps.selectThousandSeparatorToggleButton(thousandsOption);
949
+ numberLineCommonComponent.steps.verifyThousandSeparatorToggleButtonSelected(thousandsOption);
950
+ numberLineCommonComponent.steps.switchToPreviewTab();
951
+ if (option === 'Decimals') {
952
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab([{ value: decimalValues[innerIndex], index: 10 }]);
953
+ }
954
+ else if (option === 'Fractions') {
955
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab([{ value: fractionValues[innerIndex], index: 10 }]);
956
+ }
957
+ else if (option === 'Mixed fractions') {
958
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab([{ value: mixedFractionValues[innerIndex], index: 10 }]);
959
+ }
960
+ else {
961
+ numberLineCommonComponent.steps.verifyThousandSeparatorLabelOnNumberLineNumberLineSectionPreviewTab([{ value: wholeNumberValues[innerIndex], index: 0 }]);
962
+ }
963
+ });
964
+ });
965
+ });
966
+ }
822
967
  }
823
968
 
824
969
  export const numberLineCommonComponent = {
@@ -1,6 +1,6 @@
1
1
  global:
2
2
  name: itemengine-audio-response
3
- type: test
3
+ type: job
4
4
  autoDeploy:
5
5
  enabled: true
6
6
  highestEnvironment: dev
@@ -13,7 +13,6 @@ deployment:
13
13
  parallelism: 7
14
14
  image:
15
15
  cmd: /ie-e2e/deploy/audioResponseQuestion/run.sh
16
- buildContext: ../..
17
16
  resources:
18
17
  limits:
19
18
  memory: 8446Mi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.484-IEI-6793-de92626.0",
3
+ "version": "1.0.485-IEI-3121-c55fa67.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {