1 declare namespace Cypress {
3 initAAIMock: typeof initAAIMock;
4 initAlaCarteService : typeof initAlaCarteService;
5 initZones : typeof initZones;
6 initTenants : typeof initTenants;
7 initSearchVNFMemebers : typeof initSearchVNFMemebers;
8 initActiveNetworks : typeof initActiveNetworks;
9 initActiveVPNs : typeof initActiveVPNs;
10 initGetAAISubDetails : typeof initGetAAISubDetails;
11 initAAIServices: typeof initAAIServices;
15 function initGetSubscribers(response? : JSON) : void {
16 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
21 url : Cypress.config('baseUrl') + "/aai_get_subscribers**",
22 response : response ? response : res
23 }).as('initGetSubscribers')
27 function initAaiGetFullSubscribers(response? : JSON) : void {
28 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
33 url : Cypress.config('baseUrl') + "/aai_get_full_subscribers**",
34 response : response ? response : res
35 }).as('initGetSubscribers')
39 function initGetAAISubDetails(response? : JSON) : void {
40 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
45 url: Cypress.config('baseUrl') + "/aai_sub_details/**",
46 response: response ? response : res
47 }).as('aai-sub-details')
51 function initAlaCarteService(response? : JSON) : void {
52 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
57 url: Cypress.config('baseUrl') + "/rest/models/services**",
58 response: response ? response : res
59 }).as('initAlaCarteService')
67 function initTenants(response? : JSON) : void {
68 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/tenants.json').then((res) => {
73 url: Cypress.config('baseUrl') + "/aai_get_tenants/**",
74 response: response ? response : res
79 function initAAIServices(response? : JSON) : void {
80 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServices.json').then((res) => {
85 url : Cypress.config('baseUrl') + "/aai_get_services**",
86 response : response ? response : res
87 }).as(('initAAIServices'));
91 function initZones(response? : JSON) : void {
92 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/zones.json').then((res) => {
97 url : Cypress.config('baseUrl') + "/aai_get_aic_zones**",
98 response : response ? response : res
103 //Mock of vnf's that members for VNF Group
104 function initSearchVNFMemebers(response? : JSON) : void {
105 cy.readFile('../vid-automation/src/test/resources/VnfGroup/searchMembersResponse.json').then((res) => {
110 url : Cypress.config('baseUrl') + "/aai_search_group_members/**",
111 response : response ? response : res
112 }).as(('searchVNFMembers'));
116 function initActiveNetworks(response? : JSON) : void {
117 cy.readFile('../vid-automation/src/test/resources/viewEdit/aaiGetActiveNetworks.json').then((res) => {
122 url : Cypress.config('baseUrl') + "/aai_get_active_networks/**",
123 response : response ? response : res
124 }).as(('getActiveNetworks'));
128 function initActiveVPNs(response? : JSON) : void {
129 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiActiveVPNs.json').then((res) => {
134 url : Cypress.config('baseUrl') + "/aai_get_vpn_list/**",
135 response : response ? response : res
140 function initAAIMock(): void {
141 initAaiGetFullSubscribers();
142 initGetSubscribers();
149 Cypress.Commands.add('initAAIMock', initAAIMock);
150 Cypress.Commands.add('initAlaCarteService', initAlaCarteService);
151 Cypress.Commands.add('initZones', initZones);
152 Cypress.Commands.add('initTenants', initTenants);
153 Cypress.Commands.add('initAaiGetFullSubscribers', initAaiGetFullSubscribers);
154 Cypress.Commands.add('initGetAAISubDetails', initGetAAISubDetails);
155 Cypress.Commands.add('initSearchVNFMemebers', initSearchVNFMemebers);
156 Cypress.Commands.add('initActiveNetworks', initActiveNetworks);
157 Cypress.Commands.add('initActiveVPNs', initActiveVPNs);
158 Cypress.Commands.add('initAAIServices', initAAIServices);