summaryrefslogtreecommitdiffstats
path: root/catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js
diff options
context:
space:
mode:
authorys9693 <ys9693@att.com>2020-01-19 13:50:02 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-01-22 12:33:31 +0000
commit16a9fce0e104a38371a9e5a567ec611ae3fc7f33 (patch)
tree03a2aff3060ddb5bc26a90115805a04becbaffc9 /catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js
parentaa83a2da4f911c3ac89318b8e9e8403b072942e1 (diff)
Catalog alignment
Issue-ID: SDC-2724 Signed-off-by: ys9693 <ys9693@att.com> Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe
Diffstat (limited to 'catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js')
-rw-r--r--catalog-ui/cypress/integration/modify-service-consumption.composition.spec.js52
1 files changed, 52 insertions, 0 deletions
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');
+ });
+
+});