itemengine-cypress-automation 1.0.504-IEI-6793-v4-88cc369.0 → 1.0.504-dependabot-npm-and-yarn-multi-92087b3b2d-322b243.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,64 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { chartsBarPage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const lineSettingsOptions = ['Integers', 'Decimals', 'Fractions', 'Mixed fractions'];
6
+ const integerValues = ['10', '9', '8', '7', '6', '5', '4', '3', '2', '1', '0'];
7
+ const integerIfDecimalsExist = ['10', '', '9', '', '8', '', '7', '', '6', '', '5', '', '4', '', '3', '', '2', '', '1', '', '0'];
8
+ const decimalValues = ['10', '9.5', '9', '8.5', '8', '7.5', '7', '6.5', '6', '5.5', '5', '4.5', '4', '3.5', '3', '2.5', '2', '1.5', '1', '0.5', '0'];
9
+ // The fraction values are represented like this: 19/2 = 192, 17/2 = 172, 3/2 = 32, 1/2 = 12 etc.
10
+ const fractionValues = ['10', '192', '9', '172', '8', '152', '7', '132', '6', '112', '5', '92', '4', '72', '3', '52', '2', '32', '1', '12', '0'];
11
+ // The mixed fraction values are represented like this: 9(1/2) = 912, 8(1/2) = 812, 2(1/2) = 212, 1/2 = 12 etc.
12
+ const mixedFractionValues = ['10', '912', '9', '812', '8', '712', '7', '612', '6', '512', '5', '412', '4', '312', '3', '212', '2', '112', '1', '12', '0'];
13
+
14
+ describe('Create item page - Charts - Bar: Line setting section', () => {
15
+ before(() => {
16
+ cy.loginAs('admin');
17
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
18
+ cy.barsPreLoaderWait();
19
+ chartsBarPage.steps.selectLineButton();
20
+ });
21
+
22
+ describe('Line setting section contents', () => {
23
+ abortEarlySetup();
24
+ it(`Line settings label and 4 options ${lineSettingsOptions} should be displayed and by default ${lineSettingsOptions[0]} should be selected`, () => {
25
+ utilities.verifyInnerText(chartsBarPage.lineSettingsLabel(), 'Line settings');
26
+ utilities.verifyElementVisibilityState(chartsBarPage.lineSettingsLabel(), 'visible');
27
+ utilities.verifyElementVisibilityState(chartsBarPage.lineSettingsToggleButton(), 'visible');
28
+ utilities.verifyElementCount(chartsBarPage.lineSettingsToggleButton(), 4);
29
+ lineSettingsOptions.forEach((label) => {
30
+ utilities.verifyInnerText(chartsBarPage.lineSettingsToggleButton(label), label);
31
+ utilities.verifyElementVisibilityState(chartsBarPage.lineSettingsToggleButton(label), 'visible');
32
+ });
33
+ chartsBarPage.steps.verifyLineSettingsToggleButtonSelected(lineSettingsOptions[0]);
34
+ chartsBarPage.steps.verifyChartYAxisValues(integerValues);
35
+ });
36
+ });
37
+
38
+ describe('Functionality of line settings section', () => {
39
+ abortEarlySetup();
40
+ it('When integer option is selected in line settings, integer values should be displayed in labels and decimal values should not be displayed in labels', () => {
41
+ chartsBarPage.steps.enterTextInIntervalInputField(0.5);
42
+ cy.wait(500);
43
+ chartsBarPage.steps.verifyChartYAxisValues(integerIfDecimalsExist);
44
+ });
45
+
46
+ it('When decimal option is selected in line settings, decimal values should be displayed in labels', () => {
47
+ chartsBarPage.steps.selectLineSettingsToggleButton(lineSettingsOptions[1]);
48
+ cy.wait(500);
49
+ chartsBarPage.steps.verifyChartYAxisValues(decimalValues);
50
+ });
51
+
52
+ it('When fraction option is selected in line settings, fraction values should be displayed in labels', () => {
53
+ chartsBarPage.steps.selectLineSettingsToggleButton(lineSettingsOptions[2]);
54
+ cy.wait(500);
55
+ chartsBarPage.steps.verifyChartYAxisValues(fractionValues);
56
+ });
57
+
58
+ it('When mixed fraction option is selected in line settings, mixed fraction values should be displayed in labels', () => {
59
+ chartsBarPage.steps.selectLineSettingsToggleButton(lineSettingsOptions[3]);
60
+ cy.wait(500);
61
+ chartsBarPage.steps.verifyChartYAxisValues(mixedFractionValues);
62
+ });
63
+ });
64
+ });
@@ -0,0 +1,64 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { chartsLinePage, dialogBoxBase } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const lineSettingsOptions = ['Integers', 'Decimals', 'Fractions', 'Mixed fractions'];
6
+ const integerValues = ['10', '9', '8', '7', '6', '5', '4', '3', '2', '1', '0'];
7
+ const integerIfDecimalsExist = ['10', '', '9', '', '8', '', '7', '', '6', '', '5', '', '4', '', '3', '', '2', '', '1', '', '0'];
8
+ const decimalValues = ['10', '9.5', '9', '8.5', '8', '7.5', '7', '6.5', '6', '5.5', '5', '4.5', '4', '3.5', '3', '2.5', '2', '1.5', '1', '0.5', '0'];
9
+ // The fraction values are represented like this: 19/2 = 192, 17/2 = 172, 3/2 = 32, 1/2 = 12 etc.
10
+ const fractionValues = ['10', '192', '9', '172', '8', '152', '7', '132', '6', '112', '5', '92', '4', '72', '3', '52', '2', '32', '1', '12', '0'];
11
+ // The mixed fraction values are represented like this: 9(1/2) = 912, 8(1/2) = 812, 2(1/2) = 212, 1/2 = 12 etc.
12
+ const mixedFractionValues = ['10', '912', '9', '812', '8', '712', '7', '612', '6', '512', '5', '412', '4', '312', '3', '212', '2', '112', '1', '12', '0'];
13
+
14
+ describe('Create item page - Charts - Line: Line setting section', () => {
15
+ before(() => {
16
+ cy.loginAs('admin');
17
+ chartsLinePage.steps.navigateToCreateQuestion('charts');
18
+ cy.barsPreLoaderWait();
19
+ chartsLinePage.steps.selectLineButton();
20
+ });
21
+
22
+ describe('Line setting section contents', () => {
23
+ abortEarlySetup();
24
+ it(`Line settings label and 4 options ${lineSettingsOptions} should be displayed and by default ${lineSettingsOptions[0]} should be selected`, () => {
25
+ utilities.verifyInnerText(chartsLinePage.lineSettingsLabel(), 'Line settings');
26
+ utilities.verifyElementVisibilityState(chartsLinePage.lineSettingsLabel(), 'visible');
27
+ utilities.verifyElementVisibilityState(chartsLinePage.lineSettingsToggleButton(), 'visible');
28
+ utilities.verifyElementCount(chartsLinePage.lineSettingsToggleButton(), 4);
29
+ lineSettingsOptions.forEach((label) => {
30
+ utilities.verifyInnerText(chartsLinePage.lineSettingsToggleButton(label), label);
31
+ utilities.verifyElementVisibilityState(chartsLinePage.lineSettingsToggleButton(label), 'visible');
32
+ });
33
+ chartsLinePage.steps.verifyLineSettingsToggleButtonSelected(lineSettingsOptions[0]);
34
+ chartsLinePage.steps.verifyChartYAxisValues(integerValues);
35
+ });
36
+ });
37
+
38
+ describe('Functionality of line settings section', () => {
39
+ abortEarlySetup();
40
+ it('When integer option is selected in line settings, integer values should be displayed in labels and decimal values should not be displayed in labels', () => {
41
+ chartsLinePage.steps.enterTextInIntervalInputField(0.5);
42
+ cy.wait(500);
43
+ chartsLinePage.steps.verifyChartYAxisValues(integerIfDecimalsExist);
44
+ });
45
+
46
+ it('When decimal option is selected in line settings, decimal values should be displayed in labels', () => {
47
+ chartsLinePage.steps.selectLineSettingsToggleButton(lineSettingsOptions[1]);
48
+ cy.wait(500);
49
+ chartsLinePage.steps.verifyChartYAxisValues(decimalValues);
50
+ });
51
+
52
+ it('When fraction option is selected in line settings, fraction values should be displayed in labels', () => {
53
+ chartsLinePage.steps.selectLineSettingsToggleButton(lineSettingsOptions[2]);
54
+ cy.wait(500);
55
+ chartsLinePage.steps.verifyChartYAxisValues(fractionValues);
56
+ });
57
+
58
+ it('When mixed fraction option is selected in line settings, mixed fraction values should be displayed in labels', () => {
59
+ chartsLinePage.steps.selectLineSettingsToggleButton(lineSettingsOptions[3]);
60
+ cy.wait(500);
61
+ chartsLinePage.steps.verifyChartYAxisValues(mixedFractionValues);
62
+ });
63
+ });
64
+ });
@@ -15,6 +15,7 @@ const selectors = {
15
15
  ...selectQuestionResourceToolPage,
16
16
  ...autoScoredScoringSectionMultiResponseType,
17
17
  ...chartsCommonComponent,
18
+ ...layoutSectionComponent,
18
19
  ...autoScoredSpecifyCorrectAnswerSection,
19
20
  point: () => cy.get('.ngie-chart-point'),
20
21
  selectChartTypePoint: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] .ngie-chart-point'),
@@ -57,8 +57,8 @@ const selectors = {
57
57
  titlePopupAddLabelInputField: () => cy.get('[aria-labelledby="alert-dialog-title"] input'),
58
58
  titlePopupCancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
59
59
  titlePopupSaveButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
60
- numberLineNumberLineSection: () => cy.get('.number-line-grid-setting .ngie-jxgbox svg'),
61
- numberLineAxisNumberLineSection: () => cy.get('.number-line-grid-setting .ngie-jxgbox svg line'),
60
+ numberLineNumberLineSection: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) .ngie-jxgbox svg'),
61
+ numberLineAxisNumberLineSection: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) .ngie-jxgbox svg line'),
62
62
  numberLineTitleNumberLineSection: () => cy.get('[class*="LineGraphComponentsstyles__TitleContainer"]'),
63
63
  minLabel: () => cy.get('[class*="CustomInputFieldWrapper"] [class*="CustomInputFieldLabel"]').eq(0),
64
64
  minInputField: () => cy.get('[class*="CustomInputFieldWrapper"] input').eq(0),
@@ -68,26 +68,27 @@ const selectors = {
68
68
  intervalInputField: () => cy.get('input[id="Interval"]'),
69
69
  annotateEveryLabel: () => cy.get('[for="Annotate every"]'),
70
70
  annotateEveryInputField: () => cy.get('input[id="Annotate every"]'),
71
- lineSettingsToggleButtonWrapper: () => cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(0),
72
- lineSettingsLabel: () => cy.get('.number-line-grid-setting .single-select-toggle-group-title').eq(0),
71
+ lineSettingsToggleButtonWrapper: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(0),
72
+ lineSettingsLabel: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) .single-select-toggle-group-title').eq(0),
73
73
  lineSettingsToggleButton: (ariaLabel = null) => {
74
74
  if (ariaLabel !== null) {
75
- return cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find(`button[aria-label*="${ariaLabel}"]`);
75
+ return cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find(`button[aria-label*="${ariaLabel}"]`);
76
76
  } else {
77
- return cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find('button');
77
+ return cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find('button');
78
78
  }
79
79
  },
80
- displayNumbersToggleButtonWrapper: () => cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(1),
81
- displayNumbersLabel: () => cy.get('.number-line-grid-setting .single-select-toggle-group-title').eq(1),
80
+ displayNumbersToggleButtonWrapper: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(1),
81
+ displayNumbersLabel: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) .single-select-toggle-group-title').eq(1),
82
82
  displayNumbersToggleButton: (ariaLabel = null) => {
83
83
  if (ariaLabel !== null) {
84
- return cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find(`button[aria-label*="${ariaLabel}"]`);
84
+ return cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find(`button[aria-label*="${ariaLabel}"]`);
85
85
  } else {
86
- return cy.get('.number-line-grid-setting [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find('button');
86
+ return cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find('button');
87
87
  }
88
88
  },
89
- displaySpecificAnnotationLabel: () => cy.get('.number-line-grid-setting [class*="SpecificAnnotationWrapper"] [class*="PropertyLabel"]'),
90
- displaySpecificAnnotationInputField: () => cy.get('.number-line-grid-setting [class*="SpecificAnnotationWrapper"] input')
89
+ displaySpecificAnnotationLabel: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SpecificAnnotationWrapper"] [class*="PropertyLabel"]'),
90
+ displaySpecificAnnotationInputField: () => cy.get(':is(.grid-options-wrapper, .number-line-grid-setting) [class*="SpecificAnnotationWrapper"] input'),
91
+ chartYAxisLabels: () => cy.get('.ngie-charts-authoring .row-header-container .value-container'),
91
92
  }
92
93
 
93
94
  const steps = {
@@ -823,6 +824,16 @@ const steps = {
823
824
  verifyTextInHeightInputField: (value) => {
824
825
  layoutSectionComponent.heightInputField()
825
826
  .should('have.value', value);
827
+ },
828
+
829
+ /**
830
+ * Verifies that each chart Y-axis label matches the corresponding value in the expectedValues array.
831
+ * @param {string[]} expectedValues - An array of expected Y-axis label values to verify against the chart.
832
+ */
833
+ verifyChartYAxisValues: (expectedValues) => {
834
+ layoutSectionComponent.chartYAxisLabels().each(($element, index) => {
835
+ cy.wrap($element).should('have.text', expectedValues[index]);
836
+ });
826
837
  }
827
838
  }
828
839
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.504-IEI-6793-v4-88cc369.0",
3
+ "version": "1.0.504-dependabot-npm-and-yarn-multi-92087b3b2d-322b243.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,8 +30,7 @@
30
30
  "spinnaker:audioResponse": "node scripts/questions.mjs --env theme=ilc,questionType=AudioResponseNew_VideoResponseNew_UploadResponse_ToolAudioPlayerNew,grepTags=-css+-a11y",
31
31
  "spinnaker:feedbackScale": "node scripts/questions.mjs --env theme=ilc,questionType=FeedbackScaleNew_BrainingCampManipulative_EditItem_ToolSettings_CkEditorAudioPlayer_CkEditorEquationEditor_CkEditorInsertImage_CkEditorInsertTable_CkEditorInsertTable,grepTags=-css+-a11y",
32
32
  "spinnaker:resourcesAndTools": "node scripts/questions.mjs --env theme=ilc,questionType=Compass_ContentBlocks_Protractor_ReadingRuler_SimpleCalculator_Ruler,grepTags=-css+-a11y",
33
- "spinnaker:dataApiTest": "node scripts/dataApi.mjs --env theme=ilc,questionType=dataApi_Sessions,grepTags=-css+-a11y",
34
- "spinnaker:test": "node scripts/testcypress.mjs --env theme=ilc,questionType=test_Sessions,grepTags=-css+-a11y"
33
+ "spinnaker:dataApiTest": "node scripts/dataApi.mjs --env theme=ilc,questionType=dataApi_Sessions,grepTags=-css+-a11y"
35
34
  },
36
35
  "repository": {
37
36
  "type": "git",
@@ -42,7 +41,7 @@
42
41
  "axe-core": "^4.7.1",
43
42
  "cy-verify-downloads": "^0.1.11",
44
43
  "cy2": "^4.0.9",
45
- "cypress": "^12.17.2",
44
+ "cypress": "^15.2.0",
46
45
  "cypress-axe": "^1.4.0",
47
46
  "cypress-file-upload": "^5.0.8",
48
47
  "cypress-real-events": "^1.7.6",
@@ -301,15 +301,4 @@ export function runSorryCypressSpinnakerDataApi() {
301
301
  let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs} --spec "cypress/e2e/ILC/dataApi/**/*.js,cypress/e2e/Sessions/**/*.js"`;
302
302
  console.log(`command: ${command}`);
303
303
  execSync(command, { stdio: "inherit" });
304
- }
305
-
306
- export function runSorryCypressTest() {
307
- process.env.CYPRESS_API_URL = "https://cypress-director.imaginelearning.tech/";
308
- const user = OS.userInfo().username;
309
- startTime = Math.round(Date.now() / 1000000);
310
- ciBuildId = setCiBuildId(user, startTime);
311
- const envArgs = setCommandLineEnvArgs()
312
- let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs} --spec "cypress/e2e/ILC/test/**/*.js"`;
313
- console.log(`command: ${command}`);
314
- execSync(command, { stdio: "inherit" });
315
304
  }
@@ -1,21 +0,0 @@
1
- describe('Page Load Test for v1', () => {
2
- it('should load the page successfully', () => {
3
- cy.log('Navigating to Login Page');
4
- cy.visit('https://sandbox.itemengine-staging.il-apps.com/login');
5
- cy.get('body').should('exist');
6
- cy.log('Login page loaded');
7
- cy.get('h1').should('have.text', 'Log in');
8
- cy.get('button[data-at="Sign-in-button"] span').should('have.text', 'Sign In');
9
- });
10
- });
11
-
12
- describe('Page Load Test for v2', () => {
13
- it('should load the page successfully', () => {
14
- cy.log('Navigating to Login Page');
15
- cy.visit('https://itemengine-sandbox-staging.content-nonprod.imaginelearning.com/login');
16
- cy.get('body').should('exist');
17
- cy.log('Login page loaded');
18
- cy.get('h1').should('have.text', 'Log in');
19
- cy.get('button[data-at="Sign-in-button"] span').should('have.text', 'Sign In');
20
- });
21
- });
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
- env=$STAGE
3
- echo Environment to test: $env
4
- echo START_TIME: $START_TIME
5
-
6
- npm run spinnaker:test
@@ -1,42 +0,0 @@
1
- global:
2
- name: ie-test
3
- type: test
4
- autoDeploy:
5
- enabled: true
6
- highestEnvironment: dev
7
-
8
- deployment:
9
- activeDeadlineSeconds: 28800
10
- architecture: amd64
11
- backoffLimit: 25
12
- completions: 15
13
- parallelism: 15
14
- restartPolicy: Never
15
- image:
16
- cmd: /ie-e2e/deploy/test/run.sh
17
- buildContext: ../..
18
- resources:
19
- limits:
20
- memory: 8446Mi
21
- cpu: 5000m
22
- requests:
23
- memory: 4096Mi
24
- cpu: 2000m
25
-
26
- namespaces:
27
- dev:
28
- env:
29
- - name: STAGE
30
- value: "dev"
31
- qa:
32
- env:
33
- - name: STAGE
34
- value: "qa"
35
- staging:
36
- env:
37
- - name: STAGE
38
- value: "staging"
39
- prod:
40
- env:
41
- - name: STAGE
42
- value: "prod"
@@ -1,3 +0,0 @@
1
- import { runSorryCypressTest } from "./sorry-cypress.mjs";
2
-
3
- runSorryCypressTest();