From ed8d18eb5e9c22a8601b52d54e2c3ec213007470 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 17 Nov 2023 15:19:25 +0100 Subject: [PATCH 001/106] feat(testing):[TRACEFOSS-2838] added cypress checks for test TRACEFOSS-797. !not tested yet! --- .../pages/QualityInvestigationsPage.ts | 24 +++ .../support/step_definitions/dashboard.ts | 5 + .../quality-investigations.ts | 192 ++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 frontend/cypress/integration/pages/QualityInvestigationsPage.ts create mode 100644 frontend/cypress/support/step_definitions/quality-investigations.ts diff --git a/frontend/cypress/integration/pages/QualityInvestigationsPage.ts b/frontend/cypress/integration/pages/QualityInvestigationsPage.ts new file mode 100644 index 0000000000..63cf5b71c6 --- /dev/null +++ b/frontend/cypress/integration/pages/QualityInvestigationsPage.ts @@ -0,0 +1,24 @@ +/******************************************************************************** + * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2022, 2023 ZF Friedrichshafen AG + * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +export class QualityInvestigationsPage { +//TBD if necessary +} diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index 8d9aa52866..2aede6b670 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -47,6 +47,7 @@ Then(/^should be visible "Dashboard" header$/, () => { Then(/^should be visible "TOTAL OF PARTS" section$/, () => { cy.get('section').contains('Total of parts').should('be.visible'); }); + Then(/^should be visible "TOTAL OF OTHER PARTS" section$/, () => { cy.get('section').contains('Total of other parts').should('be.visible'); }); @@ -66,3 +67,7 @@ Then( cy.url().should('include', '/investigations'); }, ); + +When(/^user navigate to "Other parts"$/, () => { + cy.get('[href="otherParts"]').click() +}); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts new file mode 100644 index 0000000000..0b5655a91f --- /dev/null +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -0,0 +1,192 @@ +/******************************************************************************** + * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2022, 2023 ZF Friedrichshafen AG + * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; +import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; + +private String notificationDescription = null; + +Then(/^select "one" other part$/, () => { +//since IDs of desired asset are not shown in FE the selection has to be done by other number + cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click() +]); + +Then(/^start investigation creation with description {string}$/, (description) => { + notificationDescription = wrapStringWithTimestamp(input.get("description")); + cy.get('div').should('contain.text', 'Start investigation').click(); + cy.get('mat-label').should('contain.text', 'Description').click().focus().type(notificationDescription); +}); + +And(/^severity {string}$/, (severity) => { + cy.get('#mat-select-56').click(); // First the dropdown has to be opened. + cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. +}); + +And(/^{string} deadline$/, (deadline) => { +//---TBD--- + if (deadline == 'no') { + // do nothing + } else { + // ---TBD--- + } +}); + +And(/^request the investigation$/, () => { + cy.get('span').should('contain.text', 'ADD TO QUEUE').click(); +}); + +Then(/^selected parts are marked as investigated$/, () => { + cy.get('class').should('contain', 'highlighted'); + //---TBD--- to check the desired assets, have to be adjusted with desired asset selection +}); + +And(/^popup with information about queued investigation is shown$/, () => { + cy.contains(/You queued an investigation for 1 part/i).should('be.visible') +}); + +When(/^user navigate to "queued quality investigation" with button in popup$/, () => { + cy.get('a').should('contain.text', 'Go to Queue').click(); +}); + +And(/^open details of created investigation$/, () => { + cy.get('p').should('contain.text', notificationDescription).parent('.row').get('[class="mat-mdc-button-touch-target"]').click() + cy.get('span').should('contain.text', 'View details').click(); +}); + +//When user cancel selected investigation with entering "correct" id +// #include: check popup (id, description, status, created, createdby, texts, buttons (cancel, approve), then click on Delete +// #check: Deletion is only possible after entering the expected id +// #check: popup on the right sight is shown +When(/^user cancel selected investigation with entering {string} id$/, (input) => { + let investigationId = ''; + switch (input) { + case 'no': { + cy.get('span').should('contain.text', 'Confirm cancellation').click(); + break; + } + case 'wrong': { + cy.get('#mat-mdc-form-field-label-4').click().focus().type('000'); + cy.get('span').should('contain.text', 'Confirm cancellation').click(); + break; + } + case 'correct': { + //get correct id ---TBD--- + cy.get('#mat-mdc-form-field-label-4').click().focus().type(investigated); + cy.get('span').should('contain.text', 'Confirm cancellation').click(); + break; + } + } +}); + +Then(/^cancelation is not possible due to {string} id$/, (id) => { +// -> extend method for both cases "wrong ID" and "no ID" ---TBD--- + cy.contains(/This field is required!/i).should('be.visible') +}); + +Then(/^cancelation is not possible due to wrong id$/, () => { + cy.contains(/This field is required!/i).should('be.visible') +}); + +Then(/^selected {string} has been {string} as expected$/, (notificationType, expectedStatus) => { +matched = false; + switch (expectedStatus) { + case 'canceled': { + matched = true; + cy.get('[title="Cancelled"]').should('be.visible') + break; + } + case 'requested': { + matched = true; + cy.get('[title="Requested"]').should('be.visible') + break; + } + case 'accepted': { + matched = true; + cy.get('[title="Accepted"]').should('be.visible') + break; + } + case 'declined': { + matched = true; + cy.get('[title="Declined"]').should('be.visible') + break; + } + case 'acknowledged': { + matched = true; + cy.get('[title="Acknowledged"]').should('be.visible') + break; + } + case 'closed': { + matched = true; + cy.get('[title="Closed"]').should('be.visible') + break; + } + } + if (!matched) { + throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed].") + } +}); + +And(/^selected {string} is not allowed to be {string}$/, (notificationType, status) => { +matched = false; + switch (status) { + case 'canceled': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Cancelled"]').should('not.be.visible') + break; + } + case 'requested': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Requested"]').should('not.be.visible') + break; + } + case 'accepted': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Accepted"]').should('not.be.visible') + break; + } + case 'declined': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Declined"]').should('not.be.visible') + break; + } + case 'acknowledged': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Acknowledged"]').should('not.be.visible') + break; + } + case 'closed': { + matched = true; + //TBD selection once the environment is running up again + cy.get('[title="Closed"]').should('not.be.visible') + break; + } + } + if (!matched) { + throw new Error("Set status '" + status + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed].") + } +}); + +); From ad1585da2ad829efd008ec276c5e275f200a680e Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 20 Nov 2023 15:05:19 +0100 Subject: [PATCH 002/106] feat(testing):[TRACEFOSS-2838] some changes on cypress methods --- .../quality-investigations.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 0b5655a91f..f222b95965 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; -import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; +import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; private String notificationDescription = null; @@ -98,11 +98,20 @@ When(/^user cancel selected investigation with entering {string} id$/, (input) = Then(/^cancelation is not possible due to {string} id$/, (id) => { // -> extend method for both cases "wrong ID" and "no ID" ---TBD--- - cy.contains(/This field is required!/i).should('be.visible') + switch (id) { + case 'no': { + cy.contains(/This field is required!/i).should('be.visible') + break; + } + case 'wrong': { + cy.contains(/This id is wrong.... TBD/i).should('be.visible') //---TBD--- + break; + } + } }); -Then(/^cancelation is not possible due to wrong id$/, () => { - cy.contains(/This field is required!/i).should('be.visible') +Then(/^informations for selected investigation are displayed as expected$/, () => { +// ---TBD--- include: overview, supplier parts, STATUS }); Then(/^selected {string} has been {string} as expected$/, (notificationType, expectedStatus) => { @@ -114,6 +123,7 @@ matched = false; break; } case 'requested': { + // same as "approved" matched = true; cy.get('[title="Requested"]').should('be.visible') break; @@ -154,6 +164,7 @@ matched = false; break; } case 'requested': { + // same as "approved" matched = true; //TBD selection once the environment is running up again cy.get('[title="Requested"]').should('not.be.visible') From f7bb4f1465c45a43b5adaa1f421272a6c64036a7 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 20 Nov 2023 15:13:29 +0100 Subject: [PATCH 003/106] feat(testing):[TRACEFOSS-2838] fix while testing, added package traceability.test --- .../cypress/support/step_definitions/quality-investigations.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index f222b95965..4875fef3c0 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,6 +18,8 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +package org.eclipse.tractusx.traceability.test; + import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; From d1584cd7b9078f6b691f2c8c2908de010bed2bdd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 08:00:05 +0100 Subject: [PATCH 004/106] feat(testing):[TRACEFOSS-2838] fix while testing, several adjustments --- .../support/step_definitions/dashboard.ts | 12 +++++-- .../quality-investigations.ts | 36 +++++++++---------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index 2aede6b670..355b1664f4 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -68,6 +68,12 @@ Then( }, ); -When(/^user navigate to "Other parts"$/, () => { - cy.get('[href="otherParts"]').click() -}); +When("user navigate to {string}", function(desiredPage) { + cy.get('[href="otherParts"]').click(); + }); + +// //user navigate to "Other parts" +// When("user navigate to {string}", function(desiredPage) => { +// // ---TBD--- add more selections: "Parts", "Quality Alerts"... +// cy.get('[href="otherParts"]').click(); +// }); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 4875fef3c0..795c5b0a81 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -28,7 +28,7 @@ private String notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number - cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click() + cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); ]); Then(/^start investigation creation with description {string}$/, (description) => { @@ -61,7 +61,7 @@ Then(/^selected parts are marked as investigated$/, () => { }); And(/^popup with information about queued investigation is shown$/, () => { - cy.contains(/You queued an investigation for 1 part/i).should('be.visible') + cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); When(/^user navigate to "queued quality investigation" with button in popup$/, () => { @@ -102,11 +102,11 @@ Then(/^cancelation is not possible due to {string} id$/, (id) => { // -> extend method for both cases "wrong ID" and "no ID" ---TBD--- switch (id) { case 'no': { - cy.contains(/This field is required!/i).should('be.visible') + cy.contains(/This field is required!/i).should('be.visible'); break; } case 'wrong': { - cy.contains(/This id is wrong.... TBD/i).should('be.visible') //---TBD--- + cy.contains(/This id is wrong.... TBD/i).should('be.visible'); //---TBD--- break; } } @@ -121,38 +121,38 @@ matched = false; switch (expectedStatus) { case 'canceled': { matched = true; - cy.get('[title="Cancelled"]').should('be.visible') + cy.get('[title="Cancelled"]').should('be.visible'); break; } case 'requested': { // same as "approved" matched = true; - cy.get('[title="Requested"]').should('be.visible') + cy.get('[title="Requested"]').should('be.visible'); break; } case 'accepted': { matched = true; - cy.get('[title="Accepted"]').should('be.visible') + cy.get('[title="Accepted"]').should('be.visible'); break; } case 'declined': { matched = true; - cy.get('[title="Declined"]').should('be.visible') + cy.get('[title="Declined"]').should('be.visible'); break; } case 'acknowledged': { matched = true; - cy.get('[title="Acknowledged"]').should('be.visible') + cy.get('[title="Acknowledged"]').should('be.visible'); break; } case 'closed': { matched = true; - cy.get('[title="Closed"]').should('be.visible') + cy.get('[title="Closed"]').should('be.visible'); break; } } if (!matched) { - throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed].") + throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed]."); } }); @@ -162,43 +162,43 @@ matched = false; case 'canceled': { matched = true; //TBD selection once the environment is running up again - cy.get('[title="Cancelled"]').should('not.be.visible') + cy.get('[title="Cancelled"]').should('not.be.visible'); break; } case 'requested': { // same as "approved" matched = true; //TBD selection once the environment is running up again - cy.get('[title="Requested"]').should('not.be.visible') + cy.get('[title="Requested"]').should('not.be.visible'); break; } case 'accepted': { matched = true; //TBD selection once the environment is running up again - cy.get('[title="Accepted"]').should('not.be.visible') + cy.get('[title="Accepted"]').should('not.be.visible'); break; } case 'declined': { matched = true; //TBD selection once the environment is running up again - cy.get('[title="Declined"]').should('not.be.visible') + cy.get('[title="Declined"]').should('not.be.visible'); break; } case 'acknowledged': { matched = true; //TBD selection once the environment is running up again - cy.get('[title="Acknowledged"]').should('not.be.visible') + cy.get('[title="Acknowledged"]').should('not.be.visible'); break; } case 'closed': { matched = true; //TBD selection once the environment is running up again - cy.get('[title="Closed"]').should('not.be.visible') + cy.get('[title="Closed"]').should('not.be.visible'); break; } } if (!matched) { - throw new Error("Set status '" + status + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed].") + throw new Error("Set status '" + status + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed]."); } }); From 078b5b0e6dce0c68f28645c10e0022a257ac7702 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 08:17:12 +0100 Subject: [PATCH 005/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 795c5b0a81..c938292b2e 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,7 +18,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.test; +//package org.eclipse.tractusx.traceability.test; import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; From 3a769fc2550a9dffb7fc42b2105ae512dea559fe Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 08:24:19 +0100 Subject: [PATCH 006/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c938292b2e..3d196f0f5c 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -20,7 +20,7 @@ ********************************************************************************/ //package org.eclipse.tractusx.traceability.test; -import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; From b60899129e35565a6a4281cf6c3c706264082344 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 08:43:25 +0100 Subject: [PATCH 007/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3d196f0f5c..8e76ac7daa 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,7 +18,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -//package org.eclipse.tractusx.traceability.test; +package org.eclipse.tractusx.traceability.test; import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; From ddfe53430977d5b1abdfd04ce912556b2479611c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 08:56:50 +0100 Subject: [PATCH 008/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 8e76ac7daa..427cfdddfe 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,9 +18,9 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.test; +//package org.eclipse.tractusx.traceability.test; -import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +//import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; From 253e7d79c38d6d16bbef5f3a93fa4d3ea4f9dad5 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 09:05:34 +0100 Subject: [PATCH 009/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 427cfdddfe..307232f923 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -24,7 +24,7 @@ import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; -private String notificationDescription = null; +let notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number From 8b2ea8df9e6c5f082d82e0672b46619688e9aa49 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 09:16:16 +0100 Subject: [PATCH 010/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 307232f923..734effadbd 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -29,7 +29,7 @@ let notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); -]); +}); Then(/^start investigation creation with description {string}$/, (description) => { notificationDescription = wrapStringWithTimestamp(input.get("description")); From cda6d19ce051db17b4822953072134b807b54e20 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 09:21:56 +0100 Subject: [PATCH 011/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 734effadbd..7fc5f85a4c 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -201,5 +201,3 @@ matched = false; throw new Error("Set status '" + status + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed]."); } }); - -); From 21026d0f7ffb412ccd6eacc8bcba361d6e55e4c6 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 09:27:59 +0100 Subject: [PATCH 012/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7fc5f85a4c..05c71d3706 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -21,7 +21,7 @@ //package org.eclipse.tractusx.traceability.test; //import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; -import { Given, Then, And } from '@badeball/cypress-cucumber-preprocessor'; +import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; let notificationDescription = null; From 845cf6f5147a7f1a361139146ecc7c3000757abd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 09:38:30 +0100 Subject: [PATCH 013/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 05c71d3706..334f50b0ee 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -21,7 +21,7 @@ //package org.eclipse.tractusx.traceability.test; //import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; -import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; +import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; let notificationDescription = null; @@ -37,12 +37,12 @@ Then(/^start investigation creation with description {string}$/, (description) = cy.get('mat-label').should('contain.text', 'Description').click().focus().type(notificationDescription); }); -And(/^severity {string}$/, (severity) => { +When(/^severity {string}$/, (severity) => { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); -And(/^{string} deadline$/, (deadline) => { +When(/^{string} deadline$/, (deadline) => { //---TBD--- if (deadline == 'no') { // do nothing @@ -51,7 +51,7 @@ And(/^{string} deadline$/, (deadline) => { } }); -And(/^request the investigation$/, () => { +When(/^request the investigation$/, () => { cy.get('span').should('contain.text', 'ADD TO QUEUE').click(); }); @@ -60,7 +60,7 @@ Then(/^selected parts are marked as investigated$/, () => { //---TBD--- to check the desired assets, have to be adjusted with desired asset selection }); -And(/^popup with information about queued investigation is shown$/, () => { +When(/^popup with information about queued investigation is shown$/, () => { cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); @@ -68,7 +68,7 @@ When(/^user navigate to "queued quality investigation" with button in popup$/, ( cy.get('a').should('contain.text', 'Go to Queue').click(); }); -And(/^open details of created investigation$/, () => { +When(/^open details of created investigation$/, () => { cy.get('p').should('contain.text', notificationDescription).parent('.row').get('[class="mat-mdc-button-touch-target"]').click() cy.get('span').should('contain.text', 'View details').click(); }); @@ -156,7 +156,7 @@ matched = false; } }); -And(/^selected {string} is not allowed to be {string}$/, (notificationType, status) => { +When(/^selected {string} is not allowed to be {string}$/, (notificationType, status) => { matched = false; switch (status) { case 'canceled': { From 280d1bc13c79928816d5757b2c0226dc312ca2a7 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 10:15:10 +0100 Subject: [PATCH 014/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/dashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index 355b1664f4..e5ec9fce89 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; +import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; import { DashboardPage } from '../../integration/pages/DashboardPage'; From b56d2fbcd207e4a35e7d233159de78baea9141f3 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 10:25:06 +0100 Subject: [PATCH 015/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/dashboard.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index e5ec9fce89..8ed110e699 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -69,9 +69,8 @@ Then( ); When("user navigate to {string}", function(desiredPage) { - cy.get('[href="otherParts"]').click(); + cy.get('[href="/otherParts"]').click(); }); - // //user navigate to "Other parts" // When("user navigate to {string}", function(desiredPage) => { // // ---TBD--- add more selections: "Parts", "Quality Alerts"... From 4e370b38ab82f2f302951006d056eb421dcd0553 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 10:38:09 +0100 Subject: [PATCH 016/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/dashboard.ts | 6 +----- .../support/step_definitions/quality-investigations.ts | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index 8ed110e699..509a199d6b 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -69,10 +69,6 @@ Then( ); When("user navigate to {string}", function(desiredPage) { +// ---TBD--- add more selections: "Parts", "Quality Alerts"... cy.get('[href="/otherParts"]').click(); }); -// //user navigate to "Other parts" -// When("user navigate to {string}", function(desiredPage) => { -// // ---TBD--- add more selections: "Parts", "Quality Alerts"... -// cy.get('[href="otherParts"]').click(); -// }); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 334f50b0ee..65c0f4a0c1 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -28,6 +28,7 @@ let notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number + cy.wait(500); cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); }); From da2bb0638f6b06d299f77d6e6d25e8c295efce1c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 11:15:45 +0100 Subject: [PATCH 017/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing, refactoring --- .../support/step_definitions/dashboard.ts | 5 -- .../cypress/support/step_definitions/menu.ts | 67 +++++++++++++++++++ .../quality-investigations.ts | 9 +-- 3 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 frontend/cypress/support/step_definitions/menu.ts diff --git a/frontend/cypress/support/step_definitions/dashboard.ts b/frontend/cypress/support/step_definitions/dashboard.ts index 509a199d6b..e9a33fff49 100644 --- a/frontend/cypress/support/step_definitions/dashboard.ts +++ b/frontend/cypress/support/step_definitions/dashboard.ts @@ -67,8 +67,3 @@ Then( cy.url().should('include', '/investigations'); }, ); - -When("user navigate to {string}", function(desiredPage) { -// ---TBD--- add more selections: "Parts", "Quality Alerts"... - cy.get('[href="/otherParts"]').click(); - }); diff --git a/frontend/cypress/support/step_definitions/menu.ts b/frontend/cypress/support/step_definitions/menu.ts new file mode 100644 index 0000000000..4a36118032 --- /dev/null +++ b/frontend/cypress/support/step_definitions/menu.ts @@ -0,0 +1,67 @@ +/******************************************************************************** + * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2022, 2023 ZF Friedrichshafen AG + * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; + +// When("user navigate to {string}", function(desiredPage) { +// // ---TBD--- add more selections: "Parts", "Quality Alerts"... +// cy.get('[href="/otherParts"]').click(); +// }); + + +When("user navigate to {string}", function(desiredMenu) { +matched = false; + switch (desiredMenu) { + case 'Other parts': { + matched = true; + cy.get('[href="/otherParts"]').click(); + break; + } + case 'Parts': { + matched = true; + cy.get('[href="/parts"]').click(); + break; + } + case 'Dashboard': { + matched = true; + cy.get('[href="/dashboard"]').click(); + break; + } + case 'Quality investigations': { + matched = true; + cy.get('[href="/investigations"]').click(); + break; + } + case 'Quality alerts': { + matched = true; + cy.get('[href="/alerts"]').click(); + break; + } + case 'About': { + matched = true; + cy.get('[href="/about"]').click(); + break; + } + } + if (!matched) { + throw new Error("Set header menu '" + desiredMenu + "' is not one of valid status [Dashboard, Parts, Other parts, Quality investigations, Quality alerts, About]."); + } +}); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 65c0f4a0c1..e71d7c31c6 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,18 +18,19 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -//package org.eclipse.tractusx.traceability.test; +package org.eclipse.tractusx.traceability.test; -//import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; -import { DashboardPage } from '../../integration/pages/QualityInvestigationsPage'; +import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; let notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number cy.wait(500); - cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); + cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); + cy.get('@part').get('#mat-mds-checkbox-21').click(); }); Then(/^start investigation creation with description {string}$/, (description) => { From 904f60c2564c4659914d3b76e38e1964d426f4f5 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 21 Nov 2023 11:20:52 +0100 Subject: [PATCH 018/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing, refactoring --- .../support/step_definitions/quality-investigations.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index e71d7c31c6..dc4ee98f19 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,9 +18,9 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.test; +//package org.eclipse.tractusx.traceability.test; -import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +//import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; @@ -101,14 +101,13 @@ When(/^user cancel selected investigation with entering {string} id$/, (input) = }); Then(/^cancelation is not possible due to {string} id$/, (id) => { -// -> extend method for both cases "wrong ID" and "no ID" ---TBD--- switch (id) { case 'no': { cy.contains(/This field is required!/i).should('be.visible'); break; } case 'wrong': { - cy.contains(/This id is wrong.... TBD/i).should('be.visible'); //---TBD--- + cy.contains(/Please enter data that matches this pattern:/i).should('be.visible'); break; } } From 7cf65dcdd53d09971e3e1a45e28469b3a3fa0f4c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 07:54:30 +0100 Subject: [PATCH 019/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/login.ts | 10 +++++----- .../support/step_definitions/quality-investigations.ts | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/cypress/support/step_definitions/login.ts b/frontend/cypress/support/step_definitions/login.ts index 66e0e1e511..56ff2e1669 100644 --- a/frontend/cypress/support/step_definitions/login.ts +++ b/frontend/cypress/support/step_definitions/login.ts @@ -26,18 +26,18 @@ Given('user logged in as {string}', function(userType) { cy.visit('https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth?client_id=Cl17-CX-Part&redirect_uri=https%3A%2F%2Ftraceability-portal-e2e-a.dev.demo.catena-x.net%2Fdashboard&state=0aaee615-388e-400c-8b0c-81ac443a2cf3&response_mode=fragment&response_type=code&scope=openid&nonce=4104d5ab-b2bd-43a1-b6c2-7adf30543579&code_challenge=uXHR3gDRnSyjPEu8yWNdzm6Izsd7cKzEryfvRAtJTjU&code_challenge_method=S256'); cy.get('.search').click(); cy.get('.search').type('CX-Test-Access'); - cy.wait(5000); + cy.wait(500); cy.get('.CX_Test_Access').click(); - cy.wait(5000); + cy.wait(500); cy.get('input[name="username"]').type(loginMail); - cy.wait(5000); + cy.wait(500); cy.get('input[name="password"]').click().focus().type(loginPW); - cy.wait(5000); + cy.wait(500); cy.get('input[type="submit"]').click(); }); Given('user is directed to the {string}', function(value) { - cy.wait(5000); + cy.wait(500); cy.get('div.layout-content').should('exist'); }); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index dc4ee98f19..d0dc516643 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -28,9 +28,11 @@ let notificationDescription = null; Then(/^select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number - cy.wait(500); - cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); - cy.get('@part').get('#mat-mds-checkbox-21').click(); +// cy.wait(500); +// cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); +// cy.get('@part').get('#mat-mds-checkbox-21').click(); + + cy.get('#mat-mdc-checkbox-38').click(); }); Then(/^start investigation creation with description {string}$/, (description) => { From 1ee8555e067a2413f7d625f1a86a25fa8dc1f693 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 08:20:51 +0100 Subject: [PATCH 020/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index d0dc516643..c8522bc46b 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -35,18 +35,19 @@ Then(/^select "one" other part$/, () => { cy.get('#mat-mdc-checkbox-38').click(); }); -Then(/^start investigation creation with description {string}$/, (description) => { - notificationDescription = wrapStringWithTimestamp(input.get("description")); +Then(/^start investigation creation with description {string}$/, function (description) { + //notificationDescription = wrapStringWithTimestamp(input.get("description")); + notificationDescription = "Test 123123 description"; cy.get('div').should('contain.text', 'Start investigation').click(); cy.get('mat-label').should('contain.text', 'Description').click().focus().type(notificationDescription); }); -When(/^severity {string}$/, (severity) => { +When(/^severity {string}$/, function (severity) { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); -When(/^{string} deadline$/, (deadline) => { +When(/^{string} deadline$/, function (deadline) { //---TBD--- if (deadline == 'no') { // do nothing From 7042b67a2f63316af1e7f31b5be7667839eccd33 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 08:28:45 +0100 Subject: [PATCH 021/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/menu.ts | 5 ----- .../support/step_definitions/quality-investigations.ts | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/cypress/support/step_definitions/menu.ts b/frontend/cypress/support/step_definitions/menu.ts index 4a36118032..1d844e9f0a 100644 --- a/frontend/cypress/support/step_definitions/menu.ts +++ b/frontend/cypress/support/step_definitions/menu.ts @@ -21,11 +21,6 @@ import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; -// When("user navigate to {string}", function(desiredPage) { -// // ---TBD--- add more selections: "Parts", "Quality Alerts"... -// cy.get('[href="/otherParts"]').click(); -// }); - When("user navigate to {string}", function(desiredMenu) { matched = false; diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c8522bc46b..7fc0514480 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -35,11 +35,11 @@ Then(/^select "one" other part$/, () => { cy.get('#mat-mdc-checkbox-38').click(); }); -Then(/^start investigation creation with description {string}$/, function (description) { +Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); - notificationDescription = "Test 123123 description"; + //notificationDescription = "Test 123123 description"; cy.get('div').should('contain.text', 'Start investigation').click(); - cy.get('mat-label').should('contain.text', 'Description').click().focus().type(notificationDescription); + cy.get('mat-label').should('contain.text', 'Description').click().focus().type(description); }); When(/^severity {string}$/, function (severity) { From 21cd4c3a62b3f10837553f1095b3aa1d4119a195 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 08:53:51 +0100 Subject: [PATCH 022/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7fc0514480..58822bdf17 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -32,13 +32,14 @@ Then(/^select "one" other part$/, () => { // cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); // cy.get('@part').get('#mat-mds-checkbox-21').click(); - cy.get('#mat-mdc-checkbox-38').click(); + cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! }); Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); //notificationDescription = "Test 123123 description"; - cy.get('div').should('contain.text', 'Start investigation').click(); + //cy.get('div').should('contain.text', 'Start investigation').click(); + cy.get('div').contains('Start investigation').click(); cy.get('mat-label').should('contain.text', 'Description').click().focus().type(description); }); From 4d63d7be80c8dd44daae6979c0ff46767751d6b1 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 09:03:53 +0100 Subject: [PATCH 023/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 58822bdf17..eccb897e1d 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -38,9 +38,8 @@ Then(/^select "one" other part$/, () => { Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); //notificationDescription = "Test 123123 description"; - //cy.get('div').should('contain.text', 'Start investigation').click(); cy.get('div').contains('Start investigation').click(); - cy.get('mat-label').should('contain.text', 'Description').click().focus().type(description); + cy.get('mat-label').contains('Description').click().focus().type(description); }); When(/^severity {string}$/, function (severity) { @@ -58,11 +57,11 @@ When(/^{string} deadline$/, function (deadline) { }); When(/^request the investigation$/, () => { - cy.get('span').should('contain.text', 'ADD TO QUEUE').click(); + cy.get('span').contains('ADD TO QUEUE').click(); }); Then(/^selected parts are marked as investigated$/, () => { - cy.get('class').should('contain', 'highlighted'); + cy.get('class').contains('highlighted'); //---TBD--- to check the desired assets, have to be adjusted with desired asset selection }); @@ -71,12 +70,12 @@ When(/^popup with information about queued investigation is shown$/, () => { }); When(/^user navigate to "queued quality investigation" with button in popup$/, () => { - cy.get('a').should('contain.text', 'Go to Queue').click(); + cy.get('a').contains('Go to Queue').click(); }); When(/^open details of created investigation$/, () => { cy.get('p').should('contain.text', notificationDescription).parent('.row').get('[class="mat-mdc-button-touch-target"]').click() - cy.get('span').should('contain.text', 'View details').click(); + cy.get('span').contains('View details').click(); }); //When user cancel selected investigation with entering "correct" id @@ -87,18 +86,18 @@ When(/^user cancel selected investigation with entering {string} id$/, (input) = let investigationId = ''; switch (input) { case 'no': { - cy.get('span').should('contain.text', 'Confirm cancellation').click(); + cy.get('span').contains('Confirm cancellation').click(); break; } case 'wrong': { cy.get('#mat-mdc-form-field-label-4').click().focus().type('000'); - cy.get('span').should('contain.text', 'Confirm cancellation').click(); + cy.get('span').contains('Confirm cancellation').click(); break; } case 'correct': { //get correct id ---TBD--- cy.get('#mat-mdc-form-field-label-4').click().focus().type(investigated); - cy.get('span').should('contain.text', 'Confirm cancellation').click(); + cy.get('span').contains('Confirm cancellation').click(); break; } } From 38661c904ddf4900cd36a25213041185c73ff646 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 09:09:38 +0100 Subject: [PATCH 024/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index eccb897e1d..d0f2e97bb6 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -39,7 +39,7 @@ Then("start investigation creation with description {string}", function (descrip //notificationDescription = wrapStringWithTimestamp(input.get("description")); //notificationDescription = "Test 123123 description"; cy.get('div').contains('Start investigation').click(); - cy.get('mat-label').contains('Description').click().focus().type(description); + cy.get('mat-label').contains('Description').click().type(description); }); When(/^severity {string}$/, function (severity) { From 004a7e41e5d9bf1708a7b1fe3e614cf7399efc08 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 09:20:39 +0100 Subject: [PATCH 025/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index d0f2e97bb6..3f7a513026 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -26,7 +26,7 @@ import { QualityInvestigationsPage } from '../../integration/pages/QualityInvest let notificationDescription = null; -Then(/^select "one" other part$/, () => { +Then("select "one" other part$/, () => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); // cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); @@ -42,12 +42,12 @@ Then("start investigation creation with description {string}", function (descrip cy.get('mat-label').contains('Description').click().type(description); }); -When(/^severity {string}$/, function (severity) { +When("severity {string}", function (severity) { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); -When(/^{string} deadline$/, function (deadline) { +When("{string} deadline", function (deadline) { //---TBD--- if (deadline == 'no') { // do nothing @@ -56,24 +56,24 @@ When(/^{string} deadline$/, function (deadline) { } }); -When(/^request the investigation$/, () => { +When("request the investigation", () => { cy.get('span').contains('ADD TO QUEUE').click(); }); -Then(/^selected parts are marked as investigated$/, () => { +Then("selected parts are marked as investigated", () => { cy.get('class').contains('highlighted'); //---TBD--- to check the desired assets, have to be adjusted with desired asset selection }); -When(/^popup with information about queued investigation is shown$/, () => { +When("popup with information about queued investigation is shown", () => { cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); -When(/^user navigate to "queued quality investigation" with button in popup$/, () => { +When("user navigate to "queued quality investigation" with button in popup", () => { cy.get('a').contains('Go to Queue').click(); }); -When(/^open details of created investigation$/, () => { +When("open details of created investigation", () => { cy.get('p').should('contain.text', notificationDescription).parent('.row').get('[class="mat-mdc-button-touch-target"]').click() cy.get('span').contains('View details').click(); }); @@ -82,7 +82,7 @@ When(/^open details of created investigation$/, () => { // #include: check popup (id, description, status, created, createdby, texts, buttons (cancel, approve), then click on Delete // #check: Deletion is only possible after entering the expected id // #check: popup on the right sight is shown -When(/^user cancel selected investigation with entering {string} id$/, (input) => { +When("user cancel selected investigation with entering {string} id", (input) => { let investigationId = ''; switch (input) { case 'no': { @@ -103,7 +103,7 @@ When(/^user cancel selected investigation with entering {string} id$/, (input) = } }); -Then(/^cancelation is not possible due to {string} id$/, (id) => { +Then("cancelation is not possible due to {string} id", (id) => { switch (id) { case 'no': { cy.contains(/This field is required!/i).should('be.visible'); @@ -116,11 +116,11 @@ Then(/^cancelation is not possible due to {string} id$/, (id) => { } }); -Then(/^informations for selected investigation are displayed as expected$/, () => { +Then("informations for selected investigation are displayed as expected", () => { // ---TBD--- include: overview, supplier parts, STATUS }); -Then(/^selected {string} has been {string} as expected$/, (notificationType, expectedStatus) => { +Then("selected {string} has been {string} as expected", (notificationType, expectedStatus) => { matched = false; switch (expectedStatus) { case 'canceled': { @@ -160,7 +160,7 @@ matched = false; } }); -When(/^selected {string} is not allowed to be {string}$/, (notificationType, status) => { +When("selected {string} is not allowed to be {string}", (notificationType, status) => { matched = false; switch (status) { case 'canceled': { From 4f10abab743182a5dbe2519e961cb4d014f7c536 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 09:26:37 +0100 Subject: [PATCH 026/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3f7a513026..916734180c 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -26,7 +26,7 @@ import { QualityInvestigationsPage } from '../../integration/pages/QualityInvest let notificationDescription = null; -Then("select "one" other part$/, () => { +Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); // cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); From d24de1953ceae565b10f7cd23143127bbe423421 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 09:33:36 +0100 Subject: [PATCH 027/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 916734180c..e6c2e81c11 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -69,7 +69,7 @@ When("popup with information about queued investigation is shown", () => { cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); -When("user navigate to "queued quality investigation" with button in popup", () => { +When("user navigate to {string} with button in popup", (popupClick) => { cy.get('a').contains('Go to Queue').click(); }); From 2e59eb4b742890cdcce1037bc427deee9f508ea4 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 10:46:26 +0100 Subject: [PATCH 028/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index e6c2e81c11..02f8b8fd1f 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -44,7 +44,8 @@ Then("start investigation creation with description {string}", function (descrip When("severity {string}", function (severity) { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. - cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. + cy.get('p').contains(severity).click(); + //cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); When("{string} deadline", function (deadline) { From a00a433efffe6d31c39a98fb2977eb4bd4e07f36 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 11:01:46 +0100 Subject: [PATCH 029/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 02f8b8fd1f..9de779dadf 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -31,7 +31,7 @@ Then("select {string} other part", (partAmount) => { // cy.wait(500); // cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); // cy.get('@part').get('#mat-mds-checkbox-21').click(); - + cy.get('div').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! }); From d571d7940af9288f2cdad0a8e64ed2efaf17d61c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 11:02:14 +0100 Subject: [PATCH 030/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 9de779dadf..212b68b605 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -31,7 +31,7 @@ Then("select {string} other part", (partAmount) => { // cy.wait(500); // cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); // cy.get('@part').get('#mat-mds-checkbox-21').click(); - cy.get('div').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection + cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! }); From f76dddd6db7a6ef99abfdffa95bb023a802e22fa Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 11:32:00 +0100 Subject: [PATCH 031/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 212b68b605..4daf952484 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -62,7 +62,7 @@ When("request the investigation", () => { }); Then("selected parts are marked as investigated", () => { - cy.get('class').contains('highlighted'); + //cy.get('class').contains('highlighted'); //---TBD--- to check the desired assets, have to be adjusted with desired asset selection }); From a3541e7803e7997148460338996eccba9929b12b Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 11:44:32 +0100 Subject: [PATCH 032/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 4daf952484..3f6f70512a 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -29,10 +29,11 @@ let notificationDescription = null; Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); -// cy.get('span').should('contain.text', 'NO-989134870198932317923938').parent('.row').as('part'); -// cy.get('@part').get('#mat-mds-checkbox-21').click(); - cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection - cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! + //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); + cy.get('span').contains('NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); + //cy.get('@part').get('#mat-mds-checkbox-21').click(); + //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection + //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! }); Then("start investigation creation with description {string}", function (description) { From bd65cef30cce0be5fa7f199bd01dcd40ed688b57 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 11:55:44 +0100 Subject: [PATCH 033/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3f6f70512a..976ee99858 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,7 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parent('.row').get('#mat-mds-checkbox-21').click(); + cy.get('span').contains('NO-989134870198932317923938').parent('tr').get('#mat-mds-checkbox-21').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From e75bfb6aa969a2be72f6c4535f006ecda42135af Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 13:08:50 +0100 Subject: [PATCH 034/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 976ee99858..e210b7d38b 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,7 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parent('tr').get('#mat-mds-checkbox-21').click(); + cy.get('span').contains('NO-989134870198932317923938').parent('tr _ngcontent-tfc-c88').get('#mat-mds-checkbox-21').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From a10897d4f9ad9e8e11260d5fa8079dc600523c0e Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 13:19:53 +0100 Subject: [PATCH 035/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index e210b7d38b..d53be92c29 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,7 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parent('tr _ngcontent-tfc-c88').get('#mat-mds-checkbox-21').click(); + cy.get('span').contains('NO-989134870198932317923938').parent('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mds-checkbox-21').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From f75fcb7109f09123aa2f48066c4e49ee475c2af0 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 13:53:05 +0100 Subject: [PATCH 036/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index d53be92c29..7f4f489f3d 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,7 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parent('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mds-checkbox-21').click(); + cy.get('span').contains('NO-989134870198932317923938').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mds-checkbox-21').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From 92d013ec425d20f8d3b07065777cd74b4a6f153e Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 14:01:50 +0100 Subject: [PATCH 037/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7f4f489f3d..ef2dd4e1d9 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,7 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mds-checkbox-21').click(); + cy.get('span').contains('NO-989134870198932317923938').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From 03fe5391cf52b9fbd55a18d99291705d3ee1dda3 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 14:38:28 +0100 Subject: [PATCH 038/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ef2dd4e1d9..752b023a74 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,7 +30,8 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); + cy.get('span').contains('NO-989134870198932317923938')as('part'); + cy.get('@part').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! From b0fcb499783c857d622491eb4db929c33f3d6cd7 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 14:45:06 +0100 Subject: [PATCH 039/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 752b023a74..9380baa012 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -30,11 +30,11 @@ Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number // cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - cy.get('span').contains('NO-989134870198932317923938')as('part'); - cy.get('@part').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); + //cy.get('span').contains('NO-989134870198932317923938')as('part'); + //cy.get('@part').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection - //cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! + cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! }); Then("start investigation creation with description {string}", function (description) { From 4822b29ac4178e11a42ceffd285c0bf4a94d25f5 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 14:54:36 +0100 Subject: [PATCH 040/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 9380baa012..6d5215867b 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -28,18 +28,17 @@ let notificationDescription = null; Then("select {string} other part", (partAmount) => { //since IDs of desired asset are not shown in FE the selection has to be done by other number -// cy.wait(500); //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - //cy.get('span').contains('NO-989134870198932317923938')as('part'); - //cy.get('@part').parents('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); //cy.get('@part').get('#mat-mds-checkbox-21').click(); - //cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection - cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! + cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection + // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); }); Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); //notificationDescription = "Test 123123 description"; + notificationDescription = description; cy.get('div').contains('Start investigation').click(); cy.get('mat-label').contains('Description').click().type(description); }); @@ -77,7 +76,7 @@ When("user navigate to {string} with button in popup", (popupClick) => { }); When("open details of created investigation", () => { - cy.get('p').should('contain.text', notificationDescription).parent('.row').get('[class="mat-mdc-button-touch-target"]').click() + cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() cy.get('span').contains('View details').click(); }); From f8612dc5da4ede248405a1953a9f3dce47e2e2e1 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 15:09:32 +0100 Subject: [PATCH 041/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 6d5215867b..c71b4654da 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -32,7 +32,7 @@ Then("select {string} other part", (partAmount) => { //cy.get('@part').get('#mat-mds-checkbox-21').click(); cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('#mat-mdc-checkbox mat-primary').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From c07da614f4f23fb872491cedd4c75a769a2f4fac Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 15:17:38 +0100 Subject: [PATCH 042/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c71b4654da..8bb82e5feb 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -32,7 +32,7 @@ Then("select {string} other part", (partAmount) => { //cy.get('@part').get('#mat-mds-checkbox-21').click(); cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From 6ab480ac89a6313b12ee3742d572c511b2cafb0d Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 15:22:45 +0100 Subject: [PATCH 043/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 8bb82e5feb..8728dc5c7e 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -32,7 +32,8 @@ Then("select {string} other part", (partAmount) => { //cy.get('@part').get('#mat-mds-checkbox-21').click(); cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); +// cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From 343468243b77c80d4a755106dd7df1fc50546698 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 23 Nov 2023 15:31:25 +0100 Subject: [PATCH 044/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 8728dc5c7e..01a177d129 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,7 +33,7 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From 52e2e933faf8f2054af9526227f4d6cedfa5456e Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 09:36:30 +0100 Subject: [PATCH 045/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 01a177d129..beac954642 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,7 +33,7 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From 12e74ad399527ba1bee0e44e84869e32910cb184 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 10:05:54 +0100 Subject: [PATCH 046/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index beac954642..af86c0c724 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,7 +33,7 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); }); Then("start investigation creation with description {string}", function (description) { From 9c3fe233564b16d08a07360e051da8995d430c55 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 10:14:22 +0100 Subject: [PATCH 047/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index af86c0c724..212d0eaca8 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,7 +33,7 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').last().click(); }); Then("start investigation creation with description {string}", function (description) { From f523e1c473fd0474341b411ad6a0ee96a91287f2 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 10:26:50 +0100 Subject: [PATCH 048/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 212d0eaca8..35e96a8caf 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,7 +33,8 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').last().click(); + //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); + cy.get('span').contains('NO-989134870198932317923938').prevUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('[type="checkbox"]').first().click(); }); Then("start investigation creation with description {string}", function (description) { From dc5f924bf07ff962ff987013a49f34c9f919d021 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 10:39:19 +0100 Subject: [PATCH 049/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 35e96a8caf..b56fa7e33f 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -34,7 +34,7 @@ Then("select {string} other part", (partAmount) => { // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); - cy.get('span').contains('NO-989134870198932317923938').prevUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').get('[type="checkbox"]').first().click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').click(); }); Then("start investigation creation with description {string}", function (description) { From 7c13d30e91e82e64759ba80d593bceadede0533c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 10:56:27 +0100 Subject: [PATCH 050/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index b56fa7e33f..73e7ddefb2 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -34,7 +34,7 @@ Then("select {string} other part", (partAmount) => { // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').click(); + cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); }); Then("start investigation creation with description {string}", function (description) { From 82708e60fbcd4653efc45719b482c5bae1d302fa Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 11:02:45 +0100 Subject: [PATCH 051/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 73e7ddefb2..7298a410c7 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -70,7 +70,7 @@ Then("selected parts are marked as investigated", () => { }); When("popup with information about queued investigation is shown", () => { - cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); + cy.contains(/You queued an investigation for 5 parts/i).should('be.visible'); }); When("user navigate to {string} with button in popup", (popupClick) => { From 10f1406bd6b94ddc205285953bfc3267f993dd81 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 12:16:30 +0100 Subject: [PATCH 052/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7298a410c7..d4f456fc17 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -34,7 +34,26 @@ Then("select {string} other part", (partAmount) => { // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); - cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); +// cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); + + +// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell +// .parent() // gives you the row +// .within($tr => { // filters just that row +// .get('td a') // finds the buttons cell of that row +// .contains('DELETE') // finds the delete button +// .click() + +// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell +// .siblings() // gives you all the other cells in the row +// .contains('a', 'DELETE') // finds the delete button +// .click() + cy.contains('span', 'NO-989134870198932317923938') // gives you the cell + .siblings() // gives you all the other cells in the row + .get('[type="checkbox"]') // finds the delete button + .click() + + //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); }); Then("start investigation creation with description {string}", function (description) { From 0ba60ce273bb2fcdaa991a26fdb272cc2d34d3fb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 12:31:34 +0100 Subject: [PATCH 053/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index d4f456fc17..812824afa5 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -37,21 +37,21 @@ Then("select {string} other part", (partAmount) => { // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); -// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell -// .parent() // gives you the row -// .within($tr => { // filters just that row -// .get('td a') // finds the buttons cell of that row -// .contains('DELETE') // finds the delete button -// .click() + cy.contains('span', 'NO-989134870198932317923938') // gives you the cell + .parent() // gives you the row + .within($tr => { // filters just that row + .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + //.contains('DELETE') // finds the delete button + .click() // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .siblings() // gives you all the other cells in the row // .contains('a', 'DELETE') // finds the delete button // .click() - cy.contains('span', 'NO-989134870198932317923938') // gives you the cell - .siblings() // gives you all the other cells in the row - .get('[type="checkbox"]') // finds the delete button - .click() +// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell +// .siblings() // gives you all the other cells in the row +// .get('[type="checkbox"]') // finds the delete button +// .click() //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); }); From 198c28205ab91071c883112c994261f56fbad45f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 12:38:36 +0100 Subject: [PATCH 054/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 812824afa5..7f159329aa 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -43,6 +43,7 @@ Then("select {string} other part", (partAmount) => { .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row //.contains('DELETE') // finds the delete button .click() + }); // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .siblings() // gives you all the other cells in the row From 88fa4ea26b4c1dd038169d8a0f7e803f8344a969 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 12:54:25 +0100 Subject: [PATCH 055/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7f159329aa..5990994696 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,8 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within($tr => { // filters just that row - .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row - //.contains('DELETE') // finds the delete button + .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From def609f351cc2ad6fb168489bb97e0172b4e79f4 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 13:20:29 +0100 Subject: [PATCH 056/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 5990994696..7f092c7648 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -39,11 +39,17 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row - .within($tr => { // filters just that row + .within(($tr) => { // filters just that row .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); + + // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell + // .siblings() // gives you all the other cells in the row + // .get('[type="checkbox"]') // finds the delete button + // .click() + // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .siblings() // gives you all the other cells in the row // .contains('a', 'DELETE') // finds the delete button From 765750f55883d58376c1da24a2e03853d3e7da12 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 13:26:57 +0100 Subject: [PATCH 057/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 7f092c7648..ac659615da 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,7 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - .get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + cy.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From 154dc0a8642a48cbde2fc438c114b3262c1fb87f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 13:44:11 +0100 Subject: [PATCH 058/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ac659615da..e1b3b48150 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,7 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - cy.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From 3a2a8dfb9fca42950497bf3c5b24f80f98eeccbf Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 13:52:54 +0100 Subject: [PATCH 059/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index e1b3b48150..357be7415e 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,7 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + //cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From e226665586bacf250e505ff5ef88f6386cfa89eb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 13:57:20 +0100 Subject: [PATCH 060/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 357be7415e..c8830d7054 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -41,7 +41,7 @@ Then("select {string} other part", (partAmount) => { .parent() // gives you the row .within(($tr) => { // filters just that row //cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row - .click() + cy.click() }); From 220143a4cd620c3c3fa925bf88ee0dfb89236e4a Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 14:07:38 +0100 Subject: [PATCH 061/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c8830d7054..509a8ea2b9 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,8 +40,8 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - //cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row - cy.click() + cy.get($mat-checkbox)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + .click() }); From c9280736301fb66408679b3a3cc344981b3d1ef4 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 14:27:37 +0100 Subject: [PATCH 062/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 509a8ea2b9..e91e54f190 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,7 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - cy.get($mat-checkbox)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + cy.get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From 4f338861705b8e554dcc119e6df427625765115e Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 14:40:42 +0100 Subject: [PATCH 063/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index e91e54f190..ec52a22287 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,7 +40,7 @@ Then("select {string} other part", (partAmount) => { cy.contains('span', 'NO-989134870198932317923938') // gives you the cell .parent() // gives you the row .within(($tr) => { // filters just that row - cy.get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row + cy.children().get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row .click() }); From 6b4db9ee23f4b0aa4ea4792290da7a8fb304e9d5 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 14:55:05 +0100 Subject: [PATCH 064/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ec52a22287..2a6740bff7 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -33,32 +33,28 @@ Then("select {string} other part", (partAmount) => { cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); - //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); +//cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); - - cy.contains('span', 'NO-989134870198932317923938') // gives you the cell - .parent() // gives you the row - .within(($tr) => { // filters just that row - cy.children().get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row - .click() - }); + cy.contains('NO-989134870198932317923938') + .parent('tr') + .within(() => { + // all searches are automatically rooted to the found tr element + //cy.get('[type="checkbox"]').click() + cy.get('td').get('mat-checkbox').click() + }); +// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell +// .parent() // gives you the row +// .within(($tr) => { // filters just that row +// cy.children().get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row +// .click() +// }); // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .siblings() // gives you all the other cells in the row // .get('[type="checkbox"]') // finds the delete button // .click() - -// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell -// .siblings() // gives you all the other cells in the row -// .contains('a', 'DELETE') // finds the delete button -// .click() -// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell -// .siblings() // gives you all the other cells in the row -// .get('[type="checkbox"]') // finds the delete button -// .click() - //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); }); From 327166e8e6daea0ebd4a621bae4e7102324f9fb7 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 15:07:36 +0100 Subject: [PATCH 065/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 2a6740bff7..3fe31e8cc9 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -37,7 +37,7 @@ Then("select {string} other part", (partAmount) => { // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); cy.contains('NO-989134870198932317923938') - .parent('tr') + .parentsUntil('tr') .within(() => { // all searches are automatically rooted to the found tr element //cy.get('[type="checkbox"]').click() From 152d07f1145adc6f29629f4dd854b4749e35da2c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 15:12:40 +0100 Subject: [PATCH 066/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3fe31e8cc9..3239ad1391 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -37,7 +37,7 @@ Then("select {string} other part", (partAmount) => { // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); cy.contains('NO-989134870198932317923938') - .parentsUntil('tr') + .parentsUntil('tr').first() .within(() => { // all searches are automatically rooted to the found tr element //cy.get('[type="checkbox"]').click() From e8dcfff82e666d8be62a1da52f2a37ed186b3db4 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 15:19:24 +0100 Subject: [PATCH 067/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3239ad1391..9c1ccde426 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -37,7 +37,7 @@ Then("select {string} other part", (partAmount) => { // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); cy.contains('NO-989134870198932317923938') - .parentsUntil('tr').first() + .parentsUntil('tr').last() .within(() => { // all searches are automatically rooted to the found tr element //cy.get('[type="checkbox"]').click() From eb60f089a15bb57a437f74e299f0ce7c345e70a9 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 15:34:10 +0100 Subject: [PATCH 068/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 9c1ccde426..0f986a0dfd 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,9 +40,13 @@ Then("select {string} other part", (partAmount) => { .parentsUntil('tr').last() .within(() => { // all searches are automatically rooted to the found tr element - //cy.get('[type="checkbox"]').click() - cy.get('td').get('mat-checkbox').click() + cy.get('[@id="mat-mdc-checkbox-234-input"]').click() + //cy.get('td').get('mat-checkbox').click() }); + +// +// #mat-mdc-checkbox-234-input + //*[@id="mat-mdc-checkbox-234-input"] // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .parent() // gives you the row // .within(($tr) => { // filters just that row From 0fd3a0d845609ec23d2aad5e5e809ef7fbc5d9c2 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 24 Nov 2023 15:41:19 +0100 Subject: [PATCH 069/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 0f986a0dfd..94c1f2c5fd 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -40,13 +40,14 @@ Then("select {string} other part", (partAmount) => { .parentsUntil('tr').last() .within(() => { // all searches are automatically rooted to the found tr element - cy.get('[@id="mat-mdc-checkbox-234-input"]').click() + cy.get('[id="mat-mdc-checkbox-234-input"]').click() //cy.get('td').get('mat-checkbox').click() }); // // #mat-mdc-checkbox-234-input //*[@id="mat-mdc-checkbox-234-input"] + ///html/body/app-root/div/div/app-layout/main/div/div/div/app-other-parts/div/as-split/as-split-area[1]/mat-tab-group/div/mat-tab-body[1]/div/app-supplier-parts/div/app-parts-table/div[2]/table/tbody/tr[1]/td[1]/mat-checkbox/div/div/input // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell // .parent() // gives you the row // .within(($tr) => { // filters just that row From 059d6b167c20ad045e8c7c728b5acd172d9c0b26 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 07:42:46 +0100 Subject: [PATCH 070/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 94c1f2c5fd..09a5798ecf 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -31,16 +31,16 @@ Then("select {string} other part", (partAmount) => { //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); //cy.get('@part').get('#mat-mds-checkbox-21').click(); cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection - // cy.get('#mat-mdc-checkbox-38').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! + cy.get('#mat-mdc-checkbox-38*').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); // cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); - cy.contains('NO-989134870198932317923938') - .parentsUntil('tr').last() - .within(() => { - // all searches are automatically rooted to the found tr element - cy.get('[id="mat-mdc-checkbox-234-input"]').click() +// cy.contains('NO-989134870198932317923938') +// .parentsUntil('tr').last() +// .within(() => { +// // all searches are automatically rooted to the found tr element +// cy.get('[id="mat-mdc-checkbox-234-input"]').click() //cy.get('td').get('mat-checkbox').click() }); @@ -104,7 +104,8 @@ When("user navigate to {string} with button in popup", (popupClick) => { }); When("open details of created investigation", () => { - cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() + //cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() + cy.get('[data-testid="table-menu-button"]').first().click(); cy.get('span').contains('View details').click(); }); From 1ce8071a133b663e1c7d913b928984627ac0ca3f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 07:58:18 +0100 Subject: [PATCH 071/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 09a5798ecf..66bccad4c5 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -42,7 +42,7 @@ Then("select {string} other part", (partAmount) => { // // all searches are automatically rooted to the found tr element // cy.get('[id="mat-mdc-checkbox-234-input"]').click() //cy.get('td').get('mat-checkbox').click() - }); + // }); // // #mat-mdc-checkbox-234-input From 448df46802c2082e91800fb6e4fc1d346a42d457 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 08:06:59 +0100 Subject: [PATCH 072/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 66bccad4c5..58498dcdca 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -96,7 +96,7 @@ Then("selected parts are marked as investigated", () => { }); When("popup with information about queued investigation is shown", () => { - cy.contains(/You queued an investigation for 5 parts/i).should('be.visible'); + cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); When("user navigate to {string} with button in popup", (popupClick) => { From 8ce34bf0bfd4b6fec56a364951d42850a66018bb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 08:35:43 +0100 Subject: [PATCH 073/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 58498dcdca..86322d56fa 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -106,7 +106,8 @@ When("user navigate to {string} with button in popup", (popupClick) => { When("open details of created investigation", () => { //cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() cy.get('[data-testid="table-menu-button"]').first().click(); - cy.get('span').contains('View details').click(); + cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); + //cy.get('span').contains('View details').click(); }); //When user cancel selected investigation with entering "correct" id From a2e4fad74c2b5afa906ded2a0839598c9cf05218 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 08:44:00 +0100 Subject: [PATCH 074/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 86322d56fa..215d8bb8f5 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -107,7 +107,6 @@ When("open details of created investigation", () => { //cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() cy.get('[data-testid="table-menu-button"]').first().click(); cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); - //cy.get('span').contains('View details').click(); }); //When user cancel selected investigation with entering "correct" id @@ -116,6 +115,7 @@ When("open details of created investigation", () => { // #check: popup on the right sight is shown When("user cancel selected investigation with entering {string} id", (input) => { let investigationId = ''; + cy.get('div').contains('Cancel').click(); switch (input) { case 'no': { cy.get('span').contains('Confirm cancellation').click(); From 37d0664486dbff6e0670dd656123e3ea760f631f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 09:11:57 +0100 Subject: [PATCH 075/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 215d8bb8f5..c03c7e2e90 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -126,9 +126,12 @@ When("user cancel selected investigation with entering {string} id", (input) => cy.get('span').contains('Confirm cancellation').click(); break; } - case 'correct': { - //get correct id ---TBD--- - cy.get('#mat-mdc-form-field-label-4').click().focus().type(investigated); + case 'correct': { //get correct id ---TBD--- + cy.get('mat-label').as('cancelId'); +// cy.get('mat-label').then(function($elem){ +// cy.get($elem.text()).as('cancelId')}); + + cy.get('#mat-mdc-form-field-label-4').click().focus().type('@cancelId'); cy.get('span').contains('Confirm cancellation').click(); break; } From b6f203571322d7ae09e904b932b563e52f2663a6 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 09:22:20 +0100 Subject: [PATCH 076/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c03c7e2e90..97caf5eccd 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -128,10 +128,11 @@ When("user cancel selected investigation with entering {string} id", (input) => } case 'correct': { //get correct id ---TBD--- cy.get('mat-label').as('cancelId'); + cy.log('@cancelId'); // cy.get('mat-label').then(function($elem){ // cy.get($elem.text()).as('cancelId')}); - cy.get('#mat-mdc-form-field-label-4').click().focus().type('@cancelId'); + cy.get('#mat-input-0').click().type('@cancelId'); cy.get('span').contains('Confirm cancellation').click(); break; } From a2a6b9e114d6764df586419485f7bbf450104669 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 09:33:26 +0100 Subject: [PATCH 077/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 97caf5eccd..fa499c6504 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -109,13 +109,16 @@ When("open details of created investigation", () => { cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); }); +When("user start cancelation", () => { + cy.get('div').contains('Cancel').click(); +}); + //When user cancel selected investigation with entering "correct" id // #include: check popup (id, description, status, created, createdby, texts, buttons (cancel, approve), then click on Delete // #check: Deletion is only possible after entering the expected id // #check: popup on the right sight is shown When("user cancel selected investigation with entering {string} id", (input) => { let investigationId = ''; - cy.get('div').contains('Cancel').click(); switch (input) { case 'no': { cy.get('span').contains('Confirm cancellation').click(); From 36cec8e313038eff061650e7cebdc164c36a7483 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 10:25:51 +0100 Subject: [PATCH 078/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index fa499c6504..ac492730b6 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -130,12 +130,16 @@ When("user cancel selected investigation with entering {string} id", (input) => break; } case 'correct': { //get correct id ---TBD--- - cy.get('mat-label').as('cancelId'); - cy.log('@cancelId'); + cy.get('mat-label').invoke('val').as('cancelId'); + // cy.log('@cancelId'); // cy.get('mat-label').then(function($elem){ // cy.get($elem.text()).as('cancelId')}); - cy.get('#mat-input-0').click().type('@cancelId'); + cy.get('@cancelId').then((cancelId) => { + cy.log('Cancel Id ' + cancelId) + cy.get('#mat-input-0').click().type(cancelId); + }); + cy.get('span').contains('Confirm cancellation').click(); break; } From 8f53da3cc47203f3c28fc5fec3feff511c840288 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 10:37:58 +0100 Subject: [PATCH 079/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ac492730b6..6e6c199a98 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -130,7 +130,7 @@ When("user cancel selected investigation with entering {string} id", (input) => break; } case 'correct': { //get correct id ---TBD--- - cy.get('mat-label').invoke('val').as('cancelId'); + cy.get('mat-label').invoke('text').as('cancelId'); // cy.log('@cancelId'); // cy.get('mat-label').then(function($elem){ // cy.get($elem.text()).as('cancelId')}); From 710c65ee5d30ffab5c7159a4530f31eb4bc4e1dd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 11:18:14 +0100 Subject: [PATCH 080/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 6e6c199a98..5d03e59743 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -129,17 +129,12 @@ When("user cancel selected investigation with entering {string} id", (input) => cy.get('span').contains('Confirm cancellation').click(); break; } - case 'correct': { //get correct id ---TBD--- + case 'correct': { cy.get('mat-label').invoke('text').as('cancelId'); - // cy.log('@cancelId'); -// cy.get('mat-label').then(function($elem){ -// cy.get($elem.text()).as('cancelId')}); - cy.get('@cancelId').then((cancelId) => { cy.log('Cancel Id ' + cancelId) cy.get('#mat-input-0').click().type(cancelId); }); - cy.get('span').contains('Confirm cancellation').click(); break; } @@ -208,43 +203,36 @@ matched = false; switch (status) { case 'canceled': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Cancelled"]').should('not.be.visible'); + cy.get('div').contains('Cancel').should('not.exist'); break; } - case 'requested': { - // same as "approved" + case 'approved': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Requested"]').should('not.be.visible'); + cy.get('div').contains('Approve').should('not.exist'); break; } case 'accepted': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Accepted"]').should('not.be.visible'); + cy.get('div').contains('Accept').should('not.exist'); break; } case 'declined': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Declined"]').should('not.be.visible'); + cy.get('div').contains('Decline').should('not.exist'); break; } case 'acknowledged': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Acknowledged"]').should('not.be.visible'); + cy.get('div').contains('Acknowledge').should('not.exist'); break; } case 'closed': { matched = true; - //TBD selection once the environment is running up again - cy.get('[title="Closed"]').should('not.be.visible'); + cy.get('div').contains('Close').should('not.exist'); break; } } if (!matched) { - throw new Error("Set status '" + status + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed]."); + throw new Error("Set status '" + status + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); } }); From 6e50d1b82d0a376b0f620a84bbaaeb6e9ff8147f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 11:36:39 +0100 Subject: [PATCH 081/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 5d03e59743..fd427744b5 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -203,7 +203,7 @@ matched = false; switch (status) { case 'canceled': { matched = true; - cy.get('div').contains('Cancel').should('not.exist'); + cy.get('div').contains('/^Cancel$/').should('not.exist'); break; } case 'approved': { From 4912c669fb01eb1e67bfd1b588676df7569addeb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 11:56:18 +0100 Subject: [PATCH 082/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index fd427744b5..1b0c92e822 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -203,7 +203,7 @@ matched = false; switch (status) { case 'canceled': { matched = true; - cy.get('div').contains('/^Cancel$/').should('not.exist'); + cy.get('div').contains('/^Cancel$/', {matchCase: true}).should('not.exist'); break; } case 'approved': { From 68af564a7996ee7b84eb891e0674684d4d7aa299 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 12:03:47 +0100 Subject: [PATCH 083/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 1b0c92e822..c167ebbfdc 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -208,27 +208,27 @@ matched = false; } case 'approved': { matched = true; - cy.get('div').contains('Approve').should('not.exist'); + cy.get('div').contains('/^Approve$/', {matchCase: true}).should('not.exist'); break; } case 'accepted': { matched = true; - cy.get('div').contains('Accept').should('not.exist'); + cy.get('div').contains('/^Accept$/', {matchCase: true}).should('not.exist'); break; } case 'declined': { matched = true; - cy.get('div').contains('Decline').should('not.exist'); + cy.get('div').contains('/^Decline$/', {matchCase: true}).should('not.exist'); break; } case 'acknowledged': { matched = true; - cy.get('div').contains('Acknowledge').should('not.exist'); + cy.get('div').contains('/^Acknowledge$/', {matchCase: true}).should('not.exist'); break; } case 'closed': { matched = true; - cy.get('div').contains('Close').should('not.exist'); + cy.get('div').contains('/^Close$/', {matchCase: true}).should('not.exist'); break; } } From 251faa8c23c5953e18547b36afdcb73dad70bf52 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 12:20:09 +0100 Subject: [PATCH 084/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index c167ebbfdc..08ab30655f 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -109,15 +109,11 @@ When("open details of created investigation", () => { cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); }); -When("user start cancelation", () => { - cy.get('div').contains('Cancel').click(); -}); - //When user cancel selected investigation with entering "correct" id // #include: check popup (id, description, status, created, createdby, texts, buttons (cancel, approve), then click on Delete // #check: Deletion is only possible after entering the expected id // #check: popup on the right sight is shown -When("user cancel selected investigation with entering {string} id", (input) => { +When("user confirm cancelation of selected investigation with entering {string} id", (input) => { let investigationId = ''; switch (input) { case 'no': { @@ -154,6 +150,19 @@ Then("cancelation is not possible due to {string} id", (id) => { } }); +When("user {string} selected investigation", (action) => { + switch (action) { + case 'approve': { + cy.get('div').contains('Approve').click(); + break; + } + case 'cancel': { + cy.get('div').contains('Cancel').click(); + break; + } + } +}); + Then("informations for selected investigation are displayed as expected", () => { // ---TBD--- include: overview, supplier parts, STATUS }); From 7b7aed6321031473334082be942e267a0c3795fd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 12:40:31 +0100 Subject: [PATCH 085/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 08ab30655f..6f9b4f34d2 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -163,6 +163,10 @@ When("user {string} selected investigation", (action) => { } }); +When("user confirm approval of selected investigation", (action) => { + cy.get('span').contains('Approve').click(); +}); + Then("informations for selected investigation are displayed as expected", () => { // ---TBD--- include: overview, supplier parts, STATUS }); From 29ddd60e5962a46ff7198180f2efbb82ff86eb83 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 12:51:54 +0100 Subject: [PATCH 086/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 6f9b4f34d2..704c7a65a5 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -164,7 +164,7 @@ When("user {string} selected investigation", (action) => { }); When("user confirm approval of selected investigation", (action) => { - cy.get('span').contains('Approve').click(); + cy.get('span').contains('Approve').last().click(); }); Then("informations for selected investigation are displayed as expected", () => { From a99c319afcb37bf62e32294aa0bcdfed9cbd5ddd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 13:55:45 +0100 Subject: [PATCH 087/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../quality-investigations.ts | 53 ++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 704c7a65a5..eb093936e9 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -63,6 +63,7 @@ Then("select {string} other part", (partAmount) => { //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); }); + Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); //notificationDescription = "Test 123123 description"; @@ -71,14 +72,15 @@ Then("start investigation creation with description {string}", function (descrip cy.get('mat-label').contains('Description').click().type(description); }); + When("severity {string}", function (severity) { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. cy.get('p').contains(severity).click(); //cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); + When("{string} deadline", function (deadline) { -//---TBD--- if (deadline == 'no') { // do nothing } else { @@ -86,33 +88,37 @@ When("{string} deadline", function (deadline) { } }); + When("request the investigation", () => { cy.get('span').contains('ADD TO QUEUE').click(); }); + Then("selected parts are marked as investigated", () => { //cy.get('class').contains('highlighted'); //---TBD--- to check the desired assets, have to be adjusted with desired asset selection }); + When("popup with information about queued investigation is shown", () => { cy.contains(/You queued an investigation for 1 part/i).should('be.visible'); }); + When("user navigate to {string} with button in popup", (popupClick) => { cy.get('a').contains('Go to Queue').click(); }); + When("open details of created investigation", () => { //cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() - cy.get('[data-testid="table-menu-button"]').first().click(); + cy.get('[data-testid="table-menu-button"]').first().click(); //the first investigation will be opened cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); }); -//When user cancel selected investigation with entering "correct" id -// #include: check popup (id, description, status, created, createdby, texts, buttons (cancel, approve), then click on Delete -// #check: Deletion is only possible after entering the expected id -// #check: popup on the right sight is shown + +// --- TBD --- check id, description, status, created, createdby, text +// --- TBD --- #check: popup on the right sight is shown When("user confirm cancelation of selected investigation with entering {string} id", (input) => { let investigationId = ''; switch (input) { @@ -137,6 +143,7 @@ When("user confirm cancelation of selected investigation with entering {string} } }); + Then("cancelation is not possible due to {string} id", (id) => { switch (id) { case 'no': { @@ -150,7 +157,9 @@ Then("cancelation is not possible due to {string} id", (id) => { } }); + When("user {string} selected investigation", (action) => { +//within opened detail view of quality investigation switch (action) { case 'approve': { cy.get('div').contains('Approve').click(); @@ -160,17 +169,44 @@ When("user {string} selected investigation", (action) => { cy.get('div').contains('Cancel').click(); break; } + case 'close': { + cy.get('div').contains('Close').click(); + break; + } + case 'acknowledge': { + cy.get('div').contains('Acknowledge').click(); + break; + } + case 'accept': { + cy.get('div').contains('Accept').click(); + break; + } + case 'decline': { + cy.get('div').contains('Decline').click(); + break; + } } }); + When("user confirm approval of selected investigation", (action) => { - cy.get('span').contains('Approve').last().click(); + //cy.get('span').contains('Approve').last().click(); + + cy.get('have.variant', 'raised') + .within(() => { + cy.get('span').contains('Approve').click(); + //return cy.contains('Child element').should('have.class', 'some-child') + }) + + ///////////////////////////////////////// }); + Then("informations for selected investigation are displayed as expected", () => { -// ---TBD--- include: overview, supplier parts, STATUS +// --- TBD --- include: overview, supplier parts, STATUS }); + Then("selected {string} has been {string} as expected", (notificationType, expectedStatus) => { matched = false; switch (expectedStatus) { @@ -211,6 +247,7 @@ matched = false; } }); + When("selected {string} is not allowed to be {string}", (notificationType, status) => { matched = false; switch (status) { From 47d90d5436f1fb9201ab5306c82736043d4c3138 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 14:05:05 +0100 Subject: [PATCH 088/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index eb093936e9..8036521342 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -194,7 +194,7 @@ When("user confirm approval of selected investigation", (action) => { cy.get('have.variant', 'raised') .within(() => { - cy.get('span').contains('Approve').click(); + cy.get('span').click(); //return cy.contains('Child element').should('have.class', 'some-child') }) From 8e1ca413188d64bd29aa09107e1adc242d437d6b Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 14:15:57 +0100 Subject: [PATCH 089/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 8036521342..b3c4ca1f25 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -191,13 +191,12 @@ When("user {string} selected investigation", (action) => { When("user confirm approval of selected investigation", (action) => { //cy.get('span').contains('Approve').last().click(); - - cy.get('have.variant', 'raised') - .within(() => { - cy.get('span').click(); - //return cy.contains('Child element').should('have.class', 'some-child') - }) - +// cy.get('have.variant', 'raised') +// .within(() => { +// cy.get('span').click(); +// //return cy.contains('Child element').should('have.class', 'some-child') +// }) + cy.get('have.variant', 'raised').find('span').contains('Approve').click(); ///////////////////////////////////////// }); From 0d35540217fdf0dc07d67e3c5afd84eed6c6dde8 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 14:25:43 +0100 Subject: [PATCH 090/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index b3c4ca1f25..1d791e09aa 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -196,7 +196,7 @@ When("user confirm approval of selected investigation", (action) => { // cy.get('span').click(); // //return cy.contains('Child element').should('have.class', 'some-child') // }) - cy.get('have.variant', 'raised').find('span').contains('Approve').click(); + cy.get('app-button').should('have.variant', 'raised').find('span').contains('Approve').click(); ///////////////////////////////////////// }); From 147037478c4110b8ce8e220edb77526d821450bb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 14:40:31 +0100 Subject: [PATCH 091/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 1d791e09aa..4627a78593 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -134,7 +134,6 @@ When("user confirm cancelation of selected investigation with entering {string} case 'correct': { cy.get('mat-label').invoke('text').as('cancelId'); cy.get('@cancelId').then((cancelId) => { - cy.log('Cancel Id ' + cancelId) cy.get('#mat-input-0').click().type(cancelId); }); cy.get('span').contains('Confirm cancellation').click(); @@ -196,7 +195,8 @@ When("user confirm approval of selected investigation", (action) => { // cy.get('span').click(); // //return cy.contains('Child element').should('have.class', 'some-child') // }) - cy.get('app-button').should('have.variant', 'raised').find('span').contains('Approve').click(); + //cy.get('app-button').should('have.variant', 'raised').find('span').contains('Approve').click(); + cy.get('app-confirm').should('have.variant', 'raised').find('span').contains('Approve').click(); ///////////////////////////////////////// }); From a9a1c4e8814d5197edc33f948873148658b2e50c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 14:50:28 +0100 Subject: [PATCH 092/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 4627a78593..302e6f590f 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -196,7 +196,8 @@ When("user confirm approval of selected investigation", (action) => { // //return cy.contains('Child element').should('have.class', 'some-child') // }) //cy.get('app-button').should('have.variant', 'raised').find('span').contains('Approve').click(); - cy.get('app-confirm').should('have.variant', 'raised').find('span').contains('Approve').click(); +// cy.get('app-confirm').should('have.variant', 'raised').find('span').contains('Approve').click(); + cy.get('app-confirm').find('span').contains('Approve').click(); ///////////////////////////////////////// }); From 3ce6f15b8a40b271394c6ef2461d50aeb0a94e01 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 15:01:16 +0100 Subject: [PATCH 093/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 302e6f590f..b4bb1f28d8 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -215,8 +215,8 @@ matched = false; cy.get('[title="Cancelled"]').should('be.visible'); break; } - case 'requested': { - // same as "approved" + case 'approved': { + // same as "requested" matched = true; cy.get('[title="Requested"]').should('be.visible'); break; @@ -243,7 +243,7 @@ matched = false; } } if (!matched) { - throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, requested, accepted, declined, acknowledged, closed]."); + throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); } }); From 96ffc58a32ba1507d00769db1b9d9dd3d9e01869 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 15:41:40 +0100 Subject: [PATCH 094/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../step_definitions/quality-investigations.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index b4bb1f28d8..3ef72e71aa 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -65,18 +65,16 @@ Then("select {string} other part", (partAmount) => { Then("start investigation creation with description {string}", function (description) { - //notificationDescription = wrapStringWithTimestamp(input.get("description")); - //notificationDescription = "Test 123123 description"; - notificationDescription = description; + notificationDescription = wrapStringWithTimestamp(input.get("description")); + //notificationDescription = description; cy.get('div').contains('Start investigation').click(); - cy.get('mat-label').contains('Description').click().type(description); + cy.get('mat-label').contains('Description').click().type(notificationDescription); }); When("severity {string}", function (severity) { cy.get('#mat-select-56').click(); // First the dropdown has to be opened. cy.get('p').contains(severity).click(); - //cy.get('#mat-select-56-panel').select(severity); // Dropdown menu has own id. }); @@ -189,16 +187,7 @@ When("user {string} selected investigation", (action) => { When("user confirm approval of selected investigation", (action) => { - //cy.get('span').contains('Approve').last().click(); -// cy.get('have.variant', 'raised') -// .within(() => { -// cy.get('span').click(); -// //return cy.contains('Child element').should('have.class', 'some-child') -// }) - //cy.get('app-button').should('have.variant', 'raised').find('span').contains('Approve').click(); -// cy.get('app-confirm').should('have.variant', 'raised').find('span').contains('Approve').click(); cy.get('app-confirm').find('span').contains('Approve').click(); - ///////////////////////////////////////// }); From 94b18ffe46901897e2108aa80290768222f9a968 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 15:50:07 +0100 Subject: [PATCH 095/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 3ef72e71aa..ef46b4b8c3 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -20,7 +20,7 @@ ********************************************************************************/ //package org.eclipse.tractusx.traceability.test; -//import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; From a3aa3ebcd88b852d7f18f380577209025584fe50 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 15:54:08 +0100 Subject: [PATCH 096/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ef46b4b8c3..665c54cdd2 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -20,7 +20,7 @@ ********************************************************************************/ //package org.eclipse.tractusx.traceability.test; -import static from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +import * from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; From 73a454038569a76133fb9650f80ddd8044ede974 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 27 Nov 2023 16:05:52 +0100 Subject: [PATCH 097/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 665c54cdd2..ec3cca92a8 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -20,7 +20,7 @@ ********************************************************************************/ //package org.eclipse.tractusx.traceability.test; -import * from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; +// import * from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; @@ -65,8 +65,8 @@ Then("select {string} other part", (partAmount) => { Then("start investigation creation with description {string}", function (description) { - notificationDescription = wrapStringWithTimestamp(input.get("description")); - //notificationDescription = description; + //notificationDescription = wrapStringWithTimestamp(input.get("description")); + notificationDescription = description + cy.clock(now); cy.get('div').contains('Start investigation').click(); cy.get('mat-label').contains('Description').click().type(notificationDescription); }); From a9a9a430be2d8311b20695e87936b5a06964514d Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 08:02:11 +0100 Subject: [PATCH 098/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ec3cca92a8..ce1050a5dd 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -66,7 +66,8 @@ Then("select {string} other part", (partAmount) => { Then("start investigation creation with description {string}", function (description) { //notificationDescription = wrapStringWithTimestamp(input.get("description")); - notificationDescription = description + cy.clock(now); + const date = new Date().getTime(); + notificationDescription = description + date; cy.get('div').contains('Start investigation').click(); cy.get('mat-label').contains('Description').click().type(notificationDescription); }); From 4c2979e646491207a33e048388a6dc159f6b64dd Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 08:13:33 +0100 Subject: [PATCH 099/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../support/step_definitions/quality-investigations.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ce1050a5dd..85f85c5514 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -18,9 +18,6 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -//package org.eclipse.tractusx.traceability.test; - -// import * from org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; import { When, Then, Given } from '@badeball/cypress-cucumber-preprocessor'; import { QualityInvestigationsPage } from '../../integration/pages/QualityInvestigationsPage'; @@ -65,7 +62,6 @@ Then("select {string} other part", (partAmount) => { Then("start investigation creation with description {string}", function (description) { - //notificationDescription = wrapStringWithTimestamp(input.get("description")); const date = new Date().getTime(); notificationDescription = description + date; cy.get('div').contains('Start investigation').click(); @@ -188,6 +184,7 @@ When("user {string} selected investigation", (action) => { When("user confirm approval of selected investigation", (action) => { + cy.wait(50); cy.get('app-confirm').find('span').contains('Approve').click(); }); From 24d7ecd973840ec2a18a96c337cfee0c655bbff3 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 08:26:00 +0100 Subject: [PATCH 100/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- .../cypress/support/step_definitions/quality-investigations.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 85f85c5514..0879a13020 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -184,7 +184,6 @@ When("user {string} selected investigation", (action) => { When("user confirm approval of selected investigation", (action) => { - cy.wait(50); cy.get('app-confirm').find('span').contains('Approve').click(); }); @@ -205,7 +204,7 @@ matched = false; case 'approved': { // same as "requested" matched = true; - cy.get('[title="Requested"]').should('be.visible'); + cy.get('[title="Requested"]', { timeout: 10000 }).should('be.visible'); break; } case 'accepted': { From 82639ae251f67243b24f0a145e7855c180243b36 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 08:32:46 +0100 Subject: [PATCH 101/106] feat(testing):[TRACEFOSS-2838] tryouts and fix while testing --- frontend/cypress/support/step_definitions/login.ts | 5 ----- .../support/step_definitions/quality-investigations.ts | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/frontend/cypress/support/step_definitions/login.ts b/frontend/cypress/support/step_definitions/login.ts index 56ff2e1669..f866b02de6 100644 --- a/frontend/cypress/support/step_definitions/login.ts +++ b/frontend/cypress/support/step_definitions/login.ts @@ -26,18 +26,13 @@ Given('user logged in as {string}', function(userType) { cy.visit('https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth?client_id=Cl17-CX-Part&redirect_uri=https%3A%2F%2Ftraceability-portal-e2e-a.dev.demo.catena-x.net%2Fdashboard&state=0aaee615-388e-400c-8b0c-81ac443a2cf3&response_mode=fragment&response_type=code&scope=openid&nonce=4104d5ab-b2bd-43a1-b6c2-7adf30543579&code_challenge=uXHR3gDRnSyjPEu8yWNdzm6Izsd7cKzEryfvRAtJTjU&code_challenge_method=S256'); cy.get('.search').click(); cy.get('.search').type('CX-Test-Access'); - cy.wait(500); cy.get('.CX_Test_Access').click(); - cy.wait(500); cy.get('input[name="username"]').type(loginMail); - cy.wait(500); cy.get('input[name="password"]').click().focus().type(loginPW); - cy.wait(500); cy.get('input[type="submit"]').click(); }); Given('user is directed to the {string}', function(value) { - cy.wait(500); cy.get('div.layout-content').should('exist'); }); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 0879a13020..0b0d104c4a 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -63,7 +63,7 @@ Then("select {string} other part", (partAmount) => { Then("start investigation creation with description {string}", function (description) { const date = new Date().getTime(); - notificationDescription = description + date; + notificationDescription = description + "_" + date; cy.get('div').contains('Start investigation').click(); cy.get('mat-label').contains('Description').click().type(notificationDescription); }); @@ -209,22 +209,22 @@ matched = false; } case 'accepted': { matched = true; - cy.get('[title="Accepted"]').should('be.visible'); + cy.get('[title="Accepted"]', { timeout: 10000 }).should('be.visible'); break; } case 'declined': { matched = true; - cy.get('[title="Declined"]').should('be.visible'); + cy.get('[title="Declined"]', { timeout: 10000 }).should('be.visible'); break; } case 'acknowledged': { matched = true; - cy.get('[title="Acknowledged"]').should('be.visible'); + cy.get('[title="Acknowledged"]', { timeout: 10000 }).should('be.visible'); break; } case 'closed': { matched = true; - cy.get('[title="Closed"]').should('be.visible'); + cy.get('[title="Closed"]', { timeout: 10000 }).should('be.visible'); break; } } From 2bf4a6f83286cd4bcf29fac35f8b7b2727053b55 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 12:13:36 +0100 Subject: [PATCH 102/106] feat(testing):[TRACEFOSS-2838] deleted comments --- .../quality-investigations.ts | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 0b0d104c4a..ccb31f9ce4 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -24,40 +24,10 @@ import { QualityInvestigationsPage } from '../../integration/pages/QualityInvest let notificationDescription = null; Then("select {string} other part", (partAmount) => { -//since IDs of desired asset are not shown in FE the selection has to be done by other number - //cy.get('span').contains('NO-989134870198932317923938').parent('.row').as('part'); - //cy.get('@part').get('#mat-mds-checkbox-21').click(); - cy.get('span').contains('As Planned').click(); // see comment above. This has to be done to avoid asPlanned selection - cy.get('#mat-mdc-checkbox-38*').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part as above! -// cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').first().get('[type="checkbox"]').click(); -//cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row ng-star-inserted').children().get('[type="checkbox"]').first().click(); -// cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); - -// cy.contains('NO-989134870198932317923938') -// .parentsUntil('tr').last() -// .within(() => { -// // all searches are automatically rooted to the found tr element -// cy.get('[id="mat-mdc-checkbox-234-input"]').click() - //cy.get('td').get('mat-checkbox').click() - // }); - -// -// #mat-mdc-checkbox-234-input - //*[@id="mat-mdc-checkbox-234-input"] - ///html/body/app-root/div/div/app-layout/main/div/div/div/app-other-parts/div/as-split/as-split-area[1]/mat-tab-group/div/mat-tab-body[1]/div/app-supplier-parts/div/app-parts-table/div[2]/table/tbody/tr[1]/td[1]/mat-checkbox/div/div/input -// cy.contains('span', 'NO-989134870198932317923938') // gives you the cell -// .parent() // gives you the row -// .within(($tr) => { // filters just that row -// cy.children().get($div)//cy.get('[type="checkbox"]')//.get('[data-testid="select-one--test-id"]') // finds the buttons cell of that row -// .click() -// }); - - - // cy.contains('span', 'NO-989134870198932317923938') // gives you the cell - // .siblings() // gives you all the other cells in the row - // .get('[type="checkbox"]') // finds the delete button - // .click() - //cy.get('span').contains('NO-989134870198932317923938').parentsUntil('.mat-mdc-cell mdc-data-table__cell cdk-cell table--cell cdk-column-semanticModelId mat-column-semanticModelId ng-star-inserted').get('[type="checkbox"]').first().click(); +//since IDs of desired asset are not shown in FE the selection has to be done by other number. + cy.get('span').contains('As Planned').click(); // This has to be done to avoid asPlanned selection + cy.get('#mat-mdc-checkbox-38*').click(); //---TBD--- this is only a method to make it run, has to be changed to selected part. + }); @@ -79,7 +49,7 @@ When("{string} deadline", function (deadline) { if (deadline == 'no') { // do nothing } else { - // ---TBD--- + // ---TBD--- implement timepicker once it´s necessary. } }); @@ -106,7 +76,6 @@ When("user navigate to {string} with button in popup", (popupClick) => { When("open details of created investigation", () => { - //cy.get('p').contains(notificationDescription).parentsUntil('.mat-mdc-row mdc-data-table__row cdk-row no-hover ng-star-inserted').get('[class="mat-mdc-button-touch-target"]').click() cy.get('[data-testid="table-menu-button"]').first().click(); //the first investigation will be opened cy.get('[data-testid="table-menu-button--actions.viewDetails"]').first().click(); }); From 89e2f37835e46c79883361aec081e37052f7255d Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 13:07:09 +0100 Subject: [PATCH 103/106] feat(testing):[TRACEFOSS-2838] added log:false to password, adjusted switch method with default --- .../cypress/support/step_definitions/login.ts | 2 +- .../step_definitions/quality-investigations.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/support/step_definitions/login.ts b/frontend/cypress/support/step_definitions/login.ts index f866b02de6..40135f36f1 100644 --- a/frontend/cypress/support/step_definitions/login.ts +++ b/frontend/cypress/support/step_definitions/login.ts @@ -28,7 +28,7 @@ Given('user logged in as {string}', function(userType) { cy.get('.search').type('CX-Test-Access'); cy.get('.CX_Test_Access').click(); cy.get('input[name="username"]').type(loginMail); - cy.get('input[name="password"]').click().focus().type(loginPW); + cy.get('input[name="password"]').click().focus().type(loginPW, {log:false}); cy.get('input[type="submit"]').click(); }); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index ccb31f9ce4..23228dbb89 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -148,6 +148,10 @@ When("user {string} selected investigation", (action) => { cy.get('div').contains('Decline').click(); break; } + default: { + throw new Error("Set action '" + action + "' is not one of valid actions [approve, cancel, close, acknowledge, accept, decline]."); + break; + } } }); @@ -196,9 +200,10 @@ matched = false; cy.get('[title="Closed"]', { timeout: 10000 }).should('be.visible'); break; } - } - if (!matched) { - throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); + default: { + throw new Error("Set expected status '" + expectedStatus + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); + break; + } } }); @@ -236,8 +241,9 @@ matched = false; cy.get('div').contains('/^Close$/', {matchCase: true}).should('not.exist'); break; } - } - if (!matched) { - throw new Error("Set status '" + status + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); + default: { + throw new Error("Set status '" + status + "' is not one of valid status [canceled, approved, accepted, declined, acknowledged, closed]."); + break; + } } }); From 3962ee41f9a1a168402e043d0c35b00f2b4b7563 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 13:11:00 +0100 Subject: [PATCH 104/106] feat(testing):[TRACEFOSS-2838] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3df4326a..88f0680a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [UNRELEASED - DD.MM.YYYY] ### Added - Added Api-Input in Argo Workflow to fix bugs +- Added implementation for cucumber tests for quality investigations ### Changed - Updated mikefarah/yq from 4.35.2 to 4.40.2 - Upgraded maven-checkstyle-plugin from 3.3.0 to 3.3.1 From 158ed79e04850f54b641345024a1e91ce49f4c57 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 13:43:48 +0100 Subject: [PATCH 105/106] feat(testing):[TRACEFOSS-2838] added missing defaults to switch methods --- .../support/step_definitions/quality-investigations.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index 23228dbb89..ce4b4af421 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -103,6 +103,10 @@ When("user confirm cancelation of selected investigation with entering {string} cy.get('span').contains('Confirm cancellation').click(); break; } + default: { + throw new Error("Set cancelation id '" + input + "' is not one of valid actions [no, wrong, correct]."); + break; + } } }); @@ -117,6 +121,10 @@ Then("cancelation is not possible due to {string} id", (id) => { cy.contains(/Please enter data that matches this pattern:/i).should('be.visible'); break; } + default: { + throw new Error("Set cancelation action '" + id + "' is not one of valid actions [no, wrong]."); + break; + } } }); From 25511e8f6a30b56c42eae57b36db5234bbc390bb Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 28 Nov 2023 13:47:36 +0100 Subject: [PATCH 106/106] feat(testing):[TRACEFOSS-2838] changed if with default in switch of menu.ts --- frontend/cypress/support/step_definitions/menu.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/support/step_definitions/menu.ts b/frontend/cypress/support/step_definitions/menu.ts index 1d844e9f0a..8bb0435632 100644 --- a/frontend/cypress/support/step_definitions/menu.ts +++ b/frontend/cypress/support/step_definitions/menu.ts @@ -55,8 +55,9 @@ matched = false; cy.get('[href="/about"]').click(); break; } - } - if (!matched) { - throw new Error("Set header menu '" + desiredMenu + "' is not one of valid status [Dashboard, Parts, Other parts, Quality investigations, Quality alerts, About]."); + default: { + throw new Error("Set header menu '" + desiredMenu + "' is not one of valid status [Dashboard, Parts, Other parts, Quality investigations, Quality alerts, About]."); + break; + } } });