@luomus/laji-form 14.3.7 → 15.0.0
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/CHANGELOG.md +4 -0
- package/dist/laji-form.js +1 -1
- package/lib/components/fields/ImageArrayField.js +1 -1
- package/lib/components/fields/NamedPlaceSaverField.js +1 -1
- package/lib/components/fields/SectionArrayField.js +5 -1
- package/lib/components/fields/SingleActiveArrayField.js +1 -1
- package/lib/components/fields/UnitShorthandField.js +2 -2
- package/lib/components/templates/ArrayFieldTemplate.js +3 -2
- package/lib/components/templates/FieldTemplate.js +2 -2
- package/lib/utils.d.ts +6 -2
- package/lib/utils.js +13 -13
- package/migrate.sh +33 -0
- package/package.json +14 -21
- package/playwright-report/index.html +62 -0
- package/playwright.config.ts +77 -0
- package/rename.sh +24 -0
- package/test-export/test-utils.d.ts +176 -150
- package/test-export/test-utils.js +210 -218
- package/trip-report.spec.ts +594 -0
- package/tsconfig.test.json +1 -1
- package/test-export/array-spec.d.ts +0 -1
- package/test-export/array-spec.js +0 -204
- package/test-export/bird-point-count-spec.d.ts +0 -1
- package/test-export/bird-point-count-spec.js +0 -62
- package/test-export/collection-contest-form-spec.d.ts +0 -1
- package/test-export/collection-contest-form-spec.js +0 -38
- package/test-export/dataset-form-spec.d.ts +0 -1
- package/test-export/dataset-form-spec.js +0 -50
- package/test-export/date-time-widget-spec.d.ts +0 -1
- package/test-export/date-time-widget-spec.js +0 -188
- package/test-export/geocoder-spec.d.ts +0 -1
- package/test-export/geocoder-spec.js +0 -135
- package/test-export/image-array-spec.d.ts +0 -1
- package/test-export/image-array-spec.js +0 -94
- package/test-export/inject-field-spec.d.ts +0 -1
- package/test-export/inject-field-spec.js +0 -148
- package/test-export/internal-uuids-spec.d.ts +0 -1
- package/test-export/internal-uuids-spec.js +0 -157
- package/test-export/invasive-species-eradication-np-spec.d.ts +0 -1
- package/test-export/invasive-species-eradication-np-spec.js +0 -18
- package/test-export/invasive-species-eradication-spec.d.ts +0 -1
- package/test-export/invasive-species-eradication-spec.js +0 -25
- package/test-export/line-transect-spec.d.ts +0 -1
- package/test-export/line-transect-spec.js +0 -121
- package/test-export/mobile-form-spec.d.ts +0 -1
- package/test-export/mobile-form-spec.js +0 -84
- package/test-export/nafi-spec.d.ts +0 -1
- package/test-export/nafi-spec.js +0 -85
- package/test-export/select-widget-spec.d.ts +0 -1
- package/test-export/select-widget-spec.js +0 -68
- package/test-export/single-item-array-field-spec.d.ts +0 -1
- package/test-export/single-item-array-field-spec.js +0 -92
- package/test-export/syke-butterfly-spec.d.ts +0 -1
- package/test-export/syke-butterfly-spec.js +0 -163
- package/test-export/transaction-form-spec.d.ts +0 -1
- package/test-export/transaction-form-spec.js +0 -63
- package/test-export/trip-report-autosuggest-spec.d.ts +0 -1
- package/test-export/trip-report-autosuggest-spec.js +0 -272
- package/test-export/trip-report-spec.d.ts +0 -1
- package/test-export/trip-report-spec.js +0 -456
- package/test-export/unit-list-shorthand-array-field-spec.d.ts +0 -1
- package/test-export/unit-list-shorthand-array-field-spec.js +0 -71
- package/test-export/validation-spec.d.ts +0 -1
- package/test-export/validation-spec.js +0 -336
- package/test-export/water-bird-spec.d.ts +0 -1
- package/test-export/water-bird-spec.js +0 -30
- package/test-export/wbc-spec.d.ts +0 -1
- package/test-export/wbc-spec.js +0 -82
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read environment variables from file.
|
|
5
|
+
* https://github.com/motdotla/dotenv
|
|
6
|
+
*/
|
|
7
|
+
// require('dotenv').config();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* See https://playwright.dev/docs/test-configuration.
|
|
11
|
+
*/
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
testDir: './test',
|
|
14
|
+
/* Run tests in files in parallel */
|
|
15
|
+
fullyParallel: true,
|
|
16
|
+
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
17
|
+
forbidOnly: !!process.env.CI,
|
|
18
|
+
/* Retry on CI only */
|
|
19
|
+
retries: process.env.CI ? 2 : 0,
|
|
20
|
+
/* Opt out of parallel tests on CI. */
|
|
21
|
+
workers: process.env.CI ? 1 : undefined,
|
|
22
|
+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
23
|
+
reporter: 'line',
|
|
24
|
+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
25
|
+
use: {
|
|
26
|
+
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
27
|
+
baseURL: 'http://127.0.0.1:8083',
|
|
28
|
+
|
|
29
|
+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
30
|
+
trace: 'on-first-retry',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/* Configure projects for major browsers */
|
|
34
|
+
projects: [
|
|
35
|
+
{
|
|
36
|
+
name: 'chromium',
|
|
37
|
+
use: { ...devices['Desktop Chrome'] },
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
name: 'firefox',
|
|
42
|
+
use: { ...devices['Desktop Firefox'] },
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
// {
|
|
46
|
+
// name: 'webkit',
|
|
47
|
+
// use: { ...devices['Desktop Safari'] },
|
|
48
|
+
// },
|
|
49
|
+
|
|
50
|
+
/* Test against mobile viewports. */
|
|
51
|
+
// {
|
|
52
|
+
// name: 'Mobile Chrome',
|
|
53
|
+
// use: { ...devices['Pixel 5'] },
|
|
54
|
+
// },
|
|
55
|
+
// {
|
|
56
|
+
// name: 'Mobile Safari',
|
|
57
|
+
// use: { ...devices['iPhone 12'] },
|
|
58
|
+
// },
|
|
59
|
+
|
|
60
|
+
/* Test against branded browsers. */
|
|
61
|
+
// {
|
|
62
|
+
// name: 'Microsoft Edge',
|
|
63
|
+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
64
|
+
// },
|
|
65
|
+
// {
|
|
66
|
+
// name: 'Google Chrome',
|
|
67
|
+
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
68
|
+
// },
|
|
69
|
+
],
|
|
70
|
+
|
|
71
|
+
/* Run your local dev server before starting the tests */
|
|
72
|
+
// webServer: {
|
|
73
|
+
// command: 'npm run start',
|
|
74
|
+
// url: 'http://127.0.0.1:3000',
|
|
75
|
+
// reuseExistingServer: !process.env.CI,
|
|
76
|
+
// },
|
|
77
|
+
});
|
package/rename.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
mv array-spec.ts array.spec.ts
|
|
2
|
+
mv bird-point-count-spec.ts sbird-point-count.spec.ts
|
|
3
|
+
mv collection-contest-form-spec.ts collection-contest-form.spec.ts
|
|
4
|
+
mv dataset-form-spec.ts dataset-form.spec.ts
|
|
5
|
+
mv date-time-widget-spec.ts date-time-widget.spec.ts
|
|
6
|
+
mv geocoder-spec.ts geocoder.spec.ts
|
|
7
|
+
mv image-array-spec.ts image-array.spec.ts
|
|
8
|
+
mv inject-field-spec.ts inject-field.spec.ts
|
|
9
|
+
mv internal-uuids-spec.ts internal-uuids.spec.ts
|
|
10
|
+
mv invasive-species-eradication-np-spec.ts invasive-species-eradication-np.spec.ts
|
|
11
|
+
mv invasive-species-eradication-spec.ts invasive-species-eradication.spec.ts
|
|
12
|
+
mv line-transect-spec.ts line-transect.spec.ts
|
|
13
|
+
mv mobile-form-spec.ts mobile-form.spec.ts
|
|
14
|
+
mv nafi-spec.ts nafi.spec.ts
|
|
15
|
+
mv select-widget-spec.ts select-widget.spec.ts
|
|
16
|
+
mv single-item-array-field-spec.ts single-item-array-field.spec.ts
|
|
17
|
+
mv syke-butterfly-spec.ts syke-butterfly.spec.ts
|
|
18
|
+
mv transaction-form-spec.ts transaction-form.spec.ts
|
|
19
|
+
mv trip-report-autosuggest-spec.ts trip-report-autosuggest.spec.ts
|
|
20
|
+
mv trip-report-spec.ts trip-report.spec.ts
|
|
21
|
+
mv unit-list-shorthand-array-field-spec.ts unit-list-shorthand-array-field.spec.ts
|
|
22
|
+
mv validation-spec.ts validation.spec.ts
|
|
23
|
+
mv water-bird-spec.ts water-bird.spec.ts
|
|
24
|
+
mv wbc-spec.ts wbc.spec.ts
|
|
@@ -1,53 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Locator, Page } from "@playwright/test";
|
|
2
2
|
import { JSONSchema7 } from "json-schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
3
|
+
import { LajiFormState } from "@luomus/laji-form/lib/components/LajiForm";
|
|
4
|
+
import type { JSONSerializable } from "@luomus/laji-form/lib/utils";
|
|
5
|
+
import { MapPageObject } from "@luomus/laji-map/test-export/test-utils";
|
|
6
|
+
export declare const emptyForm: (page: Page, params?: string) => Promise<import("playwright-core").Response | null>;
|
|
7
|
+
export declare const navigateToForm: (page: Page, formID: string, params?: string) => Promise<import("playwright-core").Response | null>;
|
|
7
8
|
export declare const lajiFormLocator: (path: string) => string;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const getFocusedElement: () => import("selenium-webdriver").WebElementPromise;
|
|
10
|
-
export declare const getFocusedId: () => import("selenium-webdriver").promise.Promise<string>;
|
|
9
|
+
export declare const getFocusedElement: (page: Page) => Locator;
|
|
11
10
|
export interface Mock {
|
|
12
11
|
resolve: (response?: any, raw?: boolean) => Promise<void>;
|
|
13
12
|
reject: (response?: any, raw?: boolean) => Promise<void>;
|
|
14
13
|
remove: () => Promise<void>;
|
|
15
14
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
calendar: {
|
|
27
|
-
$today: ElementFinder;
|
|
28
|
-
waitAnimation: () => Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
clock: {
|
|
31
|
-
"$01:00": ElementFinder;
|
|
32
|
-
waitAnimation: () => Promise<void>;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface BooleanWidgetPO {
|
|
36
|
-
$container: ElementFinder;
|
|
37
|
-
$true: ElementFinder;
|
|
38
|
-
$false: ElementFinder;
|
|
39
|
-
$undefined: ElementFinder;
|
|
40
|
-
$active: ElementFinder;
|
|
41
|
-
$nonactive: ElementFinder;
|
|
42
|
-
}
|
|
43
|
-
export interface EnumWidgetPOI {
|
|
44
|
-
$container: ElementFinder;
|
|
15
|
+
export declare type ImageArrayFieldPO = ReturnType<Form["getImageArrayField"]>;
|
|
16
|
+
export declare type TaxonAutosuggestWidgetPO = ReturnType<Form["getTaxonAutosuggestWidget"]>;
|
|
17
|
+
export declare type UnitListShorthandArrayFieldPO = ReturnType<Form["getUnitListShorthandArrayField"]>;
|
|
18
|
+
export declare type EnumWidgetPO = ReturnType<typeof getEnumWidgetForContainer>;
|
|
19
|
+
export declare type DateWidgetPO = ReturnType<Form["getDateWidget"]>;
|
|
20
|
+
export declare type BooleanWidgetPO = ReturnType<Form["getBooleanWidget"]>;
|
|
21
|
+
export declare type NamedPlaceChooserPO = ReturnType<Form["getNamedPlaceChooser"]>;
|
|
22
|
+
declare function getEnumWidgetForContainer($container: Locator): {
|
|
23
|
+
$container: Locator;
|
|
45
24
|
openEnums: () => Promise<void>;
|
|
46
|
-
$enumContainer:
|
|
47
|
-
|
|
48
|
-
$input:
|
|
49
|
-
}
|
|
50
|
-
interface
|
|
25
|
+
$enumContainer: Locator;
|
|
26
|
+
$enums: Locator;
|
|
27
|
+
$input: Locator;
|
|
28
|
+
};
|
|
29
|
+
interface DemoPageProps {
|
|
51
30
|
schema?: JSONSchema7;
|
|
52
31
|
uiSchema?: any;
|
|
53
32
|
formData?: any;
|
|
@@ -58,127 +37,174 @@ interface FormProps {
|
|
|
58
37
|
localFormData?: boolean | string;
|
|
59
38
|
}
|
|
60
39
|
export declare class Form {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
submitOnlySchemaValidations(): Promise<void>;
|
|
71
|
-
waitUntilBlockingLoaderHides(timeout?: number): import("selenium-webdriver").promise.Promise<unknown>;
|
|
72
|
-
getSubmittedData(): Promise<any>;
|
|
73
|
-
getChangedData(): Promise<any>;
|
|
74
|
-
getPropsData(): Promise<any>;
|
|
75
|
-
$form: ElementFinder;
|
|
76
|
-
$locate(path: string): ElementFinder;
|
|
77
|
-
$locateButton(path: string, selector: string): ElementFinder;
|
|
78
|
-
$locateAddition(path: string, selector: string): ElementFinder;
|
|
79
|
-
getMockStr: (path: string, query: any) => string;
|
|
80
|
-
setMockResponse(path: string, query?: any): Promise<Mock>;
|
|
81
|
-
createMockResponseQueue(path: string, query?: any): Promise<{
|
|
82
|
-
create: () => Promise<{
|
|
83
|
-
resolve: (response: any, raw?: boolean | undefined) => import("selenium-webdriver").promise.Promise<unknown>;
|
|
84
|
-
reject: (response: any, raw?: boolean | undefined) => import("selenium-webdriver").promise.Promise<unknown>;
|
|
85
|
-
}>;
|
|
86
|
-
remove: () => import("selenium-webdriver").promise.Promise<unknown>;
|
|
87
|
-
}>;
|
|
40
|
+
protected page: Page;
|
|
41
|
+
constructor(page: Page);
|
|
42
|
+
$form: Locator;
|
|
43
|
+
/** Locates a field with a dot separated identifier, e.g. "gatherings.0.units.1" */
|
|
44
|
+
$locate(path: string): Locator;
|
|
45
|
+
/** Locates a button for a field with a dot separated identifier, e.g. "gatherings.0.units.1" */
|
|
46
|
+
$locateButton(path: string, selector: string): Locator;
|
|
47
|
+
/** Locates some additional element for a field with a dot separated identifier, e.g. "gatherings.0.units.1" */
|
|
48
|
+
$locateAddition(path: string, selector: string): Locator;
|
|
88
49
|
createValidatorPO: (type: "error" | "warning") => {
|
|
89
|
-
|
|
90
|
-
$panel:
|
|
50
|
+
$all: Locator;
|
|
51
|
+
$panel: Locator;
|
|
91
52
|
};
|
|
92
53
|
errors: {
|
|
93
|
-
|
|
94
|
-
$panel:
|
|
54
|
+
$all: Locator;
|
|
55
|
+
$panel: Locator;
|
|
95
56
|
};
|
|
96
57
|
warnings: {
|
|
97
|
-
|
|
98
|
-
$panel:
|
|
58
|
+
$all: Locator;
|
|
59
|
+
$panel: Locator;
|
|
99
60
|
};
|
|
100
61
|
failedJobs: {
|
|
101
|
-
$container:
|
|
62
|
+
$container: Locator;
|
|
63
|
+
$errors: Locator;
|
|
64
|
+
};
|
|
65
|
+
$runningJobs: Locator;
|
|
66
|
+
$acknowledgeWarnings: Locator;
|
|
67
|
+
$blocker: Locator;
|
|
68
|
+
$mapFieldFullscreenMap: Locator;
|
|
69
|
+
getBooleanWidget(str: string): {
|
|
70
|
+
$container: Locator;
|
|
71
|
+
$true: Locator;
|
|
72
|
+
$false: Locator;
|
|
73
|
+
$undefined: Locator;
|
|
74
|
+
$active: Locator;
|
|
75
|
+
$nonactive: Locator;
|
|
76
|
+
};
|
|
77
|
+
$getInputWidget(str: string): Locator;
|
|
78
|
+
$getTextareaWidget(str: string): Locator;
|
|
79
|
+
$getEnumWidget(str: string): {
|
|
80
|
+
$container: Locator;
|
|
81
|
+
openEnums: () => Promise<void>;
|
|
82
|
+
$enumContainer: Locator;
|
|
83
|
+
$enums: Locator;
|
|
84
|
+
$input: Locator;
|
|
85
|
+
};
|
|
86
|
+
getDateWidget(str: string): {
|
|
87
|
+
$container: Locator;
|
|
88
|
+
$input: Locator;
|
|
89
|
+
buttons: {
|
|
90
|
+
$today: Locator;
|
|
91
|
+
$yesterday: Locator;
|
|
92
|
+
$same: Locator;
|
|
93
|
+
$date: Locator;
|
|
94
|
+
$time: Locator;
|
|
95
|
+
};
|
|
96
|
+
calendar: {
|
|
97
|
+
$today: Locator;
|
|
98
|
+
};
|
|
99
|
+
clock: {
|
|
100
|
+
"$01:00": Locator;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
$getFieldErrors(str: string): Locator;
|
|
104
|
+
getImageArrayField: (lajiFormLocator: string) => {
|
|
105
|
+
$container: Locator;
|
|
106
|
+
$imgContainers: Locator;
|
|
107
|
+
$imgs: Locator;
|
|
108
|
+
$imgLoading: Locator;
|
|
109
|
+
$imgRemoves: Locator;
|
|
110
|
+
$imgRemoveConfirmButton: (id: string) => Locator;
|
|
111
|
+
$dropzone: Locator;
|
|
112
|
+
$modal: Locator;
|
|
113
|
+
$addModal: Locator;
|
|
114
|
+
$modalClose: Locator;
|
|
115
|
+
$addModalCancel: Locator;
|
|
116
|
+
};
|
|
117
|
+
getTaxonAutosuggestWidget: (lajiFormLocator: string) => {
|
|
118
|
+
$input: Locator;
|
|
119
|
+
$suggestionsContainer: Locator;
|
|
120
|
+
$suggestions: Locator;
|
|
121
|
+
$getGlyph: (glyph: string) => Locator;
|
|
122
|
+
$suggestedGlyph: Locator;
|
|
123
|
+
$nonsuggestedGlyph: Locator;
|
|
124
|
+
$powerUserButton: Locator;
|
|
102
125
|
};
|
|
103
|
-
$acknowledgeWarnings: ElementFinder;
|
|
104
|
-
isBlocked: () => import("selenium-webdriver").promise.Promise<boolean>;
|
|
105
|
-
mockImageUpload: (lajiFormLocator: string) => Promise<{
|
|
106
|
-
resolve: () => Promise<void>;
|
|
107
|
-
remove: () => Promise<void>;
|
|
108
|
-
}>;
|
|
109
|
-
getBooleanWidget(str: string): BooleanWidgetPO;
|
|
110
|
-
$getInputWidget(str: string): ElementFinder;
|
|
111
|
-
$getTextareaWidget(str: string): ElementFinder;
|
|
112
|
-
$getEnumWidget(str: string): EnumWidgetPOI;
|
|
113
|
-
getDateWidget(str: string): DateWidgetPO;
|
|
114
|
-
$$getFieldErrors(str: string): ElementArrayFinder;
|
|
115
|
-
_getImageArrayField: (form: Form) => (lajiFormLocator: string) => ImageArrayFieldPOI;
|
|
116
|
-
getImageArrayField: (lajiFormLocator: string) => ImageArrayFieldPOI;
|
|
117
|
-
_getTaxonAutosuggestWidget: (form: Form) => (lajiFormLocator: string) => TaxonAutosuggestWidgetPOI;
|
|
118
|
-
getTaxonAutosuggestWidget: (lajiFormLocator: string) => TaxonAutosuggestWidgetPOI;
|
|
119
126
|
getScopeField: (lajiFormLocator: string) => {
|
|
120
|
-
$button:
|
|
121
|
-
|
|
127
|
+
$button: Locator;
|
|
128
|
+
$listItems: Locator;
|
|
129
|
+
modal: {
|
|
130
|
+
$container: Locator;
|
|
131
|
+
$close: Locator;
|
|
132
|
+
$loadingGroup: Locator;
|
|
133
|
+
$groupTitles: Locator;
|
|
134
|
+
$listItems: Locator;
|
|
135
|
+
};
|
|
122
136
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
$modalClose: ElementFinder;
|
|
135
|
-
}
|
|
136
|
-
export interface TaxonAutosuggestWidgetPOI {
|
|
137
|
-
$input: ElementFinder;
|
|
138
|
-
$suggestionsContainer: ElementFinder;
|
|
139
|
-
$$suggestions: ElementArrayFinder;
|
|
140
|
-
waitForSuggestionsToLoad: () => Promise<void>;
|
|
141
|
-
waitForGlyph: () => Promise<void>;
|
|
142
|
-
isSuggested: () => Promise<boolean>;
|
|
143
|
-
isNonsuggested: () => Promise<boolean>;
|
|
144
|
-
$powerUserButton: ElementFinder;
|
|
145
|
-
powerUserButtonIsActive: () => Promise<boolean>;
|
|
146
|
-
waitForPopoverToHide: () => Promise<void>;
|
|
147
|
-
}
|
|
148
|
-
export interface UnitListShorthandArrayFieldPOI {
|
|
149
|
-
$button: ElementFinder;
|
|
150
|
-
modal: {
|
|
151
|
-
$input: ElementFinder;
|
|
152
|
-
$addButton: ElementFinder;
|
|
137
|
+
getLocationChooser: (lajiFormLocator: string) => {
|
|
138
|
+
$button: Locator;
|
|
139
|
+
modal: {
|
|
140
|
+
$container: Locator;
|
|
141
|
+
map: MapPageObject;
|
|
142
|
+
};
|
|
143
|
+
peeker: {
|
|
144
|
+
$popover: Locator;
|
|
145
|
+
$map: Locator;
|
|
146
|
+
$markers: Locator;
|
|
147
|
+
};
|
|
153
148
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
149
|
+
getUnitListShorthandArrayField: (lajiFormLocator: string) => {
|
|
150
|
+
$button: Locator;
|
|
151
|
+
modal: {
|
|
152
|
+
$input: Locator;
|
|
153
|
+
$addButton: Locator;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
/** Draws a marker to the center of a laji-map rendered to the given locator. The locator defaults to "gatherings" */
|
|
157
|
+
putMarkerToMap(lajiFormLocator?: string): Promise<void>;
|
|
158
|
+
updateValue($input: Locator, value: string, blur?: boolean): Promise<void>;
|
|
159
|
+
$getShortHandWidget: (lajiFormLocator: string) => Locator;
|
|
160
|
+
getGeocoder: (lajiFormLocator?: string) => {
|
|
161
|
+
$btn: Locator;
|
|
162
|
+
$spinner: Locator;
|
|
163
|
+
};
|
|
164
|
+
getNamedPlaceChooser: () => {
|
|
165
|
+
select: {
|
|
166
|
+
$container: Locator;
|
|
167
|
+
openEnums: () => Promise<void>;
|
|
168
|
+
$enumContainer: Locator;
|
|
169
|
+
$enums: Locator;
|
|
170
|
+
$input: Locator;
|
|
171
|
+
};
|
|
172
|
+
mapPopup: {
|
|
173
|
+
$container: Locator;
|
|
174
|
+
$useBtn: Locator;
|
|
175
|
+
};
|
|
176
|
+
$alert: Locator;
|
|
177
|
+
$close: Locator;
|
|
160
178
|
};
|
|
161
|
-
$alert: ElementFinder;
|
|
162
|
-
$close: ElementFinder;
|
|
163
179
|
}
|
|
164
|
-
export declare
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
export declare class DemoPageForm extends Form {
|
|
181
|
+
props: DemoPageProps;
|
|
182
|
+
constructor(page: Page, params?: DemoPageProps);
|
|
183
|
+
initialize(beforeInit?: (form: DemoPageForm) => Promise<void>): Promise<void>;
|
|
184
|
+
e<T>(path: string): Promise<T>;
|
|
185
|
+
setState(state: any): Promise<unknown>;
|
|
186
|
+
getState(): Promise<Pick<LajiFormState, "formData">>;
|
|
187
|
+
submit(): Promise<void>;
|
|
188
|
+
submitOnlySchemaValidations(): Promise<unknown>;
|
|
189
|
+
getSubmittedData(): Promise<JSONSerializable>;
|
|
190
|
+
getChangedData(): Promise<JSONSerializable>;
|
|
191
|
+
getPropsData(): Promise<JSONSerializable>;
|
|
192
|
+
getMockStr: (path: string, query: any) => string;
|
|
193
|
+
setMockResponse(path: string, query?: any): Promise<Mock>;
|
|
194
|
+
createMockResponseQueue(path: string, query?: any): Promise<{
|
|
195
|
+
create: () => Promise<{
|
|
196
|
+
resolve: (response: any, raw?: boolean | undefined) => Promise<unknown>;
|
|
197
|
+
reject: (response: any, raw?: boolean | undefined) => Promise<unknown>;
|
|
198
|
+
}>;
|
|
199
|
+
remove: () => Promise<unknown>;
|
|
200
|
+
}>;
|
|
201
|
+
mockImageUpload: (lajiFormLocator: string) => Promise<{
|
|
202
|
+
resolve: () => Promise<void>;
|
|
203
|
+
remove: () => Promise<void>;
|
|
204
|
+
}>;
|
|
205
|
+
}
|
|
206
|
+
export declare function createForm(page: Page, props?: DemoPageProps, beforeInit?: (form: Form) => Promise<void>): Promise<DemoPageForm>;
|
|
182
207
|
export declare const filterUUIDs: (any: any) => any;
|
|
183
208
|
export declare const maybeJSONPointerToLocator: (pointer: string) => string;
|
|
209
|
+
export declare const getRemoveUnit: (page: Page) => (gatheringIdx: number, unitIdx: number) => Promise<void>;
|
|
184
210
|
export {};
|