From 16a9fce0e104a38371a9e5a567ec611ae3fc7f33 Mon Sep 17 00:00:00 2001 From: ys9693 Date: Sun, 19 Jan 2020 13:50:02 +0200 Subject: Catalog alignment Issue-ID: SDC-2724 Signed-off-by: ys9693 Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe --- catalog-ui/cypress/integration/catalog.spec.js | 21 ++ ...ollapsing_roles-certified_life_cycle_buttons.js | 280 ++++++++++++++ .../cypress/integration/composition_page.spec.js | 104 +++++ .../deployment-artifacts.composition.spec.js | 86 +++++ .../cypress/integration/distribution_page.spec.js | 417 +++++++++++++++++++++ .../cypress/integration/general-page.spec.js | 28 ++ catalog-ui/cypress/integration/home.spec.js | 32 ++ catalog-ui/cypress/integration/import-vsp.spec.js | 205 ++++++++++ .../modify-service-consumption.composition.spec.js | 52 +++ .../integration/property-assignment.spec.js | 75 ++++ .../service-dependencies-rules.composition.spec.js | 70 ++++ .../cypress/integration/welcome_page.spec.js | 20 + 12 files changed, 1390 insertions(+) create mode 100644 catalog-ui/cypress/integration/catalog.spec.js create mode 100644 catalog-ui/cypress/integration/collapsing_roles-certified_life_cycle_buttons.js create mode 100644 catalog-ui/cypress/integration/composition_page.spec.js create mode 100644 catalog-ui/cypress/integration/deployment-artifacts.composition.spec.js create mode 100644 catalog-ui/cypress/integration/distribution_page.spec.js create mode 100644 catalog-ui/cypress/integration/general-page.spec.js create mode 100644 catalog-ui/cypress/integration/home.spec.js create mode 100644 catalog-ui/cypress/integration/import-vsp.spec.js create mode 100644 catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js create mode 100644 catalog-ui/cypress/integration/property-assignment.spec.js create mode 100644 catalog-ui/cypress/integration/service-dependencies-rules.composition.spec.js create mode 100644 catalog-ui/cypress/integration/welcome_page.spec.js (limited to 'catalog-ui/cypress/integration') diff --git a/catalog-ui/cypress/integration/catalog.spec.js b/catalog-ui/cypress/integration/catalog.spec.js new file mode 100644 index 0000000000..3e0aa9efd7 --- /dev/null +++ b/catalog-ui/cypress/integration/catalog.spec.js @@ -0,0 +1,21 @@ +import {initCommonFixtures} from "../common/init"; + +describe('Catalog Screen', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + // Followed Resources for the dashboard screen + cy.fixture('catalog/catalog').as('catalog'); + cy.route('GET', '**/catalog?*', '@catalog'); + }); + + it('Test that only In Design/Distributed/Certify appears in catalog left panel filters', function () { + const catalogPageUrl = '#!/catalog?*'; + cy.visit(catalogPageUrl); + + cy.get('[data-tests-id="checklist-status-in-design"]').should('exist'); + cy.get('[data-tests-id="checklist-status-certified"]').should('exist'); + cy.get('[data-tests-id="checklist-status-distributed"]').should('exist'); + }); +}); \ No newline at end of file diff --git a/catalog-ui/cypress/integration/collapsing_roles-certified_life_cycle_buttons.js b/catalog-ui/cypress/integration/collapsing_roles-certified_life_cycle_buttons.js new file mode 100644 index 0000000000..9e806d1ab0 --- /dev/null +++ b/catalog-ui/cypress/integration/collapsing_roles-certified_life_cycle_buttons.js @@ -0,0 +1,280 @@ +import { initCommonFixtures } from "../common/init"; + +describe('Collapsing Roles', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + cy.fixture('common/service-metadata').as('serviceMetaData'); + cy.fixture('common/vf-metadata').as('vfMetaData'); + cy.fixture('common/service-certifyResponse').as('serviceCertifyResponse'); + cy.fixture('common/dependencies').as('dependenciesResponse'); + cy.fixture('common/packages').as('packagesResponse'); + }); + + it('Service - Verify UpdateServices, CheckOut, Distribute and Archive exist for a Certified Service that was not Distributed', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[]); + + this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTION_NOT_APPROVED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Waiting For Distribution'); + + console.log('Verify Upgrade Services Button'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services'); + + console.log('Verify Distribute Services Button'); + cy.get('[data-tests-id="distribute"]').should('be.visible'); + cy.get('[data-tests-id="distribute"]').should('contain.text','Distribute'); + + console.log('Verify Check Out Button'); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + cy.get('[data-tests-id="check_out"]').should('contain.text','Check Out'); + + console.log('Verify Archive Button'); + cy.get('[data-tests-id="archive-component-button"]').should('be.visible'); + cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive'); + + console.log('Verify Redistribute Button Not Exist'); + cy.get('[data-tests-id="redistribute"]').should('not.be.visible'); + cy.get('[data-tests-id="redistribute"]').should('not.exist'); + + console.log("Verify that Certify button does not exist") + cy.get('[data-tests-id="certify"]').should('not.be.visible'); + }); + + it('Service - Verify UpdateServices, CheckOut, Redistribute and Archive exist for a Certified Service that was Distributed', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[]); + + this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Distributed'); + + console.log('Verify Upgrade Services Button'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services'); + + console.log('Verify Distribute Services Button'); + cy.get('[data-tests-id="redistribute"]').should('be.visible'); + cy.get('[data-tests-id="redistribute"]').should('contain.text','Redistribute'); + + console.log('Verify Check Out Button'); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + cy.get('[data-tests-id="check_out"]').should('contain.text','Check Out'); + + console.log('Verify Archive Button'); + cy.get('[data-tests-id="archive-component-button"]').should('be.visible'); + cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive'); + + console.log('Verify Distribute Button Not Exist'); + cy.get('[data-tests-id="distribute"]').should('not.be.visible'); + cy.get('[data-tests-id="distribute"]').should('not.exist'); + + console.log("Verify that Certify button does not exist") + cy.get('[data-tests-id="certify"]').should('not.be.visible'); + }); + + it('Service - Verify UpdateServices button is disabled in case there are no Dependencies for a Certified Service', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[{dependencies: null}]); + + this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.disabled'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services'); + + console.log("Verify that Certify button does not exist") + cy.get('[data-tests-id="certify"]').should('not.be.visible'); + }); + + it('Service - Verify UpdateServices button is enabled in case there are Dependencies for a Certified Service', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]); + + this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.enabled'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services'); + + console.log("Verify that Certify button does not exist") + cy.get('[data-tests-id="certify"]').should('not.be.visible'); + }); + + it('Service - Verify UpdateServices Not exist and Certify Exist in case Service is in state NOT_CERTIFIED_CHECKOUT', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]); + + this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKOUT'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('not.be.visible'); + + cy.get('[data-tests-id="certify"]').should('be.visible').click(); + cy.get('[data-tests-id="checkindialog"]').should('be.visible'); + }); + + it('Service - Verify UpdateServices Not exist and Certify Exist in case Service is in state NOT_CERTIFIED_CHECKIN', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]); + + this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKIN'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + cy.get('[data-tests-id="certify"]').should('be.visible').click(); + cy.get('[data-tests-id="checkindialog"]').should('be.visible'); + }); + + + it('Service - When Service is being Certified, and has Dependencies, Update Service modal will be opened automatically', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData'); + cy.route('GET', '**/services/*/dependencies','@dependenciesResponse'); + cy.route('POST', '**/services/*/lifecycleState/certify','@serviceCertifyResponse'); + cy.route('GET', '**/catalog/services/validate-name/*', { isValid: true}) + this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKOUT'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('not.be.visible'); + + console.log('Click Certify'); + cy.get('[data-tests-id="certify"]').should('be.visible').click(); + + console.log('Insert confirm text'); + cy.get('[data-tests-id="checkindialog"]').should('be.visible').type('Test_1234'); + + console.log('Click OK'); + cy.get('[data-tests-id="confirm-modal-button-ok"]').should('be.visible').click(); + + console.log('Close the Modal'); + cy.get('[data-tests-id="upgradeVspModal-button-close"]').should('be.visible').click(); + }); + + it('VF - Verify Certify and Check in exist for a NOT_CERTIFIED_CHECKOUT VF', function () { + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData'); + cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse'); + + const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is IN DESIGN CHECK OUT'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','In Design Check Out'); + + console.log('Verify Certify button exist'); + cy.get('[data-tests-id="certify"]').should('be.visible').click(); + cy.get('[data-tests-id="checkindialog"]').should('be.visible'); + + console.log('Verify Check in button exist'); + cy.get('[data-tests-id="check_in"]').should('be.visible'); + + }); + + it('VF - Verify Certify and Check out exist for a NOT_CERTIFIED_CHECKOUT VF', function () { + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData'); + cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse'); + + this.vfMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKIN'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is IN DESIGN CHECK IN'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','In Design Check In'); + + console.log('Verify Certify button exist'); + cy.get('[data-tests-id="certify"]').should('be.visible').click(); + cy.get('[data-tests-id="checkindialog"]').should('be.visible'); + + console.log('Verify Check Out button exist'); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + + }); + + it('VF - Verify UpgradeServices is Disabled in case there are no Dependencies for a Certified VF', function () { + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData'); + cy.route('GET', '**/resources/*/dependencies',[{dependencies: null}]); + + this.vfMetaData.metadata.lifecycleState = 'CERTIFIED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Certified'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Certified'); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.disabled'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Upgrade Services'); + + console.log('Verify Check Out button exist'); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + + console.log('Verify Archive Button'); + cy.get('[data-tests-id="archive-component-button"]').should('be.visible'); + cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive'); + + }); + + it('VF - Verify UpgradeServices is Enabled and Modal is opened in case there are no Dependencies for a Certified VF', function () { + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData'); + cy.route('GET', '**/resources/*/dependencies',[{dependencies: {}}]); + cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse'); + + this.vfMetaData.metadata.lifecycleState = 'CERTIFIED'; + + const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general'; + cy.visit(generalPageUrl); + + console.log('Verify life cycle is Certified'); + cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible'); + cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Certified'); + + console.log('Verify life cycle is Distribution Approved'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.enabled'); + cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Upgrade Services').click(); + cy.get('[class="sdc-modal__wrapper sdc-modal-type-custom"]').should('be.visible'); + cy.get('[data-tests-id="upgradeVspModal-button-close"]').should('be.enabled').click(); + + console.log('Verify Check Out button exist'); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + + console.log('Verify Archive Button'); + cy.get('[data-tests-id="archive-component-button"]').should('be.visible'); + cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive'); + + }); + +}); diff --git a/catalog-ui/cypress/integration/composition_page.spec.js b/catalog-ui/cypress/integration/composition_page.spec.js new file mode 100644 index 0000000000..32cbe20e12 --- /dev/null +++ b/catalog-ui/cypress/integration/composition_page.spec.js @@ -0,0 +1,104 @@ +import { initCommonFixtures } from "../common/init"; + +describe('The Composition Page', function () { + + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + cy.fixture('metadata-vf').as('metadata'); + cy.fixture('full-data-vf').as('fullData'); + + cy.fixture('metadata-vf1').as('metadata1'); + cy.fixture('full-data-vf1').as('fullData1'); + }) + + it('VF Verify groups policies right panel tabs, name and Icon', function () { + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups', '@fullData'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/resource/composition/details'; + cy.visit(compositionPageUrl); + + cy.get('.sdc-composition-graph-wrapper').should('be.visible'); // it should show the correct number of elements on the canvas -- how to?? + + //Group / Policy + cy.get('.policy-zone .sdc-canvas-zone__counter').should('have.text', this.fullData.policies.length.toString()); //4 Policies + cy.get('.group-zone .sdc-canvas-zone__counter').should('have.html', this.fullData.groups.length.toString()); //2 Groups + + //VF name & Icon + cy.get('[data-tests-id=selectedCompTitle]').should('contain', this.metadata.metadata.name);// Name is vf + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('exist');// Icon exist + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('have.attr', 'ng-reflect-name', 'defaulticon'); + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('have.attr', 'ng-reflect-type','resources_24'); + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('have.attr', 'ng-reflect-size','x_large'); + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('have.attr', 'ng-reflect-background-shape','circle'); + cy.get('.icon').children('sdc-element-icon').children('div').children('svg-icon').should('have.attr', 'ng-reflect-background-color','purple'); + + //Verify the below tabs exist for VF + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text=Information]').should('exist');//General Info Tab Exist + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Deployment Artifacts"]').should('exist');//General Info Tab Exist + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text=Properties]').should('exist');//General Info Tab Exist + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Information Artifacts"]').should('exist');//General Info Tab Exist + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Requirements and Capabilities"]').should('exist');//General Info Tab Exist + + cy.get('[data-tests-id="leftPalette.category.Generic"]').should('exist'); + cy.get('[data-tests-id="leftPalette.category.Generic"]').children().get('.sdc-accordion-header').should('exist'); + cy.get('[data-tests-id="leftPalette.category.Generic"]').children().get('.sdc-accordion-header').first().trigger('click'); + + + // //Drag & Drop + // cy.get('[data-tests-id="extContrailCP"]').children('palette-element').children('div').trigger("mousedown", { which: 1 }) + // .trigger("mousemove", { which: 1, clientX: 200, clientY: 200}) + // .trigger("mouseup") + + }) + + it('successfully loads VF', function () { + //Verify can change ShayTestVF from V1.0 to V1.1 + //Verify the right panel properties + + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadata1'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups', '@fullData1'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/resource/composition/details' + cy.visit(compositionPageUrl); + + cy.get('.sdc-composition-graph-wrapper').should('be.visible'); // it should show the correct number of elements on the canvas -- how to?? + + + // TODO: + // 1. Verify element exist on Canvas + // 2. Drag and drop new Element + + + // //Drag & Drop + // // cy.get('[data-tests-id="Port"]').children('palette-element').children('div').children('sdc-element-icon').trigger("mousedown", { which: 1 }) + // cy.get('[data-tests-id="extContrailCP"]').children('palette-element').children('div').trigger("mousedown", { which: 1 }) + // // cy.get('.zoom-icons').first() + // .trigger("mousemove", { which: 1, clientX: 200, clientY: 200}) + // // .trigger("mousemove") + // .trigger("mouseup") + + }) + + // it('can add a deployment artifact', function() { + + // }); + // it('can delete a deployment artifact', function() { + + // }); + // it('can delete a component instance on the canvas', function() { + + // }); + // it('can add a component instance to the canvas', function() { + + // }); + // it('can add a group', function() { + + // }); + // it('can add targets to a group', function() { + + // }); + +}) \ No newline at end of file diff --git a/catalog-ui/cypress/integration/deployment-artifacts.composition.spec.js b/catalog-ui/cypress/integration/deployment-artifacts.composition.spec.js new file mode 100644 index 0000000000..edd200b805 --- /dev/null +++ b/catalog-ui/cypress/integration/deployment-artifacts.composition.spec.js @@ -0,0 +1,86 @@ +import { initCommonFixtures } from "../common/init"; + +describe('Deployment Artifacts', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + cy.fixture('deployment-artifacts/metadata-service-with-vsp').as('metadata'); + cy.fixture('deployment-artifacts/metadata-service-checkedin-with-vsp').as('metadataCheckedInService'); + cy.fixture('deployment-artifacts/full-data-service-with-vsp').as('fullData'); + cy.fixture('deployment-artifacts/vsp-deployment-artifacts').as('vsp-deployment-artifacts'); + cy.fixture('deployment-artifacts/updated-vsp-deployment-artifacts').as('updated-vsp-deployment-artifacts'); + cy.fixture('deployment-artifacts/heat-env-post-result').as('heat-env-result'); + cy.fixture('deployment-artifacts/vsp.json').as('vsp'); + cy.fixture('deployment-artifacts/service-deployment-artifacts.json').as('service-deployment-artifacts'); + + cy.route('GET', '**/services/*/filteredDataByParams?include=deploymentArtifacts', '@service-deployment-artifacts'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups&include=forwardingPaths', '@fullData'); + cy.route('GET', '**/services/*/resourceInstances/*/artifactsByType/DEPLOYMENT', '@vsp-deployment-artifacts'); + cy.route('GET', '**/resources/*', '@vsp'); + cy.route('POST', '**/services/*/resourceInstance/*/artifacts/*', '@heat-env-result'); + }); + + it('Test the timeout update in composition deployment artifacts tab', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/composition/details'; + cy.visit(compositionPageUrl); + + console.log('Wait for the canvas to be visible'); + cy.get('canvas-search').should('be.visible'); + + console.log('Click on the component instance via the testBridge'); + cy.window().its('testBridge').invoke('selectComponentInstance', ['VSP1']); + + console.log('Click on Deployment Artifacts Tab'); + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Deployment Artifacts"]').trigger('click', { force: true }); + + console.log('Click on edit artifact - base_ldsa (modal should be opened'); + cy.get('[data-tests-id="edit-parameters-of-base_ldsa"]').click({ force: true }); // edit icon is not visible until we hover on it so we force to click here + + console.log('Make sure timeout field is visible'); + cy.get('[data-tests-id="deploymentTimeout"]').should('be.visible').should('have.value', '2'); + + console.log('Update the route to return the new updated artifact'); + cy.route('GET', '**/services/*/resourceInstances/*/artifactsByType/DEPLOYMENT', '@updated-vsp-deployment-artifacts'); + + console.log('Click 3 as input changing the input value from 2 to 23. Then click Save. Modal should be closed'); + cy.get('[data-tests-id="deploymentTimeout"]').type('3'); + cy.get('[data-tests-id="envParams-button-save"]').click(); + cy.wait(1000); + console.log('Click edit again to open modal and then make sure the updated value is in the field.'); + cy.get('[data-tests-id="artifactName-base_ldsa"]').should('be.visible'); // Wait for modal to be be closed (wait for artifact label to be visible + cy.get('[data-tests-id="edit-parameters-of-base_ldsa"]').click({ force: true }); // edit icon is not visible until we hover on it so we force to click here + cy.get('[data-tests-id="deploymentTimeout"]').should('be.visible').should('have.value', '23'); // Check value + + console.log('Make sure artifact timeout values (min and max) are set according to configuration that was accepted from server (setup-ui.json fixture)'); + cy.get('[data-tests-id="deploymentTimeout"]').should('have.attr', 'max', '150') + cy.get('[data-tests-id="deploymentTimeout"]').should('have.attr', 'min', '2') + }); + + it('Test that readonly modal is opened in case service is in Checkin state', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadataCheckedInService'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/composition/details'; + cy.visit(compositionPageUrl); + + console.log('Wait for the canvas to be visible'); + cy.get('canvas-search').should('be.visible'); + + console.log('Click on the component instance via the testBridge'); + cy.window().its('testBridge').invoke('selectComponentInstance', ['VSP1']); + + console.log('Click on Deployment Artifacts Tab'); + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Deployment Artifacts"]').trigger('click', { force: true }); + + console.log('Click on edit artifact - base_ldsa (modal should be opened'); + cy.get('[data-tests-id="view-parameters-of-base_ldsa"]').click({ force: true }); // edit icon is not visible until we hover on it so we force to click here + + cy.get('[data-tests-id="deploymentTimeout"]').should('be.disabled').should('have.value', '2'); + cy.get('[data-tests-id="value-field-of-vnf_name"]').should('be.disabled'); + + cy.get('[data-tests-id="envParams-button-save"]').should('not.be.visible'); + }); + +}); \ No newline at end of file diff --git a/catalog-ui/cypress/integration/distribution_page.spec.js b/catalog-ui/cypress/integration/distribution_page.spec.js new file mode 100644 index 0000000000..592c6e91c2 --- /dev/null +++ b/catalog-ui/cypress/integration/distribution_page.spec.js @@ -0,0 +1,417 @@ +import { initCommonFixtures } from "../common/init"; + +describe('Distribution Page', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + cy.fixture('deployment-artifacts/metadata-service-with-vsp').as('metadata'); + cy.fixture('distribution-page/distributionList').as('distributionList'); + cy.fixture('distribution-page/distributionStatus').as('distributionStatus'); +}); + +it('Test the No Distribution Label exist in case no distributions', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Make sure No Distributions To Present is visible'); + cy.get('[data-tests-id="noDistributionsLabel"]').should('be.visible'); + cy.get('[data-tests-id="noDistributionsLabel"]').should('have.text','No Distributions To Present'); +}); + + +it('Test Distribution Sum, Search and Refresh exist in case there are distributions', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Make sure No Distributions To Present is visible'); + cy.get('[data-tests-id="noDistributionsLabel"]').should('not.be.visible') + + console.log('Make sure Number of Distributions is as expected'); + cy.get('[data-tests-id="DistributionsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalArtifacts"]').should('be.visible'); + cy.get('[data-tests-id="DistributionsLabel"]').should('have.text','DISTRIBUTION [2]'); + + console.log('Make sure Filter text box appear is as expected'); + cy.get('[data-tests-id="searchTextbox"]').should('be.visible'); + + console.log('Make sure refresh button appear is as expected'); + cy.get('[data-tests-id="refreshButton"]').should('be.visible'); +}); + +it('Test Filter Distributions as expectd', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Make sure 2 Distributions are presented in the table'); + cy.get('[data-tests-id="expandIcon_d2595"]').should('be.visible'); + + cy.get('[data-tests-id="distID_d2595"]').should('be.visible'); + cy.get('[data-tests-id="userID_d2595"]').should('be.visible'); + cy.get('[data-tests-id="timeStamp_d2595"]').should('be.visible'); + cy.get('[data-tests-id="status_d2595"]').should('be.visible'); + + cy.get('[data-tests-id="distID_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="userID_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="timeStamp_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="status_9a5b5"]').should('be.visible'); + + console.log('Verify the Distribution details in the Distributions Table'); + cy.get('[data-tests-id="distID_9a5b5"]').should('have.text','9a5b5a9d-5d52-40df-bd62-fe71e7c01b85'); + cy.get('[data-tests-id="userID_9a5b5"]').should('have.text','Aretha Franklin(op0001)'); + cy.get('[data-tests-id="timeStamp_9a5b5"]').should('have.text','2019-07-25 09:47:55.849 UTC '); + cy.get('[data-tests-id="status_9a5b5"]').should('contains.text','Distributed'); + + console.log('Insert filter criteria to the input text box'); + cy.get('[data-tests-id="searchTextbox"]').type('9a'); + + console.log('Verify that distribution that should not be displayed is not in the table'); + cy.get('[data-tests-id="distID_d2595"]').should('not.be.visible'); + cy.get('[data-tests-id="userID_d2595"]').should('not.be.visible'); + cy.get('[data-tests-id="timeStamp_d2595"]').should('not.be.visible'); + cy.get('[data-tests-id="status_d2595"]').should('not.be.visible'); + + console.log('Clear the filter'); + cy.get('[data-tests-id="searchTextbox"]').clear(); + + console.log('Verify all appear as expected'); + cy.get('[data-tests-id="distID_d2595"]').should('be.visible'); + cy.get('[data-tests-id="userID_d2595"]').should('be.visible'); + cy.get('[data-tests-id="timeStamp_d2595"]').should('be.visible'); + cy.get('[data-tests-id="status_d2595"]').should('be.visible'); + + cy.get('[data-tests-id="distID_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="userID_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="timeStamp_9a5b5"]').should('be.visible'); + cy.get('[data-tests-id="status_9a5b5"]').should('be.visible'); +}); + + it('Test Distribution and Component Statuses for specific Distribution ID', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + cy.route('GET', '**/services/distribution/9a5b5a9d-5d52-40df-bd62-fe71e7c01b85', '@distributionStatus'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Click on specific DistributionID to display its status'); + cy.get('[data-tests-id="expandIcon_9a5b5"]').click(); + + console.log('Verify Total Artifacts label for Distribution'); + cy.get('[data-tests-id="totalDistributionArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionArtifactsLabel"]').should('have.text','Total Artifacts 8 '); + + console.log('Verify Total Notified label for Distribution'); + cy.get('[data-tests-id="totalDistributionNotifiedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionNotifiedArtifactsLabel"]').should('have.text','Notified 1'); + + console.log('Verify Total Downloaded label for Distribution'); + cy.get('[data-tests-id="totalDistributionDownloadedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionDownloadedArtifactsLabel"]').should('have.text','Downloaded 1'); + + console.log('Verify Total Deployed label for Distribution'); + cy.get('[data-tests-id="totalDistributionDeployedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionDeployedArtifactsLabel"]').should('have.text','Deployed 1'); + + console.log('Verify Total Not Notified label for Distribution'); + cy.get('[data-tests-id="totalDistributionNotNotifiedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionNotNotifiedArtifactsLabel"]').should('have.text','Not Notified 1'); + + console.log('Verify Total Download Errors label for Distribution'); + cy.get('[data-tests-id="totalDistributionDownloadErrorArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionDownloadErrorArtifactsLabel"]').should('have.text','Download Errors 1'); + + console.log('Verify Total Deploy Errors label for Distribution'); + cy.get('[data-tests-id="totalDistributionDeployErrorArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalDistributionDeployErrorArtifactsLabel"]').should('have.text','Deploy Errors 1'); + + + + console.log('Verify Total Artifacts label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1ArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1ArtifactsLabel"]').should('have.text','Consumer1 1'); + + console.log('Verify Total Notified label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1NotifiedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1NotifiedArtifactsLabel"]').should('have.text','Notified 1'); + + console.log('Verify Total Downloaded label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1DownloadedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1DownloadedArtifactsLabel"]').should('have.text','Downloaded 0'); + + console.log('Verify Total Deployed label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1DeployedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1DeployedArtifactsLabel"]').should('have.text','Deployed 0'); + + console.log('Verify Total Not Notified label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1NotNotifiedArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1NotNotifiedArtifactsLabel"]').should('have.text','Not Notified 0'); + + console.log('Verify Total Download Errors label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1DownloadErrorsArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1DownloadErrorsArtifactsLabel"]').should('have.text','Download Errors 0'); + + console.log('Verify Total Deploy Errors label for Consumer1'); + cy.get('[data-tests-id="totalConsumer1DeployErrorsArtifactsLabel"]').should('be.visible'); + cy.get('[data-tests-id="totalConsumer1DeployErrorsArtifactsLabel"]').should('have.text','Deploy Errors 0'); + + + + + console.log('Verify Total Artifacts label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2ArtifactsLabel"]').should('have.text','Consumer2 2'); + + console.log('Verify Total Notified label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2NotifiedArtifactsLabel"]').should('have.text','Notified 0'); + + console.log('Verify Total Downloaded label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2DownloadedArtifactsLabel"]').should('have.text','Downloaded 1'); + + console.log('Verify Total Deployed label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2DeployedArtifactsLabel"]').should('have.text','Deployed 1'); + + console.log('Verify Total Not Notified label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2NotNotifiedArtifactsLabel"]').should('have.text','Not Notified 0'); + + console.log('Verify Total Download Errors label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2DownloadErrorsArtifactsLabel"]').should('have.text','Download Errors 0'); + + console.log('Verify Total Deploy Errors label for Consumer2'); + cy.get('[data-tests-id="totalConsumer2DeployErrorsArtifactsLabel"]').should('have.text','Deploy Errors 0'); + + + + + + console.log('Verify Total Artifacts label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3ArtifactsLabel"]').should('have.text','Consumer3 2'); + + console.log('Verify Total Notified label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3NotifiedArtifactsLabel"]').should('have.text','Notified 0'); + + console.log('Verify Total Downloaded label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3DownloadedArtifactsLabel"]').should('have.text','Downloaded 0'); + + console.log('Verify Total Deployed label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3DeployedArtifactsLabel"]').should('have.text','Deployed 0'); + + console.log('Verify Total Not Notified label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3NotNotifiedArtifactsLabel"]').should('have.text','Not Notified 1'); + + console.log('Verify Total Download Errors label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3DownloadErrorsArtifactsLabel"]').should('have.text','Download Errors 0'); + + console.log('Verify Total Deploy Errors label for Consumer3'); + cy.get('[data-tests-id="totalConsumer3DeployErrorsArtifactsLabel"]').should('have.text','Deploy Errors 1'); + + + + + + + console.log('Verify Total Artifacts label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4ArtifactsLabel"]').should('have.text','Consumer4 1'); + + console.log('Verify Total Notified label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4NotifiedArtifactsLabel"]').should('have.text','Notified 0'); + + console.log('Verify Total Downloaded label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4DownloadedArtifactsLabel"]').should('have.text','Downloaded 0'); + + console.log('Verify Total Deployed label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4DeployedArtifactsLabel"]').should('have.text','Deployed 0'); + + console.log('Verify Total Not Notified label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4NotNotifiedArtifactsLabel"]').should('have.text','Not Notified 0'); + + console.log('Verify Total Download Errors label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4DownloadErrorsArtifactsLabel"]').should('have.text','Download Errors 0'); + + console.log('Verify Total Deploy Errors label for Consumer4'); + cy.get('[data-tests-id="totalConsumer4DeployErrorsArtifactsLabel"]').should('have.text','Deploy Errors 0'); + + + + console.log('Verify Total Artifacts label for Consumer5'); + cy.get('[data-tests-id="totalConsumer5ArtifactsLabel"]').should('have.text','Consumer5 1'); + + + + console.log('Verify Total Artifacts label for Consumer6'); + cy.get('[data-tests-id="totalConsumer6ArtifactsLabel"]').should('have.text','Consumer6 1'); + + console.log('Verify Total Download Errors label for Consumer6'); + cy.get('[data-tests-id="totalConsumer6DownloadErrorsArtifactsLabel"]').should('have.text','Download Errors 1'); + +}); + +it('Test Artifacts table for Specific Consumer and specific Artifact', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + cy.route('GET', '**/services/distribution/9a5b5a9d-5d52-40df-bd62-fe71e7c01b85', '@distributionStatus'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Click on specific DistributionID icon to display its status'); + cy.get('[data-tests-id="expandIcon_9a5b5"]').click(); + + console.log('Click on specific ServiceID icon to display its artifacts'); + cy.get('[data-tests-id="expandIcon_Consumer1"]').click(); + + console.log('Verify ComponentID for Consumer: Consumer1, artifact: artifact1'); + cy.get('[data-tests-id="compID_Consumer1_artifact1.env"]').should('be.visible'); + cy.get('[data-tests-id="compID_Consumer1_artifact1.env"]').should('contain.text','Consumer1'); + + console.log('Verify Artifact Name for Consumer: Consumer1, artifact: artifact1'); + cy.get('[data-tests-id="artName_Consumer1_artifact1.env"]').should('be.visible'); + cy.get('[data-tests-id="artName_Consumer1_artifact1.env"]').should('have.text','artifact1.env'); + + console.log('Verify URL for Consumer: Consumer1, artifact: artifact1'); + cy.get('[data-tests-id="url_Consumer1_artifact1.env"]').should('have.text','url/artifacts/artifact1.env'); + + console.log('Verify Time for Consumer: Consumer1, artifact: artifact1'); + cy.get('[data-tests-id="time_Consumer1_artifact1.env"]').should('contain.text','7/25/19, 9:47 AM'); + + console.log('Verify Status for Consumer: Consumer1, artifact: artifact1'); + cy.get('[data-tests-id="status_Consumer1_artifact1.env"]').should('have.text','NOTIFIED'); + + cy.get('[data-tests-id="expandIcon_Consumer2"]').click(); + cy.get('[data-tests-id="compID_Consumer2_artifact2_1.csar"]').should('contain.text','Consumer2'); + cy.get('[data-tests-id="artName_Consumer2_artifact2_1.csar"]').should('contain.text','artifact2_1.csar'); + cy.get('[data-tests-id="time_Consumer2_artifact2_1.csar"]').should('contain.text','7/25/19, 9:47 AM'); + cy.get('[data-tests-id="status_Consumer2_artifact2_1.csar"]').should('contain.text','DOWNLOAD_OK'); + + cy.get('[data-tests-id="compID_Consumer2_artifact2_2.csar"]').should('contain.text','Consumer2'); + cy.get('[data-tests-id="artName_Consumer2_artifact2_2.csar"]').should('contain.text','artifact2_2.csar'); + cy.get('[data-tests-id="time_Consumer2_artifact2_2.csar"]').should('contain.text','7/25/19, 9:47 AM'); + cy.get('[data-tests-id="status_Consumer2_artifact2_2.csar"]').should('contain.text','DEPLOY_OK'); + +}); + +it('Test Artifacts Notifications for Specific Consumer and specific Artifact', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + cy.route('GET', '**/services/distribution/9a5b5a9d-5d52-40df-bd62-fe71e7c01b85', '@distributionStatus'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Click on specific DistributionID to display its status'); + cy.get('[data-tests-id="expandIcon_9a5b5"]').click(); + + console.log('Click on specific ServiceID icon to display its artifacts'); + cy.get('[data-tests-id="expandIcon_Consumer5"]').click(); + + console.log('Click on specific artifact to verify its notifications'); + cy.get('[data-tests-id="expandIcon_compID_Consumer5_ArtifactWithTwoStatuses"]').click(); + + console.log('Verify EARLIER_STATUS Time Stamp'); + cy.get('[data-tests-id="statusTimeStamp_EARLIER_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('be.visible'); + cy.get('[data-tests-id="statusTimeStamp_EARLIER_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('have.text','7/24/19, 9:47 AM'); + + console.log('Verify EARLIER_STATUS Status Value'); + cy.get('[data-tests-id="statusValue_EARLIER_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('be.visible'); + cy.get('[data-tests-id="statusValue_EARLIER_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('have.text','EARLIER_STATUS'); + + console.log('Verify LATEST_STATUS Time Stamp'); + cy.get('[data-tests-id="statusTimeStamp_LATEST_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('be.visible'); + cy.get('[data-tests-id="statusTimeStamp_LATEST_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('have.text','7/25/19, 9:47 AM'); + + console.log('Verify LATEST_STATUS Status Value'); + cy.get('[data-tests-id="statusValue_LATEST_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('be.visible'); + cy.get('[data-tests-id="statusValue_LATEST_STATUS_Consumer5_ArtifactWithTwoStatuses"]').should('have.text','LATEST_STATUS'); + + console.log('Verify LATEST_STATUS Status apear in the component (verify that the last time stamp appear)'); + cy.get('[data-tests-id="status_Consumer5_ArtifactWithTwoStatuses"]').should('have.text','LATEST_STATUS'); +}); + + it('Test Open Notified Modal for specific Distribution ID', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + cy.route('GET', '**/services/distribution/9a5b5a9d-5d52-40df-bd62-fe71e7c01b85', '@distributionStatus'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Click on specific DistributionID to display its status'); + cy.get('[data-tests-id="expandIcon_9a5b5"]').click(); + + //Clicks on "Total Artifacts Label" + console.log('Click on Notified to display its Modal'); + cy.get('[data-tests-id="totalDistributionNotifiedArtifactsLabel"]').click(); + + + console.log('Make sure the Distributions are presented in the table'); + cy.get('[data-tests-id="distID_9a5b5_Modal"]').should('be.visible'); + + console.log('Verify the Distribution details in the Distributions Table'); + cy.get('[data-tests-id="distID_9a5b5_Modal"]').should('have.text','9a5b5a9d-5d52-40df-bd62-fe71e7c01b85'); + + console.log('Open the Modal details') + cy.get('[data-tests-id="expandIcon_9a5b5_Modal"]').click() + + console.log('Verify Status Notify and its summary in the Modal'); + cy.get('[data-tests-id="modalStatusLabel"]').should('be.visible'); + cy.get('[data-tests-id="modalStatusLabel"]').should('have.text','Status NOTIFIED 1'); + + + console.log('Verify Component1 and Component2, 3, 4 & 5 and their summary in the Modal'); + cy.get('[data-tests-id="modalComponentLabel"]').should('be.visible'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer1 1'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer2 0'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer3 0'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer4 0'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer5 0'); + cy.get('[data-tests-id="modalComponentLabel"]').should('contains.text','Consumer6 0'); + + console.log('Open to display he component statuses'); + cy.get('[data-tests-id="expandIcon_Consumer1_ForModal"]').click(); + cy.get('[data-tests-id="expandIcon_compID_Consumer1_artifact1.env"]').click(); + + console.log('Verify Status & TimeStamp'); + + cy.get('[data-tests-id="time_Consumer1_artifact1.env"]').should('contain.text','7/25/19, 9:47 AM'); + cy.get('[data-tests-id="statusValue_NOTIFIED_Consumer1_artifact1.env"]').should('have.text','NOTIFIED'); + + console.log('Close the Modal'); + cy.get('[data-tests-id="button-close"]').should('be.visible'); + cy.get('[data-tests-id="button-close"]').click(); +}); + +it('Verify Mark As Deploy button appear for Designer', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Make sure Mark As Deploy button Exist'); + cy.get('[class="btnMarkAsDistributed"]').should('be.visible'); +}); + +it('Verify COMPONENT_DONE_OK and COMPONENT_DONE_ERROR appear for relevant components', function () { + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/distribution', '@distributionList'); + cy.route('GET', '**/services/distribution/9a5b5a9d-5d52-40df-bd62-fe71e7c01b85', '@distributionStatus'); + + const distributionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/distribution'; + cy.visit(distributionPageUrl); + + console.log('Click on specific DistributionID icon to display its status'); + cy.get('[data-tests-id="expandIcon_9a5b5"]').click(); + + + cy.get('[class="msoStatus green"]').should('contain.text','COMPONENT_DONE_OK'); + cy.get('[class="msoStatus red"]').should('contain.text','COMPONENT_DONE_ERROR'); +}); + +}); diff --git a/catalog-ui/cypress/integration/general-page.spec.js b/catalog-ui/cypress/integration/general-page.spec.js new file mode 100644 index 0000000000..3ca72fe5ba --- /dev/null +++ b/catalog-ui/cypress/integration/general-page.spec.js @@ -0,0 +1,28 @@ +import {initCommonFixtures} from "../common/init"; + +describe('General Screen', () => { + + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + // Service Metadata Fixture for General Page + cy.fixture('general-page/service-metadata').as('service-metadata'); + cy.route('GET', '**/catalog/services/*/filteredDataByParams?include=metadata', '@service-metadata'); + cy.route({ method: 'PUT', url: '**/catalog/services/*/metadata'}, '@service-metadata-update-response').as('updateService'); + }); + + it('Test that metadata fields are populated', function () { + const generalPageUrl = '#!/dashboard/workspace/035ca9eb-ab9a-4e03-9bfb-e051a6c47a82/service/general'; + cy.visit(generalPageUrl); + + cy.get('[data-tests-id="serviceFunction"]').should('be.visible'); + cy.get('[data-tests-id="serviceFunction"]').should('have.value', 'serviceFunction1'); + cy.get('[data-tests-id="create/save"]').click(); + + // Assert that the request body includes the serviceFunction parameter + cy.wait('@updateService').then((xhr) => { + assert.equal(xhr.request.body.serviceFunction, 'serviceFunction1'); + }); + }); +}); \ No newline at end of file diff --git a/catalog-ui/cypress/integration/home.spec.js b/catalog-ui/cypress/integration/home.spec.js new file mode 100644 index 0000000000..4e563ee8ac --- /dev/null +++ b/catalog-ui/cypress/integration/home.spec.js @@ -0,0 +1,32 @@ +import {initCommonFixtures} from "../common/init"; + +describe('Home (Dashboard) Screen', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + // Followed Resources for the dashboard screen + cy.fixture('home/followed').as('followed'); + cy.route('GET', '**/followed', '@followed'); + }); + + it('Test that only Certify and Distributed appear in followed projects filter', function () { + const homePageUrl = '#!/dashboard'; + cy.visit(homePageUrl); + + // Test that tiles are sorted + cy.get('ui-tile .multiline-ellipsis-content'). + first().should('include.text', 'MyVSP1'). + last().should('include.text', 'MyVSP1'); + + // Test that there are 5 components tiles + cy.get('ui-tile .multiline-ellipsis-content').should('have.length', 5); + + + cy.get('[data-tests-id="filter-CERTIFIED"]').should('be.visible'); + cy.get('[data-tests-id="filter-DISTRIBUTED"]').should('be.visible'); // Ready for Testing + cy.get('[data-tests-id="count-DISTRIBUTED"]').should('have.text', '1'); + cy.get('[data-tests-id="filter-CERTIFICATION_IN_PROGRESS"]').should('not.be.visible'); // In Testing + cy.get('[data-tests-id="filter-READY_FOR_CERTIFICATION"]').should('not.be.visible'); // Ready for Testing + }); +}); \ No newline at end of file diff --git a/catalog-ui/cypress/integration/import-vsp.spec.js b/catalog-ui/cypress/integration/import-vsp.spec.js new file mode 100644 index 0000000000..05910665b7 --- /dev/null +++ b/catalog-ui/cypress/integration/import-vsp.spec.js @@ -0,0 +1,205 @@ +import { initCommonFixtures } from "../common/init"; + +describe('Update vsp', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + // Followed Resources for the dashboard screen + cy.fixture('home/followed').as('followed'); + cy.fixture('update-vsp/packages-first').as('packagesFirst'); + cy.fixture('update-vsp/vsp-first').as('vspFirst'); + cy.fixture('update-vsp/vf-metadata-first').as('vfMetadataFirst'); + + cy.fixture('update-vsp/checkout-vsp').as('checkoutVsp'); + cy.fixture('update-vsp/metadata-after-checkout').as('metadataAfterCheckout'); + + cy.fixture('update-vsp/metadata-after-save-fails').as('metadataAfterSaveFails'); + + cy.fixture('update-vsp/packages-second').as('packagesSecond'); + cy.fixture('update-vsp/metadata-second').as('metadataSecond'); + cy.fixture('update-vsp/checkout-vsp-second').as('checkoutVspSecond'); + cy.fixture('update-vsp/metadata-third').as('metadataThird'); + + cy.fixture('update-vsp/packages-browse').as('packagesBrowse'); + cy.fixture('update-vsp/metadata-browse').as('metadatabrowse'); + + cy.route('GET', '**/followed', '@followed'); + + }); + + it('Test if checkout fail when update vsp we display the old version', function () { + const homePageUrl = '#!/dashboard'; + cy.visit(homePageUrl); + + cy.route('GET', '**/packages', '@packagesFirst'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-first'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetadataFirst'); + cy.route({ + method: 'POST', + url: '**/resources/*/lifecycleState/CHECKOUT', + status: 404, + response: { + "requestError": { + "serviceException": { + "messageId": "SVC4063", + "text": "Error: Requested \u0027%1\u0027 resource was not found.", + "ecompRequestId": "87c1efc1-9f8e-4953-9394-654d28e48bbd", + "variables": [ + "" + ] + } + } + } + }); + + cy.get('[data-tests-id="repository-icon"]').should('be.visible'); + cy.get('[data-tests-id="repository-icon"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + cy.get('[data-tests-id="error-modal-button-ok"]').click({ force: true }); + cy.get('[data-tests-id="check_out"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').should('be.visible'); + cy.get('[data-tests-id="browseButton"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (1.0)'); + + }); + it('Test if save fail when update vsp and the mode is check in. we did check out and see the unsave warning', function () { + const homePageUrl = '#!/dashboard'; + cy.visit(homePageUrl); + cy.route('GET', '**/packages', '@packagesFirst'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-first'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetadataFirst'); + cy.route('POST', '**/resources/*/lifecycleState/CHECKOUT', '@checkoutVsp'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataAfterCheckout'); + cy.route({ + method: 'PUT', + url: '**/resources/*', + status: 404, + response: { + "requestError": { + "serviceException": { + "messageId": "SVC4063", + "text": "Error: Requested \u0027%1\u0027 resource was not found.", + "ecompRequestId": "591b0702-115d-4b6a-94c4-ed2bbbc452bc", + "variables": [ + null + ] + } + } + } + }); + + cy.get('[data-tests-id="repository-icon"]').should('be.visible'); + cy.get('[data-tests-id="repository-icon"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + cy.get('[data-tests-id="check_in"]').should('be.visible'); + cy.get('[data-tests-id="error-modal-button-ok"]').click({ force: true }); + cy.get('[data-tests-id="filename"]').should('be.visible'); + cy.get('[data-tests-id="browseButton"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (2.0)'); + cy.get('[data-tests-id="save-warning"]').should('be.visible'); + + }); + it('Test after save fails when refresh the page the new version did not update ', function () { + cy.route('GET', '**/packages', '@packagesFirst'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataAfterSaveFails'); + const vspUrl = '#!/dashboard/workspace/92582379-f0d5-4655-a0f1-f92b3038d853/resource/general'; + cy.visit(vspUrl); + cy.get('[data-tests-id="filename"]').contains('test update vsp (1.0)'); + }); + it('Test when update vsp and the mode is check out. we save the new version', function () { + const homePageUrl = '#!/dashboard'; + cy.visit(homePageUrl); + + cy.route('GET', '**/packages', '@packagesFirst'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-first'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataAfterCheckout'); + cy.route('PUT', '**/resources/*', 'fixture:update-vsp/save-vsp'); + + + cy.get('[data-tests-id="repository-icon"]').should('be.visible'); + cy.get('[data-tests-id="repository-icon"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + + cy.get('[data-tests-id="check_in"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (2.0)'); + cy.get('[data-tests-id="save-warning"]').should('not.be.visible'); + + + }); + it('Test after save succeeded when refresh the page the new version update', function () { + cy.route('GET', '**/packages', '@packagesSecond'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataSecond'); + const vspUrl = '#!/dashboard/workspace/09f56471-cb97-49f9-af25-44eaa1af1f05/resource/general'; + cy.visit(vspUrl); + cy.get('[data-tests-id="filename"]').contains('test update vsp (2.0)'); + + }); + + it('Test when update vsp and the mode is check in. we do checkout and save the new version', function () { + const homePageUrl = '#!/dashboard'; + cy.visit(homePageUrl); + + cy.route('GET', '**/packages', '@packagesSecond'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-second'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataSecond'); + cy.route('POST', '**/resources/*/lifecycleState/CHECKOUT', '@checkoutVspSecond'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadataThird'); + cy.route('PUT', '**/resources/*', 'fixture:update-vsp/save-vsp-second'); + + cy.get('[data-tests-id="repository-icon"]').should('be.visible'); + cy.get('[data-tests-id="repository-icon"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + cy.get('[data-tests-id="check_in"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (3.0)'); + cy.get('[data-tests-id="save-warning"]').should('not.be.visible'); + }); + + it('Test update vsp from browse button, and version in the vf is the same of vsp, check that check out and save finish succeessfully', function () { + + cy.route('GET', '**/packages', '@packagesSecond'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-second'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadatabrowse'); + cy.route('PUT', '**/resources/*', 'fixture:update-vsp/save-vsp-second'); + + const homePageUrl = '#!/dashboard/workspace/09f56471-cb97-49f9-af25-44eaa1af1f05/resource/general'; + cy.visit(homePageUrl); + + cy.get('[data-tests-id="filename"]').contains('test update vsp (3.0)'); + cy.get('[data-tests-id="browseButton"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + cy.get('[data-tests-id="check_in"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (3.0)'); + cy.get('[data-tests-id="save-warning"]').should('not.be.visible'); + + }); + + it('Test update vsp from browse button check out and save succeessfully', function () { + const homePageUrl = '#!/dashboard/workspace/09f56471-cb97-49f9-af25-44eaa1af1f05/resource/general'; + cy.visit(homePageUrl); + + cy.route('GET', '**/packages', '@packagesBrowse'); + cy.route('GET', '**/resources/csar/*', 'fixture:update-vsp/vsp-browse'); + cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@metadatabrowse'); + cy.route('PUT', '**/resources/*', 'fixture:update-vsp/save-vsp-browse'); + + cy.get('[data-tests-id="filename"]').contains('test update vsp (3.0)'); + cy.get('[data-tests-id="browseButton"]').click({ force: true }); + cy.get('[data-tests-id="csar-row"]').should('be.visible'); + cy.get('[data-tests-id="csar-row"]').last().click({ force: true }); + cy.get('[data-tests-id="update-csar"]').click({ force: true }); + cy.get('[data-tests-id="check_in"]').should('be.visible'); + cy.get('[data-tests-id="filename"]').contains('test update vsp (4.0)'); + cy.get('[data-tests-id="save-warning"]').should('not.be.visible'); + + }); +}) \ No newline at end of file diff --git a/catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js b/catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js new file mode 100644 index 0000000000..5099413d11 --- /dev/null +++ b/catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js @@ -0,0 +1,52 @@ +import { initCommonFixtures } from "../common/init"; + +describe('Test modify service consumption in service consumption tab', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + cy.fixture('properties-assignment/onap-user-data').as('onapUserData'); + + cy.fixture('service-proxy-tabs/metadata-service-with-service').as('metadata'); + cy.fixture('service-proxy-tabs/full-data-service-with-service').as('fullData'); + cy.fixture('service-proxy-tabs/service-inputs').as('serviceInputs'); + cy.fixture('service-proxy-tabs/update-operation-input').as('updateOperationInput'); + cy.fixture('service-proxy-tabs/service-input-update-value').as('inputsUpdateValue'); + }); + + it('Update property', function () { + cy.route('GET', '**/authorize', '@onapUserData'); + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups&include=forwardingPaths', '@fullData'); + cy.route('GET', '**/services/*', 'fixture:service-proxy-tabs/service-proxy'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesProperties&include=inputs&include=componentInstances&include=capabilities', 'fixture:service-proxy-tabs/service-with-capabilities-requirment'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesInterfaces&include=componentInstancesProperties&include=componentInstancesInputs&include=inputs&include=componentInstances&include=capabilities','fixture:service-proxy-tabs/full-data-service-proxy') + cy.route('GET', '**/services/*/consumption/*/interfaces/*/operations/*/inputs', '@serviceInputs'); + cy.route('POST', '**/services/*/consumption/*', '@updateOperationInput'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/composition/details'; + cy.visit(compositionPageUrl); + + // Wait for the canvas to be visible + cy.get('canvas-search').should('be.visible'); + + // Click on the component instance via the testBridge + cy.window().its('testBridge').invoke('selectComponentInstance', ['childservice_proxy']); + + // Click on operation consumption Tab + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Service Consumption"]').trigger('click', { force: true }); + //update operation property value + cy.get('.operation-data').trigger('click', { force: true }); + cy.get('.operation-input-name').trigger('click', { force: true }); + cy.wait(1000); + cy.get('.value-input').clear().type('update property'); + cy.get('[data-tests-id="Save"]').trigger('click', { force: true }); + //check the changed property + cy.wait(1000); + cy.route('GET', '**/services/*/consumption/*/interfaces/*/operations/*/inputs', '@inputsUpdateValue'); + cy.get('.operation-data').trigger('click', { force: true }); + cy.wait(1000); + cy.get('.operation-input-name').trigger('click', { force: true }); + cy.get('.value-input').should('have.value','update property'); + }); + +}); diff --git a/catalog-ui/cypress/integration/property-assignment.spec.js b/catalog-ui/cypress/integration/property-assignment.spec.js new file mode 100644 index 0000000000..bad6dee730 --- /dev/null +++ b/catalog-ui/cypress/integration/property-assignment.spec.js @@ -0,0 +1,75 @@ +import { initCommonFixtures } from "../common/init"; + + +describe('Test add property to self in service at property assignment page', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + cy.fixture('properties-assignment/onap-user-data').as('onapUserData'); + + cy.fixture('service-proxy-tabs/metadata-service-with-service').as('metadata'); + cy.fixture('service-proxy-tabs/full-data-service-with-service').as('fullData'); + cy.fixture('properties-assignment/service-include-policies').as('serviceIncludePolicies'); + cy.fixture('properties-assignment/service-properties').as('serviceProperty'); + cy.fixture('properties-assignment/service-update-properties').as('serviceUpdateProperty'); + cy.fixture('properties-assignment/service-proxy-properties').as('serviceProxyProperties'); + cy.fixture('properties-assignment/create-policies').as('createPolicy'); + cy.fixture('properties-assignment/undeclare-policy').as('undeclarePolicy'); + //vl + cy.fixture('properties-assignment/vl-properties').as('vlProperties'); + cy.fixture('properties-assignment/vl-list-input').as('vlListInput'); + cy.fixture('properties-assignment/vl-properties-update').as('vlPropertiesUpdate'); + }); + + it('add property to self, declare policy, create inputs list', function () { + cy.route('GET', '**/authorize', '@onapUserData'); + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups&include=forwardingPaths', '@fullData'); + cy.route('GET', '**/services/*/filteredDataByParams?include=inputs&include=componentInstances&include=componentInstancesProperties&include=properties','fixture:service-proxy-tabs/full-properties'); + cy.route('GET','**/services/*/filteredDataByParams?include=componentInstances&include=policies&include=nonExcludedGroups', '@serviceIncludePolicies'); + cy.route('GET', '**/services/*/properties', '@serviceProperty'); + cy.route('POST', '**/services/*/properties', '@serviceUpdateProperty'); + cy.route('GET','**/services/*/componentInstances/*/properties','@serviceProxyProperties'); + cy.route('POST', '**/services/*/create/policies', '@createPolicy'); + cy.route('PUT', '**/services/*/policies/*/undeclare','@undeclarePolicy'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/properties_assignment'; + cy.visit(compositionPageUrl); + // Add property to service + cy.get('.table-row').should('have.length', 2); + cy.get('.add-btn').click(); + cy.get('[data-tests-id="property-name"]').type('new_property'); + cy.get('[data-tests-id="value-property-type"]').select('string'); + cy.get('[data-tests-id="property-description"]').type('new service property'); + cy.get('[data-tests-id="Save"]').trigger('click', {force: true}); + cy.get('.table-row').should('have.length', 3); + //declare policy for service proxy + cy.get('[data-tests-id="childservice_proxy 0"]').trigger('click', {force: true}); + cy.get('.table-body > :nth-child(2) > .col1').find('[type="checkbox"]').check({force: true}); + cy.get('[data-tests-id="declare-button declare-policy"]').trigger('click', {force: true}); + cy.get('[data-tests-id="Policies"]').trigger('click', {force: true}); + cy.get('.properties-table').contains('contrailv2virtualnetwork0_segmentation_id'); + cy.get(':nth-child(3) > .valueCol > .delete-button-container > .sprite-new').trigger('click', {force: true}); + cy.get('[data-tests-id="Delete"]').trigger('click', {force: true}); + cy.get('.properties-table').contains('contrailv2virtualnetwork0_segmentation_id'); + cy.wait(100); + //create list inputs for vl 0 + cy.route('GET','**/services/*/componentInstances/*/properties','@vlProperties'); + cy.route('POST', '**/services/*/create/listInput', '@vlListInput'); + cy.get('[data-tests-id="Composition"]').trigger('click', {force: true}); + cy.get('[data-tests-id="Properties"]').trigger('click', {force: true}); + cy.get('[data-tests-id="VL 0"]').trigger('click', {force: true}); + + cy.get('.table-body > :nth-child(5) > .col1').find('[type="checkbox"]').check({force: true}); + cy.get('.table-body > :nth-child(6) > .col1').find('[type="checkbox"]').check({force: true}); + + cy.get('[data-tests-id="declare-button declare-list-input"]').trigger('click', {force: true}); + cy.get('[data-tests-id="property-name"]').type('vl 0 list'); + cy.get('input[name="typeName"]').type('new schema'); + cy.get('[data-tests-id="property-description"]').type('new list for vl 0 properties'); + cy.get('[data-tests-id="Save"]').trigger('click', {force: true}); + cy.get('[data-tests-id="Inputs"]').trigger('click', {force: true}); + cy.get('.properties-table').contains('vl 0 list'); + }); + +}); diff --git a/catalog-ui/cypress/integration/service-dependencies-rules.composition.spec.js b/catalog-ui/cypress/integration/service-dependencies-rules.composition.spec.js new file mode 100644 index 0000000000..e6eef0eaed --- /dev/null +++ b/catalog-ui/cypress/integration/service-dependencies-rules.composition.spec.js @@ -0,0 +1,70 @@ +import { initCommonFixtures } from "../common/init"; + + +describe('Test dependencies rule in service dependencies tab', () => { + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + cy.fixture('properties-assignment/onap-user-data').as('onapUserData'); + + cy.fixture('service-proxy-tabs/metadata-service-with-service').as('metadata'); + cy.fixture('service-proxy-tabs/full-data-service-with-service').as('fullData'); + cy.fixture('service-proxy-tabs/service-inputs').as('serviceInputs') + cy.fixture('service-proxy-tabs/service-proxy-properties').as('serviceProxyProperties'); + cy.fixture('service-proxy-tabs/service-proxy-node-filter').as('serviceProxyNodeFilter'); + cy.fixture('service-proxy-tabs/properties-rules-result').as('getRules'); + cy.fixture('service-proxy-tabs/add-rule-result').as('addRuleResult'); + cy.fixture('service-proxy-tabs/update-rule-result').as('updateRuleResult'); + cy.fixture('service-proxy-tabs/delete-rule-result').as('deleteRuleResult'); + cy.fixture('service-proxy-tabs/delete-all-rule').as('deleteAllRules'); + cy.fixture('service-proxy-tabs/service-proxy-after-delete-rules').as('serviceProxydeleteAllRules'); + + }); + + it('Create update and delete Rule', function () { + cy.route('GET', '**/authorize', '@onapUserData'); + cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@metadata'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=nonExcludedPolicies&include=nonExcludedGroups&include=forwardingPaths', '@fullData'); + cy.route('GET', '**/services/*', 'fixture:service-proxy-tabs/service-proxy'); + cy.route('GET', '**/services/*/filteredDataByParams?include=componentInstancesProperties', '@serviceProxyProperties') + cy.route('GET', '**/services/*/filteredDataByParams?include=nodeFilter', '@serviceProxyNodeFilter'); + cy.route('GET', '**/services/*/filteredDataByParams?include=inputs&include=componentInstances&include=componentInstancesProperties&include=properties','fixture:service-proxy-tabs/full-properties'); + + cy.route('POST', '**/services/*/resourceInstances/*/nodeFilter', '@getRules'); + cy.route('POST', '**/services/*/resourceInstances/*/nodeFilter', '@addRuleResult'); + cy.route('PUT', '**/services/*/resourceInstances/*/nodeFilter', '@updateRuleResult'); + cy.route('DELETE', '**/services/*/resourceInstances/*/nodeFilter/*', '@deleteRuleResult'); + cy.route('DELETE', '**/services/*/resourceInstances/*/nodeFilter/*', '@deleteAllRules'); + cy.route('POST','**/services/*/resourceInstance/*', '@serviceProxydeleteAllRules'); + + const compositionPageUrl = '#!/dashboard/workspace/' + this.metadata.metadata.uniqueId + '/service/composition/details'; + cy.visit(compositionPageUrl); + + // Wait for the canvas to be visible + cy.get('canvas-search').should('be.visible'); + + // Click on the component instance via the testBridge + cy.window().its('testBridge').invoke('selectComponentInstance', ['childservice_proxy']); + + // Click on Service Proxy + cy.get('.component-details-panel-tabs sdc-tabs ul').children('li[ng-reflect-text="Service Dependencies"]').trigger('click', { force: true }); + cy.wait(100); + //Add new rule + cy.get('[data-tests-id="add-rule-button"]').trigger('click', { force: true }); + cy.get(':nth-child(1) > .i-sdc-form-select > .ng-valid').select('internalvl0_dhcp_enabled').should('have.value', '0: internalvl0_dhcp_enabled'); + cy.get('.rule-assigned-value > ui-element-dropdown > .ng-pristine').select('TRUE').should('have.value', '0: true'); + cy.get('.ng2-modal-footer > .blue').trigger('click', { force: true }); + //Update rule + cy.get(':nth-child(1) > .rule-details > .rule-desc').trigger('click', {force: true}); + cy.get('.rule-assigned-value > ui-element-dropdown > .ng-pristine').should('have.value', '0: true'); + cy.get('.rule-assigned-value > ui-element-dropdown > .ng-pristine').select('FALSE').should('have.value', '1: false'); + cy.get('.ng2-modal-footer > .blue').trigger('click', { force: true }); + //delete rule + cy.get(':nth-child(1) > .rule-details > .delete-icon').trigger('click', {force: true}); + cy.get('[data-tests-id="Delete"]').trigger('click', {force: true}); + //delete all role + cy.get('[type="checkbox"]').uncheck({ force: true }); + cy.get('[data-tests-id="Yes"]').trigger('click', {force: true}); + }); + +}); diff --git a/catalog-ui/cypress/integration/welcome_page.spec.js b/catalog-ui/cypress/integration/welcome_page.spec.js new file mode 100644 index 0000000000..b462eb0e14 --- /dev/null +++ b/catalog-ui/cypress/integration/welcome_page.spec.js @@ -0,0 +1,20 @@ +import { initCommonFixtures } from "../common/init"; + +describe('The Welcome Page', function () { + + beforeEach(() => { + cy.server(); + initCommonFixtures(cy); + + cy.fixture('metadata-vf').as('metadata'); + cy.fixture('full-data-vf').as('fullData'); + }) + + it.skip('successfully loads', function () { + cy.visit('/'); + cy.get('.project-icon').should('be.visible'); + }) + it.skip('redirects to the dashboard', function () { + cy.url().should('contain', 'dashboard') + }) +}) \ No newline at end of file -- cgit 1.2.3-korg