Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | permissionVidMock: typeof permissionVidMock; |
| 4 | initDrawingBoardUserPermission : typeof initDrawingBoardUserPermission; |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | |
| 9 | |
| 10 | function 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 | |
| 23 | function permissionVidMock(): void { |
| 24 | initDrawingBoardUserPermission(); |
| 25 | } |
| 26 | |
| 27 | |
| 28 | Cypress.Commands.add('permissionVidMock', permissionVidMock); |
| 29 | Cypress.Commands.add('initDrawingBoardUserPermission', initDrawingBoardUserPermission); |