@yomotech/view-toolkit 1.0.44 → 1.0.45
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/fesm2022/yomotech-view-toolkit-catalog.mjs +117 -4
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +785 -2148
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/yomotech-view-toolkit-catalog.d.ts +45 -5
- package/types/yomotech-view-toolkit.d.ts +158 -545
package/package.json
CHANGED
|
@@ -126,11 +126,13 @@ declare function assertFieldSettings(schema: Bag, fallback: string, option: Bag,
|
|
|
126
126
|
|
|
127
127
|
declare const TESTS_DIR = ".liveforge/tests";
|
|
128
128
|
declare const RESULTS_DIR = ".liveforge/results";
|
|
129
|
+
/** The app's test data, shared by its tests: { customer: { firstName: "Max" }, card: { number: "4242…" } } */
|
|
130
|
+
declare const TEST_DATA_FILE = ".liveforge/test-data.json";
|
|
129
131
|
declare const TEST_DEVICES: readonly ["phone", "tablet", "laptop", "desktop"];
|
|
130
132
|
declare const ORIENTATIONS: readonly ["portrait", "landscape"];
|
|
131
|
-
declare const STEP_KINDS: readonly ["open", "tap", "type", "pick", "press", "rotate", "device", "wait", "expect"];
|
|
133
|
+
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "expect"];
|
|
132
134
|
/** What an expect step can check - one of them per step. */
|
|
133
|
-
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame"];
|
|
135
|
+
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast"];
|
|
134
136
|
/** What has to stay inside the page frame (safe areas, top gap). */
|
|
135
137
|
declare const FRAME_PARTS: readonly ["keyboard", "dialog", "calendar", "list", "menu"];
|
|
136
138
|
declare const LIST_STATES: readonly ["open", "closed"];
|
|
@@ -153,15 +155,36 @@ interface TestExpect {
|
|
|
153
155
|
/** a button that writes real data is there and this flow may not press it (the runner's lock) */
|
|
154
156
|
blocked?: string;
|
|
155
157
|
inFrame?: typeof FRAME_PARTS[number];
|
|
158
|
+
/** the open page: its folder under pages/ ("sidemenu/books") */
|
|
159
|
+
page?: string;
|
|
160
|
+
/** the records the open list shows now (exactly / at least) */
|
|
161
|
+
records?: number;
|
|
162
|
+
recordsAtLeast?: number;
|
|
163
|
+
/** back with the X the list stands where it was left (records and scroll position before openRecord) */
|
|
164
|
+
samePlace?: true;
|
|
165
|
+
/** items in the cart (the header's count); "+1" = one more than at the flow's last cart check */
|
|
166
|
+
cartCount?: number | string;
|
|
167
|
+
/** a message shown to the user (its text or its translation key) */
|
|
168
|
+
toast?: string;
|
|
156
169
|
}
|
|
157
170
|
interface TestStep {
|
|
158
171
|
open?: string;
|
|
172
|
+
/** a menu entry by its caption key in Main (a new start: the page history is emptied) */
|
|
173
|
+
menu?: string;
|
|
159
174
|
tap?: string;
|
|
160
175
|
type?: string;
|
|
161
176
|
into?: string;
|
|
162
177
|
pick?: string;
|
|
163
178
|
in?: string;
|
|
164
179
|
press?: string;
|
|
180
|
+
/** pages to go on in the open list (swipe up / its end into view), 1-20 */
|
|
181
|
+
scroll?: number;
|
|
182
|
+
/** a record of the open list by its position (1 = first) or by its shown name - its link opens its page */
|
|
183
|
+
openRecord?: number | string;
|
|
184
|
+
/** the page X - back to the page before */
|
|
185
|
+
close?: true;
|
|
186
|
+
/** the cart in the header */
|
|
187
|
+
cart?: true;
|
|
165
188
|
rotate?: Orientation;
|
|
166
189
|
device?: string;
|
|
167
190
|
/** milliseconds */
|
|
@@ -238,8 +261,25 @@ declare function parseDevice(text: string): {
|
|
|
238
261
|
declare function flowDevices(flow: TestFlow): string[];
|
|
239
262
|
/** The kind of a step - the first step key it has. */
|
|
240
263
|
declare function stepKind(step: TestStep): string | null;
|
|
241
|
-
/** The
|
|
242
|
-
declare function
|
|
264
|
+
/** The test data a flow uses, per step: [{ step, ref: "customer.firstName" }]; ref without "data.". */
|
|
265
|
+
declare function testDataRefs(flow: any): {
|
|
266
|
+
step: number;
|
|
267
|
+
ref: string;
|
|
268
|
+
raw: string;
|
|
269
|
+
}[];
|
|
270
|
+
/**
|
|
271
|
+
* The flow with its test data put in: "{{data.customer.firstName}}" -> "Max"; a whole value that is one placeholder
|
|
272
|
+
* keeps the data's type (a number stays a number). Both runners call it before a run; missing lists what is not in data.
|
|
273
|
+
*/
|
|
274
|
+
declare function withTestData(flow: TestFlow, data: any): {
|
|
275
|
+
flow: TestFlow;
|
|
276
|
+
missing: string[];
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* The problems of a flow; an empty list means it can run. With the app's test data, a placeholder that names nothing
|
|
280
|
+
* in it is a problem too (dataUnknown); a placeholder that is no {{data.…}} is one always (dataRefInvalid).
|
|
281
|
+
*/
|
|
282
|
+
declare function checkTestFlow(flow: any, data?: any): TestProblem[];
|
|
243
283
|
|
|
244
284
|
/** The building blocks of the app settings in Main, in the order they are shown. */
|
|
245
285
|
declare const APP_SETTING_BLOCKS: readonly ["startPage", "login", "pagination", "terms", "menu"];
|
|
@@ -415,5 +455,5 @@ declare function appSettingsMenu(menu: any[], center: Bag | any, context?: {
|
|
|
415
455
|
signedIn?: boolean;
|
|
416
456
|
}): any[];
|
|
417
457
|
|
|
418
|
-
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, EXPECT_KINDS, FRAME_PARTS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NUMBER_STYLES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, RESULTS_DIR, RESULTS_KEEP, SETTING_MENU_TEXTS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DEVICES, TYPE_ALIASES, appSettingsMenu, assertFieldSettings, baseType, basicType, canonicalControl, checkAppSettings, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, defaultKeyboard, displaySettings, effectiveControl, effectiveFormat, flowDevices, keyboardFor, languageName, loginMethod, normalizeFormat, pageOf, paginationFor, parseDevice, readAppSettings, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, temporalPart, validateSettings, validationSettings };
|
|
458
|
+
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, EXPECT_KINDS, FRAME_PARTS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NUMBER_STYLES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, RESULTS_DIR, RESULTS_KEEP, SETTING_MENU_TEXTS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TYPE_ALIASES, appSettingsMenu, assertFieldSettings, baseType, basicType, canonicalControl, checkAppSettings, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, defaultKeyboard, displaySettings, effectiveControl, effectiveFormat, flowDevices, keyboardFor, languageName, loginMethod, normalizeFormat, pageOf, paginationFor, parseDevice, readAppSettings, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, temporalPart, testDataRefs, validateSettings, validationSettings, withTestData };
|
|
419
459
|
export type { AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag, DocumentKind, FlowResult, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep };
|