@fluxenginejp/sftest 2.1.0 → 2.3.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} +14 -13
- package/dist/cli/sftest.js +39 -6
- package/dist/pages/common/ListViewPage.d.ts +4 -2
- package/dist/pages/common/ListViewPage.js +25 -4
- package/dist/pages/common/RecordFields.d.ts +35 -0
- package/dist/pages/common/RecordFields.js +101 -2
- package/dist/pages/common/RecordFormDialog.js +7 -2
- package/dist/pages/common/ScreenDialog.js +2 -2
- package/dist/pages/common/listViewReady.d.ts +6 -1
- package/dist/pages/common/listViewReady.js +8 -3
- package/dist/pages/common/screenReady.d.ts +26 -0
- package/dist/pages/common/screenReady.js +131 -0
- package/dist/pages/common/scrollCapture.d.ts +55 -2
- package/dist/pages/common/scrollCapture.js +144 -2
- package/dist/steps/common/conditional.steps.d.ts +1 -0
- package/dist/steps/common/conditional.steps.js +36 -0
- package/dist/steps/common/data.steps.js +37 -9
- package/dist/steps/common/instance.steps.js +22 -2
- package/dist/support/afterSaveEvidence.d.ts +1 -0
- package/dist/support/conditionalBlocks.d.ts +105 -0
- package/dist/support/conditionalBlocks.js +148 -0
- package/dist/support/csvInsert.d.ts +73 -0
- package/dist/support/csvInsert.js +457 -6
- package/dist/support/dataLockLauncher.d.ts +1 -0
- package/dist/support/dataLockLauncher.js +18 -0
- package/dist/support/dataLockWatcher.d.ts +1 -0
- package/dist/support/dataLockWatcher.js +127 -0
- package/dist/support/dataLocks.d.ts +374 -0
- package/dist/support/dataLocks.js +913 -0
- package/dist/support/dataRestore.d.ts +3 -9
- package/dist/support/dataRestore.js +5 -29
- package/dist/support/dataSnapshot.d.ts +154 -0
- package/dist/support/dataSnapshot.js +358 -0
- 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/evidenceId.d.ts +29 -1
- package/dist/support/evidenceId.js +83 -3
- package/dist/support/fixtures.d.ts +27 -0
- package/dist/support/fixtures.js +59 -9
- package/dist/support/globalSetup.d.ts +3 -0
- package/dist/support/globalSetup.js +49 -1
- package/dist/support/outputPaths.d.ts +12 -0
- package/dist/support/outputPaths.js +24 -1
- package/dist/support/playwrightConfig.js +3 -0
- package/dist/support/recordCondition.d.ts +61 -0
- package/dist/support/recordCondition.js +83 -0
- package/dist/support/runner.d.ts +6 -0
- package/dist/support/runner.js +28 -0
- package/dist/support/scenarioFunctions.d.ts +20 -0
- package/dist/support/scenarioFunctions.js +37 -0
- package/dist/support/settings.d.ts +132 -0
- package/dist/support/settings.js +224 -2
- package/dist/support/sf.d.ts +31 -32
- package/dist/support/sf.js +88 -46
- 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.d.ts +15 -0
- package/dist/support/standardFunctions.js +39 -1
- package/dist/support/variables.d.ts +7 -0
- package/dist/support/variables.js +12 -0
- package/docs/CHANGELOG.md +83 -34
- package/docs/EXTENSIONS.md +481 -0
- package/docs/SPEC.md +3990 -0
- package/package.json +4 -4
- package/sftest.config.jsonc +51 -0
- package/templates/gitignore +1 -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 -9230
|
@@ -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,8 @@ 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");
|
|
43
|
+
const screenReady_1 = require("../pages/common/screenReady");
|
|
42
44
|
// SFTEST_STARTUP_TIMING=1 の場合、ワーカー以外のプロセス(BDD の生成・テストの探索)とワーカー(シナリオの実行の準備)がステップ定義を読み込んだ時点を表示する。
|
|
43
45
|
(0, startupTiming_1.startupNote)(process.env.TEST_WORKER_INDEX ? 'ステップ定義の読み込み(ワーカーの準備)' : 'ステップ定義の読み込み(BDD の生成・テストの探索)');
|
|
44
46
|
/**
|
|
@@ -120,19 +122,41 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
120
122
|
scenarioFunctions: [
|
|
121
123
|
async ({ customFunctions, scenarioVariables }, use) => {
|
|
122
124
|
const functions = new scenarioFunctions_1.ScenarioFunctions(customFunctions);
|
|
123
|
-
|
|
124
|
-
scenarioVariables.setFunctionCaller({
|
|
125
|
-
canCall: (functionName) => functions.canCall(functionName),
|
|
126
|
-
call: async (functionName, values, usage) => (await functions.callPositional(functionName, values, usage)).value,
|
|
127
|
-
isClass: (className) => functions.isClass(className),
|
|
128
|
-
callOnNew: (className, values, member, usage) => functions.callOnNew(className, values, member, usage),
|
|
129
|
-
});
|
|
125
|
+
(0, scenarioFunctions_1.bindFunctions)(scenarioVariables, functions);
|
|
130
126
|
await use(functions);
|
|
131
127
|
},
|
|
132
128
|
{ auto: true },
|
|
133
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
|
+
],
|
|
134
153
|
/** エビデンス名の先頭に付ける ID(「ID "…"」のステップで設定する)。 */
|
|
135
|
-
|
|
154
|
+
// 標準クラス DataSnapshot の take が、呼ばれたシナリオの ID を使えるよう、テスト情報に結び付ける(20261024-009)。
|
|
155
|
+
evidenceId: async ({}, use, testInfo) => {
|
|
156
|
+
const id = new evidenceId_1.EvidenceId();
|
|
157
|
+
(0, evidenceId_1.registerEvidenceId)(testInfo, id);
|
|
158
|
+
await use(id);
|
|
159
|
+
},
|
|
136
160
|
/** シナリオのエビデンスのファイルを保存するフォルダ(results/evidence/<実行日時>/<機能ファイル名>/<シナリオ名>)。 */
|
|
137
161
|
evidenceDir: async ({}, use, testInfo) => { await use((0, evidenceId_1.evidenceDirOf)(testInfo)); },
|
|
138
162
|
/**
|
|
@@ -263,11 +287,18 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
263
287
|
*
|
|
264
288
|
* ID が設定されていれば名前の先頭に付ける。同じシナリオで同じ名前になった場合は、ファイル名の末尾に _2, _3, … を付ける(上書きしない)。
|
|
265
289
|
* 通常はページ全体を撮る。options.fullPage が false の場合は画面の表示範囲だけを撮る(スクロールしながらの撮影。20261015-007)。
|
|
290
|
+
* 撮る直前に、画面の種類(ダイアログ・詳細画面・一覧・そのほか)ごとの共通の部品で、表示が落ち着くまで待つ(pages/common/screenReady.ts。
|
|
291
|
+
* 20261024-005、POの決定 案A)。落ち着かない場合も失敗にせず、その時点の画面を撮り、待っていたものをレポートに添付する。
|
|
292
|
+
* options.settle が false の場合は待たない(スクロールしながら撮る2枚目以降と、失敗時の撮影)。
|
|
266
293
|
*/
|
|
267
294
|
evidence: async ({ page, evidenceId, evidenceDir, evidenceLog }, use, testInfo) => {
|
|
268
295
|
await use(async (label, options) => {
|
|
269
296
|
const name = evidenceId.prefix(label);
|
|
297
|
+
const waiting = options?.settle === false ? '' : await (0, screenReady_1.waitForScreenSettled)(page);
|
|
270
298
|
const body = await page.screenshot({ fullPage: options?.fullPage ?? true });
|
|
299
|
+
if (waiting) {
|
|
300
|
+
await testInfo.attach('画面キャプチャーの待ち', { body: `画面の表示が落ち着く前に「${name}」を取得しました(待っていたもの: ${waiting})`, contentType: 'text/plain' });
|
|
301
|
+
}
|
|
271
302
|
evidenceLog.count++;
|
|
272
303
|
await testInfo.attach(name, { body, contentType: 'image/png' });
|
|
273
304
|
(0, node_fs_1.mkdirSync)(evidenceDir, { recursive: true });
|
|
@@ -285,8 +316,11 @@ exports.test = playwright_bdd_1.test.extend({
|
|
|
285
316
|
*
|
|
286
317
|
* 撮るきっかけ(次の操作系ステップの直前)はステップを包む処理が判定するため、シナリオの TestInfo に結び付けて登録する。
|
|
287
318
|
* シナリオの終わりに撮影が未了なら撮る。中断(例外)で終わった場合は撮らない(失敗時の扱いは従来どおり)。
|
|
319
|
+
* シナリオの終わりの撮影は、作成したレコードの片付け(createdRecords)と、記憶したデータの戻し(dataRestores)より先に行う
|
|
320
|
+
* (片付けた後の画面を撮らないため。フィクスチャは使う側から先に片付けられるため、両方を使う。20261024-005 の内部検証で、
|
|
321
|
+
* @片付け の削除の後に撮って「レコードが見つかりません」の画面を撮っていた)。
|
|
288
322
|
*/
|
|
289
|
-
afterSaveEvidence: async ({ evidence, evidenceLog }, use, testInfo) => {
|
|
323
|
+
afterSaveEvidence: async ({ evidence, evidenceLog, createdRecords: _createdRecords, dataRestores: _dataRestores }, use, testInfo) => {
|
|
290
324
|
const afterSave = new afterSaveEvidence_1.AfterSaveEvidence(testInfo, evidence, evidenceLog);
|
|
291
325
|
await use(afterSave);
|
|
292
326
|
if (!(0, mismatch_1.wasInterrupted)(testInfo))
|
|
@@ -355,10 +389,22 @@ function controlledDefinition(define, acceptsExpectNg, triggersAfterSave) {
|
|
|
355
389
|
const fn = args[args.length - 1];
|
|
356
390
|
const rawIndexes = typeof args[0] === 'string' ? (RAW_ARGUMENT_STEPS[args[0]] ?? []) : [];
|
|
357
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;
|
|
358
393
|
const wrapped = async function (...fnArgs) {
|
|
359
394
|
await (0, executionControl_1.runControlled)('step', async () => {
|
|
360
395
|
// 1つ目の引数はフィクスチャ。2つ目以降(ステップの文言の引数と表)を置き換える。
|
|
361
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
|
+
}
|
|
362
408
|
// 保存後の画面キャプチャーが未了なら、この操作で画面が変わる前に撮る(20261023-017)。
|
|
363
409
|
if (capturesAfterSave)
|
|
364
410
|
await (0, afterSaveEvidence_1.afterSaveEvidenceOf)(testInfo)?.captureIfDue();
|
|
@@ -397,6 +443,10 @@ function controlledDefinition(define, acceptsExpectNg, triggersAfterSave) {
|
|
|
397
443
|
(0, startupTiming_1.finishStartupTiming)('最初のステップの開始');
|
|
398
444
|
if (/^ID "/.test($step.title))
|
|
399
445
|
return;
|
|
446
|
+
// 条件の範囲の始まり・それ以外・終わりは画面を操作しないため、確認の対象外にする。条件が成り立たない範囲の中のステップは
|
|
447
|
+
// 実行しないため、保存エラー・ダイアログ・アップロードエラーの確認もしない(どちらも、ダイアログの指示のステップの数に入れない。20261113-003)。
|
|
448
|
+
if ((0, conditionalBlocks_1.isControlStepTitle)($step.title) || (0, conditionalBlocks_1.conditionalBlocksOf)(exports.test.info())?.isSkipping())
|
|
449
|
+
return;
|
|
400
450
|
const uploadProblem = uploadErrors.checkBeforeStep($step.title);
|
|
401
451
|
if (uploadProblem)
|
|
402
452
|
throw new executionControl_1.ExecutionFailure('scenario-invalid', uploadProblem);
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* テストとしては実行しないため、HTML レポートと JUnit 形式の結果にはシナリオだけが表示される。
|
|
6
6
|
* ログインに失敗した場合は、セッションファイルを削除し、シナリオを実行せずに終了する(エラーはターミナルに表示される)。
|
|
7
7
|
* 接続情報は、前回の実行で残ったファイルを使わず、開始時に Salesforce CLI から取得する(support/sf.ts の startConnectionRun)。
|
|
8
|
+
* 設定 dataLocks があれば、ログインの後にテスト実行の排他制御のロックを取り(前の実行で戻せずに残ったロックは先に戻す)、終了後に戻す
|
|
9
|
+
* (support/dataLocks.ts。20261024-010)。書く値のプレースホルダは、シナリオと同じ規則で置き換える(利用者の関数は設定の customFunctions から受け取る。
|
|
10
|
+
* 20261025-004)。ロックを取れずに中断する場合も、セッションファイルを削除してからシナリオを実行せずに終了する。
|
|
8
11
|
*
|
|
9
12
|
* @author Fluxengine.co.jp
|
|
10
13
|
*/
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.default = globalSetup;
|
|
4
7
|
const session_1 = require("./session");
|
|
@@ -6,6 +9,11 @@ const sf_1 = require("./sf");
|
|
|
6
9
|
const metadataCache_1 = require("./metadataCache");
|
|
7
10
|
const startupTiming_1 = require("./startupTiming");
|
|
8
11
|
const executionControl_1 = require("./executionControl");
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const dataLocks_1 = require("./dataLocks");
|
|
14
|
+
const settings_1 = require("./settings");
|
|
15
|
+
const scenarioFunctions_1 = require("./scenarioFunctions");
|
|
16
|
+
const runner_1 = require("./runner");
|
|
9
17
|
/**
|
|
10
18
|
* ログインしてセッションを保存し、テスト全体の終了後に実行する削除処理を返す。
|
|
11
19
|
*
|
|
@@ -16,6 +24,8 @@ const executionControl_1 = require("./executionControl");
|
|
|
16
24
|
async function globalSetup(config) {
|
|
17
25
|
// 開始・終了工程ではNGによる継続を許さないため、この記録先には到達しない。
|
|
18
26
|
const noNg = (failure) => { throw failure; };
|
|
27
|
+
/** テスト実行の排他制御の復元の記録(ロックした場合だけ)。 */
|
|
28
|
+
let lockRecord;
|
|
19
29
|
await (0, executionControl_1.runControlled)('test-setup', async () => {
|
|
20
30
|
const baseURL = config.projects[0]?.use.baseURL;
|
|
21
31
|
if (!baseURL)
|
|
@@ -30,6 +40,8 @@ async function globalSetup(config) {
|
|
|
30
40
|
await (0, session_1.saveSession)(baseURL);
|
|
31
41
|
// ログインで取得した接続情報を保存し、シナリオを実行するプロセスが sf を呼ばずに使えるようにする。
|
|
32
42
|
(0, sf_1.saveConnection)();
|
|
43
|
+
if (settings_1.dataLocks.length)
|
|
44
|
+
lockRecord = await acquireDataLocks(config.projects[0]?.use?.customFunctions ?? {});
|
|
33
45
|
}
|
|
34
46
|
catch (e) {
|
|
35
47
|
(0, startupTiming_1.finishStartupTiming)('前処理(ログイン)の失敗');
|
|
@@ -44,5 +56,41 @@ async function globalSetup(config) {
|
|
|
44
56
|
}
|
|
45
57
|
(0, startupTiming_1.finishStartupTiming)('前処理(ログイン)の終了');
|
|
46
58
|
}, noNg);
|
|
47
|
-
return async () => {
|
|
59
|
+
return async () => {
|
|
60
|
+
await (0, executionControl_1.runControlled)('test-teardown', async () => {
|
|
61
|
+
// テスト実行の排他制御を戻してから、セッションファイルを削除する。戻せなかった場合も削除し、テストの結果を失敗にする
|
|
62
|
+
// (記録が残り、次の実行か npx sftest restore で戻す。Codex のレビューの指摘)。
|
|
63
|
+
try {
|
|
64
|
+
if (lockRecord)
|
|
65
|
+
(0, dataLocks_1.releaseDataLocks)(lockRecord);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await (0, session_1.removeSession)();
|
|
69
|
+
}
|
|
70
|
+
}, noNg);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* テスト実行の排他制御のロックを取り、見張りのプロセスを起動する(20261024-010)。前の実行で戻せずに残ったロックは、先に戻す。
|
|
75
|
+
*
|
|
76
|
+
* @param customFunctions - 利用者の関数・クラス(書く値のプレースホルダの置き換えに使う。20261025-004)。
|
|
77
|
+
* @returns 復元の記録のファイル。すべてロックした時点で解決する。
|
|
78
|
+
* @throws 前の実行のロックを戻せない場合、待つ上限を過ぎてもロック中の場合、設定の誤り・更新の失敗の場合。
|
|
79
|
+
*/
|
|
80
|
+
async function acquireDataLocks(customFunctions) {
|
|
81
|
+
(0, startupTiming_1.startupNote)('テスト実行の排他制御の開始');
|
|
82
|
+
const dir = node_path_1.default.resolve(process.cwd(), dataLocks_1.LOCK_RECORD_DIR);
|
|
83
|
+
const leftovers = (0, dataLocks_1.restoreLeftovers)(dir);
|
|
84
|
+
if (leftovers.length) {
|
|
85
|
+
throw new executionControl_1.ExecutionFailure('runtime-error', `前の実行で残ったテスト実行の排他制御を戻せないため、テストを中断します(${leftovers.join(' / ')})。原因を取り除いてから npx sftest restore で戻してください`);
|
|
86
|
+
}
|
|
87
|
+
const file = node_path_1.default.join(dir, `lock-${process.pid}-${Date.now()}.json`);
|
|
88
|
+
const locks = new dataLocks_1.DataLocks(settings_1.dataLocks, settings_1.dataLockWait, file, undefined, undefined, (0, runner_1.runnerName)(), (0, scenarioFunctions_1.createSettingExpander)(customFunctions));
|
|
89
|
+
// 空の復元の記録を作って見張りのプロセスを起動し、動き始めたことを確かめてから、ロックを書く(書いた後に起動すると、その間に強制終了されたときに
|
|
90
|
+
// 戻す人がいないため)。見張りのプロセスが動き始めなければ、シナリオに進まない(Codex の再レビューの指摘)。
|
|
91
|
+
locks.prepare();
|
|
92
|
+
await (0, dataLocks_1.startWatcherOrRelease)(file, settings_1.dataLockWait);
|
|
93
|
+
await locks.acquireAll();
|
|
94
|
+
(0, startupTiming_1.startupNote)('テスト実行の排他制御の終了');
|
|
95
|
+
return file;
|
|
48
96
|
}
|
|
@@ -21,3 +21,15 @@ export declare const TEST_DATA_DIR_ENV = "SFTEST_TESTDATA_DIR";
|
|
|
21
21
|
* @returns 環境変数 SFTEST_TESTDATA_DIR の値。設定されていない(または空の)場合は、作業フォルダの testdata。
|
|
22
22
|
*/
|
|
23
23
|
export declare function testDataRoot(): string;
|
|
24
|
+
/**
|
|
25
|
+
* 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261024-007)。
|
|
26
|
+
* エビデンスの保存先に、機能ファイルのサブフォルダを含めるために使う(support/evidenceId.ts の evidenceDirOf)。
|
|
27
|
+
*/
|
|
28
|
+
export declare const FEATURES_GEN_DIR_ENV = "SFTEST_FEATURES_GEN_DIR";
|
|
29
|
+
/**
|
|
30
|
+
* 機能ファイルのパターンのうち、ワイルドカードを含まない先頭のフォルダを返す(20261024-007)。
|
|
31
|
+
*
|
|
32
|
+
* @param pattern - 機能ファイルのパターン(例: features/**\/*.feature)。
|
|
33
|
+
* @returns 先頭のフォルダ(例: features)。ワイルドカードがない(1つのファイルを指す)場合は、そのファイルのフォルダ。
|
|
34
|
+
*/
|
|
35
|
+
export declare function featuresBaseDir(pattern: string): string;
|
|
@@ -3,10 +3,11 @@ 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.TEST_DATA_DIR_ENV = exports.OUTPUT_DIR_ENV = void 0;
|
|
6
|
+
exports.FEATURES_GEN_DIR_ENV = exports.TEST_DATA_DIR_ENV = exports.OUTPUT_DIR_ENV = void 0;
|
|
7
7
|
exports.outputRoot = outputRoot;
|
|
8
8
|
exports.outputPath = outputPath;
|
|
9
9
|
exports.testDataRoot = testDataRoot;
|
|
10
|
+
exports.featuresBaseDir = featuresBaseDir;
|
|
10
11
|
/**
|
|
11
12
|
* テストの出力(テストの成果物・HTML レポート・JUnit 形式の結果・エビデンス・セッションと接続情報のファイル)の基準フォルダを扱う。
|
|
12
13
|
*
|
|
@@ -47,3 +48,25 @@ exports.TEST_DATA_DIR_ENV = 'SFTEST_TESTDATA_DIR';
|
|
|
47
48
|
function testDataRoot() {
|
|
48
49
|
return process.env[exports.TEST_DATA_DIR_ENV] || node_path_1.default.join(process.cwd(), 'testdata');
|
|
49
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダの絶対パスを、設定からほかのプロセスに引き継ぐ環境変数(20261024-007)。
|
|
53
|
+
* エビデンスの保存先に、機能ファイルのサブフォルダを含めるために使う(support/evidenceId.ts の evidenceDirOf)。
|
|
54
|
+
*/
|
|
55
|
+
exports.FEATURES_GEN_DIR_ENV = 'SFTEST_FEATURES_GEN_DIR';
|
|
56
|
+
/**
|
|
57
|
+
* 機能ファイルのパターンのうち、ワイルドカードを含まない先頭のフォルダを返す(20261024-007)。
|
|
58
|
+
*
|
|
59
|
+
* @param pattern - 機能ファイルのパターン(例: features/**\/*.feature)。
|
|
60
|
+
* @returns 先頭のフォルダ(例: features)。ワイルドカードがない(1つのファイルを指す)場合は、そのファイルのフォルダ。
|
|
61
|
+
*/
|
|
62
|
+
function featuresBaseDir(pattern) {
|
|
63
|
+
const segments = pattern.replace(/\\/g, '/').split('/');
|
|
64
|
+
const fixed = [];
|
|
65
|
+
for (const segment of segments) {
|
|
66
|
+
if (/[*?[\]{}]/.test(segment))
|
|
67
|
+
break;
|
|
68
|
+
fixed.push(segment);
|
|
69
|
+
}
|
|
70
|
+
const base = fixed.join('/');
|
|
71
|
+
return fixed.length === segments.length ? node_path_1.default.posix.dirname(base) : base;
|
|
72
|
+
}
|
|
@@ -77,6 +77,9 @@ function sfTestConfig(options) {
|
|
|
77
77
|
process.env[outputPaths_1.OUTPUT_DIR_ENV] = fromProject(options.outputDir ?? '.');
|
|
78
78
|
// CSV の登録で、CSV を探すフォルダを、同じく環境変数でワーカーに引き継ぐ(support/outputPaths.ts の testDataRoot。20261021-005)。
|
|
79
79
|
process.env[outputPaths_1.TEST_DATA_DIR_ENV] = fromProject(options.testDataDir ?? 'testdata');
|
|
80
|
+
// 機能ファイルのフォルダ(例: features)から生成したテストコードを置くフォルダを、同じく環境変数でワーカーに引き継ぐ(20261024-007)。
|
|
81
|
+
// 生成したテストコードは、出力先の下に featuresRoot からの相対パスで置かれるため、エビデンスの保存先に機能ファイルのサブフォルダを含められる。
|
|
82
|
+
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))));
|
|
80
83
|
// エビデンスのファイルを保存するフォルダ名(results/evidence/<実行日時>)を決める。
|
|
81
84
|
// 設定ファイルは実行の最初と各ワーカーで読み込まれるため、最初に決めた値を環境変数でワーカーに引き継ぐ。
|
|
82
85
|
if (!process.env.SFTEST_RUN_ID) {
|
|
@@ -0,0 +1,61 @@
|
|
|
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';
|
|
13
|
+
/** 条件の解釈に使う組織の情報(単体の確認では差し替える)。 */
|
|
14
|
+
export interface ConditionApi {
|
|
15
|
+
/** オブジェクトの表示ラベル(または API 名)から API 名を返す。 */
|
|
16
|
+
objectApiName(labelOrApiName: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* 条件のサブクエリの FROM に書いたオブジェクトの表示ラベル(または API 名)から API 名を返す(20261023-012)。
|
|
19
|
+
* 標準クラス SOQL と同じ照合(画面を持たないオブジェクトも許す)。省略した場合は support/sobjects.ts の sobjectApiNameForSoql を使う。
|
|
20
|
+
*/
|
|
21
|
+
soqlObjectApiName?(labelOrApiName: string): string;
|
|
22
|
+
/** オブジェクトの項目の情報(API 名・項目ラベル・型など。項目ラベルを API 名にするために使う)を返す。 */
|
|
23
|
+
describeFields(apiName: string): LabeledField[];
|
|
24
|
+
}
|
|
25
|
+
/** 指定する側(メッセージに使う)。 */
|
|
26
|
+
export interface ConditionOwner {
|
|
27
|
+
/** クラスの名前(例: データの初期化、DataSnapshot)。 */
|
|
28
|
+
className: string;
|
|
29
|
+
/** 条件が空の場合のメッセージの「"<オブジェクト>" の<purpose>条件」の部分(例: データを記憶する)。 */
|
|
30
|
+
purpose: string;
|
|
31
|
+
}
|
|
32
|
+
/** 解釈したオブジェクトと条件。 */
|
|
33
|
+
export interface RecordCondition {
|
|
34
|
+
/** オブジェクトの API 名。 */
|
|
35
|
+
apiName: string;
|
|
36
|
+
/** WHERE 句(引用符の外の YYYY/MM/DD の日付を YYYY-MM-DD にし、項目ラベルを API 名にしたもの)。 */
|
|
37
|
+
where: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* オブジェクト名と条件を解釈し、オブジェクトの API 名と、SOQL に使える WHERE 句にする。
|
|
41
|
+
*
|
|
42
|
+
* @param objectName - オブジェクト(表示ラベルまたは API 名。シナリオに書いたもの)。
|
|
43
|
+
* @param written - WHERE 句(WHERE は書かない)。{名前} は、呼ぶ前に置き換え済みである。コメントと末尾の ; は取り除く。引用符の外の YYYY/MM/DD の日付は、
|
|
44
|
+
* SOQL の日付の書式 YYYY-MM-DD にして使う。項目ラベル([項目ラベル]、または日本語などを含む語)は、オブジェクトの項目の API 名にして使う。
|
|
45
|
+
* @param api - 組織の情報。
|
|
46
|
+
* @param owner - 指定する側(メッセージに使う)。
|
|
47
|
+
* @returns オブジェクトの API 名と WHERE 句。
|
|
48
|
+
* @throws WHERE 句が空・WHERE や LIMIT などを含む、オブジェクトがない、項目ラベルの誤りの場合(シナリオ不正)。
|
|
49
|
+
* 項目の情報を取得できない場合(実行時エラー)。
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveRecordCondition(objectName: string, written: string, api: ConditionApi, owner: ConditionOwner): RecordCondition;
|
|
52
|
+
/**
|
|
53
|
+
* 条件を使う SOQL を実行する。SOQL の誤りは、位置を示すシナリオ不正にする。
|
|
54
|
+
*
|
|
55
|
+
* @param run - SOQL を実行する処理。
|
|
56
|
+
* @param soql - 実行する SOQL。
|
|
57
|
+
* @param label - メッセージに示す、指定の名前(オブジェクトと条件)。
|
|
58
|
+
* @returns レコード。
|
|
59
|
+
* @throws SOQL の誤り(シナリオ不正)、そのほかの失敗(実行時エラー)。
|
|
60
|
+
*/
|
|
61
|
+
export declare function queryWithCondition(run: (soql: string) => Record<string, unknown>[], soql: string, label: string): Record<string, unknown>[];
|