Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame^] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | setReduxState : typeof setReduxState; |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | /********************************** |
| 8 | Type to input with id some text |
| 9 | *********************************/ |
| 10 | function setReduxState(state?: string) : void { |
| 11 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => { |
| 12 | cy.window().then((win) => { |
| 13 | win.sessionStorage.setItem('reduxState', JSON.stringify(state ? state : res)); |
| 14 | }); |
| 15 | }); |
| 16 | } |
| 17 | |
| 18 | |
| 19 | |
| 20 | Cypress.Commands.add('setReduxState', setReduxState); |
| 21 | |