@fluxenginejp/sftest 2.2.0 → 3.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/{readme.md → README.md} +13 -12
- package/dist/cli/sftest.js +6 -6
- package/dist/pages/common/RecordFields.d.ts +35 -0
- package/dist/pages/common/RecordFields.js +101 -2
- package/dist/steps/common/conditional.steps.d.ts +1 -0
- package/dist/steps/common/conditional.steps.js +41 -0
- package/dist/steps/common/data.steps.js +51 -13
- package/dist/steps/common/instance.steps.js +22 -2
- package/dist/support/conditionalBlocks.d.ts +110 -0
- package/dist/support/conditionalBlocks.js +153 -0
- package/dist/support/csvInsert.d.ts +92 -8
- package/dist/support/csvInsert.js +359 -247
- package/dist/support/dateValues.d.ts +1 -24
- package/dist/support/dateValues.js +10 -87
- package/dist/support/dmlWrite.d.ts +99 -0
- package/dist/support/dmlWrite.js +194 -0
- package/dist/support/fixtures.d.ts +27 -0
- package/dist/support/fixtures.js +40 -0
- package/dist/support/outputPaths.d.ts +0 -8
- package/dist/support/outputPaths.js +1 -12
- package/dist/support/playwrightConfig.d.ts +0 -5
- package/dist/support/playwrightConfig.js +0 -2
- package/dist/support/recordCondition.d.ts +13 -2
- package/dist/support/recordCondition.js +13 -10
- package/dist/support/settings.d.ts +21 -0
- package/dist/support/settings.js +38 -2
- package/dist/support/sf.d.ts +18 -32
- package/dist/support/sf.js +44 -40
- package/dist/support/sobjects.d.ts +5 -3
- package/dist/support/sobjects.js +7 -16
- package/dist/support/soqlQuery.d.ts +45 -32
- package/dist/support/soqlQuery.js +88 -116
- package/dist/support/standardFunctions.js +7 -0
- package/docs/CHANGELOG.md +80 -40
- package/docs/EXTENSIONS.md +481 -0
- package/docs/SPEC.md +4000 -0
- package/package.json +4 -4
- package/sftest.config.jsonc +6 -0
- package/dist/support/soqlLabels.d.ts +0 -60
- package/dist/support/soqlLabels.js +0 -304
- package/docs/EXTENSIONS.html +0 -843
- package/docs/SPEC.html +0 -9729
|
@@ -33,6 +33,7 @@ import { ScenarioVariables } from './variables';
|
|
|
33
33
|
import { CustomFunctions, ScenarioFunctions } from './scenarioFunctions';
|
|
34
34
|
import { DataRestores } from './dataRestore';
|
|
35
35
|
import { AfterSaveEvidence, EvidenceLog } from './afterSaveEvidence';
|
|
36
|
+
import { ConditionalBlocks } from './conditionalBlocks';
|
|
36
37
|
/** 設定(playwright.config.ts の use)で指定する sfTest のオプション。 */
|
|
37
38
|
export interface SfTestOptions {
|
|
38
39
|
/** 標準と異なる画面のページクラス(キーはオブジェクトの表示ラベルまたは API 名)。sfTestConfig の customPages から設定される。 */
|
|
@@ -72,6 +73,7 @@ export declare const test: import("@playwright/test").TestType<import("@playwrig
|
|
|
72
73
|
scenarioVariables: ScenarioVariables;
|
|
73
74
|
scenarioFunctions: ScenarioFunctions;
|
|
74
75
|
dataRestores: DataRestores;
|
|
76
|
+
conditionalBlocks: ConditionalBlocks;
|
|
75
77
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>;
|
|
76
78
|
/** sfTest のフィクスチャを使うステップ定義・フックの登録関数。 */
|
|
77
79
|
declare const bdd: {
|
|
@@ -102,6 +104,7 @@ declare const bdd: {
|
|
|
102
104
|
scenarioVariables: ScenarioVariables;
|
|
103
105
|
scenarioFunctions: ScenarioFunctions;
|
|
104
106
|
dataRestores: DataRestores;
|
|
107
|
+
conditionalBlocks: ConditionalBlocks;
|
|
105
108
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
106
109
|
When: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
107
110
|
evidenceId: EvidenceId;
|
|
@@ -130,6 +133,7 @@ declare const bdd: {
|
|
|
130
133
|
scenarioVariables: ScenarioVariables;
|
|
131
134
|
scenarioFunctions: ScenarioFunctions;
|
|
132
135
|
dataRestores: DataRestores;
|
|
136
|
+
conditionalBlocks: ConditionalBlocks;
|
|
133
137
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
134
138
|
Then: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
135
139
|
evidenceId: EvidenceId;
|
|
@@ -158,6 +162,7 @@ declare const bdd: {
|
|
|
158
162
|
scenarioVariables: ScenarioVariables;
|
|
159
163
|
scenarioFunctions: ScenarioFunctions;
|
|
160
164
|
dataRestores: DataRestores;
|
|
165
|
+
conditionalBlocks: ConditionalBlocks;
|
|
161
166
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
162
167
|
Step: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
163
168
|
evidenceId: EvidenceId;
|
|
@@ -186,6 +191,7 @@ declare const bdd: {
|
|
|
186
191
|
scenarioVariables: ScenarioVariables;
|
|
187
192
|
scenarioFunctions: ScenarioFunctions;
|
|
188
193
|
dataRestores: DataRestores;
|
|
194
|
+
conditionalBlocks: ConditionalBlocks;
|
|
189
195
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
190
196
|
BeforeAll: (...args: [(fixtures: import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
191
197
|
name?: string;
|
|
@@ -224,6 +230,7 @@ declare const bdd: {
|
|
|
224
230
|
scenarioVariables: ScenarioVariables;
|
|
225
231
|
scenarioFunctions: ScenarioFunctions;
|
|
226
232
|
dataRestores: DataRestores;
|
|
233
|
+
conditionalBlocks: ConditionalBlocks;
|
|
227
234
|
} & 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 & {
|
|
228
235
|
evidenceId: EvidenceId;
|
|
229
236
|
evidenceDir: string;
|
|
@@ -251,6 +258,7 @@ declare const bdd: {
|
|
|
251
258
|
scenarioVariables: ScenarioVariables;
|
|
252
259
|
scenarioFunctions: ScenarioFunctions;
|
|
253
260
|
dataRestores: DataRestores;
|
|
261
|
+
conditionalBlocks: ConditionalBlocks;
|
|
254
262
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
255
263
|
name?: string;
|
|
256
264
|
tags?: string;
|
|
@@ -282,6 +290,7 @@ declare const bdd: {
|
|
|
282
290
|
scenarioVariables: ScenarioVariables;
|
|
283
291
|
scenarioFunctions: ScenarioFunctions;
|
|
284
292
|
dataRestores: DataRestores;
|
|
293
|
+
conditionalBlocks: ConditionalBlocks;
|
|
285
294
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
286
295
|
After: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
287
296
|
evidenceId: EvidenceId;
|
|
@@ -310,6 +319,7 @@ declare const bdd: {
|
|
|
310
319
|
scenarioVariables: ScenarioVariables;
|
|
311
320
|
scenarioFunctions: ScenarioFunctions;
|
|
312
321
|
dataRestores: DataRestores;
|
|
322
|
+
conditionalBlocks: ConditionalBlocks;
|
|
313
323
|
} & 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 & {
|
|
314
324
|
evidenceId: EvidenceId;
|
|
315
325
|
evidenceDir: string;
|
|
@@ -337,6 +347,7 @@ declare const bdd: {
|
|
|
337
347
|
scenarioVariables: ScenarioVariables;
|
|
338
348
|
scenarioFunctions: ScenarioFunctions;
|
|
339
349
|
dataRestores: DataRestores;
|
|
350
|
+
conditionalBlocks: ConditionalBlocks;
|
|
340
351
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
341
352
|
name?: string;
|
|
342
353
|
tags?: string;
|
|
@@ -368,6 +379,7 @@ declare const bdd: {
|
|
|
368
379
|
scenarioVariables: ScenarioVariables;
|
|
369
380
|
scenarioFunctions: ScenarioFunctions;
|
|
370
381
|
dataRestores: DataRestores;
|
|
382
|
+
conditionalBlocks: ConditionalBlocks;
|
|
371
383
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
372
384
|
BeforeWorker: (...args: [(fixtures: import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
373
385
|
name?: string;
|
|
@@ -406,6 +418,7 @@ declare const bdd: {
|
|
|
406
418
|
scenarioVariables: ScenarioVariables;
|
|
407
419
|
scenarioFunctions: ScenarioFunctions;
|
|
408
420
|
dataRestores: DataRestores;
|
|
421
|
+
conditionalBlocks: ConditionalBlocks;
|
|
409
422
|
} & 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 & {
|
|
410
423
|
evidenceId: EvidenceId;
|
|
411
424
|
evidenceDir: string;
|
|
@@ -433,6 +446,7 @@ declare const bdd: {
|
|
|
433
446
|
scenarioVariables: ScenarioVariables;
|
|
434
447
|
scenarioFunctions: ScenarioFunctions;
|
|
435
448
|
dataRestores: DataRestores;
|
|
449
|
+
conditionalBlocks: ConditionalBlocks;
|
|
436
450
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
437
451
|
name?: string;
|
|
438
452
|
tags?: string;
|
|
@@ -464,6 +478,7 @@ declare const bdd: {
|
|
|
464
478
|
scenarioVariables: ScenarioVariables;
|
|
465
479
|
scenarioFunctions: ScenarioFunctions;
|
|
466
480
|
dataRestores: DataRestores;
|
|
481
|
+
conditionalBlocks: ConditionalBlocks;
|
|
467
482
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
468
483
|
AfterScenario: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
469
484
|
evidenceId: EvidenceId;
|
|
@@ -492,6 +507,7 @@ declare const bdd: {
|
|
|
492
507
|
scenarioVariables: ScenarioVariables;
|
|
493
508
|
scenarioFunctions: ScenarioFunctions;
|
|
494
509
|
dataRestores: DataRestores;
|
|
510
|
+
conditionalBlocks: ConditionalBlocks;
|
|
495
511
|
} & 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 & {
|
|
496
512
|
evidenceId: EvidenceId;
|
|
497
513
|
evidenceDir: string;
|
|
@@ -519,6 +535,7 @@ declare const bdd: {
|
|
|
519
535
|
scenarioVariables: ScenarioVariables;
|
|
520
536
|
scenarioFunctions: ScenarioFunctions;
|
|
521
537
|
dataRestores: DataRestores;
|
|
538
|
+
conditionalBlocks: ConditionalBlocks;
|
|
522
539
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
523
540
|
name?: string;
|
|
524
541
|
tags?: string;
|
|
@@ -550,6 +567,7 @@ declare const bdd: {
|
|
|
550
567
|
scenarioVariables: ScenarioVariables;
|
|
551
568
|
scenarioFunctions: ScenarioFunctions;
|
|
552
569
|
dataRestores: DataRestores;
|
|
570
|
+
conditionalBlocks: ConditionalBlocks;
|
|
553
571
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
554
572
|
BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
555
573
|
evidenceId: EvidenceId;
|
|
@@ -578,6 +596,7 @@ declare const bdd: {
|
|
|
578
596
|
scenarioVariables: ScenarioVariables;
|
|
579
597
|
scenarioFunctions: ScenarioFunctions;
|
|
580
598
|
dataRestores: DataRestores;
|
|
599
|
+
conditionalBlocks: ConditionalBlocks;
|
|
581
600
|
} & 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 & {
|
|
582
601
|
evidenceId: EvidenceId;
|
|
583
602
|
evidenceDir: string;
|
|
@@ -605,6 +624,7 @@ declare const bdd: {
|
|
|
605
624
|
scenarioVariables: ScenarioVariables;
|
|
606
625
|
scenarioFunctions: ScenarioFunctions;
|
|
607
626
|
dataRestores: DataRestores;
|
|
627
|
+
conditionalBlocks: ConditionalBlocks;
|
|
608
628
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
609
629
|
name?: string;
|
|
610
630
|
tags?: string;
|
|
@@ -636,6 +656,7 @@ declare const bdd: {
|
|
|
636
656
|
scenarioVariables: ScenarioVariables;
|
|
637
657
|
scenarioFunctions: ScenarioFunctions;
|
|
638
658
|
dataRestores: DataRestores;
|
|
659
|
+
conditionalBlocks: ConditionalBlocks;
|
|
639
660
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
640
661
|
AfterStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
641
662
|
evidenceId: EvidenceId;
|
|
@@ -664,6 +685,7 @@ declare const bdd: {
|
|
|
664
685
|
scenarioVariables: ScenarioVariables;
|
|
665
686
|
scenarioFunctions: ScenarioFunctions;
|
|
666
687
|
dataRestores: DataRestores;
|
|
688
|
+
conditionalBlocks: ConditionalBlocks;
|
|
667
689
|
} & 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 & {
|
|
668
690
|
evidenceId: EvidenceId;
|
|
669
691
|
evidenceDir: string;
|
|
@@ -691,6 +713,7 @@ declare const bdd: {
|
|
|
691
713
|
scenarioVariables: ScenarioVariables;
|
|
692
714
|
scenarioFunctions: ScenarioFunctions;
|
|
693
715
|
dataRestores: DataRestores;
|
|
716
|
+
conditionalBlocks: ConditionalBlocks;
|
|
694
717
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
695
718
|
name?: string;
|
|
696
719
|
tags?: string;
|
|
@@ -722,6 +745,7 @@ declare const bdd: {
|
|
|
722
745
|
scenarioVariables: ScenarioVariables;
|
|
723
746
|
scenarioFunctions: ScenarioFunctions;
|
|
724
747
|
dataRestores: DataRestores;
|
|
748
|
+
conditionalBlocks: ConditionalBlocks;
|
|
725
749
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
726
750
|
};
|
|
727
751
|
export declare const BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
@@ -751,6 +775,7 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
751
775
|
scenarioVariables: ScenarioVariables;
|
|
752
776
|
scenarioFunctions: ScenarioFunctions;
|
|
753
777
|
dataRestores: DataRestores;
|
|
778
|
+
conditionalBlocks: ConditionalBlocks;
|
|
754
779
|
} & 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 & {
|
|
755
780
|
evidenceId: EvidenceId;
|
|
756
781
|
evidenceDir: string;
|
|
@@ -778,6 +803,7 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
778
803
|
scenarioVariables: ScenarioVariables;
|
|
779
804
|
scenarioFunctions: ScenarioFunctions;
|
|
780
805
|
dataRestores: DataRestores;
|
|
806
|
+
conditionalBlocks: ConditionalBlocks;
|
|
781
807
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown] | [{
|
|
782
808
|
name?: string;
|
|
783
809
|
tags?: string;
|
|
@@ -809,6 +835,7 @@ export declare const BeforeStep: (...args: [(this: null, fixtures: import("@play
|
|
|
809
835
|
scenarioVariables: ScenarioVariables;
|
|
810
836
|
scenarioFunctions: ScenarioFunctions;
|
|
811
837
|
dataRestores: DataRestores;
|
|
838
|
+
conditionalBlocks: ConditionalBlocks;
|
|
812
839
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
813
840
|
export declare const Given: typeof bdd.Given;
|
|
814
841
|
export declare const When: typeof bdd.When;
|
package/dist/support/fixtures.js
CHANGED
|
@@ -39,6 +39,7 @@ const variables_1 = require("./variables");
|
|
|
39
39
|
const scenarioFunctions_1 = require("./scenarioFunctions");
|
|
40
40
|
const dataRestore_1 = require("./dataRestore");
|
|
41
41
|
const afterSaveEvidence_1 = require("./afterSaveEvidence");
|
|
42
|
+
const conditionalBlocks_1 = require("./conditionalBlocks");
|
|
42
43
|
const screenReady_1 = require("../pages/common/screenReady");
|
|
43
44
|
// SFTEST_STARTUP_TIMING=1 の場合、ワーカー以外のプロセス(BDD の生成・テストの探索)とワーカー(シナリオの実行の準備)がステップ定義を読み込んだ時点を表示する。
|
|
44
45
|
(0, startupTiming_1.startupNote)(process.env.TEST_WORKER_INDEX ? 'ステップ定義の読み込み(ワーカーの準備)' : 'ステップ定義の読み込み(BDD の生成・テストの探索)');
|
|
@@ -126,6 +127,29 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
126
127
|
},
|
|
127
128
|
{ auto: true },
|
|
128
129
|
],
|
|
130
|
+
/**
|
|
131
|
+
* 条件を満たしたときだけステップを実行する範囲の状態(20261113-003)。すべてのシナリオで作り(auto)、すべてのステップを包む処理が
|
|
132
|
+
* 実行しない範囲の中のステップを通過させるため、シナリオの TestInfo に結び付けて登録する(support/conditionalBlocks.ts)。
|
|
133
|
+
*
|
|
134
|
+
* シナリオの終わりに、実行しなかったステップの数をシナリオの注記に示す。閉じられていない範囲があれば、シナリオを失敗にする
|
|
135
|
+
* (シナリオ不正)。中断(例外)で終わった場合は、元の失敗の原因を残すため判定しない。
|
|
136
|
+
*/
|
|
137
|
+
conditionalBlocks: [
|
|
138
|
+
async ({}, use, testInfo) => {
|
|
139
|
+
const blocks = new conditionalBlocks_1.ConditionalBlocks();
|
|
140
|
+
(0, conditionalBlocks_1.registerConditionalBlocks)(testInfo, blocks);
|
|
141
|
+
await use(blocks);
|
|
142
|
+
if (blocks.skippedCount) {
|
|
143
|
+
testInfo.annotations.push({ type: conditionalBlocks_1.SKIPPED_ATTACHMENT.name, description: `${blocks.skippedCount} 件(${conditionalBlocks_1.SKIPPED_ATTACHMENT.body})` });
|
|
144
|
+
}
|
|
145
|
+
const problem = blocks.unclosedProblem();
|
|
146
|
+
(0, executionControl_1.runRequired)('scenario-teardown', () => {
|
|
147
|
+
if (problem && !(0, mismatch_1.wasInterrupted)(testInfo))
|
|
148
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', problem);
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
{ auto: true },
|
|
152
|
+
],
|
|
129
153
|
/** エビデンス名の先頭に付ける ID(「ID "…"」のステップで設定する)。 */
|
|
130
154
|
// 標準クラス DataSnapshot の take が、呼ばれたシナリオの ID を使えるよう、テスト情報に結び付ける(20261024-009)。
|
|
131
155
|
evidenceId: async ({}, use, testInfo) => {
|
|
@@ -365,10 +389,22 @@ function controlledDefinition(define, acceptsExpectNg, triggersAfterSave) {
|
|
|
365
389
|
const fn = args[args.length - 1];
|
|
366
390
|
const rawIndexes = typeof args[0] === 'string' ? (RAW_ARGUMENT_STEPS[args[0]] ?? []) : [];
|
|
367
391
|
const capturesAfterSave = triggersAfterSave && !(typeof args[0] === 'string' && afterSaveEvidence_1.NON_TRIGGER_STEPS.has(args[0]));
|
|
392
|
+
const control = typeof args[0] === 'string' ? conditionalBlocks_1.CONTROL_STEPS.get(args[0]) : undefined;
|
|
368
393
|
const wrapped = async function (...fnArgs) {
|
|
369
394
|
await (0, executionControl_1.runControlled)('step', async () => {
|
|
370
395
|
// 1つ目の引数はフィクスチャ。2つ目以降(ステップの文言の引数と表)を置き換える。
|
|
371
396
|
const testInfo = exports.test.info();
|
|
397
|
+
// 条件が成り立たない範囲の中のステップは、関数を呼ばずに通過する(20261113-003)。画面キャプチャー・変数の置き換えも行わない
|
|
398
|
+
// (範囲の中でだけ設定される変数などを参照していても誤りにしないため)。範囲の始まりは、入れ子の範囲として数えるため状態に積む。
|
|
399
|
+
// 「それ以外」と終わりは、範囲の対応を保つため、実行しない範囲の中でも関数を呼ぶ(引数がないため、置き換えの影響はない)。
|
|
400
|
+
const blocks = (0, conditionalBlocks_1.conditionalBlocksOf)(testInfo);
|
|
401
|
+
if (blocks?.isSkipping() && control !== 'else' && control !== 'end') {
|
|
402
|
+
if (control === 'begin')
|
|
403
|
+
blocks.begin(() => false);
|
|
404
|
+
blocks.countSkipped();
|
|
405
|
+
await testInfo.attach(conditionalBlocks_1.SKIPPED_ATTACHMENT.name, { body: conditionalBlocks_1.SKIPPED_ATTACHMENT.body, contentType: 'text/plain' });
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
372
408
|
// 保存後の画面キャプチャーが未了なら、この操作で画面が変わる前に撮る(20261023-017)。
|
|
373
409
|
if (capturesAfterSave)
|
|
374
410
|
await (0, afterSaveEvidence_1.afterSaveEvidenceOf)(testInfo)?.captureIfDue();
|
|
@@ -407,6 +443,10 @@ function controlledDefinition(define, acceptsExpectNg, triggersAfterSave) {
|
|
|
407
443
|
(0, startupTiming_1.finishStartupTiming)('最初のステップの開始');
|
|
408
444
|
if (/^ID "/.test($step.title))
|
|
409
445
|
return;
|
|
446
|
+
// 条件の範囲の始まり・それ以外・終わりは画面を操作しないため、確認の対象外にする。条件が成り立たない範囲の中のステップは
|
|
447
|
+
// 実行しないため、保存エラー・ダイアログ・アップロードエラーの確認もしない(どちらも、ダイアログの指示のステップの数に入れない。20261113-003)。
|
|
448
|
+
if ((0, conditionalBlocks_1.isControlStepTitle)($step.title) || (0, conditionalBlocks_1.conditionalBlocksOf)(exports.test.info())?.isSkipping())
|
|
449
|
+
return;
|
|
410
450
|
const uploadProblem = uploadErrors.checkBeforeStep($step.title);
|
|
411
451
|
if (uploadProblem)
|
|
412
452
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', uploadProblem);
|
|
@@ -13,14 +13,6 @@ 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;
|
|
24
16
|
/**
|
|
25
17
|
* 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261024-007)。
|
|
26
18
|
* エビデンスの保存先に、機能ファイルのサブフォルダを含めるために使う(support/evidenceId.ts の evidenceDirOf)。
|
|
@@ -3,10 +3,9 @@ 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.FEATURES_GEN_DIR_ENV = exports.
|
|
6
|
+
exports.FEATURES_GEN_DIR_ENV = exports.OUTPUT_DIR_ENV = void 0;
|
|
7
7
|
exports.outputRoot = outputRoot;
|
|
8
8
|
exports.outputPath = outputPath;
|
|
9
|
-
exports.testDataRoot = testDataRoot;
|
|
10
9
|
exports.featuresBaseDir = featuresBaseDir;
|
|
11
10
|
/**
|
|
12
11
|
* テストの出力(テストの成果物・HTML レポート・JUnit 形式の結果・エビデンス・セッションと接続情報のファイル)の基準フォルダを扱う。
|
|
@@ -38,16 +37,6 @@ function outputRoot() {
|
|
|
38
37
|
function outputPath(...segments) {
|
|
39
38
|
return node_path_1.default.join(outputRoot(), ...segments);
|
|
40
39
|
}
|
|
41
|
-
/** 「… に CSV … のデータを登録する」の CSV を置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261021-005)。 */
|
|
42
|
-
exports.TEST_DATA_DIR_ENV = 'SFTEST_TESTDATA_DIR';
|
|
43
|
-
/**
|
|
44
|
-
* CSV の登録で、CSV を探すフォルダの絶対パスを返す(20261021-005)。
|
|
45
|
-
*
|
|
46
|
-
* @returns 環境変数 SFTEST_TESTDATA_DIR の値。設定されていない(または空の)場合は、作業フォルダの testdata。
|
|
47
|
-
*/
|
|
48
|
-
function testDataRoot() {
|
|
49
|
-
return process.env[exports.TEST_DATA_DIR_ENV] || node_path_1.default.join(process.cwd(), 'testdata');
|
|
50
|
-
}
|
|
51
40
|
/**
|
|
52
41
|
* 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261024-007)。
|
|
53
42
|
* エビデンスの保存先に、機能ファイルのサブフォルダを含めるために使う(support/evidenceId.ts の evidenceDirOf)。
|
|
@@ -30,11 +30,6 @@ export interface SfTestConfigOptions {
|
|
|
30
30
|
* 開発元の内部検証が npm run report:dev を示すための開発用の指定であり、利用者向けの仕様書には載せない(20261015-011)。
|
|
31
31
|
*/
|
|
32
32
|
reportCommand?: string;
|
|
33
|
-
/**
|
|
34
|
-
* 「… に CSV … のデータを登録する」の CSV を置くフォルダ。作業フォルダからの相対パスで指定する。省略時は testdata(利用者の既定)。
|
|
35
|
-
* 開発元の内部検証が develop/tests/testdata を指定するための開発用の指定であり、利用者向けの仕様書には載せない(20261021-005)。
|
|
36
|
-
*/
|
|
37
|
-
testDataDir?: string;
|
|
38
33
|
}
|
|
39
34
|
/**
|
|
40
35
|
* sfTest の Playwright の設定を作る。
|
|
@@ -75,8 +75,6 @@ function sfTestConfig(options) {
|
|
|
75
75
|
// テストの出力の基準フォルダを決め、環境変数でテスト全体の前後処理とワーカーに引き継ぐ(support/outputPaths.ts)。
|
|
76
76
|
// 設定ファイルは実行の最初と各ワーカーで読み込まれ、どちらも同じ指定から同じ値を設定する。
|
|
77
77
|
process.env[outputPaths_1.OUTPUT_DIR_ENV] = fromProject(options.outputDir ?? '.');
|
|
78
|
-
// CSV の登録で、CSV を探すフォルダを、同じく環境変数でワーカーに引き継ぐ(support/outputPaths.ts の testDataRoot。20261021-005)。
|
|
79
|
-
process.env[outputPaths_1.TEST_DATA_DIR_ENV] = fromProject(options.testDataDir ?? 'testdata');
|
|
80
78
|
// 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダを、同じく環境変数でワーカーに引き継ぐ(20261024-007)。
|
|
81
79
|
// 生成したテストコードは、出力先の下に featuresRoot からの相対パスで置かれるため、エビデンスの保存先に機能ファイルのサブフォルダを含められる。
|
|
82
80
|
process.env[outputPaths_1.FEATURES_GEN_DIR_ENV] = node_path_1.default.join(fromProject(options.bddOutputDir), node_path_1.default.relative(fromProject(options.featuresRoot), fromProject((0, outputPaths_1.featuresBaseDir)(options.features))));
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* オブジェクト名と条件(WHERE 句)で、対象のレコードを指定する共通の処理(20261024-009)。
|
|
3
|
+
*
|
|
4
|
+
* データの記憶・復元(「"<オブジェクト>" の "<条件>" の状態を記憶し、シナリオの終わりに戻す」。support/dataRestore.ts)と、
|
|
5
|
+
* 標準クラス DataSnapshot(support/dataSnapshot.ts)が、それぞれのインスタンスで使う。オブジェクト名は表示ラベルまたは API 名で、
|
|
6
|
+
* 条件は項目ラベルと YYYY/MM/DD の日付で書ける(20261022-002・20261022-003)。日付の変換と項目ラベルの解決は、SOQL Editor と共通の
|
|
7
|
+
* ライブラリ @fluxenginejp/soql-core を使う(20261028-001。WHERE の中のサブクエリの項目ラベルも解決する)。コメントと末尾の ; も、
|
|
8
|
+
* 標準クラス SOQL と同じく取り除く(20261028-001 の PO の決定 案B)。
|
|
9
|
+
*
|
|
10
|
+
* @author Fluxengine.co.jp
|
|
11
|
+
*/
|
|
12
|
+
import { LabeledField } from '@fluxenginejp/soql-core';
|
|
2
13
|
/** 条件の解釈に使う組織の情報(単体の確認では差し替える)。 */
|
|
3
14
|
export interface ConditionApi {
|
|
4
15
|
/** オブジェクトの表示ラベル(または API 名)から API 名を返す。 */
|
|
@@ -29,7 +40,7 @@ export interface RecordCondition {
|
|
|
29
40
|
* オブジェクト名と条件を解釈し、オブジェクトの API 名と、SOQL に使える WHERE 句にする。
|
|
30
41
|
*
|
|
31
42
|
* @param objectName - オブジェクト(表示ラベルまたは API 名。シナリオに書いたもの)。
|
|
32
|
-
* @param written - WHERE 句(WHERE は書かない)。{名前}
|
|
43
|
+
* @param written - WHERE 句(WHERE は書かない)。{名前} は、呼ぶ前に置き換え済みである。コメントと末尾の ; は取り除く。引用符の外の YYYY/MM/DD の日付は、
|
|
33
44
|
* SOQL の日付の書式 YYYY-MM-DD にして使う。項目ラベル([項目ラベル]、または日本語などを含む語)は、オブジェクトの項目の API 名にして使う。
|
|
34
45
|
* @param api - 組織の情報。
|
|
35
46
|
* @param owner - 指定する側(メッセージに使う)。
|
|
@@ -7,20 +7,21 @@ exports.queryWithCondition = queryWithCondition;
|
|
|
7
7
|
*
|
|
8
8
|
* データの記憶・復元(「"<オブジェクト>" の "<条件>" の状態を記憶し、シナリオの終わりに戻す」。support/dataRestore.ts)と、
|
|
9
9
|
* 標準クラス DataSnapshot(support/dataSnapshot.ts)が、それぞれのインスタンスで使う。オブジェクト名は表示ラベルまたは API 名で、
|
|
10
|
-
* 条件は項目ラベルと YYYY/MM/DD の日付で書ける(20261022-002・20261022-003
|
|
10
|
+
* 条件は項目ラベルと YYYY/MM/DD の日付で書ける(20261022-002・20261022-003)。日付の変換と項目ラベルの解決は、SOQL Editor と共通の
|
|
11
|
+
* ライブラリ @fluxenginejp/soql-core を使う(20261028-001。WHERE の中のサブクエリの項目ラベルも解決する)。コメントと末尾の ; も、
|
|
12
|
+
* 標準クラス SOQL と同じく取り除く(20261028-001 の PO の決定 案B)。
|
|
11
13
|
*
|
|
12
14
|
* @author Fluxengine.co.jp
|
|
13
15
|
*/
|
|
16
|
+
const soql_core_1 = require("@fluxenginejp/soql-core");
|
|
14
17
|
const executionControl_1 = require("./executionControl");
|
|
15
18
|
const sobjects_1 = require("./sobjects");
|
|
16
19
|
const soqlQuery_1 = require("./soqlQuery");
|
|
17
|
-
const dateValues_1 = require("./dateValues");
|
|
18
|
-
const soqlLabels_1 = require("./soqlLabels");
|
|
19
20
|
/**
|
|
20
21
|
* オブジェクト名と条件を解釈し、オブジェクトの API 名と、SOQL に使える WHERE 句にする。
|
|
21
22
|
*
|
|
22
23
|
* @param objectName - オブジェクト(表示ラベルまたは API 名。シナリオに書いたもの)。
|
|
23
|
-
* @param written - WHERE 句(WHERE は書かない)。{名前}
|
|
24
|
+
* @param written - WHERE 句(WHERE は書かない)。{名前} は、呼ぶ前に置き換え済みである。コメントと末尾の ; は取り除く。引用符の外の YYYY/MM/DD の日付は、
|
|
24
25
|
* SOQL の日付の書式 YYYY-MM-DD にして使う。項目ラベル([項目ラベル]、または日本語などを含む語)は、オブジェクトの項目の API 名にして使う。
|
|
25
26
|
* @param api - 組織の情報。
|
|
26
27
|
* @param owner - 指定する側(メッセージに使う)。
|
|
@@ -39,18 +40,20 @@ function resolveRecordCondition(objectName, written, api, owner) {
|
|
|
39
40
|
throw new executionControl_1.ExecutionFailure(category, `${owner.className}("${objectName}"): ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
// コメント(// …、/* … */)と末尾の ; を取り除く(標準クラス SOQL と同じ。20261028-001 の PO の決定 案B)。引用符の外の // と /* は
|
|
44
|
+
// WHERE 句の正しい書き方にないため、今まで動いている条件は変わらない。コメントだけの条件は、空の条件の誤りになる。
|
|
45
|
+
const dated = (0, soql_core_1.soqlDisplayDatesToIso)((0, soql_core_1.toExecutableSoql)(written));
|
|
43
46
|
if (!dated.trim())
|
|
44
47
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', `"${objectName}" の${owner.purpose}条件(WHERE 句)が空です。条件を書いてください(オブジェクトのすべてのレコードは対象にできません)`);
|
|
45
48
|
const apiName = wrap(() => api.objectApiName(objectName), 'scenario-invalid');
|
|
46
|
-
// 項目ラベルを API
|
|
47
|
-
//
|
|
49
|
+
// 項目ラベルを API 名にする(ライブラリの書き方の誤り(SoqlInputError)はシナリオ不正。describe を取得できない場合は実行時エラー)。
|
|
50
|
+
// WHERE・LIMIT などの確認は、角括弧の中の文字を誤って拾わないよう、API 名にした後の条件で行う(20261022-003 のレビューの指摘)。
|
|
48
51
|
// 主のオブジェクトは指定したオブジェクト名、条件のサブクエリの FROM は標準クラス SOQL と同じ照合で決める(20261023-012 のレビューの指摘)。
|
|
49
52
|
const soqlObjectApiName = (o) => (api.soqlObjectApiName ?? sobjects_1.sobjectApiNameForSoql)(o);
|
|
50
|
-
const where = wrap(() => (0,
|
|
53
|
+
const where = wrap(() => (0, soqlQuery_1.scenarioInvalidOnSoqlInput)(() => (0, soql_core_1.resolveSoqlLabels)(dated, apiName, (o) => api.describeFields(o), soqlObjectApiName)), 'runtime-error');
|
|
51
54
|
if (/^\s*WHERE\b/i.test(where))
|
|
52
55
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', `条件には WHERE を書かず、その後の部分だけを書いてください(指定値: "${dated}")`);
|
|
53
|
-
if (/\b(LIMIT|OFFSET|ORDER\s+BY|GROUP\s+BY)\b/i.test((0,
|
|
56
|
+
if (/\b(LIMIT|OFFSET|ORDER\s+BY|GROUP\s+BY)\b/i.test((0, soql_core_1.maskStrings)(where))) {
|
|
54
57
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', `条件(WHERE 句)には、LIMIT・OFFSET・ORDER BY・GROUP BY を書けません(指定値: "${dated}")`);
|
|
55
58
|
}
|
|
56
59
|
return { apiName, where };
|
|
@@ -73,7 +76,7 @@ function queryWithCondition(run, soql, label) {
|
|
|
73
76
|
throw error;
|
|
74
77
|
const message = error instanceof Error ? error.message : String(error);
|
|
75
78
|
if (/HTTP 400|MALFORMED_QUERY|INVALID_FIELD|INVALID_TYPE|INVALID_QUERY|INVALID_OPERATION/.test(message)) {
|
|
76
|
-
throw new executionControl_1.ExecutionFailure('scenario-invalid', `${label} の条件に誤りがあります${(0,
|
|
79
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', `${label} の条件に誤りがあります${(0, soql_core_1.describeQueryError)(message)}\n実行した SOQL: ${soql}`, { cause: error });
|
|
77
80
|
}
|
|
78
81
|
throw new executionControl_1.ExecutionFailure('runtime-error', `${label} の SOQL を実行できません: ${message}(SOQL: ${soql})`, { cause: error });
|
|
79
82
|
}
|
|
@@ -26,6 +26,12 @@ export declare const DEFAULT_SOQL_LIMIT = 10;
|
|
|
26
26
|
export declare const MAX_SOQL_ROWS = 2000;
|
|
27
27
|
/** データを記憶して戻すステップの、1つのステップで扱うレコードの初期値(20261021-003)。 */
|
|
28
28
|
export declare const DEFAULT_DATA_RESTORE_MAX_RECORDS = 200;
|
|
29
|
+
/** 標準のクラス DML の設定の初期値(20261113-004。2026-11-14、PO の決定)。 */
|
|
30
|
+
export declare const DEFAULT_DML: {
|
|
31
|
+
maxRecords: number;
|
|
32
|
+
};
|
|
33
|
+
/** 標準のクラス DML の設定。 */
|
|
34
|
+
export type DmlSettings = typeof DEFAULT_DML;
|
|
29
35
|
/** 標準クラス DataSnapshot の take で CSV に保存するレコードの上限の初期値(20261024-009)。 */
|
|
30
36
|
export declare const DEFAULT_SNAPSHOT_MAX_RECORDS = 1000;
|
|
31
37
|
/** 標準クラス DataSnapshot の CSV の見出しの書き方(label: 項目ラベル、apiName: API 参照名。20261024-009、POの決定 案A)。 */
|
|
@@ -74,6 +80,17 @@ export declare const CAPTURE_WAIT_LIMIT_ENV = "SFTEST_CAPTURE_WAIT_LIMIT";
|
|
|
74
80
|
* @throws 整数でない、範囲の外の場合。
|
|
75
81
|
*/
|
|
76
82
|
export declare function loadDataRestoreMaxRecords(config: Record<string, unknown>): number;
|
|
83
|
+
/**
|
|
84
|
+
* 設定から、標準のクラス DML の設定を読み込む(20261113-004)。
|
|
85
|
+
*
|
|
86
|
+
* dml を書かない場合は初期値を使う。書く場合は { "maxRecords": 件数 } の形とし、maxRecords は 1 以上 2,000(MAX_SOQL_ROWS)以下の整数とする
|
|
87
|
+
* (書かない項目は初期値)。
|
|
88
|
+
*
|
|
89
|
+
* @param config - 設定ファイルに書かれた項目(readSettings の結果)。
|
|
90
|
+
* @returns DML の設定。
|
|
91
|
+
* @throws 形が正しくない、設定できない項目がある、maxRecords が範囲の外の場合。
|
|
92
|
+
*/
|
|
93
|
+
export declare function loadDml(config: Record<string, unknown>): DmlSettings;
|
|
77
94
|
/**
|
|
78
95
|
* 設定から、データを記憶して戻すときに記憶・更新しない項目を読み込む(20261021-003)。
|
|
79
96
|
*
|
|
@@ -157,6 +174,10 @@ export declare const capture: {
|
|
|
157
174
|
export declare const dataRestoreMaxRecords: number;
|
|
158
175
|
/** 設定ファイルを反映した、データを記憶して戻すときに記憶・更新しない項目(オブジェクトの API 名の小文字・"*" → 項目の API 名の小文字。20261021-003)。 */
|
|
159
176
|
export declare const dataRestoreExcludeFields: ReadonlyMap<string, ReadonlySet<string>>;
|
|
177
|
+
/** 設定ファイルを反映した、標準のクラス DML の設定(20261113-004)。 */
|
|
178
|
+
export declare const dml: {
|
|
179
|
+
maxRecords: number;
|
|
180
|
+
};
|
|
160
181
|
/** 設定ファイルを反映した、標準クラス DataSnapshot の take で CSV に保存するレコードの上限(20261024-009)。 */
|
|
161
182
|
export declare const snapshotMaxRecords: number;
|
|
162
183
|
/** 設定ファイルを反映した、標準クラス DataSnapshot の CSV の見出しの書き方(20261024-009)。 */
|
package/dist/support/settings.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timeoutMs = exports.dataLockWait = exports.dataLocks = exports.snapshotHeader = exports.snapshotMaxRecords = exports.dataRestoreExcludeFields = exports.dataRestoreMaxRecords = exports.capture = exports.soqlDefaultLimit = exports.lookupSeparator = exports.sectionSeparator = exports.timeouts = exports.CAPTURE_WAIT_LIMIT_ENV = exports.DEFAULT_CAPTURE = exports.DEFAULT_DATA_LOCK_WAIT = exports.DEFAULT_SNAPSHOT_MAX_RECORDS = exports.DEFAULT_DATA_RESTORE_MAX_RECORDS = exports.MAX_SOQL_ROWS = exports.DEFAULT_SOQL_LIMIT = exports.DEFAULT_LOOKUP_SEPARATOR = exports.DEFAULT_SECTION_SEPARATOR = exports.DEFAULT_TIMEOUTS = exports.SETTINGS_FILE = void 0;
|
|
3
|
+
exports.timeoutMs = exports.dataLockWait = exports.dataLocks = exports.snapshotHeader = exports.snapshotMaxRecords = exports.dml = exports.dataRestoreExcludeFields = exports.dataRestoreMaxRecords = exports.capture = exports.soqlDefaultLimit = exports.lookupSeparator = exports.sectionSeparator = exports.timeouts = exports.CAPTURE_WAIT_LIMIT_ENV = exports.DEFAULT_CAPTURE = exports.DEFAULT_DATA_LOCK_WAIT = exports.DEFAULT_SNAPSHOT_MAX_RECORDS = exports.DEFAULT_DML = exports.DEFAULT_DATA_RESTORE_MAX_RECORDS = exports.MAX_SOQL_ROWS = exports.DEFAULT_SOQL_LIMIT = exports.DEFAULT_LOOKUP_SEPARATOR = exports.DEFAULT_SECTION_SEPARATOR = exports.DEFAULT_TIMEOUTS = exports.SETTINGS_FILE = void 0;
|
|
4
4
|
exports.loadDataRestoreMaxRecords = loadDataRestoreMaxRecords;
|
|
5
|
+
exports.loadDml = loadDml;
|
|
5
6
|
exports.loadDataRestoreExcludeFields = loadDataRestoreExcludeFields;
|
|
6
7
|
exports.loadSnapshotMaxRecords = loadSnapshotMaxRecords;
|
|
7
8
|
exports.loadSnapshotHeader = loadSnapshotHeader;
|
|
@@ -46,6 +47,10 @@ exports.DEFAULT_SOQL_LIMIT = 10;
|
|
|
46
47
|
exports.MAX_SOQL_ROWS = 2000;
|
|
47
48
|
/** データを記憶して戻すステップの、1つのステップで扱うレコードの初期値(20261021-003)。 */
|
|
48
49
|
exports.DEFAULT_DATA_RESTORE_MAX_RECORDS = 200;
|
|
50
|
+
/** 標準のクラス DML の設定の初期値(20261113-004。2026-11-14、PO の決定)。 */
|
|
51
|
+
exports.DEFAULT_DML = {
|
|
52
|
+
maxRecords: 200, // 1つの文で変えるレコードの上限。超えたら実行せずにシナリオ不正
|
|
53
|
+
};
|
|
49
54
|
/** 標準クラス DataSnapshot の take で CSV に保存するレコードの上限の初期値(20261024-009)。 */
|
|
50
55
|
exports.DEFAULT_SNAPSHOT_MAX_RECORDS = 1000;
|
|
51
56
|
/** テスト実行の排他制御の待ち方の初期値(秒。20261024-010)。 */
|
|
@@ -56,7 +61,7 @@ exports.DEFAULT_DATA_LOCK_WAIT = {
|
|
|
56
61
|
stale: 600, // ハートビートがこれより古いロックを、放置されたとみなす
|
|
57
62
|
};
|
|
58
63
|
/** 設定ファイルに書ける項目名。 */
|
|
59
|
-
const SETTING_KEYS = ['timeouts', 'sectionSeparator', 'lookupSeparator', 'soqlDefaultLimit', 'dataRestoreMaxRecords', 'dataRestoreExcludeFields', 'capture', 'snapshotMaxRecords', 'snapshotHeader', 'dataLocks', 'dataLockWait'];
|
|
64
|
+
const SETTING_KEYS = ['timeouts', 'sectionSeparator', 'lookupSeparator', 'soqlDefaultLimit', 'dataRestoreMaxRecords', 'dataRestoreExcludeFields', 'capture', 'snapshotMaxRecords', 'snapshotHeader', 'dataLocks', 'dataLockWait', 'dml'];
|
|
60
65
|
/** 画面キャプチャーの前に表示が落ち着くまで待つ設定の初期値(秒。20261024-005)。 */
|
|
61
66
|
exports.DEFAULT_CAPTURE = {
|
|
62
67
|
waitLimit: 30, // 表示が落ち着くまで待つ上限。0 は待たない
|
|
@@ -218,6 +223,35 @@ function loadDataRestoreMaxRecords(config) {
|
|
|
218
223
|
}
|
|
219
224
|
return value;
|
|
220
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* 設定から、標準のクラス DML の設定を読み込む(20261113-004)。
|
|
228
|
+
*
|
|
229
|
+
* dml を書かない場合は初期値を使う。書く場合は { "maxRecords": 件数 } の形とし、maxRecords は 1 以上 2,000(MAX_SOQL_ROWS)以下の整数とする
|
|
230
|
+
* (書かない項目は初期値)。
|
|
231
|
+
*
|
|
232
|
+
* @param config - 設定ファイルに書かれた項目(readSettings の結果)。
|
|
233
|
+
* @returns DML の設定。
|
|
234
|
+
* @throws 形が正しくない、設定できない項目がある、maxRecords が範囲の外の場合。
|
|
235
|
+
*/
|
|
236
|
+
function loadDml(config) {
|
|
237
|
+
const value = config.dml;
|
|
238
|
+
const result = { ...exports.DEFAULT_DML };
|
|
239
|
+
if (value === undefined)
|
|
240
|
+
return result;
|
|
241
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
242
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', `${exports.SETTINGS_FILE} の dml は { "maxRecords": 件数 } の形で書いてください(指定値: ${JSON.stringify(value)})`);
|
|
243
|
+
}
|
|
244
|
+
for (const [name, item] of Object.entries(value)) {
|
|
245
|
+
if (name !== 'maxRecords') {
|
|
246
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', `${exports.SETTINGS_FILE} の dml."${name}" は設定できない項目です(設定できる項目: ${Object.keys(exports.DEFAULT_DML).join(', ')})`);
|
|
247
|
+
}
|
|
248
|
+
if (typeof item !== 'number' || !Number.isInteger(item) || item < 1 || item > exports.MAX_SOQL_ROWS) {
|
|
249
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', `${exports.SETTINGS_FILE} の dml.maxRecords は、1 以上 ${exports.MAX_SOQL_ROWS} 以下の整数で書いてください(指定値: ${JSON.stringify(item)})`);
|
|
250
|
+
}
|
|
251
|
+
result.maxRecords = item;
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
221
255
|
/**
|
|
222
256
|
* 設定から、データを記憶して戻すときに記憶・更新しない項目を読み込む(20261021-003)。
|
|
223
257
|
*
|
|
@@ -413,6 +447,8 @@ exports.capture = (0, executionControl_1.runRequired)('configuration', () => loa
|
|
|
413
447
|
exports.dataRestoreMaxRecords = (0, executionControl_1.runRequired)('configuration', () => loadDataRestoreMaxRecords(settings));
|
|
414
448
|
/** 設定ファイルを反映した、データを記憶して戻すときに記憶・更新しない項目(オブジェクトの API 名の小文字・"*" → 項目の API 名の小文字。20261021-003)。 */
|
|
415
449
|
exports.dataRestoreExcludeFields = (0, executionControl_1.runRequired)('configuration', () => loadDataRestoreExcludeFields(settings));
|
|
450
|
+
/** 設定ファイルを反映した、標準のクラス DML の設定(20261113-004)。 */
|
|
451
|
+
exports.dml = (0, executionControl_1.runRequired)('configuration', () => loadDml(settings));
|
|
416
452
|
/** 設定ファイルを反映した、標準クラス DataSnapshot の take で CSV に保存するレコードの上限(20261024-009)。 */
|
|
417
453
|
exports.snapshotMaxRecords = (0, executionControl_1.runRequired)('configuration', () => loadSnapshotMaxRecords(settings));
|
|
418
454
|
/** 設定ファイルを反映した、標準クラス DataSnapshot の CSV の見出しの書き方(20261024-009)。 */
|