2022-11-08 04:21:10 -08:00
|
|
|
// Load type definitions that come with Cypress module
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
2024-06-11 05:45:15 -07:00
|
|
|
import type { IN8nUISettings } from 'n8n-workflow';
|
|
|
|
|
|
|
|
Cypress.Keyboard.defaults({
|
|
|
|
keystrokeDelay: 0,
|
|
|
|
});
|
2023-02-08 12:41:35 -08:00
|
|
|
|
2022-11-28 09:11:33 -08:00
|
|
|
interface SigninPayload {
|
|
|
|
email: string;
|
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
2024-08-12 07:47:14 -07:00
|
|
|
interface DragAndDropOptions {
|
|
|
|
position: 'top' | 'center' | 'bottom';
|
|
|
|
}
|
|
|
|
|
2022-11-08 04:21:10 -08:00
|
|
|
declare global {
|
|
|
|
namespace Cypress {
|
2023-06-22 15:38:12 -07:00
|
|
|
interface SuiteConfigOverrides {
|
|
|
|
disableAutoLogin: boolean;
|
|
|
|
}
|
|
|
|
|
2022-11-08 04:21:10 -08:00
|
|
|
interface Chainable {
|
2023-06-22 15:38:12 -07:00
|
|
|
config(key: keyof SuiteConfigOverrides): boolean;
|
2022-12-15 07:39:59 -08:00
|
|
|
getByTestId(
|
|
|
|
selector: string,
|
2024-06-10 06:49:50 -07:00
|
|
|
...args: Array<Partial<Loggable & Timeoutable & Withinable & Shadow> | undefined>
|
2022-12-15 07:39:59 -08:00
|
|
|
): Chainable<JQuery<HTMLElement>>;
|
|
|
|
findChildByTestId(childTestId: string): Chainable<JQuery<HTMLElement>>;
|
2024-06-12 23:39:53 -07:00
|
|
|
/**
|
|
|
|
* Creates a workflow from the given fixture and optionally renames it.
|
|
|
|
*
|
|
|
|
* @param fixtureKey
|
|
|
|
* @param [workflowName] Optional name for the workflow. A random nanoid is used if not given
|
|
|
|
*/
|
|
|
|
createFixtureWorkflow(fixtureKey: string, workflowName?: string): void;
|
2024-06-14 05:48:49 -07:00
|
|
|
/** @deprecated use signinAsOwner, signinAsAdmin or signinAsMember instead */
|
2022-11-28 09:11:33 -08:00
|
|
|
signin(payload: SigninPayload): void;
|
2024-01-08 01:35:18 -08:00
|
|
|
signinAsOwner(): void;
|
2024-06-11 05:45:15 -07:00
|
|
|
signinAsAdmin(): void;
|
2024-06-14 05:48:49 -07:00
|
|
|
/**
|
|
|
|
* Omitting the index will default to index 0.
|
|
|
|
*/
|
2024-06-11 05:45:15 -07:00
|
|
|
signinAsMember(index?: number): void;
|
2023-02-08 12:41:35 -08:00
|
|
|
signout(): void;
|
2024-06-11 05:45:15 -07:00
|
|
|
overrideSettings(value: Partial<IN8nUISettings>): void;
|
2023-01-04 00:47:48 -08:00
|
|
|
enableFeature(feature: string): void;
|
2023-05-03 05:06:06 -07:00
|
|
|
disableFeature(feature: string): void;
|
2023-11-10 14:48:31 -08:00
|
|
|
enableQueueMode(): void;
|
|
|
|
disableQueueMode(): void;
|
2024-05-17 01:53:15 -07:00
|
|
|
changeQuota(feature: string, value: number): void;
|
2023-03-16 02:19:12 -07:00
|
|
|
waitForLoad(waitForIntercepts?: boolean): void;
|
2022-12-07 09:16:38 -08:00
|
|
|
grantBrowserPermissions(...permissions: string[]): void;
|
|
|
|
readClipboard(): Chainable<string>;
|
2022-12-15 07:39:59 -08:00
|
|
|
paste(pastePayload: string): void;
|
2023-08-16 08:13:57 -07:00
|
|
|
drag(
|
2024-06-10 06:49:50 -07:00
|
|
|
selector: string | Chainable<JQuery<HTMLElement>>,
|
2023-08-16 08:13:57 -07:00
|
|
|
target: [number, number],
|
2023-11-03 07:22:37 -07:00
|
|
|
options?: { abs?: boolean; index?: number; realMouse?: boolean; clickToFinish?: boolean },
|
2023-08-16 08:13:57 -07:00
|
|
|
): void;
|
2024-08-12 07:47:14 -07:00
|
|
|
draganddrop(
|
|
|
|
draggableSelector: string,
|
|
|
|
droppableSelector: string,
|
|
|
|
options?: Partial<DragAndDropOptions>,
|
|
|
|
): void;
|
2023-11-28 07:47:28 -08:00
|
|
|
push(type: string, data: unknown): void;
|
2023-10-30 05:44:19 -07:00
|
|
|
shouldNotHaveConsoleErrors(): void;
|
2023-12-11 10:21:10 -08:00
|
|
|
window(): Chainable<
|
|
|
|
AUTWindow & {
|
2024-06-10 06:49:50 -07:00
|
|
|
innerWidth: number;
|
|
|
|
innerHeight: number;
|
|
|
|
preventNodeViewBeforeUnload?: boolean;
|
2024-07-05 07:52:12 -07:00
|
|
|
maxPinnedDataSize?: number;
|
2023-12-11 10:21:10 -08:00
|
|
|
featureFlags: {
|
2024-06-10 06:49:50 -07:00
|
|
|
override: (feature: string, value: unknown) => void;
|
2023-12-11 10:21:10 -08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
>;
|
2024-01-08 01:35:18 -08:00
|
|
|
resetDatabase(): void;
|
2024-06-11 01:23:30 -07:00
|
|
|
setAppDate(targetDate: number | Date): void;
|
2022-11-08 04:21:10 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export {};
|