blob: 490016bf6dd506dbe715cfa9a9c9b0eac0cec1c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
declare namespace Cypress {
interface Chainable {
setReduxState : typeof setReduxState;
}
}
/**********************************
Type to input with id some text
*********************************/
function setReduxState(state?: string) : void {
cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
cy.window().then((win) => {
win.sessionStorage.setItem('reduxState', JSON.stringify(state ? state : res));
});
});
}
Cypress.Commands.add('setReduxState', setReduxState);
|