3
3
* SPDX-License-Identifier: AGPL-3.0-or-later
4
4
*/
5
5
// eslint-disable-next-line n/no-extraneous-import
6
- import axios , { type AxiosResponse } from 'axios'
6
+ import axios from 'axios'
7
7
import { addCommands , User } from '@nextcloud/cypress'
8
8
import { basename } from 'path'
9
9
@@ -13,79 +13,6 @@ import 'cypress-if'
13
13
import 'cypress-wait-until'
14
14
addCommands ( )
15
15
16
- // Register this file's custom commands types
17
- declare global {
18
- // eslint-disable-next-line @typescript-eslint/no-namespace
19
- namespace Cypress {
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
21
- interface Chainable < Subject = any > {
22
- /**
23
- * Enable or disable a given user
24
- */
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- enableUser ( user : User , enable ?: boolean ) : Cypress . Chainable < Cypress . Response < any > > ,
27
-
28
- /**
29
- * Upload a file from the fixtures folder to a given user storage.
30
- * **Warning**: Using this function will reset the previous session
31
- */
32
- uploadFile ( user : User , fixture ?: string , mimeType ?: string , target ?: string ) : Cypress . Chainable < void > ,
33
-
34
- /**
35
- * Upload a raw content to a given user storage.
36
- * **Warning**: Using this function will reset the previous session
37
- */
38
- uploadContent ( user : User , content : Blob , mimeType : string , target : string , mtime ?: number ) : Cypress . Chainable < AxiosResponse > ,
39
-
40
- /**
41
- * Create a new directory
42
- * **Warning**: Using this function will reset the previous session
43
- */
44
- mkdir ( user : User , target : string ) : Cypress . Chainable < void > ,
45
-
46
- /**
47
- * Set a file as favorite (or remove from favorite)
48
- */
49
- setFileAsFavorite ( user : User , target : string , favorite ?: boolean ) : Cypress . Chainable < void > ,
50
-
51
- /**
52
- * Reset the admin theming entirely.
53
- * **Warning**: Using this function will reset the previous session
54
- */
55
- resetAdminTheming ( ) : Cypress . Chainable < void > ,
56
-
57
- /**
58
- * Reset the user theming settings.
59
- * If provided, will clear session and login as the given user.
60
- * **Warning**: Providing a user will reset the previous session.
61
- */
62
- resetUserTheming ( user ?: User ) : Cypress . Chainable < void > ,
63
-
64
- /**
65
- * Run an occ command in the docker container.
66
- */
67
- runOccCommand ( command : string , options ?: Partial < Cypress . ExecOptions > ) : Cypress . Chainable < Cypress . Exec > ,
68
-
69
- userFileExists ( user : string , path : string ) : Cypress . Chainable < number >
70
-
71
- /**
72
- * Create a snapshot of the current database
73
- */
74
- backupDB ( ) : Cypress . Chainable < string > ,
75
-
76
- /**
77
- * Restore a snapshot of the database
78
- * Default is the post-setup state
79
- */
80
- restoreDB ( snapshot ?: string ) : Cypress . Chainable
81
-
82
- backupData ( users ?: string [ ] ) : Cypress . Chainable < string >
83
-
84
- restoreData ( snapshot ?: string ) : Cypress . Chainable
85
- }
86
- }
87
- }
88
-
89
16
const url = ( Cypress . config ( 'baseUrl' ) || '' ) . replace ( / \/ i n d e x .p h p \/ ? $ / g, '' )
90
17
Cypress . env ( 'baseUrl' , url )
91
18
0 commit comments