19
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
*
21
21
*/
22
- import { getNc } from "./commands"
22
+ import { getNc , restoreState , saveState } from "./commands"
23
23
import { login , logout } from "./commands/sessions"
24
24
import { User , createRandomUser , createUser , deleteUser , modifyUser , listUsers , getUserData , enableUser } from "./commands/users"
25
25
import type { Selector } from "./selectors"
@@ -69,7 +69,7 @@ declare global {
69
69
* Query list of users on the Nextcloud instance
70
70
*
71
71
* **Warning**: Using this function will reset the previous session
72
- *
72
+ *
73
73
* @param details Set to true to fetch users with detailed information (default false)
74
74
* @return List of user IDs or list of Users (if details was set to true)
75
75
*/
@@ -87,18 +87,35 @@ declare global {
87
87
88
88
/**
89
89
* Enable or disable a given user
90
- *
90
+ *
91
91
* @param user user whom to enable or disable
92
92
* @param enable True to enable, false to disable (default is enable)
93
93
*/
94
94
enableUser ( user : User , enable ?: boolean ) : Cypress . Chainable < Cypress . Response < any > >
95
+
95
96
/**
96
- *
97
+ *
97
98
* Query metadata for, and in behalf, of a given user
98
99
*
99
100
* @param user User whom metadata to query
100
101
*/
101
- getUserData ( user : User ) : Cypress . Chainable < Cypress . Response < any > >
102
+ getUserData ( user : User ) : Cypress . Chainable < Cypress . Response < any > >
103
+
104
+ /**
105
+ *
106
+ * Saves the DB and data folder state.
107
+ *
108
+ * @return string the ID of the snapshot
109
+ */
110
+ saveState ( ) : Cypress . Chainable < string >
111
+
112
+ /**
113
+ *
114
+ * Restores the DB and data folder state.
115
+ *
116
+ * @param snapshot string the ID of the snapshot
117
+ */
118
+ restoreState ( snapshot : string ) : Cypress . Chainable < void >
102
119
}
103
120
}
104
121
}
@@ -121,6 +138,9 @@ export const addCommands = function() {
121
138
Cypress . Commands . add ( 'modifyUser' , modifyUser )
122
139
Cypress . Commands . add ( 'enableUser' , enableUser )
123
140
Cypress . Commands . add ( 'getUserData' , getUserData )
141
+ Cypress . Commands . add ( 'modifyUser' , modifyUser )
142
+ Cypress . Commands . add ( 'saveState' , saveState )
143
+ Cypress . Commands . add ( 'restoreState' , restoreState )
124
144
}
125
145
126
146
export { User }
0 commit comments