From fa502614fa4e2297a66687177738a7bc9e9bda00 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 16 Oct 2024 01:07:31 +0200 Subject: 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 --- cypress/support/commands.ts | 75 +-------------------------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) (limited to 'cypress/support/commands.ts') diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 23f93ea14d9..28bd335eecf 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ // eslint-disable-next-line n/no-extraneous-import -import axios, { type AxiosResponse } from 'axios' +import axios from 'axios' import { addCommands, User } from '@nextcloud/cypress' import { basename } from 'path' @@ -13,79 +13,6 @@ import 'cypress-if' import 'cypress-wait-until' addCommands() -// Register this file's custom commands types -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 { - /** - * Enable or disable a given user - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - enableUser(user: User, enable?: boolean): Cypress.Chainable>, - - /** - * 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, - - /** - * 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, - - /** - * Create a new directory - * **Warning**: Using this function will reset the previous session - */ - mkdir(user: User, target: string): Cypress.Chainable, - - /** - * Set a file as favorite (or remove from favorite) - */ - setFileAsFavorite(user: User, target: string, favorite?: boolean): Cypress.Chainable, - - /** - * Reset the admin theming entirely. - * **Warning**: Using this function will reset the previous session - */ - resetAdminTheming(): Cypress.Chainable, - - /** - * 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, - - /** - * Run an occ command in the docker container. - */ - runOccCommand(command: string, options?: Partial): Cypress.Chainable, - - userFileExists(user: string, path: string): Cypress.Chainable - - /** - * Create a snapshot of the current database - */ - backupDB(): Cypress.Chainable, - - /** - * Restore a snapshot of the database - * Default is the post-setup state - */ - restoreDB(snapshot?: string): Cypress.Chainable - - backupData(users?: string[]): Cypress.Chainable - - restoreData(snapshot?: string): Cypress.Chainable - } - } -} - const url = (Cypress.config('baseUrl') || '').replace(/\/index.php\/?$/g, '') Cypress.env('baseUrl', url) -- cgit v1.2.3