diff options
author | 2019-08-27 16:01:01 +0300 | |
---|---|---|
committer | 2019-09-09 07:01:36 +0000 | |
commit | e1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (patch) | |
tree | 46be9cdc44cbb475527bc3c43df23d16f7579d29 /vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts | |
parent | e25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff) |
Adding feature: Replace vfmodule
Issue-ID: VID-603
Change-Id: I59068a0979d6fb733e4243c8f78921f396dc9d17
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts')
-rw-r--r-- | vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts index 8b25488b6..9698f47bb 100644 --- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts @@ -6,6 +6,7 @@ declare namespace Cypress { initAuditInfoMSO: typeof initAuditInfoMSO; initAuditInfoMSOALaCarte: typeof initAuditInfoMSOALaCarte; initAsyncInstantiation : typeof initAsyncInstantiation; + mockLatestVersionForService : typeof mockLatestVersionForService; } } @@ -106,14 +107,31 @@ function initAsyncInstantiation(response? : JSON, delay?: number, status?: numbe }) } +function mockLatestVersionForService(uuidObject :any) { + if(uuidObject && uuidObject.serviceUuid && uuidObject.invariantId){ + cy.server().route({ + url: Cypress.config('baseUrl') + '/aai_get_newest_model_version_by_invariant/' + uuidObject.invariantId, + method: 'GET', + status: 200, + response: { + "modelVersionId": uuidObject.serviceUuid, + "modelName": "SERVICE_INSTANCE_NAME", + "modelVersion": "2.0", + "distributionStatus": "DISTRIBUTION_COMPLETE_OK", + "resourceVersion": "resourceVersion", + "modelDescription": "modelDescription" + }, + }).as("expectLatestServiceModelUpgradeVersion") + } +} - -function initVidMock(): void { +function initVidMock(...args :any): void { initGetToMenuInfo(); initCategoryParameter(); initFlags(); initAuditInfoVID(); initAuditInfoMSO(); + mockLatestVersionForService(args[0]); } @@ -123,3 +141,5 @@ Cypress.Commands.add('initCategoryParameter', initCategoryParameter); Cypress.Commands.add('initAuditInfoMSO', initAuditInfoMSO); Cypress.Commands.add('initAuditInfoMSOALaCarte', initAuditInfoMSOALaCarte); Cypress.Commands.add('initAsyncInstantiation', initAsyncInstantiation); +Cypress.Commands.add('mockLatestVersionForService', mockLatestVersionForService); + |