blob: a69d725660621de38d22c8bcf97c4165d326bfe9 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001declare namespace Cypress {
2 interface Chainable {
3 permissionVidMock: typeof permissionVidMock;
4 initDrawingBoardUserPermission : typeof initDrawingBoardUserPermission;
5 }
6}
7
8
9
10function initDrawingBoardUserPermission( response?: any , delay?: number, status?: number) : void {
11 cy.server()
12 .route({
13 method: 'GET',
14 delay : delay ? delay : 0,
15 status : status ? status : 200,
16 url : Cypress.config('baseUrl') + "/roles/service_permissions?**",
17 response : response ? response : {
18 isEditPermitted : true
19 }
20 }).as('isEditPermitted');
21}
22
23function permissionVidMock(): void {
24 initDrawingBoardUserPermission();
25}
26
27
28Cypress.Commands.add('permissionVidMock', permissionVidMock);
29Cypress.Commands.add('initDrawingBoardUserPermission', initDrawingBoardUserPermission);