1 declare namespace Cypress {
3 initVidMock: typeof initVidMock;
4 preventErrorsOnLoading : typeof preventErrorsOnLoading;
5 initCategoryParameter : typeof initCategoryParameter;
9 function preventErrorsOnLoading() : void {
10 cy.on('uncaught:exception', (err, runnable) => {
15 function initGetToMenuInfo(response? : JSON) : void {
16 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/topMenuInfo.json').then((res) => {
21 url : Cypress.config('baseUrl') + "/get_topMenuInfo",
22 response : response ? response : res
29 function initCategoryParameter(response? : JSON) : void {
30 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/categoryParametres.json').then((res) => {
35 url : Cypress.config('baseUrl') + "/category_parameter**",
36 response : response ? response : res
41 function initFlags(response? : JSON, delay?: number, status?: number) : void {
42 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
46 delay : delay ? delay : 0,
47 status : status ? status : 200,
48 url : Cypress.config('baseUrl') + "/flags**",
49 response : response ? response : res
54 function initAuditInfoVID(response? : JSON, delay?: number, status?: number) : void {
55 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoVid.json').then((res) => {
59 delay : delay ? delay : 0,
60 status : status ? status : 200,
61 url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**?source=VID",
62 response : response ? response : res
63 }).as('initAuditInfoVID');
67 function initAuditInfoMSO(response? : JSON, delay?: number, status?: number) : void {
68 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoMSO.json').then((res) => {
72 delay : delay ? delay : 0,
73 status : status ? status : 200,
74 url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**?source=MSO",
75 response : response ? response : res
76 }).as('initAuditInfoMSO');
80 function initVidMock(): void {
82 initCategoryParameter();
89 Cypress.Commands.add('initVidMock', initVidMock);
90 Cypress.Commands.add('preventErrorsOnLoading', preventErrorsOnLoading);
91 Cypress.Commands.add('initCategoryParameter', initCategoryParameter);