@nocobase/test 1.2.13-alpha → 1.3.0-alpha.20240710084543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/es/client/commonSettingsChecker/blockTitle.d.ts +0 -9
- package/es/client/commonSettingsChecker/fieldTitle.d.ts +0 -9
- package/es/client/commonSettingsChecker/index.d.ts +0 -10
- package/es/client/formItemChecker/collectionField.d.ts +0 -13
- package/es/client/formItemChecker/common.d.ts +0 -21
- package/es/client/formItemChecker/icon.d.ts +0 -11
- package/es/client/formItemChecker/index.d.ts +0 -31
- package/es/client/formItemChecker/input.d.ts +0 -11
- package/es/client/formItemChecker/number.d.ts +0 -11
- package/es/client/formItemChecker/radio.d.ts +0 -11
- package/es/client/formItemChecker/textarea.d.ts +0 -11
- package/es/client/index.d.ts +0 -24
- package/es/client/index.mjs +0 -2002
- package/es/client/renderAppOptions.d.ts +0 -11
- package/es/client/renderHookWithApp.d.ts +0 -19
- package/es/client/renderSettings.d.ts +0 -15
- package/es/client/renderSingleSettings.d.ts +0 -15
- package/es/client/settingsChecker/delete.d.ts +0 -16
- package/es/client/settingsChecker/index.d.ts +0 -26
- package/es/client/settingsChecker/modal.d.ts +0 -16
- package/es/client/settingsChecker/select.d.ts +0 -18
- package/es/client/settingsChecker/switch.d.ts +0 -16
- package/es/client/utils/checkModal.d.ts +0 -21
- package/es/client/utils/checkSchema.d.ts +0 -9
- package/es/client/utils/index.d.ts +0 -11
- package/es/client/utils/utils.d.ts +0 -10
- package/es/e2e/defineConfig.d.ts +0 -10
- package/es/e2e/e2eUtils.d.ts +0 -341
- package/es/e2e/index.d.ts +0 -11
- package/es/e2e/index.mjs +0 -21064
- package/es/e2e/templatesOfCollection.d.ts +0 -49
- package/es/e2e/templatesOfPage.d.ts +0 -585
- package/es/index.d.ts +0 -9
- package/es/index.mjs +0 -226
- package/es/scripts/test-db-creator.d.ts +0 -9
- package/es/scripts/test-db-distributor.d.ts +0 -9
- package/es/server/index.d.ts +0 -26
- package/es/server/mockServer.d.ts +0 -83
- package/es/web/index.d.ts +0 -62
- package/es/web/index.mjs +0 -1600
- package/es/web/utils.d.ts +0 -9
- package/lib/client/commonSettingsChecker/blockTitle.d.ts +0 -9
- package/lib/client/commonSettingsChecker/blockTitle.js +0 -65
- package/lib/client/commonSettingsChecker/fieldTitle.d.ts +0 -9
- package/lib/client/commonSettingsChecker/fieldTitle.js +0 -65
- package/lib/client/commonSettingsChecker/index.d.ts +0 -10
- package/lib/client/commonSettingsChecker/index.js +0 -32
- package/lib/client/formItemChecker/collectionField.d.ts +0 -13
- package/lib/client/formItemChecker/collectionField.js +0 -61
- package/lib/client/formItemChecker/common.d.ts +0 -21
- package/lib/client/formItemChecker/common.js +0 -45
- package/lib/client/formItemChecker/icon.d.ts +0 -11
- package/lib/client/formItemChecker/icon.js +0 -69
- package/lib/client/formItemChecker/index.d.ts +0 -31
- package/lib/client/formItemChecker/index.js +0 -65
- package/lib/client/formItemChecker/input.d.ts +0 -11
- package/lib/client/formItemChecker/input.js +0 -61
- package/lib/client/formItemChecker/number.d.ts +0 -11
- package/lib/client/formItemChecker/number.js +0 -61
- package/lib/client/formItemChecker/radio.d.ts +0 -11
- package/lib/client/formItemChecker/radio.js +0 -66
- package/lib/client/formItemChecker/textarea.d.ts +0 -11
- package/lib/client/formItemChecker/textarea.js +0 -61
- package/lib/client/index.d.ts +0 -24
- package/lib/client/index.js +0 -97
- package/lib/client/renderAppOptions.d.ts +0 -11
- package/lib/client/renderAppOptions.js +0 -61
- package/lib/client/renderHookWithApp.d.ts +0 -19
- package/lib/client/renderHookWithApp.js +0 -58
- package/lib/client/renderSettings.d.ts +0 -15
- package/lib/client/renderSettings.js +0 -78
- package/lib/client/renderSingleSettings.d.ts +0 -15
- package/lib/client/renderSingleSettings.js +0 -49
- package/lib/client/settingsChecker/delete.d.ts +0 -16
- package/lib/client/settingsChecker/delete.js +0 -59
- package/lib/client/settingsChecker/index.d.ts +0 -26
- package/lib/client/settingsChecker/index.js +0 -73
- package/lib/client/settingsChecker/modal.d.ts +0 -16
- package/lib/client/settingsChecker/modal.js +0 -49
- package/lib/client/settingsChecker/select.d.ts +0 -18
- package/lib/client/settingsChecker/select.js +0 -85
- package/lib/client/settingsChecker/switch.d.ts +0 -16
- package/lib/client/settingsChecker/switch.js +0 -91
- package/lib/client/utils/checkModal.d.ts +0 -21
- package/lib/client/utils/checkModal.js +0 -87
- package/lib/client/utils/checkSchema.d.ts +0 -9
- package/lib/client/utils/checkSchema.js +0 -45
- package/lib/client/utils/index.d.ts +0 -11
- package/lib/client/utils/index.js +0 -34
- package/lib/client/utils/utils.d.ts +0 -10
- package/lib/client/utils/utils.js +0 -54
- package/lib/e2e/defineConfig.d.ts +0 -10
- package/lib/e2e/defineConfig.js +0 -87
- package/lib/e2e/e2eUtils.d.ts +0 -341
- package/lib/e2e/e2eUtils.js +0 -704
- package/lib/e2e/index.d.ts +0 -11
- package/lib/e2e/index.js +0 -34
- package/lib/e2e/templatesOfCollection.d.ts +0 -49
- package/lib/e2e/templatesOfCollection.js +0 -729
- package/lib/e2e/templatesOfPage.d.ts +0 -585
- package/lib/e2e/templatesOfPage.js +0 -19796
- package/lib/index.d.ts +0 -9
- package/lib/index.js +0 -30
- package/lib/scripts/test-db-creator.d.ts +0 -9
- package/lib/scripts/test-db-creator.js +0 -185
- package/lib/scripts/test-db-distributor.d.ts +0 -9
- package/lib/scripts/test-db-distributor.js +0 -243
- package/lib/server/index.d.ts +0 -26
- package/lib/server/index.js +0 -114
- package/lib/server/mockServer.d.ts +0 -83
- package/lib/server/mockServer.js +0 -221
- package/lib/web/dataSource2.json +0 -139
- package/lib/web/dataSourceMainCollections.json +0 -819
- package/lib/web/dataSourceMainData.json +0 -287
- package/lib/web/index.d.ts +0 -62
- package/lib/web/index.js +0 -298
- package/lib/web/utils.d.ts +0 -9
- package/lib/web/utils.js +0 -41
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { GetAppComponentOptions } from '../web';
|
|
10
|
-
export declare const renderAppOptions: (options: GetAppComponentOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
11
|
-
export declare const renderReadPrettyApp: (options: GetAppComponentOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React, { FC } from 'react';
|
|
10
|
-
import { GetAppOptions } from '../web';
|
|
11
|
-
interface RenderHookOptions extends Omit<GetAppOptions, 'value' | 'onChange'> {
|
|
12
|
-
hook: () => any;
|
|
13
|
-
props?: any;
|
|
14
|
-
Wrapper?: FC<{
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
export declare const renderHookWithApp: (options: RenderHookOptions) => Promise<import("@testing-library/react-hooks").RenderHookResult<any, any, import("@testing-library/react-hooks").Renderer<any>>>;
|
|
19
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { GetAppComponentOptions } from '../web';
|
|
10
|
-
export declare function showSettingsMenu(container?: HTMLElement | Document): Promise<void>;
|
|
11
|
-
export interface RenderSettingsOptions extends GetAppComponentOptions {
|
|
12
|
-
container?: () => HTMLElement;
|
|
13
|
-
}
|
|
14
|
-
export declare const renderSettings: (options?: RenderSettingsOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
15
|
-
export declare const renderReadPrettySettings: (options?: RenderSettingsOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { RenderSettingsOptions } from './renderSettings';
|
|
10
|
-
interface RenderSingleSettingsOptions extends Omit<RenderSettingsOptions, 'schemaSettings'> {
|
|
11
|
-
settingPath?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const renderSingleSettings: (options: RenderSingleSettingsOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
14
|
-
export declare const renderReadPrettySingleSettings: (options: RenderSingleSettingsOptions) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CheckModalOptions } from '../utils';
|
|
10
|
-
export interface CheckDeleteSettingOptions {
|
|
11
|
-
title: string;
|
|
12
|
-
deletedText?: string;
|
|
13
|
-
afterClick?: () => Promise<void> | void;
|
|
14
|
-
modalChecker?: Omit<CheckModalOptions, 'triggerText'>;
|
|
15
|
-
}
|
|
16
|
-
export declare function checkDeleteSetting(options: CheckDeleteSettingOptions): Promise<void>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CheckDeleteSettingOptions } from './delete';
|
|
10
|
-
import { CheckModalSettingOptions } from './modal';
|
|
11
|
-
import { CheckSwitchSettingOptions } from './switch';
|
|
12
|
-
import { SelectSettingOptions } from './select';
|
|
13
|
-
export * from './delete';
|
|
14
|
-
export * from './modal';
|
|
15
|
-
export * from './switch';
|
|
16
|
-
export * from './select';
|
|
17
|
-
export type CheckSettingsOptions = ({
|
|
18
|
-
type: 'switch';
|
|
19
|
-
} & CheckSwitchSettingOptions) | ({
|
|
20
|
-
type: 'modal';
|
|
21
|
-
} & CheckModalSettingOptions) | ({
|
|
22
|
-
type: 'select';
|
|
23
|
-
} & SelectSettingOptions) | ({
|
|
24
|
-
type: 'delete';
|
|
25
|
-
} & CheckDeleteSettingOptions);
|
|
26
|
-
export declare function checkSettings(list: CheckSettingsOptions[], checkLength?: boolean): Promise<void>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CheckModalOptions } from '../utils';
|
|
10
|
-
export interface CheckModalSettingOptions {
|
|
11
|
-
title: string;
|
|
12
|
-
beforeClick?: () => Promise<void> | void;
|
|
13
|
-
afterClick?: () => Promise<void> | void;
|
|
14
|
-
modalChecker?: Omit<CheckModalOptions, 'triggerText'>;
|
|
15
|
-
}
|
|
16
|
-
export declare function checkModalSetting(options: CheckModalSettingOptions): Promise<void>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export interface SelectSettingOptions {
|
|
10
|
-
title: string;
|
|
11
|
-
beforeSelect?: () => Promise<void> | void;
|
|
12
|
-
oldValue?: string;
|
|
13
|
-
options?: {
|
|
14
|
-
label: string;
|
|
15
|
-
checker?: () => void | Promise<void>;
|
|
16
|
-
}[];
|
|
17
|
-
}
|
|
18
|
-
export declare function checkSelectSetting(options: SelectSettingOptions): Promise<void>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export interface CheckSwitchSettingOptions {
|
|
10
|
-
title: string;
|
|
11
|
-
beforeClick?: () => Promise<void> | void;
|
|
12
|
-
afterFirstClick?: () => Promise<void> | void;
|
|
13
|
-
afterSecondClick?: () => Promise<void> | void;
|
|
14
|
-
afterThirdClick?: () => Promise<void> | void;
|
|
15
|
-
}
|
|
16
|
-
export declare function checkSwitchSetting(options: CheckSwitchSettingOptions): Promise<void>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { FormItemCheckOptions } from '../formItemChecker';
|
|
10
|
-
export interface CheckModalOptions {
|
|
11
|
-
triggerText?: string;
|
|
12
|
-
modalTitle?: string;
|
|
13
|
-
confirmTitle?: string;
|
|
14
|
-
submitText?: string;
|
|
15
|
-
contentText?: string;
|
|
16
|
-
beforeCheck?: () => Promise<void> | void;
|
|
17
|
-
customCheck?: () => Promise<void> | void;
|
|
18
|
-
formItems?: FormItemCheckOptions[];
|
|
19
|
-
afterSubmit?: () => Promise<void> | void;
|
|
20
|
-
}
|
|
21
|
-
export declare function checkModal(options: CheckModalOptions): Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare function checkSchema(matchObj?: Record<string, any>, name?: string): Promise<void>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './utils';
|
|
10
|
-
export * from './checkModal';
|
|
11
|
-
export * from './checkSchema';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare const expectNoTsError: any;
|
|
10
|
-
export declare const WaitApp: () => Promise<void>;
|
package/es/e2e/defineConfig.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { type PlaywrightTestConfig } from '@playwright/test';
|
|
10
|
-
export declare const defineConfig: (config?: PlaywrightTestConfig) => PlaywrightTestConfig<{}, {}>;
|
package/es/e2e/e2eUtils.d.ts
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Page } from '@playwright/test';
|
|
10
|
-
import { defineConfig } from './defineConfig';
|
|
11
|
-
export * from '@playwright/test';
|
|
12
|
-
export { defineConfig };
|
|
13
|
-
export interface CollectionSetting {
|
|
14
|
-
name: string;
|
|
15
|
-
title?: string;
|
|
16
|
-
titleField?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @default 'general'
|
|
19
|
-
*/
|
|
20
|
-
template?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @default true
|
|
23
|
-
*/
|
|
24
|
-
logging?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Generate ID field automatically
|
|
27
|
-
* @default true
|
|
28
|
-
*/
|
|
29
|
-
autoGenId?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Store the creation user of each record
|
|
32
|
-
* @default true
|
|
33
|
-
*/
|
|
34
|
-
createdBy?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Store the last update user of each record
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
updatedBy?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Store the creation time of each record
|
|
42
|
-
* @default true
|
|
43
|
-
*/
|
|
44
|
-
createdAt?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Store the last update time of each record
|
|
47
|
-
* @default true
|
|
48
|
-
*/
|
|
49
|
-
updatedAt?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Records can be sorted
|
|
52
|
-
* @default true
|
|
53
|
-
*/
|
|
54
|
-
sortable?: boolean | string;
|
|
55
|
-
/**
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
inherit?: boolean;
|
|
59
|
-
inherits?: string[];
|
|
60
|
-
category?: any[];
|
|
61
|
-
hidden?: boolean;
|
|
62
|
-
description?: string;
|
|
63
|
-
view?: boolean;
|
|
64
|
-
key?: string;
|
|
65
|
-
fields?: Array<{
|
|
66
|
-
interface: string;
|
|
67
|
-
type?: string;
|
|
68
|
-
name?: string;
|
|
69
|
-
unique?: boolean;
|
|
70
|
-
uiSchema?: {
|
|
71
|
-
type?: string;
|
|
72
|
-
title?: string;
|
|
73
|
-
required?: boolean;
|
|
74
|
-
'x-component'?: string;
|
|
75
|
-
'x-read-pretty'?: boolean;
|
|
76
|
-
'x-validator'?: any;
|
|
77
|
-
'x-component-props'?: Record<string, any>;
|
|
78
|
-
[key: string]: any;
|
|
79
|
-
};
|
|
80
|
-
field?: string;
|
|
81
|
-
target?: string;
|
|
82
|
-
targetKey?: string;
|
|
83
|
-
foreignKey?: string;
|
|
84
|
-
allowNull?: boolean;
|
|
85
|
-
autoIncrement?: boolean;
|
|
86
|
-
primaryKey?: boolean;
|
|
87
|
-
key?: string;
|
|
88
|
-
description?: string;
|
|
89
|
-
collectionName?: string;
|
|
90
|
-
parentKey?: any;
|
|
91
|
-
reverseKey?: any;
|
|
92
|
-
[key: string]: any;
|
|
93
|
-
}>;
|
|
94
|
-
}
|
|
95
|
-
interface AclActionsSetting {
|
|
96
|
-
name: string;
|
|
97
|
-
fields?: any[];
|
|
98
|
-
scope?: any;
|
|
99
|
-
}
|
|
100
|
-
interface AclResourcesSetting {
|
|
101
|
-
name: string;
|
|
102
|
-
usingActionsConfig: boolean;
|
|
103
|
-
actions?: AclActionsSetting[];
|
|
104
|
-
}
|
|
105
|
-
interface AclRoleSetting {
|
|
106
|
-
name?: string;
|
|
107
|
-
title?: string;
|
|
108
|
-
/**
|
|
109
|
-
* @default true
|
|
110
|
-
*/
|
|
111
|
-
allowNewMenu?: boolean;
|
|
112
|
-
snippets?: string[];
|
|
113
|
-
strategy?: any;
|
|
114
|
-
resources?: AclResourcesSetting[];
|
|
115
|
-
/**
|
|
116
|
-
* @default false
|
|
117
|
-
*/
|
|
118
|
-
default?: boolean;
|
|
119
|
-
key?: string;
|
|
120
|
-
menuUiSchemas?: string[];
|
|
121
|
-
dataSourceKey?: string;
|
|
122
|
-
}
|
|
123
|
-
interface DatabaseSetting {
|
|
124
|
-
database: string;
|
|
125
|
-
host: string;
|
|
126
|
-
port: string;
|
|
127
|
-
schema?: string;
|
|
128
|
-
username?: string;
|
|
129
|
-
password?: string;
|
|
130
|
-
}
|
|
131
|
-
interface DataSourceSetting {
|
|
132
|
-
key: string;
|
|
133
|
-
displayName: string;
|
|
134
|
-
type: string;
|
|
135
|
-
options: DatabaseSetting;
|
|
136
|
-
enabled?: boolean;
|
|
137
|
-
}
|
|
138
|
-
export interface PageConfig {
|
|
139
|
-
/**
|
|
140
|
-
* 页面类型
|
|
141
|
-
* @default 'page'
|
|
142
|
-
*/
|
|
143
|
-
type?: 'group' | 'page' | 'link';
|
|
144
|
-
/**
|
|
145
|
-
* type 为 link 时,表示跳转的链接
|
|
146
|
-
*/
|
|
147
|
-
url?: string;
|
|
148
|
-
/**
|
|
149
|
-
* 用户可见的页面名称
|
|
150
|
-
* @default uid()
|
|
151
|
-
*/
|
|
152
|
-
name?: string;
|
|
153
|
-
/**
|
|
154
|
-
* 页面的基础路径
|
|
155
|
-
* @default '/admin/'
|
|
156
|
-
*/
|
|
157
|
-
basePath?: string;
|
|
158
|
-
/**
|
|
159
|
-
* 页面数据表的配置
|
|
160
|
-
* @default undefined
|
|
161
|
-
*/
|
|
162
|
-
collections?: CollectionSetting[];
|
|
163
|
-
/**
|
|
164
|
-
* 页面整体的 Schema
|
|
165
|
-
* @default undefined
|
|
166
|
-
*/
|
|
167
|
-
pageSchema?: any;
|
|
168
|
-
/** 如果为 true 则表示不会更改 PageSchema 的 uid */
|
|
169
|
-
keepUid?: boolean;
|
|
170
|
-
}
|
|
171
|
-
interface ExtendUtils {
|
|
172
|
-
page?: Page;
|
|
173
|
-
/**
|
|
174
|
-
* 根据配置,生成一个 NocoBase 的页面
|
|
175
|
-
* @param pageConfig 页面配置
|
|
176
|
-
* @returns
|
|
177
|
-
*/
|
|
178
|
-
mockPage: (pageConfig?: PageConfig) => NocoPage;
|
|
179
|
-
/**
|
|
180
|
-
* 根据配置,生成一个需要手动销毁的 NocoPage 页面
|
|
181
|
-
* @param pageConfig
|
|
182
|
-
* @returns
|
|
183
|
-
*/
|
|
184
|
-
mockManualDestroyPage: (pageConfig?: PageConfig) => NocoPage;
|
|
185
|
-
/**
|
|
186
|
-
* 根据配置,生成多个 collections
|
|
187
|
-
* @param collectionSettings
|
|
188
|
-
* @returns 返回一个 destroy 方法,用于销毁创建的 collections
|
|
189
|
-
*/
|
|
190
|
-
mockCollections: (collectionSettings: CollectionSetting[]) => Promise<any>;
|
|
191
|
-
/**
|
|
192
|
-
* 根据配置,生成一个 collection
|
|
193
|
-
* @param collectionSetting
|
|
194
|
-
* @returns 返回一个 destroy 方法,用于销毁创建的 collection
|
|
195
|
-
*/
|
|
196
|
-
mockCollection: (collectionSetting: CollectionSetting) => Promise<any>;
|
|
197
|
-
/**
|
|
198
|
-
* 自动生成一条对应 collection 的数据
|
|
199
|
-
* @returns 返回一条生成的数据
|
|
200
|
-
*/
|
|
201
|
-
mockRecord: {
|
|
202
|
-
/**
|
|
203
|
-
* @param collectionName 数据表名称
|
|
204
|
-
* @param data 自定义的数据,缺失时会生成随机数据
|
|
205
|
-
* @param maxDepth - 生成的数据的最大深度,默认为 1,当想生成多层级数据时可以设置一个较高的值
|
|
206
|
-
*/
|
|
207
|
-
<T = any>(collectionName: string, data?: any, maxDepth?: number): Promise<T>;
|
|
208
|
-
/**
|
|
209
|
-
* @param collectionName 数据表名称
|
|
210
|
-
* @param maxDepth - 生成的数据的最大深度,默认为 1,当想生成多层级数据时可以设置一个较高的值
|
|
211
|
-
*/
|
|
212
|
-
<T = any>(collectionName: string, maxDepth?: number): Promise<T>;
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* 自动生成多条对应 collection 的数据
|
|
216
|
-
*/
|
|
217
|
-
mockRecords: {
|
|
218
|
-
/**
|
|
219
|
-
* @param collectionName - 数据表名称
|
|
220
|
-
* @param count - 生成的数据条数
|
|
221
|
-
* @param maxDepth - 生成的数据的最大深度,默认为 1,当想生成多层级数据时可以设置一个较高的值
|
|
222
|
-
*/
|
|
223
|
-
<T = any>(collectionName: string, count?: number, maxDepth?: number): Promise<T[]>;
|
|
224
|
-
/**
|
|
225
|
-
* @param collectionName - 数据表名称
|
|
226
|
-
* @param data - 指定生成的数据
|
|
227
|
-
* @param maxDepth - 生成的数据的最大深度,默认为 1,当想生成多层级数据时可以设置一个较高的值
|
|
228
|
-
*/
|
|
229
|
-
<T = any>(collectionName: string, data?: any[], maxDepth?: number): Promise<T[]>;
|
|
230
|
-
};
|
|
231
|
-
/**
|
|
232
|
-
* 该方法已弃用,请使用 mockCollections
|
|
233
|
-
* @deprecated
|
|
234
|
-
* @param collectionSettings
|
|
235
|
-
* @returns
|
|
236
|
-
*/
|
|
237
|
-
createCollections: (collectionSettings: CollectionSetting | CollectionSetting[]) => Promise<void>;
|
|
238
|
-
/**
|
|
239
|
-
* 根据页面 title 删除对应的页面
|
|
240
|
-
* @param pageName 显示在页面菜单中的名称
|
|
241
|
-
* @returns
|
|
242
|
-
*/
|
|
243
|
-
deletePage: (pageName: string) => Promise<void>;
|
|
244
|
-
/**
|
|
245
|
-
* 生成一个新的角色,并和admin关联上
|
|
246
|
-
*/
|
|
247
|
-
mockRole: <T = any>(roleSetting: AclRoleSetting) => Promise<T>;
|
|
248
|
-
/**
|
|
249
|
-
* 更新角色权限配置
|
|
250
|
-
*/
|
|
251
|
-
updateRole: <T = any>(roleSetting: AclRoleSetting) => Promise<T>;
|
|
252
|
-
/**
|
|
253
|
-
* 创建一个外部数据源(pg)
|
|
254
|
-
*/
|
|
255
|
-
mockExternalDataSource: <T = any>(DataSourceSetting: DataSourceSetting) => Promise<T>;
|
|
256
|
-
/**
|
|
257
|
-
* 删除外部数据源
|
|
258
|
-
* @param key 外部数据源key
|
|
259
|
-
*/
|
|
260
|
-
destoryExternalDataSource: <T = any>(key: string) => Promise<T>;
|
|
261
|
-
/**
|
|
262
|
-
* 清空区块模板,该方法应该放到测试用例开始的位置(放在末尾的话,如果测试报错会导致模板不会被清空)
|
|
263
|
-
*/
|
|
264
|
-
clearBlockTemplates: ({ immediate, }?: {
|
|
265
|
-
/**
|
|
266
|
-
* 是否立即清空,默认为 false。如果为 true,则会立即清空,否则会等到测试用例结束后再清空
|
|
267
|
-
*/
|
|
268
|
-
immediate: boolean;
|
|
269
|
-
}) => Promise<void>;
|
|
270
|
-
}
|
|
271
|
-
export declare class NocoPage {
|
|
272
|
-
private options?;
|
|
273
|
-
private page?;
|
|
274
|
-
private url;
|
|
275
|
-
private uid;
|
|
276
|
-
private collectionsName;
|
|
277
|
-
private _waitForInit;
|
|
278
|
-
constructor(options?: PageConfig, page?: Page);
|
|
279
|
-
init(): Promise<void>;
|
|
280
|
-
goto(): Promise<void>;
|
|
281
|
-
getUrl(): Promise<string>;
|
|
282
|
-
getUid(): Promise<string>;
|
|
283
|
-
waitForInit(this: NocoPage): Promise<NocoPage>;
|
|
284
|
-
destroy(): Promise<void>;
|
|
285
|
-
}
|
|
286
|
-
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ExtendUtils, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions> & {
|
|
287
|
-
/** 只运行在 postgres 数据库中 */
|
|
288
|
-
pgOnly: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ExtendUtils, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions> | {
|
|
289
|
-
(title: string, body: (args: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ExtendUtils & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions, testInfo: import("@playwright/test").TestInfo) => void | Promise<void>): void;
|
|
290
|
-
(title: string, details: import("@playwright/test").TestDetails, body: (args: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ExtendUtils & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions, testInfo: import("@playwright/test").TestInfo) => void | Promise<void>): void;
|
|
291
|
-
(): void;
|
|
292
|
-
(condition: boolean, description?: string): void;
|
|
293
|
-
(callback: (args: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ExtendUtils & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions) => boolean, description?: string): void;
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* 将数据表中 mock 出来的 records 删除掉
|
|
298
|
-
* @param collectionName
|
|
299
|
-
* @param records
|
|
300
|
-
*/
|
|
301
|
-
export declare const deleteRecords: (collectionName: string, filter: any) => Promise<void>;
|
|
302
|
-
/**
|
|
303
|
-
* 删除一些不需要的字段,如 key
|
|
304
|
-
* @param collectionSettings
|
|
305
|
-
* @returns
|
|
306
|
-
*/
|
|
307
|
-
export declare const omitSomeFields: (collectionSettings: CollectionSetting[]) => any[];
|
|
308
|
-
interface ExpectSettingsMenuParams {
|
|
309
|
-
showMenu: () => Promise<void>;
|
|
310
|
-
supportedOptions: string[];
|
|
311
|
-
page: Page;
|
|
312
|
-
unsupportedOptions?: string[];
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* 辅助断言 SchemaSettings 的菜单项是否存在
|
|
316
|
-
* @param param0
|
|
317
|
-
*/
|
|
318
|
-
export declare function expectSettingsMenu({ showMenu, supportedOptions, page, unsupportedOptions, }: ExpectSettingsMenuParams): Promise<void>;
|
|
319
|
-
/**
|
|
320
|
-
* 辅助断言 Initializer 的菜单项是否存在
|
|
321
|
-
* @param param0
|
|
322
|
-
*/
|
|
323
|
-
export declare function expectInitializerMenu({ showMenu, supportedOptions, page, expectValue, }: {
|
|
324
|
-
showMenu: () => Promise<void>;
|
|
325
|
-
supportedOptions: string[];
|
|
326
|
-
page: Page;
|
|
327
|
-
expectValue?: () => Promise<void>;
|
|
328
|
-
}): Promise<void>;
|
|
329
|
-
/**
|
|
330
|
-
* 用于辅助在 page 中创建区块
|
|
331
|
-
* @param page
|
|
332
|
-
* @param name
|
|
333
|
-
*/
|
|
334
|
-
export declare const createBlockInPage: (page: Page, name: string) => Promise<void>;
|
|
335
|
-
export declare const mockUserRecordsWithoutDepartments: (mockRecords: ExtendUtils['mockRecords'], count: number) => Promise<any[]>;
|
|
336
|
-
/**
|
|
337
|
-
* 用来辅助断言是否支持某些变量
|
|
338
|
-
* @param page
|
|
339
|
-
* @param variables
|
|
340
|
-
*/
|
|
341
|
-
export declare function expectSupportedVariables(page: Page, variables: string[]): Promise<void>;
|
package/es/e2e/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './e2eUtils';
|
|
10
|
-
export * from './templatesOfCollection';
|
|
11
|
-
export * from './templatesOfPage';
|