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;
13 function initGetSubscribers(response? : JSON) : void {
14 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
19 url : Cypress.config('baseUrl') + "/aai_get_subscribers**",
20 response : response ? response : res
21 }).as('initGetSubscribers')
25 function initAaiGetFullSubscribers(response? : JSON) : void {
26 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
31 url : Cypress.config('baseUrl') + "/aai_get_full_subscribers**",
32 response : response ? response : res
33 }).as('initGetSubscribers')
37 function initGetAAISubDetails(response? : JSON) : void {
38 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
43 url: Cypress.config('baseUrl') + "/aai_sub_details**",
44 response: response ? response : res
49 function initAlaCarteService(response? : JSON) : void {
50 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
55 url: Cypress.config('baseUrl') + "/rest/models/services**",
56 response: response ? response : res
57 }).as('initAlaCarteService')
65 function initTenants(response? : JSON) : void {
66 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/tenants.json').then((res) => {
71 url: Cypress.config('baseUrl') + "/aai_get_tenants/**",
72 response: response ? response : res
77 function initAAIServices(response? : JSON) : void {
78 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServices.json').then((res) => {
83 url : Cypress.config('baseUrl') + "/aai_get_services**",
84 response : response ? response : res
85 }).as(('initAAIServices'));
89 function initZones(response? : JSON) : void {
90 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/zones.json').then((res) => {
95 url : Cypress.config('baseUrl') + "/aai_get_aic_zones**",
96 response : response ? response : res
101 //Mock of vnf's that members for VNF Group
102 function initSearchVNFMemebers(response? : JSON) : void {
103 cy.readFile('../vid-automation/src/test/resources/VnfGroup/searchMembersResponse.json').then((res) => {
108 url : Cypress.config('baseUrl') + "/aai_search_group_members/**",
109 response : response ? response : res
110 }).as(('searchVNFMembers'));
114 function initActiveNetworks(response? : JSON) : void {
115 cy.readFile('../vid-automation/src/test/resources/viewEdit/aaiGetActiveNetworks.json').then((res) => {
120 url : Cypress.config('baseUrl') + "/aai_get_active_networks/**",
121 response : response ? response : res
122 }).as(('getActiveNetworks'));
126 function initActiveVPNs(response? : JSON) : void {
127 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiActiveVPNs.json').then((res) => {
132 url : Cypress.config('baseUrl') + "/aai_get_vpn_list/**",
133 response : response ? response : res
138 function initAAIMock(): void {
139 initAaiGetFullSubscribers();
140 initGetSubscribers();
147 Cypress.Commands.add('initAAIMock', initAAIMock);
148 Cypress.Commands.add('initAlaCarteService', initAlaCarteService);
149 Cypress.Commands.add('initZones', initZones);
150 Cypress.Commands.add('initTenants', initTenants);
151 Cypress.Commands.add('initAaiGetFullSubscribers', initAaiGetFullSubscribers);
152 Cypress.Commands.add('initSearchVNFMemebers', initSearchVNFMemebers);
153 Cypress.Commands.add('initActiveNetworks', initActiveNetworks);
154 Cypress.Commands.add('initActiveVPNs', initActiveVPNs);