aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
parent67d99f816cc583643c35193197594cf78d8ce60a (diff)
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts')
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts36
1 files changed, 35 insertions, 1 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
index 5bc02d1c2..8b25488b6 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
@@ -3,6 +3,9 @@ declare namespace Cypress {
initVidMock: typeof initVidMock;
preventErrorsOnLoading : typeof preventErrorsOnLoading;
initCategoryParameter : typeof initCategoryParameter;
+ initAuditInfoMSO: typeof initAuditInfoMSO;
+ initAuditInfoMSOALaCarte: typeof initAuditInfoMSOALaCarte;
+ initAsyncInstantiation : typeof initAsyncInstantiation;
}
}
@@ -34,7 +37,7 @@ function initCategoryParameter(response? : JSON) : void {
status : 200,
url : Cypress.config('baseUrl') + "/category_parameter**",
response : response ? response : res
- });
+ }).as('initCategoryParameters');
})
}
@@ -77,6 +80,34 @@ function initAuditInfoMSO(response? : JSON, delay?: number, status?: number) : v
})
}
+function initAuditInfoMSOALaCarte(response? : JSON, delay?: number, status?: number) : void {
+ cy.readFile('../vid-automation/src/test/resources/a-la-carte/auditInfoMSOALaCarte.json').then((res) => {
+ cy.server()
+ .route({
+ method: 'GET',
+ delay : delay ? delay : 0,
+ status : status ? status : 200,
+ url : Cypress.config('baseUrl') + "/asyncInstantiation/auditStatus/**/mso**",
+ response : response ? response : res
+ }).as('initAuditInfoMSOAlaCarte');
+ })
+}
+
+function initAsyncInstantiation(response? : JSON, delay?: number, status?: number) : void {
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicAsyncInstantiation.json').then((res) => {
+ cy.server()
+ .route({
+ method: 'GET',
+ delay : delay ? delay : 0,
+ status : status ? status : 200,
+ url : Cypress.config('baseUrl') + "/asyncInstantiation",
+ response : response ? response : res
+ }).as('initAsyncInstantiation');
+ })
+}
+
+
+
function initVidMock(): void {
initGetToMenuInfo();
initCategoryParameter();
@@ -89,3 +120,6 @@ function initVidMock(): void {
Cypress.Commands.add('initVidMock', initVidMock);
Cypress.Commands.add('preventErrorsOnLoading', preventErrorsOnLoading);
Cypress.Commands.add('initCategoryParameter', initCategoryParameter);
+Cypress.Commands.add('initAuditInfoMSO', initAuditInfoMSO);
+Cypress.Commands.add('initAuditInfoMSOALaCarte', initAuditInfoMSOALaCarte);
+Cypress.Commands.add('initAsyncInstantiation', initAsyncInstantiation);