1 declare namespace Cypress {
3 initVidMock: typeof initVidMock;
4 preventErrorsOnLoading : typeof preventErrorsOnLoading;
5 initCategoryParameter : typeof initCategoryParameter;
6 initAuditInfoMSO: typeof initAuditInfoMSO;
7 initAuditInfoMSOALaCarte: typeof initAuditInfoMSOALaCarte;
8 initAsyncInstantiation : typeof initAsyncInstantiation;
12 function preventErrorsOnLoading() : void {
13 cy.on('uncaught:exception', (err, runnable) => {
18 function initGetToMenuInfo(response? : JSON) : void {
19 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/topMenuInfo.json').then((res) => {
24 url : Cypress.config('baseUrl') + "/get_topMenuInfo",
25 response : response ? response : res
32 function initCategoryParameter(response? : JSON) : void {
33 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/categoryParametres.json').then((res) => {
38 url : Cypress.config('baseUrl') + "/category_parameter**",
39 response : response ? response : res
40 }).as('initCategoryParameters');
44 function initFlags(response? : JSON, delay?: number, status?: number) : void {
45 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
49 delay : delay ? delay : 0,
50 status : status ? status : 200,
51 url : Cypress.config('baseUrl') + "/flags**",
52 response : response ? response : res
57 function initAuditInfoVID(response? : JSON, delay?: number, status?: number) : void {
58 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoVid.json').then((res) => {
62 delay : delay ? delay : 0,
63 status : status ? status : 200,
64 url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**?source=VID",
65 response : response ? response : res
66 }).as('initAuditInfoVID');
70 function initAuditInfoMSO(response? : JSON, delay?: number, status?: number) : void {
71 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoMSO.json').then((res) => {
75 delay : delay ? delay : 0,
76 status : status ? status : 200,
77 url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**?source=MSO",
78 response : response ? response : res
79 }).as('initAuditInfoMSO');
83 function initAuditInfoMSOALaCarte(response? : JSON, delay?: number, status?: number) : void {
84 cy.readFile('../vid-automation/src/test/resources/a-la-carte/auditInfoMSOALaCarte.json').then((res) => {
88 delay : delay ? delay : 0,
89 status : status ? status : 200,
90 url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**/mso**",
91 response : response ? response : res
92 }).as('initAuditInfoMSOAlaCarte');
96 function initAsyncInstantiation(response? : JSON, delay?: number, status?: number) : void {
97 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicAsyncInstantiation.json').then((res) => {
101 delay : delay ? delay : 0,
102 status : status ? status : 200,
103 url : Cypress.config('baseUrl') + "/asyncInstantiation",
104 response : response ? response : res
105 }).as('initAsyncInstantiation');
111 function initVidMock(): void {
113 initCategoryParameter();
120 Cypress.Commands.add('initVidMock', initVidMock);
121 Cypress.Commands.add('preventErrorsOnLoading', preventErrorsOnLoading);
122 Cypress.Commands.add('initCategoryParameter', initCategoryParameter);
123 Cypress.Commands.add('initAuditInfoMSO', initAuditInfoMSO);
124 Cypress.Commands.add('initAuditInfoMSOALaCarte', initAuditInfoMSOALaCarte);
125 Cypress.Commands.add('initAsyncInstantiation', initAsyncInstantiation);