@fluxenginejp/sftest 1.4.1 → 2.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/dist/cli/sftest.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -1
- package/dist/pages/common/DataImportWizard.js +4 -2
- package/dist/pages/common/ElementStates.d.ts +1 -1
- package/dist/pages/common/ElementStates.js +1 -1
- package/dist/pages/common/ListViewPage.js +7 -4
- package/dist/pages/common/RecordData.js +1 -1
- package/dist/pages/common/RecordDetailPage.d.ts +4 -3
- package/dist/pages/common/RecordDetailPage.js +11 -6
- package/dist/pages/common/RecordFields.d.ts +54 -13
- package/dist/pages/common/RecordFields.js +124 -34
- package/dist/pages/common/RecordFormDialog.js +1 -1
- package/dist/pages/common/ScreenDialog.d.ts +27 -0
- package/dist/pages/common/ScreenDialog.js +71 -2
- package/dist/pages/common/fieldSections.d.ts +1 -1
- package/dist/pages/common/fieldSections.js +3 -3
- package/dist/steps/common/apex.steps.js +12 -8
- package/dist/steps/common/common.steps.js +7 -7
- package/dist/steps/common/data.steps.d.ts +1 -0
- package/dist/steps/common/data.steps.js +49 -0
- package/dist/steps/common/dialog.steps.js +8 -0
- package/dist/steps/common/file.steps.js +5 -0
- package/dist/steps/common/instance.steps.d.ts +1 -0
- package/dist/steps/common/instance.steps.js +115 -0
- package/dist/steps/common/variable.steps.d.ts +1 -0
- package/dist/steps/common/variable.steps.js +76 -0
- package/dist/support/FileDownloads.d.ts +9 -0
- package/dist/support/FileDownloads.js +12 -0
- package/dist/support/apexBatch.d.ts +11 -0
- package/dist/support/apexBatch.js +6 -4
- package/dist/support/csvInsert.d.ts +77 -0
- package/dist/support/csvInsert.js +446 -0
- package/dist/support/dataRestore.d.ts +201 -0
- package/dist/support/dataRestore.js +449 -0
- package/dist/support/dateValues.d.ts +54 -0
- package/dist/support/dateValues.js +159 -0
- package/dist/support/fixtures.d.ts +83 -0
- package/dist/support/fixtures.js +84 -0
- package/dist/support/globalSetup.js +3 -0
- package/dist/support/metadataCache.d.ts +21 -0
- package/dist/support/metadataCache.js +87 -0
- package/dist/support/outputPaths.d.ts +8 -0
- package/dist/support/outputPaths.js +12 -1
- package/dist/support/period.d.ts +30 -0
- package/dist/support/period.js +191 -0
- package/dist/support/playwrightConfig.d.ts +12 -1
- package/dist/support/playwrightConfig.js +7 -1
- package/dist/support/scenarioFunctions.d.ts +308 -0
- package/dist/support/scenarioFunctions.js +727 -0
- package/dist/support/session.js +3 -0
- package/dist/support/settings.d.ts +44 -3
- package/dist/support/settings.js +100 -13
- package/dist/support/sf.d.ts +56 -1
- package/dist/support/sf.js +169 -11
- package/dist/support/sobjects.d.ts +29 -0
- package/dist/support/sobjects.js +53 -3
- package/dist/support/soqlLabels.d.ts +60 -0
- package/dist/support/soqlLabels.js +304 -0
- package/dist/support/soqlQuery.d.ts +205 -0
- package/dist/support/soqlQuery.js +577 -0
- package/dist/support/standardFunctions.d.ts +76 -0
- package/dist/support/standardFunctions.js +269 -0
- package/dist/support/stepArguments.d.ts +1 -1
- package/dist/support/valueComparison.d.ts +22 -0
- package/dist/support/valueComparison.js +119 -0
- package/dist/support/variables.d.ts +225 -0
- package/dist/support/variables.js +720 -0
- package/docs/CHANGELOG.md +72 -4
- package/docs/EXTENSIONS.html +186 -6
- package/docs/SPEC.html +2368 -1281
- package/package.json +2 -1
- package/readme.md +9 -2
- package/scripts/backup-account.bat +1 -1
- package/sftest.config.jsonc +24 -3
- package/templates/functions/customFunctions.ts +22 -0
- package/templates/playwright.config.ts +3 -0
|
@@ -29,10 +29,15 @@ import { CreatedRecords } from './createdRecords';
|
|
|
29
29
|
import { EvidenceId } from './evidenceId';
|
|
30
30
|
import { FileDownloads } from './FileDownloads';
|
|
31
31
|
import { UploadErrors } from './UploadErrors';
|
|
32
|
+
import { ScenarioVariables } from './variables';
|
|
33
|
+
import { CustomFunctions, ScenarioFunctions } from './scenarioFunctions';
|
|
34
|
+
import { DataRestores } from './dataRestore';
|
|
32
35
|
/** 設定(playwright.config.ts の use)で指定する sfTest のオプション。 */
|
|
33
36
|
export interface SfTestOptions {
|
|
34
37
|
/** 標準と異なる画面のページクラス(キーはオブジェクトの表示ラベルまたは API 名)。sfTestConfig の customPages から設定される。 */
|
|
35
38
|
customPages: Record<string, RecordPageClass>;
|
|
39
|
+
/** シナリオから呼び出す利用者の関数(キーは名前。最後に __c を付ける)。sfTestConfig の functions から設定される(20261020-001)。 */
|
|
40
|
+
customFunctions: CustomFunctions;
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* sfTest のフィクスチャを追加した test。
|
|
@@ -61,6 +66,9 @@ export declare const test: import("@playwright/test").TestType<import("@playwrig
|
|
|
61
66
|
recordFormDialog: RecordFormDialog;
|
|
62
67
|
evidence: Evidence;
|
|
63
68
|
inAppGuidance: void;
|
|
69
|
+
scenarioVariables: ScenarioVariables;
|
|
70
|
+
scenarioFunctions: ScenarioFunctions;
|
|
71
|
+
dataRestores: DataRestores;
|
|
64
72
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>;
|
|
65
73
|
/** sfTest のフィクスチャを使うステップ定義・フックの登録関数。 */
|
|
66
74
|
declare const bdd: {
|
|
@@ -86,6 +94,9 @@ declare const bdd: {
|
|
|
86
94
|
recordFormDialog: RecordFormDialog;
|
|
87
95
|
evidence: Evidence;
|
|
88
96
|
inAppGuidance: void;
|
|
97
|
+
scenarioVariables: ScenarioVariables;
|
|
98
|
+
scenarioFunctions: ScenarioFunctions;
|
|
99
|
+
dataRestores: DataRestores;
|
|
89
100
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
90
101
|
When: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
91
102
|
evidenceId: EvidenceId;
|
|
@@ -109,6 +120,9 @@ declare const bdd: {
|
|
|
109
120
|
recordFormDialog: RecordFormDialog;
|
|
110
121
|
evidence: Evidence;
|
|
111
122
|
inAppGuidance: void;
|
|
123
|
+
scenarioVariables: ScenarioVariables;
|
|
124
|
+
scenarioFunctions: ScenarioFunctions;
|
|
125
|
+
dataRestores: DataRestores;
|
|
112
126
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
113
127
|
Then: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
114
128
|
evidenceId: EvidenceId;
|
|
@@ -132,6 +146,9 @@ declare const bdd: {
|
|
|
132
146
|
recordFormDialog: RecordFormDialog;
|
|
133
147
|
evidence: Evidence;
|
|
134
148
|
inAppGuidance: void;
|
|
149
|
+
scenarioVariables: ScenarioVariables;
|
|
150
|
+
scenarioFunctions: ScenarioFunctions;
|
|
151
|
+
dataRestores: DataRestores;
|
|
135
152
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
136
153
|
Step: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
137
154
|
evidenceId: EvidenceId;
|
|
@@ -155,6 +172,9 @@ declare const bdd: {
|
|
|
155
172
|
recordFormDialog: RecordFormDialog;
|
|
156
173
|
evidence: Evidence;
|
|
157
174
|
inAppGuidance: void;
|
|
175
|
+
scenarioVariables: ScenarioVariables;
|
|
176
|
+
scenarioFunctions: ScenarioFunctions;
|
|
177
|
+
dataRestores: DataRestores;
|
|
158
178
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
159
179
|
BeforeAll: (...args: [(fixtures: import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
160
180
|
name?: string;
|
|
@@ -188,6 +208,9 @@ declare const bdd: {
|
|
|
188
208
|
recordFormDialog: RecordFormDialog;
|
|
189
209
|
evidence: Evidence;
|
|
190
210
|
inAppGuidance: void;
|
|
211
|
+
scenarioVariables: ScenarioVariables;
|
|
212
|
+
scenarioFunctions: ScenarioFunctions;
|
|
213
|
+
dataRestores: DataRestores;
|
|
191
214
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
192
215
|
evidenceId: EvidenceId;
|
|
193
216
|
evidenceDir: string;
|
|
@@ -210,6 +233,9 @@ declare const bdd: {
|
|
|
210
233
|
recordFormDialog: RecordFormDialog;
|
|
211
234
|
evidence: Evidence;
|
|
212
235
|
inAppGuidance: void;
|
|
236
|
+
scenarioVariables: ScenarioVariables;
|
|
237
|
+
scenarioFunctions: ScenarioFunctions;
|
|
238
|
+
dataRestores: DataRestores;
|
|
213
239
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
214
240
|
name?: string;
|
|
215
241
|
tags?: string;
|
|
@@ -236,6 +262,9 @@ declare const bdd: {
|
|
|
236
262
|
recordFormDialog: RecordFormDialog;
|
|
237
263
|
evidence: Evidence;
|
|
238
264
|
inAppGuidance: void;
|
|
265
|
+
scenarioVariables: ScenarioVariables;
|
|
266
|
+
scenarioFunctions: ScenarioFunctions;
|
|
267
|
+
dataRestores: DataRestores;
|
|
239
268
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
240
269
|
After: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
241
270
|
evidenceId: EvidenceId;
|
|
@@ -259,6 +288,9 @@ declare const bdd: {
|
|
|
259
288
|
recordFormDialog: RecordFormDialog;
|
|
260
289
|
evidence: Evidence;
|
|
261
290
|
inAppGuidance: void;
|
|
291
|
+
scenarioVariables: ScenarioVariables;
|
|
292
|
+
scenarioFunctions: ScenarioFunctions;
|
|
293
|
+
dataRestores: DataRestores;
|
|
262
294
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
263
295
|
evidenceId: EvidenceId;
|
|
264
296
|
evidenceDir: string;
|
|
@@ -281,6 +313,9 @@ declare const bdd: {
|
|
|
281
313
|
recordFormDialog: RecordFormDialog;
|
|
282
314
|
evidence: Evidence;
|
|
283
315
|
inAppGuidance: void;
|
|
316
|
+
scenarioVariables: ScenarioVariables;
|
|
317
|
+
scenarioFunctions: ScenarioFunctions;
|
|
318
|
+
dataRestores: DataRestores;
|
|
284
319
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
285
320
|
name?: string;
|
|
286
321
|
tags?: string;
|
|
@@ -307,6 +342,9 @@ declare const bdd: {
|
|
|
307
342
|
recordFormDialog: RecordFormDialog;
|
|
308
343
|
evidence: Evidence;
|
|
309
344
|
inAppGuidance: void;
|
|
345
|
+
scenarioVariables: ScenarioVariables;
|
|
346
|
+
scenarioFunctions: ScenarioFunctions;
|
|
347
|
+
dataRestores: DataRestores;
|
|
310
348
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
311
349
|
BeforeWorker: (...args: [(fixtures: import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
312
350
|
name?: string;
|
|
@@ -340,6 +378,9 @@ declare const bdd: {
|
|
|
340
378
|
recordFormDialog: RecordFormDialog;
|
|
341
379
|
evidence: Evidence;
|
|
342
380
|
inAppGuidance: void;
|
|
381
|
+
scenarioVariables: ScenarioVariables;
|
|
382
|
+
scenarioFunctions: ScenarioFunctions;
|
|
383
|
+
dataRestores: DataRestores;
|
|
343
384
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
344
385
|
evidenceId: EvidenceId;
|
|
345
386
|
evidenceDir: string;
|
|
@@ -362,6 +403,9 @@ declare const bdd: {
|
|
|
362
403
|
recordFormDialog: RecordFormDialog;
|
|
363
404
|
evidence: Evidence;
|
|
364
405
|
inAppGuidance: void;
|
|
406
|
+
scenarioVariables: ScenarioVariables;
|
|
407
|
+
scenarioFunctions: ScenarioFunctions;
|
|
408
|
+
dataRestores: DataRestores;
|
|
365
409
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
366
410
|
name?: string;
|
|
367
411
|
tags?: string;
|
|
@@ -388,6 +432,9 @@ declare const bdd: {
|
|
|
388
432
|
recordFormDialog: RecordFormDialog;
|
|
389
433
|
evidence: Evidence;
|
|
390
434
|
inAppGuidance: void;
|
|
435
|
+
scenarioVariables: ScenarioVariables;
|
|
436
|
+
scenarioFunctions: ScenarioFunctions;
|
|
437
|
+
dataRestores: DataRestores;
|
|
391
438
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
392
439
|
AfterScenario: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
393
440
|
evidenceId: EvidenceId;
|
|
@@ -411,6 +458,9 @@ declare const bdd: {
|
|
|
411
458
|
recordFormDialog: RecordFormDialog;
|
|
412
459
|
evidence: Evidence;
|
|
413
460
|
inAppGuidance: void;
|
|
461
|
+
scenarioVariables: ScenarioVariables;
|
|
462
|
+
scenarioFunctions: ScenarioFunctions;
|
|
463
|
+
dataRestores: DataRestores;
|
|
414
464
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
415
465
|
evidenceId: EvidenceId;
|
|
416
466
|
evidenceDir: string;
|
|
@@ -433,6 +483,9 @@ declare const bdd: {
|
|
|
433
483
|
recordFormDialog: RecordFormDialog;
|
|
434
484
|
evidence: Evidence;
|
|
435
485
|
inAppGuidance: void;
|
|
486
|
+
scenarioVariables: ScenarioVariables;
|
|
487
|
+
scenarioFunctions: ScenarioFunctions;
|
|
488
|
+
dataRestores: DataRestores;
|
|
436
489
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
437
490
|
name?: string;
|
|
438
491
|
tags?: string;
|
|
@@ -459,6 +512,9 @@ declare const bdd: {
|
|
|
459
512
|
recordFormDialog: RecordFormDialog;
|
|
460
513
|
evidence: Evidence;
|
|
461
514
|
inAppGuidance: void;
|
|
515
|
+
scenarioVariables: ScenarioVariables;
|
|
516
|
+
scenarioFunctions: ScenarioFunctions;
|
|
517
|
+
dataRestores: DataRestores;
|
|
462
518
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
463
519
|
BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
464
520
|
evidenceId: EvidenceId;
|
|
@@ -482,6 +538,9 @@ declare const bdd: {
|
|
|
482
538
|
recordFormDialog: RecordFormDialog;
|
|
483
539
|
evidence: Evidence;
|
|
484
540
|
inAppGuidance: void;
|
|
541
|
+
scenarioVariables: ScenarioVariables;
|
|
542
|
+
scenarioFunctions: ScenarioFunctions;
|
|
543
|
+
dataRestores: DataRestores;
|
|
485
544
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
486
545
|
evidenceId: EvidenceId;
|
|
487
546
|
evidenceDir: string;
|
|
@@ -504,6 +563,9 @@ declare const bdd: {
|
|
|
504
563
|
recordFormDialog: RecordFormDialog;
|
|
505
564
|
evidence: Evidence;
|
|
506
565
|
inAppGuidance: void;
|
|
566
|
+
scenarioVariables: ScenarioVariables;
|
|
567
|
+
scenarioFunctions: ScenarioFunctions;
|
|
568
|
+
dataRestores: DataRestores;
|
|
507
569
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
508
570
|
name?: string;
|
|
509
571
|
tags?: string;
|
|
@@ -530,6 +592,9 @@ declare const bdd: {
|
|
|
530
592
|
recordFormDialog: RecordFormDialog;
|
|
531
593
|
evidence: Evidence;
|
|
532
594
|
inAppGuidance: void;
|
|
595
|
+
scenarioVariables: ScenarioVariables;
|
|
596
|
+
scenarioFunctions: ScenarioFunctions;
|
|
597
|
+
dataRestores: DataRestores;
|
|
533
598
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
534
599
|
AfterStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
535
600
|
evidenceId: EvidenceId;
|
|
@@ -553,6 +618,9 @@ declare const bdd: {
|
|
|
553
618
|
recordFormDialog: RecordFormDialog;
|
|
554
619
|
evidence: Evidence;
|
|
555
620
|
inAppGuidance: void;
|
|
621
|
+
scenarioVariables: ScenarioVariables;
|
|
622
|
+
scenarioFunctions: ScenarioFunctions;
|
|
623
|
+
dataRestores: DataRestores;
|
|
556
624
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
557
625
|
evidenceId: EvidenceId;
|
|
558
626
|
evidenceDir: string;
|
|
@@ -575,6 +643,9 @@ declare const bdd: {
|
|
|
575
643
|
recordFormDialog: RecordFormDialog;
|
|
576
644
|
evidence: Evidence;
|
|
577
645
|
inAppGuidance: void;
|
|
646
|
+
scenarioVariables: ScenarioVariables;
|
|
647
|
+
scenarioFunctions: ScenarioFunctions;
|
|
648
|
+
dataRestores: DataRestores;
|
|
578
649
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
579
650
|
name?: string;
|
|
580
651
|
tags?: string;
|
|
@@ -601,6 +672,9 @@ declare const bdd: {
|
|
|
601
672
|
recordFormDialog: RecordFormDialog;
|
|
602
673
|
evidence: Evidence;
|
|
603
674
|
inAppGuidance: void;
|
|
675
|
+
scenarioVariables: ScenarioVariables;
|
|
676
|
+
scenarioFunctions: ScenarioFunctions;
|
|
677
|
+
dataRestores: DataRestores;
|
|
604
678
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
605
679
|
};
|
|
606
680
|
export declare const BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
@@ -625,6 +699,9 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
625
699
|
recordFormDialog: RecordFormDialog;
|
|
626
700
|
evidence: Evidence;
|
|
627
701
|
inAppGuidance: void;
|
|
702
|
+
scenarioVariables: ScenarioVariables;
|
|
703
|
+
scenarioFunctions: ScenarioFunctions;
|
|
704
|
+
dataRestores: DataRestores;
|
|
628
705
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [string, (this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
629
706
|
evidenceId: EvidenceId;
|
|
630
707
|
evidenceDir: string;
|
|
@@ -647,6 +724,9 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
647
724
|
recordFormDialog: RecordFormDialog;
|
|
648
725
|
evidence: Evidence;
|
|
649
726
|
inAppGuidance: void;
|
|
727
|
+
scenarioVariables: ScenarioVariables;
|
|
728
|
+
scenarioFunctions: ScenarioFunctions;
|
|
729
|
+
dataRestores: DataRestores;
|
|
650
730
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
651
731
|
name?: string;
|
|
652
732
|
tags?: string;
|
|
@@ -673,6 +753,9 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
673
753
|
recordFormDialog: RecordFormDialog;
|
|
674
754
|
evidence: Evidence;
|
|
675
755
|
inAppGuidance: void;
|
|
756
|
+
scenarioVariables: ScenarioVariables;
|
|
757
|
+
scenarioFunctions: ScenarioFunctions;
|
|
758
|
+
dataRestores: DataRestores;
|
|
676
759
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
677
760
|
export declare const Given: typeof bdd.Given;
|
|
678
761
|
export declare const When: typeof bdd.When;
|
package/dist/support/fixtures.js
CHANGED
|
@@ -35,6 +35,9 @@ const UploadErrors_1 = require("./UploadErrors");
|
|
|
35
35
|
const mismatch_1 = require("./mismatch");
|
|
36
36
|
const executionControl_1 = require("./executionControl");
|
|
37
37
|
const startupTiming_1 = require("./startupTiming");
|
|
38
|
+
const variables_1 = require("./variables");
|
|
39
|
+
const scenarioFunctions_1 = require("./scenarioFunctions");
|
|
40
|
+
const dataRestore_1 = require("./dataRestore");
|
|
38
41
|
// SFTEST_STARTUP_TIMING=1 の場合、ワーカー以外のプロセス(BDD の生成・テストの探索)とワーカー(シナリオの実行の準備)がステップ定義を読み込んだ時点を表示する。
|
|
39
42
|
(0, startupTiming_1.startupNote)(process.env.TEST_WORKER_INDEX ? 'ステップ定義の読み込み(ワーカーの準備)' : 'ステップ定義の読み込み(BDD の生成・テストの探索)');
|
|
40
43
|
/**
|
|
@@ -91,6 +94,42 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
91
94
|
],
|
|
92
95
|
/** 標準と異なる画面のページクラス。設定で指定されていなければ空(すべて共通の RecordPage で操作する)。 */
|
|
93
96
|
customPages: [{}, { option: true }],
|
|
97
|
+
/** 利用者の関数。設定で指定されていなければ空(標準の関数だけを使える)。 */
|
|
98
|
+
customFunctions: [{}, { option: true }],
|
|
99
|
+
/**
|
|
100
|
+
* シナリオの変数(20261020-001)。すべてのシナリオで作り(auto)、ステップの引数と表の {名前} の置き換えに使う。
|
|
101
|
+
*
|
|
102
|
+
* 置き換えは、ステップがこのフィクスチャを使わなくても行うため、シナリオの TestInfo に結び付けて登録する(support/variables.ts)。
|
|
103
|
+
* シナリオの終わりに捨て、別のシナリオへ引き継がない。
|
|
104
|
+
*/
|
|
105
|
+
scenarioVariables: [
|
|
106
|
+
async ({}, use, testInfo) => {
|
|
107
|
+
const variables = new variables_1.ScenarioVariables();
|
|
108
|
+
(0, variables_1.registerScenarioVariables)(testInfo, variables);
|
|
109
|
+
await use(variables);
|
|
110
|
+
},
|
|
111
|
+
{ auto: true },
|
|
112
|
+
],
|
|
113
|
+
/**
|
|
114
|
+
* 標準の関数と利用者の関数の呼び出し。クラスのインスタンス(名前を付けて作ったものを含む)を、このシナリオの間だけ保持する。
|
|
115
|
+
*
|
|
116
|
+
* {名前::引数}(既定のメソッドの呼び出し)と {関数名(…)}(20261022-005)の置き換えに使うため、すべてのシナリオで作り(auto)、
|
|
117
|
+
* シナリオの変数と結び付ける(20261021-001・20261021-002)。
|
|
118
|
+
*/
|
|
119
|
+
scenarioFunctions: [
|
|
120
|
+
async ({ customFunctions, scenarioVariables }, use) => {
|
|
121
|
+
const functions = new scenarioFunctions_1.ScenarioFunctions(customFunctions);
|
|
122
|
+
scenarioVariables.setDefaultMethodCaller(async (ownerName, argument, usage) => (await functions.callDefault(ownerName, argument, usage)).value);
|
|
123
|
+
scenarioVariables.setFunctionCaller({
|
|
124
|
+
canCall: (functionName) => functions.canCall(functionName),
|
|
125
|
+
call: async (functionName, values, usage) => (await functions.callPositional(functionName, values, usage)).value,
|
|
126
|
+
isClass: (className) => functions.isClass(className),
|
|
127
|
+
callOnNew: (className, values, member, usage) => functions.callOnNew(className, values, member, usage),
|
|
128
|
+
});
|
|
129
|
+
await use(functions);
|
|
130
|
+
},
|
|
131
|
+
{ auto: true },
|
|
132
|
+
],
|
|
94
133
|
/** エビデンス名の先頭に付ける ID(「ID "…"」のステップで設定する)。 */
|
|
95
134
|
evidenceId: async ({}, use) => { await use(new evidenceId_1.EvidenceId()); },
|
|
96
135
|
/** シナリオのエビデンスのファイルを保存するフォルダ(results/evidence/<実行日時>/<機能ファイル名>/<シナリオ名>)。 */
|
|
@@ -103,6 +142,12 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
103
142
|
*/
|
|
104
143
|
createdRecords: async ({ $tags }, use, testInfo) => {
|
|
105
144
|
const createdRecords = new createdRecords_1.CreatedRecords();
|
|
145
|
+
if ($tags.includes(createdRecords_1.CLEANUP_TAG)) {
|
|
146
|
+
// @片付け は非推奨とした(20261021-003、PO の決定)。動きは変えず、レポートと実行中の表示で、移行を案内する。
|
|
147
|
+
const warning = `${createdRecords_1.CLEANUP_TAG} は非推奨です。次のメジャーの版で廃止する予定です。「"<オブジェクト>" の "<条件>" の状態を記憶し、シナリオの終わりに戻す」に書き換えてください(仕様書「データを記憶して戻す」)`;
|
|
148
|
+
testInfo.annotations.push({ type: '警告', description: warning });
|
|
149
|
+
process.stdout.write(` 警告: ${warning}\n`);
|
|
150
|
+
}
|
|
106
151
|
await use(createdRecords);
|
|
107
152
|
if (!$tags.includes(createdRecords_1.CLEANUP_TAG))
|
|
108
153
|
return;
|
|
@@ -117,6 +162,24 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
117
162
|
throw new executionControl_1.ExecutionFailure('runtime-error', `テストデータの片付けに失敗しました: ${failed.map((r) => `${r.sobject} ${r.id}`).join(', ')}`);
|
|
118
163
|
});
|
|
119
164
|
},
|
|
165
|
+
/**
|
|
166
|
+
* 「"…" の "…" の状態を記憶し、シナリオの終わりに戻す」で記憶したデータを持ち、シナリオの終わり(失敗した場合も)に戻す(20261021-003)。
|
|
167
|
+
*
|
|
168
|
+
* 戻した結果をレポートに添付し、戻せなかったレコードがある場合は、シナリオを失敗にする(実行時エラー)。
|
|
169
|
+
* @片付け の削除(createdRecords)より先に行うため、createdRecords を使う(フィクスチャは使う側から先に片付けられる)。
|
|
170
|
+
*/
|
|
171
|
+
dataRestores: async ({ createdRecords: _createdRecords }, use, testInfo) => {
|
|
172
|
+
const restores = new dataRestore_1.DataRestores();
|
|
173
|
+
await use(restores);
|
|
174
|
+
if (restores.isEmpty)
|
|
175
|
+
return;
|
|
176
|
+
const outcome = restores.restoreAll();
|
|
177
|
+
await testInfo.attach(dataRestore_1.DATA_RESTORE_CLASS, { body: outcome.lines.join('\n'), contentType: 'text/plain' });
|
|
178
|
+
(0, executionControl_1.runRequired)('scenario-teardown', () => {
|
|
179
|
+
if (outcome.failures.length)
|
|
180
|
+
throw new executionControl_1.ExecutionFailure('runtime-error', `データを元に戻せませんでした:\n${outcome.failures.join('\n')}`);
|
|
181
|
+
});
|
|
182
|
+
},
|
|
120
183
|
/**
|
|
121
184
|
* 保存エラー(入力規則など)を記録する。
|
|
122
185
|
*
|
|
@@ -249,9 +312,20 @@ exports.StandardThen = controlledDefinition(bdd.Then, false);
|
|
|
249
312
|
* ステップの定義の位置は、この関数の行として登録される(元の例外の呼び出し履歴には利用者の行が残る)。
|
|
250
313
|
*/
|
|
251
314
|
exports.Then = controlledDefinition(bdd.Then, true);
|
|
315
|
+
/**
|
|
316
|
+
* ステップを呼ぶ前に置き換えず、ステップ自身が置き換える引数(ステップの文言 → 文言の引数の位置。0 から。20261023-009)。
|
|
317
|
+
* インスタンスを作るステップの値 {クラス名(…)} と、関数を実行するステップの {…} は、置き換えると戻り値の文字列になってしまうため、ステップが読む。
|
|
318
|
+
*/
|
|
319
|
+
const RAW_ARGUMENT_STEPS = {
|
|
320
|
+
'インスタンス {string} を {string} で作る': [1],
|
|
321
|
+
'関数 {string} を実行する': [0],
|
|
322
|
+
};
|
|
252
323
|
/**
|
|
253
324
|
* 登録関数を包み、利用者の関数のfixture検出・引数数を維持して共通方針へ接続する。
|
|
254
325
|
*
|
|
326
|
+
* ステップの関数を呼ぶ直前に、引数と表の {名前} をシナリオの変数の値に置き換える(20261020-001。標準・利用者のすべてのステップが対象)。
|
|
327
|
+
* 置き換えた場合は、置き換えた後の引数と表をレポートに添付する。置き換えの誤りはシナリオ不正として、ステップの失敗と同じ方針で扱う。
|
|
328
|
+
*
|
|
255
329
|
* @param define - playwright-bddの登録関数。
|
|
256
330
|
* @param acceptsExpectNg - 素のexpectの失敗をNGとして受け取る既存の互換指定。方針の切替ではない。
|
|
257
331
|
* @returns 元の登録関数と同じ型の登録関数。
|
|
@@ -259,8 +333,18 @@ exports.Then = controlledDefinition(bdd.Then, true);
|
|
|
259
333
|
function controlledDefinition(define, acceptsExpectNg) {
|
|
260
334
|
return ((...args) => {
|
|
261
335
|
const fn = args[args.length - 1];
|
|
336
|
+
const rawIndexes = typeof args[0] === 'string' ? (RAW_ARGUMENT_STEPS[args[0]] ?? []) : [];
|
|
262
337
|
const wrapped = async function (...fnArgs) {
|
|
263
338
|
await (0, executionControl_1.runControlled)('step', async () => {
|
|
339
|
+
// 1つ目の引数はフィクスチャ。2つ目以降(ステップの文言の引数と表)を置き換える。
|
|
340
|
+
const testInfo = exports.test.info();
|
|
341
|
+
const variables = (0, variables_1.scenarioVariablesOf)(testInfo);
|
|
342
|
+
if (variables) {
|
|
343
|
+
const expanded = await (0, variables_1.expandStepArguments)(variables, fnArgs.slice(1), rawIndexes);
|
|
344
|
+
fnArgs = [fnArgs[0], ...expanded.args];
|
|
345
|
+
if (expanded.report)
|
|
346
|
+
await testInfo.attach('変数の置き換え', { body: expanded.report, contentType: 'text/plain' });
|
|
347
|
+
}
|
|
264
348
|
try {
|
|
265
349
|
await fn.apply(this, fnArgs);
|
|
266
350
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = globalSetup;
|
|
4
4
|
const session_1 = require("./session");
|
|
5
5
|
const sf_1 = require("./sf");
|
|
6
|
+
const metadataCache_1 = require("./metadataCache");
|
|
6
7
|
const startupTiming_1 = require("./startupTiming");
|
|
7
8
|
const executionControl_1 = require("./executionControl");
|
|
8
9
|
/**
|
|
@@ -21,6 +22,8 @@ async function globalSetup(config) {
|
|
|
21
22
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', 'SF_BASE_URL が設定されていません。プロジェクト直下の .env に書いてください');
|
|
22
23
|
// 今回の実行の ID を決める。強制終了などで残った前回の接続情報(組織や CLI のユーザが今と異なる可能性がある)は使わない。
|
|
23
24
|
(0, sf_1.startConnectionRun)();
|
|
25
|
+
// 前回の実行で残ったメタデータのキャッシュは使わない(実行の ID でも区別するが、開始時に消しておく。20261021-005)。
|
|
26
|
+
(0, metadataCache_1.clearMetadataCache)();
|
|
24
27
|
(0, startupTiming_1.startStartupClock)();
|
|
25
28
|
(0, startupTiming_1.startupNote)('前処理(ログイン)の開始');
|
|
26
29
|
try {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* キャッシュのフォルダの絶対パスを返す。
|
|
3
|
+
*
|
|
4
|
+
* @returns 出力の基準フォルダの .auth/metadata。
|
|
5
|
+
*/
|
|
6
|
+
export declare function metadataCacheDir(): string;
|
|
7
|
+
/**
|
|
8
|
+
* メタデータをキャッシュから返す。なければ取得し、このプロセスと、今回の実行のほかのプロセスのために保存する。
|
|
9
|
+
*
|
|
10
|
+
* 実行の ID がない場合(テスト全体の前処理を通らない呼び出し)は、このプロセスのメモリにだけ持つ。
|
|
11
|
+
* ファイルは一時ファイルに書いてから名前を変えるため、ほかのプロセスが書きかけのファイルを読むことはない。
|
|
12
|
+
*
|
|
13
|
+
* @param key - キャッシュのキー。メタデータの種類とオブジェクトを区別する(例: describe-Account)。
|
|
14
|
+
* @param fetch - キャッシュにない場合に、メタデータを取得する処理。
|
|
15
|
+
* @returns メタデータ。
|
|
16
|
+
*/
|
|
17
|
+
export declare function cachedMetadata<T>(key: string, fetch: () => T): T;
|
|
18
|
+
/**
|
|
19
|
+
* キャッシュを消す(このプロセスのメモリと、ファイル)。テスト全体の開始時と終了時に呼ぶ。
|
|
20
|
+
*/
|
|
21
|
+
export declare function clearMetadataCache(): void;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.metadataCacheDir = metadataCacheDir;
|
|
7
|
+
exports.cachedMetadata = cachedMetadata;
|
|
8
|
+
exports.clearMetadataCache = clearMetadataCache;
|
|
9
|
+
/**
|
|
10
|
+
* Salesforce のメタデータ(オブジェクトの一覧・オブジェクトの情報(describe))を、テストの実行全体でキャッシュする(20261021-005)。
|
|
11
|
+
*
|
|
12
|
+
* メタデータは、1回のテストの実行の中では変わらない(2026-10-21、PO の決定)。そのため、最初に取得したものを、シナリオ・機能・
|
|
13
|
+
* シナリオを実行するプロセスをまたいで使う。プロセスの中ではメモリに持ち、プロセスの間ではファイル(出力の基準フォルダの .auth/metadata/)で共有する。
|
|
14
|
+
* ファイルには実行ごとの ID(support/sf.ts の接続情報と同じ SFTEST_CONNECTION_ID)を付け、同じ実行のものだけを読む(強制終了などで残った前回のファイルは使わない)。
|
|
15
|
+
* キャッシュは、テスト全体の開始時と終了時(support/session.ts の removeSession)に消す。
|
|
16
|
+
*
|
|
17
|
+
* @author Fluxengine.co.jp
|
|
18
|
+
*/
|
|
19
|
+
const node_crypto_1 = require("node:crypto");
|
|
20
|
+
const node_fs_1 = require("node:fs");
|
|
21
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
22
|
+
const outputPaths_1 = require("./outputPaths");
|
|
23
|
+
/** 実行の ID を渡す環境変数(support/sf.ts の CONNECTION_ID_ENV と同じ)。 */
|
|
24
|
+
const RUN_ID_ENV = 'SFTEST_CONNECTION_ID';
|
|
25
|
+
/** このプロセスのキャッシュ(キー → 値)。 */
|
|
26
|
+
const memory = new Map();
|
|
27
|
+
/**
|
|
28
|
+
* キャッシュのフォルダの絶対パスを返す。
|
|
29
|
+
*
|
|
30
|
+
* @returns 出力の基準フォルダの .auth/metadata。
|
|
31
|
+
*/
|
|
32
|
+
function metadataCacheDir() {
|
|
33
|
+
return (0, outputPaths_1.outputPath)('.auth', 'metadata');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* キーのファイルの絶対パスを返す(キーの文字のうち、ファイル名に使えない文字を置き換える)。
|
|
37
|
+
*
|
|
38
|
+
* @param key - キャッシュのキー(例: sobjects、describe-Account)。
|
|
39
|
+
* @returns ファイルの絶対パス。
|
|
40
|
+
*/
|
|
41
|
+
function cacheFile(key) {
|
|
42
|
+
return node_path_1.default.join(metadataCacheDir(), `${key.replace(/[^\w.-]/g, '_')}.json`);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* メタデータをキャッシュから返す。なければ取得し、このプロセスと、今回の実行のほかのプロセスのために保存する。
|
|
46
|
+
*
|
|
47
|
+
* 実行の ID がない場合(テスト全体の前処理を通らない呼び出し)は、このプロセスのメモリにだけ持つ。
|
|
48
|
+
* ファイルは一時ファイルに書いてから名前を変えるため、ほかのプロセスが書きかけのファイルを読むことはない。
|
|
49
|
+
*
|
|
50
|
+
* @param key - キャッシュのキー。メタデータの種類とオブジェクトを区別する(例: describe-Account)。
|
|
51
|
+
* @param fetch - キャッシュにない場合に、メタデータを取得する処理。
|
|
52
|
+
* @returns メタデータ。
|
|
53
|
+
*/
|
|
54
|
+
function cachedMetadata(key, fetch) {
|
|
55
|
+
if (memory.has(key))
|
|
56
|
+
return memory.get(key);
|
|
57
|
+
const runId = process.env[RUN_ID_ENV];
|
|
58
|
+
const file = cacheFile(key);
|
|
59
|
+
if (runId && (0, node_fs_1.existsSync)(file)) {
|
|
60
|
+
try {
|
|
61
|
+
const saved = JSON.parse((0, node_fs_1.readFileSync)(file, 'utf-8'));
|
|
62
|
+
if (saved.runId === runId) {
|
|
63
|
+
memory.set(key, saved.value);
|
|
64
|
+
return saved.value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// 読めないファイル(別の実行の残りなど)は使わず、取得し直して上書きする。
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const value = fetch();
|
|
72
|
+
memory.set(key, value);
|
|
73
|
+
if (runId) {
|
|
74
|
+
(0, node_fs_1.mkdirSync)(metadataCacheDir(), { recursive: true });
|
|
75
|
+
const temporary = `${file}.${(0, node_crypto_1.randomUUID)()}.tmp`;
|
|
76
|
+
(0, node_fs_1.writeFileSync)(temporary, JSON.stringify({ runId, value }));
|
|
77
|
+
(0, node_fs_1.renameSync)(temporary, file);
|
|
78
|
+
}
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* キャッシュを消す(このプロセスのメモリと、ファイル)。テスト全体の開始時と終了時に呼ぶ。
|
|
83
|
+
*/
|
|
84
|
+
function clearMetadataCache() {
|
|
85
|
+
memory.clear();
|
|
86
|
+
(0, node_fs_1.rmSync)(metadataCacheDir(), { recursive: true, force: true });
|
|
87
|
+
}
|
|
@@ -13,3 +13,11 @@ export declare function outputRoot(): string;
|
|
|
13
13
|
* @returns 絶対パス。
|
|
14
14
|
*/
|
|
15
15
|
export declare function outputPath(...segments: string[]): string;
|
|
16
|
+
/** 「… に CSV … のデータを登録する」の CSV を置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261021-005)。 */
|
|
17
|
+
export declare const TEST_DATA_DIR_ENV = "SFTEST_TESTDATA_DIR";
|
|
18
|
+
/**
|
|
19
|
+
* CSV の登録で、CSV を探すフォルダの絶対パスを返す(20261021-005)。
|
|
20
|
+
*
|
|
21
|
+
* @returns 環境変数 SFTEST_TESTDATA_DIR の値。設定されていない(または空の)場合は、作業フォルダの testdata。
|
|
22
|
+
*/
|
|
23
|
+
export declare function testDataRoot(): string;
|
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OUTPUT_DIR_ENV = void 0;
|
|
6
|
+
exports.TEST_DATA_DIR_ENV = exports.OUTPUT_DIR_ENV = void 0;
|
|
7
7
|
exports.outputRoot = outputRoot;
|
|
8
8
|
exports.outputPath = outputPath;
|
|
9
|
+
exports.testDataRoot = testDataRoot;
|
|
9
10
|
/**
|
|
10
11
|
* テストの出力(テストの成果物・HTML レポート・JUnit 形式の結果・エビデンス・セッションと接続情報のファイル)の基準フォルダを扱う。
|
|
11
12
|
*
|
|
@@ -36,3 +37,13 @@ function outputRoot() {
|
|
|
36
37
|
function outputPath(...segments) {
|
|
37
38
|
return node_path_1.default.join(outputRoot(), ...segments);
|
|
38
39
|
}
|
|
40
|
+
/** 「… に CSV … のデータを登録する」の CSV を置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261021-005)。 */
|
|
41
|
+
exports.TEST_DATA_DIR_ENV = 'SFTEST_TESTDATA_DIR';
|
|
42
|
+
/**
|
|
43
|
+
* CSV の登録で、CSV を探すフォルダの絶対パスを返す(20261021-005)。
|
|
44
|
+
*
|
|
45
|
+
* @returns 環境変数 SFTEST_TESTDATA_DIR の値。設定されていない(または空の)場合は、作業フォルダの testdata。
|
|
46
|
+
*/
|
|
47
|
+
function testDataRoot() {
|
|
48
|
+
return process.env[exports.TEST_DATA_DIR_ENV] || node_path_1.default.join(process.cwd(), 'testdata');
|
|
49
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 締め日で期間を扱う標準のクラス。シナリオでは「インスタンス "名前" を "{Period(長さ, 締め日, 基準日)}" で作る」(または表で引数を渡す「インスタンス "名前" をクラス "Period" から作る」)で作る。
|
|
3
|
+
*/
|
|
4
|
+
export declare class Period {
|
|
5
|
+
/** 基準日を含む期間の開始日(YYYY/MM/DD)。 */
|
|
6
|
+
private readonly startDate;
|
|
7
|
+
/** 基準日を含む期間の終了日(YYYY/MM/DD)。 */
|
|
8
|
+
private readonly endDate;
|
|
9
|
+
/**
|
|
10
|
+
* 長さ・締め日・基準日から、基準日を含む期間を決める。
|
|
11
|
+
*
|
|
12
|
+
* @param length - 長さ(月内・1か月・2か月・3か月・4か月・6か月・1年)。
|
|
13
|
+
* @param closing - 締め日(月内は D日・末日 を昇順に並べる、1か月は D日・末日、それ以外は M月D日・M月末日)。
|
|
14
|
+
* @param baseDate - 基準日(YYYY/MM/DD。YYYY-MM-DD も可)。
|
|
15
|
+
* @throws 長さ・締め日・基準日の書き方が正しくない場合(シナリオ不正)。
|
|
16
|
+
*/
|
|
17
|
+
constructor(length: string, closing: string, baseDate: string);
|
|
18
|
+
/**
|
|
19
|
+
* 基準日を含む期間の開始日を返す。
|
|
20
|
+
*
|
|
21
|
+
* @returns 開始日(YYYY/MM/DD)。
|
|
22
|
+
*/
|
|
23
|
+
start(): string;
|
|
24
|
+
/**
|
|
25
|
+
* 基準日を含む期間の終了日を返す。
|
|
26
|
+
*
|
|
27
|
+
* @returns 終了日(YYYY/MM/DD)。
|
|
28
|
+
*/
|
|
29
|
+
end(): string;
|
|
30
|
+
}
|