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;
12 initGetModelByServiceType: typeof initGetModelByServiceType;
16 function initGetSubscribers(response? : JSON) : void {
17 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
22 url : Cypress.config('baseUrl') + "/aai_get_subscribers**",
23 response : response ? response : res
24 }).as('initGetSubscribers')
28 function initAaiGetFullSubscribers(response? : JSON) : void {
29 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
34 url : Cypress.config('baseUrl') + "/aai_get_full_subscribers**",
35 response : response ? response : res
36 }).as('initGetSubscribers')
40 function initGetAAISubDetails(response? : JSON) : void {
41 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
46 url: Cypress.config('baseUrl') + "/aai_sub_details/**",
47 response: response ? response : res
48 }).as('aai-sub-details')
52 function initGetModelByServiceType(response? : JSON) : void {
53 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
58 url: Cypress.config('baseUrl') + "/aai_get_models_by_service_type/**",
59 response: response ? response : res
60 }).as('aai-sub-details')
65 function initAlaCarteService(response? : JSON) : void {
66 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
71 url: Cypress.config('baseUrl') + "/rest/models/services**",
72 response: response ? response : res
73 }).as('initAlaCarteService')
81 function initTenants(response? : JSON) : void {
82 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/tenants.json').then((res) => {
87 url: Cypress.config('baseUrl') + "/aai_get_tenants/**",
88 response: response ? response : res
93 function initAAIServices(response? : JSON) : void {
94 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServices.json').then((res) => {
99 url : Cypress.config('baseUrl') + "/aai_get_services**",
100 response : response ? response : res
101 }).as(('initAAIServices'));
105 function initZones(response? : JSON) : void {
106 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/zones.json').then((res) => {
111 url : Cypress.config('baseUrl') + "/aai_get_aic_zones**",
112 response : response ? response : res
117 //Mock of vnf's that members for VNF Group
118 function initSearchVNFMemebers(response? : JSON) : void {
119 cy.readFile('../vid-automation/src/test/resources/VnfGroup/searchMembersResponse.json').then((res) => {
124 url : Cypress.config('baseUrl') + "/aai_search_group_members/**",
125 response : response ? response : res
126 }).as(('searchVNFMembers'));
130 function initActiveNetworks(response? : JSON) : void {
131 cy.readFile('../vid-automation/src/test/resources/viewEdit/aaiGetActiveNetworks.json').then((res) => {
136 url : Cypress.config('baseUrl') + "/aai_get_active_networks/**",
137 response : response ? response : res
138 }).as(('getActiveNetworks'));
142 function initActiveVPNs(response? : JSON) : void {
143 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiActiveVPNs.json').then((res) => {
148 url : Cypress.config('baseUrl') + "/aai_get_vpn_list/**",
149 response : response ? response : res
154 function initAAIMock(): void {
155 initAaiGetFullSubscribers();
156 initGetSubscribers();
163 Cypress.Commands.add('initAAIMock', initAAIMock);
164 Cypress.Commands.add('initAlaCarteService', initAlaCarteService);
165 Cypress.Commands.add('initZones', initZones);
166 Cypress.Commands.add('initTenants', initTenants);
167 Cypress.Commands.add('initAaiGetFullSubscribers', initAaiGetFullSubscribers);
168 Cypress.Commands.add('initGetAAISubDetails', initGetAAISubDetails);
169 Cypress.Commands.add('initSearchVNFMemebers', initSearchVNFMemebers);
170 Cypress.Commands.add('initActiveNetworks', initActiveNetworks);
171 Cypress.Commands.add('initActiveVPNs', initActiveVPNs);
172 Cypress.Commands.add('initAAIServices', initAAIServices);
173 Cypress.Commands.add('initGetModelByServiceType', initGetModelByServiceType);