2
2
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
3
3
* SPDX-License-Identifier: AGPL-3.0-or-later
4
4
*/
5
- import { getNc } from "./commands"
5
+ import { getNc , restoreState , saveState } from "./commands"
6
6
import { login , logout } from "./commands/sessions"
7
- import { createDBSnapshot , restoreDBSnapshot } from "./commands/snapshots"
8
7
import { User , createRandomUser , createUser , deleteUser , modifyUser , listUsers , getUserData , enableUser } from "./commands/users"
9
8
import type { Selector } from "./selectors"
10
9
@@ -53,7 +52,7 @@ declare global {
53
52
* Query list of users on the Nextcloud instance
54
53
*
55
54
* **Warning**: Using this function will reset the previous session
56
- *
55
+ *
57
56
* @param details Set to true to fetch users with detailed information (default false)
58
57
* @return List of user IDs or list of Users (if details was set to true)
59
58
*/
@@ -71,30 +70,34 @@ declare global {
71
70
72
71
/**
73
72
* Enable or disable a given user
74
- *
73
+ *
75
74
* @param user user whom to enable or disable
76
75
* @param enable True to enable, false to disable (default is enable)
77
76
*/
78
77
enableUser ( user : User , enable ?: boolean ) : Cypress . Chainable < Cypress . Response < any > >
79
78
80
79
/**
81
- *
80
+ *
82
81
* Query metadata for, and in behalf, of a given user
83
82
*
84
83
* @param user User whom metadata to query
85
84
*/
86
85
getUserData ( user : User ) : Cypress . Chainable < Cypress . Response < any > >
87
86
88
87
/**
89
- * Create a snapshot of the current database
90
- */
91
- createDBSnapshot ( snapshot ?: string ) : Cypress . Chainable < string > ,
88
+ * Create a snapshot of the current DB and data folder state.
89
+ *
90
+ * @return string the ID of the snapshot
91
+ */
92
+ saveState ( ) : Cypress . Chainable < string >
92
93
93
94
/**
94
- * Restore a snapshot of the database
95
- * Default is the post-setup state
96
- */
97
- restoreDBSnapshot ( snapshot ?: string ) : Cypress . Chainable ,
95
+ * Restore a snapshot of the database
96
+ * Default is the post-setup state
97
+ *
98
+ * @param snapshot string the ID of the snapshot
99
+ */
100
+ restoreState ( snapshot : string ) : Cypress . Chainable < void >
98
101
}
99
102
}
100
103
}
@@ -117,8 +120,8 @@ export const addCommands = function() {
117
120
Cypress . Commands . add ( 'modifyUser' , modifyUser )
118
121
Cypress . Commands . add ( 'enableUser' , enableUser )
119
122
Cypress . Commands . add ( 'getUserData' , getUserData )
120
- Cypress . Commands . add ( 'createDBSnapshot ' , createDBSnapshot )
121
- Cypress . Commands . add ( 'restoreDBSnapshot ' , restoreDBSnapshot )
123
+ Cypress . Commands . add ( 'saveState ' , saveState )
124
+ Cypress . Commands . add ( 'restoreState ' , restoreState )
122
125
}
123
126
124
127
export { User }
0 commit comments