-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add proper styles for Cypress component tests
This also fixes Typescript issue but requires to slightly adjust the Navigation test as the progress bar is not visible (because it is overlayed by another element). Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
- Loading branch information
Showing
8 changed files
with
122 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
import { getLoggerBuilder } from '@nextcloud/logger' | ||
|
||
const logger = getLoggerBuilder() | ||
.setApp('federatedfilesharing') | ||
.build() | ||
export default logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*! | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import type { mount } from '@cypress/vue2' | ||
|
||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
namespace Cypress { | ||
interface Chainable { | ||
mount: typeof mount | ||
mockInitialState: (app: string, key: string, value: unknown) => Cypress.Chainable<void> | ||
unmockInitialState: (app?: string, key?: string) => Cypress.Chainable<void> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/*! | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
// eslint-disable-next-line n/no-extraneous-import | ||
import type { AxiosResponse } from 'axios' | ||
|
||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
namespace Cypress { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars | ||
interface Chainable<Subject = any> { | ||
/** | ||
* Enable or disable a given user | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
enableUser(user: User, enable?: boolean): Cypress.Chainable<Cypress.Response<any>>, | ||
|
||
/** | ||
* Upload a file from the fixtures folder to a given user storage. | ||
* **Warning**: Using this function will reset the previous session | ||
*/ | ||
uploadFile(user: User, fixture?: string, mimeType?: string, target?: string): Cypress.Chainable<void>, | ||
|
||
/** | ||
* Upload a raw content to a given user storage. | ||
* **Warning**: Using this function will reset the previous session | ||
*/ | ||
uploadContent(user: User, content: Blob, mimeType: string, target: string, mtime?: number): Cypress.Chainable<AxiosResponse>, | ||
|
||
/** | ||
* Create a new directory | ||
* **Warning**: Using this function will reset the previous session | ||
*/ | ||
mkdir(user: User, target: string): Cypress.Chainable<void>, | ||
|
||
/** | ||
* Set a file as favorite (or remove from favorite) | ||
*/ | ||
setFileAsFavorite(user: User, target: string, favorite?: boolean): Cypress.Chainable<void>, | ||
|
||
/** | ||
* Reset the admin theming entirely. | ||
* **Warning**: Using this function will reset the previous session | ||
*/ | ||
resetAdminTheming(): Cypress.Chainable<void>, | ||
|
||
/** | ||
* Reset the user theming settings. | ||
* If provided, will clear session and login as the given user. | ||
* **Warning**: Providing a user will reset the previous session. | ||
*/ | ||
resetUserTheming(user?: User): Cypress.Chainable<void>, | ||
|
||
/** | ||
* Run an occ command in the docker container. | ||
*/ | ||
runOccCommand(command: string, options?: Partial<Cypress.ExecOptions>): Cypress.Chainable<Cypress.Exec>, | ||
|
||
userFileExists(user: string, path: string): Cypress.Chainable<number> | ||
|
||
/** | ||
* Create a snapshot of the current database | ||
*/ | ||
backupDB(): Cypress.Chainable<string>, | ||
|
||
/** | ||
* Restore a snapshot of the database | ||
* Default is the post-setup state | ||
*/ | ||
restoreDB(snapshot?: string): Cypress.Chainable | ||
|
||
backupData(users?: string[]): Cypress.Chainable<string> | ||
|
||
restoreData(snapshot?: string): Cypress.Chainable | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters