@fluxenginejp/sftest 1.3.1 → 1.4.1
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/LICENSE +21 -21
- package/dist/cli/sftest.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/pages/common/BrowserDialogs.d.ts +0 -8
- package/dist/pages/common/BrowserDialogs.js +10 -1
- package/dist/pages/common/DataImportWizard.d.ts +3 -19
- package/dist/pages/common/DataImportWizard.js +11 -8
- package/dist/pages/common/ElementStates.d.ts +0 -8
- package/dist/pages/common/ElementStates.js +4 -3
- package/dist/pages/common/FileRelatedListPage.d.ts +0 -6
- package/dist/pages/common/FileRelatedListPage.js +6 -4
- package/dist/pages/common/ListViewPage.d.ts +0 -8
- package/dist/pages/common/ListViewPage.js +5 -4
- package/dist/pages/common/LoginAsPage.d.ts +14 -13
- package/dist/pages/common/LoginAsPage.js +63 -8
- package/dist/pages/common/PageButtons.d.ts +0 -13
- package/dist/pages/common/PageButtons.js +14 -9
- package/dist/pages/common/PageLinks.d.ts +24 -0
- package/dist/pages/common/PageLinks.js +87 -0
- package/dist/pages/common/RecordData.js +2 -1
- package/dist/pages/common/RecordDetailPage.d.ts +48 -18
- package/dist/pages/common/RecordDetailPage.js +121 -28
- package/dist/pages/common/RecordFields.d.ts +40 -20
- package/dist/pages/common/RecordFields.js +153 -31
- package/dist/pages/common/RecordFormDialog.d.ts +0 -7
- package/dist/pages/common/RecordFormDialog.js +23 -10
- package/dist/pages/common/RecordPage.d.ts +5 -3
- package/dist/pages/common/RecordPage.js +18 -8
- package/dist/pages/common/ScreenDialog.d.ts +70 -10
- package/dist/pages/common/ScreenDialog.js +210 -15
- package/dist/pages/common/fieldSections.d.ts +53 -0
- package/dist/pages/common/fieldSections.js +89 -0
- package/dist/pages/common/listViewPicker.d.ts +0 -5
- package/dist/pages/common/listViewPicker.js +3 -2
- package/dist/pages/common/relatedLists.d.ts +0 -5
- package/dist/pages/common/relatedLists.js +2 -1
- package/dist/pages/common/saveErrors.d.ts +0 -10
- package/dist/pages/common/saveErrors.js +2 -3
- package/dist/steps/common/apex.steps.js +6 -2
- package/dist/steps/common/button.steps.js +14 -8
- package/dist/steps/common/common.steps.js +33 -20
- package/dist/steps/common/dialog.steps.js +29 -9
- package/dist/steps/common/file.steps.js +18 -12
- package/dist/steps/common/import.steps.js +22 -5
- package/dist/steps/common/record.steps.js +18 -6
- package/dist/steps/common/state.steps.js +2 -0
- package/dist/steps/common/window.steps.d.ts +1 -0
- package/dist/steps/common/window.steps.js +35 -0
- package/dist/support/FileDownloads.d.ts +0 -6
- package/dist/support/FileDownloads.js +8 -1
- package/dist/support/UploadErrors.d.ts +0 -6
- package/dist/support/UploadErrors.js +15 -7
- package/dist/support/activePages.d.ts +89 -0
- package/dist/support/activePages.js +182 -0
- package/dist/support/apexBatch.js +5 -4
- package/dist/support/consoleReporter.js +2 -1
- package/dist/support/executionControl.d.ts +102 -0
- package/dist/support/executionControl.js +275 -0
- package/dist/support/fileInputs.js +7 -4
- package/dist/support/fixtures.d.ts +62 -66
- package/dist/support/fixtures.js +84 -45
- package/dist/support/globalSetup.js +30 -20
- package/dist/support/loginState.d.ts +31 -0
- package/dist/support/loginState.js +26 -0
- package/dist/support/mismatch.d.ts +7 -0
- package/dist/support/mismatch.js +22 -9
- package/dist/support/operationTargets.d.ts +22 -0
- package/dist/support/operationTargets.js +26 -0
- package/dist/support/playwrightConfig.d.ts +0 -13
- package/dist/support/playwrightConfig.js +2 -1
- package/dist/support/settings.d.ts +4 -0
- package/dist/support/settings.js +61 -21
- package/dist/support/sf.js +2 -1
- package/dist/support/sobjects.js +5 -4
- package/dist/support/stepArguments.d.ts +38 -0
- package/dist/support/stepArguments.js +74 -0
- package/docs/CHANGELOG.md +219 -183
- package/docs/EXTENSIONS.html +540 -0
- package/docs/SPEC.html +5728 -1501
- package/package.json +82 -81
- package/readme.md +95 -96
- package/sftest.config.jsonc +5 -0
- package/templates/env +8 -8
- package/templates/gitignore +7 -7
- package/templates/playwright.config.ts +17 -17
- package/templates/vscode-settings.json +4 -4
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionFailure = void 0;
|
|
4
|
+
exports.classifyFailure = classifyFailure;
|
|
5
|
+
exports.withCategory = withCategory;
|
|
6
|
+
exports.isExecutionFailure = isExecutionFailure;
|
|
7
|
+
exports.runRequired = runRequired;
|
|
8
|
+
exports.decideFailure = decideFailure;
|
|
9
|
+
exports.applyFailure = applyFailure;
|
|
10
|
+
exports.runControlled = runControlled;
|
|
11
|
+
/**
|
|
12
|
+
* 失敗の分類と発生工程から、NGの記録または実行の中断を判断する。
|
|
13
|
+
*
|
|
14
|
+
* Playwrightや個別ステップには依存しない。操作・検査を行う側が分類を通知し、
|
|
15
|
+
* 実行境界が本部品の判断をNGの記録や例外の送出へ適用する。
|
|
16
|
+
*
|
|
17
|
+
* @author Fluxengine.co.jp
|
|
18
|
+
*/
|
|
19
|
+
const node_util_1 = require("node:util");
|
|
20
|
+
/** 利用者へ表示する分類名。機械的な分類はcategoryで識別し、この文字列を解析しない。 */
|
|
21
|
+
const CATEGORY_LABELS = {
|
|
22
|
+
'test-ng': 'テスト結果NG',
|
|
23
|
+
'scenario-invalid': 'シナリオ不正',
|
|
24
|
+
'runtime-error': '実行時エラー',
|
|
25
|
+
};
|
|
26
|
+
/** 拡張側と本体側が別のモジュールとして読み込まれても共有する、明示的な通知の目印。 */
|
|
27
|
+
const FAILURE_BRAND = Symbol.for('@fluxenginejp/sftest.executionFailure');
|
|
28
|
+
/**
|
|
29
|
+
* 分類と原因を保持する失敗。シナリオ間で共有する状態は持たない。
|
|
30
|
+
*
|
|
31
|
+
* NGの通知自体は例外としても扱えるが、実行境界は共通方針に従って記録へ変換する。
|
|
32
|
+
* 元のメッセージはdetail、元の例外はcauseに保持する。
|
|
33
|
+
*/
|
|
34
|
+
class ExecutionFailure extends Error {
|
|
35
|
+
category;
|
|
36
|
+
detail;
|
|
37
|
+
[FAILURE_BRAND] = true;
|
|
38
|
+
/**
|
|
39
|
+
* 分類名を表示に付け、元の原因を保持する。
|
|
40
|
+
*
|
|
41
|
+
* @param category - 通知元が確定した分類。
|
|
42
|
+
* @param detail - 対象・期待条件・観測した結果、または実行できない理由。
|
|
43
|
+
* @param options - 元の例外をcauseとして引き継ぐ指定。省略時は原因の指定なし。
|
|
44
|
+
*/
|
|
45
|
+
constructor(category, detail, options) {
|
|
46
|
+
super(`[${CATEGORY_LABELS[category]}] ${detail}`, options);
|
|
47
|
+
this.category = category;
|
|
48
|
+
this.detail = detail;
|
|
49
|
+
this.name = 'ExecutionFailure';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ExecutionFailure = ExecutionFailure;
|
|
53
|
+
/**
|
|
54
|
+
* 未分類の例外を実行時エラーへ変換する。分類済みの例外は同じものを返す。
|
|
55
|
+
*
|
|
56
|
+
* メッセージやmatcherResultから分類を推測しない。expectの互換処理は呼出元で明示する。
|
|
57
|
+
*
|
|
58
|
+
* @param error - 操作・検査または実行境界で受け取った例外。
|
|
59
|
+
* @returns 分類を識別でき、元の例外をcauseに保持する失敗。
|
|
60
|
+
*/
|
|
61
|
+
function classifyFailure(error) {
|
|
62
|
+
if (isExecutionFailure(error))
|
|
63
|
+
return error;
|
|
64
|
+
return withCategory('runtime-error', error);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 分類されていない例外に分類を付けた失敗を作る。分類済みの例外は同じものを返す(分類を付け直さない)。
|
|
68
|
+
*
|
|
69
|
+
* 発生元が原因を知っている場合(対象を確かめる expect の不成立をシナリオ不正にする場合など)に使う。元の name・スタック・
|
|
70
|
+
* matcherResult を、作る失敗そのものに移し、元の例外は cause に残す(classifyFailure と同じ)。
|
|
71
|
+
*
|
|
72
|
+
* @param category - 付ける分類。
|
|
73
|
+
* @param error - 元の例外。
|
|
74
|
+
* @returns 分類を持つ失敗。
|
|
75
|
+
*/
|
|
76
|
+
function withCategory(category, error) {
|
|
77
|
+
if (isExecutionFailure(error))
|
|
78
|
+
return error;
|
|
79
|
+
// 原因の読み取り(Error の name・message・stack の getter など)が投げても、分類と元の原因は必ず残す(20261018-009 の R10)。
|
|
80
|
+
try {
|
|
81
|
+
return describedFailure(category, error);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return new ExecutionFailure(category, '内容を読み取れない例外が投げられました', { cause: error });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 元の例外の説明・位置・付加情報を移した失敗を作る(withCategory の本体)。
|
|
89
|
+
*
|
|
90
|
+
* @param category - 付ける分類。
|
|
91
|
+
* @param error - 元の例外(分類済みではないもの)。
|
|
92
|
+
* @returns 分類を持つ失敗。
|
|
93
|
+
* @throws 元の例外の項目を読み取れない場合(呼出元が固定の説明に置き換える)。
|
|
94
|
+
*/
|
|
95
|
+
function describedFailure(category, error) {
|
|
96
|
+
const detail = node_util_1.types.isNativeError(error) ? String(error.message) : describeNonError(error);
|
|
97
|
+
const failure = new ExecutionFailure(category, detail, { cause: error });
|
|
98
|
+
if (node_util_1.types.isNativeError(error)) {
|
|
99
|
+
// レポーターが例外そのものから失敗位置とexpectの詳細を読むため、causeだけへの退避では足りない。
|
|
100
|
+
failure.name = String(error.name);
|
|
101
|
+
const stack = error.stack;
|
|
102
|
+
if (typeof stack === 'string' && stack) {
|
|
103
|
+
const header = `${failure.name}: ${detail}`;
|
|
104
|
+
failure.stack = stack.startsWith(header)
|
|
105
|
+
? `${failure.name}: ${failure.message}${stack.slice(header.length)}`
|
|
106
|
+
: stack;
|
|
107
|
+
}
|
|
108
|
+
if ('matcherResult' in error) {
|
|
109
|
+
Object.defineProperty(failure, 'matcherResult', { value: error.matcherResult, enumerable: true, configurable: true });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return failure;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* オブジェクト自身のデータの項目の値を返す。getter は呼ばない(投げられた値の診断で、利用者の処理を実行しないため。R10)。
|
|
116
|
+
*
|
|
117
|
+
* @param value - 調べるオブジェクト。
|
|
118
|
+
* @param key - 項目の名前。
|
|
119
|
+
* @returns データの項目の値。項目がない、getter である、または調べられない(Proxy が投げる場合など)場合は undefined。
|
|
120
|
+
*/
|
|
121
|
+
function ownData(value, key) {
|
|
122
|
+
try {
|
|
123
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
124
|
+
return descriptor && 'value' in descriptor ? descriptor.value : undefined;
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* オブジェクトの型の名前を、getter を呼ばずに返す(プロトタイプの constructor の name)。
|
|
132
|
+
*
|
|
133
|
+
* @param value - 調べるオブジェクト。
|
|
134
|
+
* @returns 型の名前。分からない場合は undefined。
|
|
135
|
+
*/
|
|
136
|
+
function typeName(value) {
|
|
137
|
+
try {
|
|
138
|
+
const prototype = Object.getPrototypeOf(value);
|
|
139
|
+
const constructor = prototype ? ownData(prototype, 'constructor') : undefined;
|
|
140
|
+
const name = typeof constructor === 'function' ? ownData(constructor, 'name') : undefined;
|
|
141
|
+
return typeof name === 'string' && name ? name : undefined;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Error 以外の値を投げた場合の原因の説明を作る(20261018-009 の R7)。
|
|
149
|
+
*
|
|
150
|
+
* オブジェクトは、型の名前と、キーの名前(最大10個)だけを示す。値は表示しない(認証情報などの値を、レポートやコンソールへ
|
|
151
|
+
* 広げないため)。文字列の message をデータの項目として持つオブジェクトは、その message も示す(Error に似せて作った値の説明を
|
|
152
|
+
* 失わないため)。getter・toString などの利用者の処理は呼ばない(R10)。元の値は cause に残る。
|
|
153
|
+
*
|
|
154
|
+
* @param value - 投げられた値(Error 以外)。
|
|
155
|
+
* @returns 原因の説明。
|
|
156
|
+
* @throws 値を文字にできない場合(Symbol 以外の基本の値では起きない。呼出元が固定の説明に置き換える)。
|
|
157
|
+
*/
|
|
158
|
+
function describeNonError(value) {
|
|
159
|
+
if (typeof value === 'function')
|
|
160
|
+
return `Error 以外の値(関数${typeName(value) ? `。${typeName(value)}` : ''})が投げられました`;
|
|
161
|
+
if (typeof value !== 'object' || value === null)
|
|
162
|
+
return String(value);
|
|
163
|
+
const type = typeName(value);
|
|
164
|
+
let keys = [];
|
|
165
|
+
try {
|
|
166
|
+
keys = Object.keys(value);
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
keys = [];
|
|
170
|
+
}
|
|
171
|
+
const message = ownData(value, 'message');
|
|
172
|
+
const parts = [
|
|
173
|
+
`Error 以外の値(${type ?? 'Object'}`,
|
|
174
|
+
keys.length ? `、キー: ${keys.slice(0, 10).join(', ')}${keys.length > 10 ? ' ほか' : ''}` : '',
|
|
175
|
+
')が投げられました',
|
|
176
|
+
typeof message === 'string' && message ? `: ${message}` : '',
|
|
177
|
+
];
|
|
178
|
+
return parts.join('');
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 別の読み込み元から届いた失敗も、共有する目印と契約の項目で識別する。
|
|
182
|
+
*
|
|
183
|
+
* @param error - 調べる通知。
|
|
184
|
+
* @returns 明示的な分類の目印と、必要な項目を持つ場合はtrue。
|
|
185
|
+
*/
|
|
186
|
+
function isExecutionFailure(error) {
|
|
187
|
+
if (typeof error !== 'object' || error === null)
|
|
188
|
+
return false;
|
|
189
|
+
// 項目の読み取りが投げる値(getter・Proxy)は、分類済みとして扱わない(R10)。目印と項目はデータの項目として読む。
|
|
190
|
+
try {
|
|
191
|
+
const category = ownData(error, 'category');
|
|
192
|
+
return ownData(error, FAILURE_BRAND) === true
|
|
193
|
+
&& (category === 'test-ng' || category === 'scenario-invalid' || category === 'runtime-error')
|
|
194
|
+
&& typeof ownData(error, 'detail') === 'string' && typeof ownData(error, 'message') === 'string';
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 継続を許さない開始・終了工程の同期処理に、共通の中断方針を適用する。
|
|
202
|
+
*
|
|
203
|
+
* @param phase - ステップ以外の発生工程。
|
|
204
|
+
* @param run - 設定の検証、または開始・終了の処理。
|
|
205
|
+
* @returns 正常に完了した処理の戻り値。
|
|
206
|
+
* @throws 分類を保持した失敗。ステップ以外からのNG通知は実行時エラーとなる。
|
|
207
|
+
*/
|
|
208
|
+
function runRequired(phase, run) {
|
|
209
|
+
try {
|
|
210
|
+
return run();
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
throw decideFailure(error, phase).failure;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* 失敗の分類と発生工程から、記録・シナリオ中断・テスト全体の中断を判断する。
|
|
218
|
+
*
|
|
219
|
+
* 検査を行うステップ以外からNGが通知された場合は、契約の不備を実行時エラーとする。
|
|
220
|
+
* 終了工程でも原因を分類したまま返し、必要な片付けや一次原因の保持は実行境界が担う。
|
|
221
|
+
*
|
|
222
|
+
* @param error - 分類済みの失敗、または分類がまだない例外。
|
|
223
|
+
* @param phase - 失敗が発生した工程。
|
|
224
|
+
* @returns 発生工程と、分類を保持した共通の判断。
|
|
225
|
+
*/
|
|
226
|
+
function decideFailure(error, phase) {
|
|
227
|
+
let failure = classifyFailure(error);
|
|
228
|
+
if (failure.category === 'test-ng') {
|
|
229
|
+
if (phase === 'step')
|
|
230
|
+
return { failure, phase, disposition: 'record-ng' };
|
|
231
|
+
failure = new ExecutionFailure('runtime-error', `ステップ以外の工程からNGが通知されました(${phase}): ${failure.detail}`, { cause: failure });
|
|
232
|
+
}
|
|
233
|
+
const global = phase === 'configuration' || phase === 'test-setup' || phase === 'test-teardown';
|
|
234
|
+
return { failure, phase, disposition: global ? 'abort-test' : 'abort-scenario' };
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* 共通の判断を適用し、NGを記録するか、分類済みの失敗を投げる。
|
|
238
|
+
*
|
|
239
|
+
* NGの記録先が失敗した場合は、その原因を実行時エラーとして投げる。記録失敗を成功扱いにしない。
|
|
240
|
+
*
|
|
241
|
+
* @param error - 通知された失敗。
|
|
242
|
+
* @param phase - 発生した工程。
|
|
243
|
+
* @param recordNg - NGを実行結果に残す同期処理。中断を指示する判断では呼ばない。
|
|
244
|
+
* @throws 共通方針が中断を指示した場合、またはNGを記録できない場合。
|
|
245
|
+
*/
|
|
246
|
+
function applyFailure(error, phase, recordNg) {
|
|
247
|
+
const decision = decideFailure(error, phase);
|
|
248
|
+
if (decision.disposition !== 'record-ng')
|
|
249
|
+
throw decision.failure;
|
|
250
|
+
try {
|
|
251
|
+
recordNg(decision.failure);
|
|
252
|
+
}
|
|
253
|
+
catch (cause) {
|
|
254
|
+
throw new ExecutionFailure('runtime-error', `NGの判定内容を記録できません: ${decision.failure.detail}`, {
|
|
255
|
+
cause: new AggregateError([decision.failure, cause], 'NGの通知と記録処理の失敗'),
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* 非同期の処理を実行し、通知された失敗へ共通方針を適用する。
|
|
261
|
+
*
|
|
262
|
+
* @param phase - この処理の発生工程。
|
|
263
|
+
* @param run - 操作・検査、または開始・終了の処理。
|
|
264
|
+
* @param recordNg - NGを実行結果に残す同期処理。
|
|
265
|
+
* @returns 処理が完了した時点、またはNGを記録した時点で解決する。
|
|
266
|
+
* @throws シナリオ不正・実行時エラー、契約の不備、またはNGの記録失敗。
|
|
267
|
+
*/
|
|
268
|
+
async function runControlled(phase, run, recordNg) {
|
|
269
|
+
try {
|
|
270
|
+
await run();
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
applyFailure(error, phase, recordNg);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -13,6 +13,7 @@ exports.fileIdentity = fileIdentity;
|
|
|
13
13
|
const promises_1 = require("node:fs/promises");
|
|
14
14
|
const node_fs_1 = require("node:fs");
|
|
15
15
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const executionControl_1 = require("./executionControl");
|
|
16
17
|
/**
|
|
17
18
|
* プロジェクトを基準に、読み取り可能な通常のファイルを特定する。
|
|
18
19
|
*
|
|
@@ -23,16 +24,18 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
23
24
|
*/
|
|
24
25
|
async function readableFile(inputPath, projectDir = process.cwd()) {
|
|
25
26
|
if (!inputPath || inputPath.includes('\0'))
|
|
26
|
-
throw new
|
|
27
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', '入力ファイルのパスが空、または不正です');
|
|
27
28
|
const absolute = node_path_1.default.resolve(projectDir, inputPath);
|
|
28
29
|
try {
|
|
29
30
|
if (!(await (0, promises_1.stat)(absolute)).isFile())
|
|
30
|
-
throw new
|
|
31
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', '通常のファイルではありません');
|
|
31
32
|
await (0, promises_1.access)(absolute, node_fs_1.constants.R_OK);
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
34
35
|
const reason = error instanceof Error ? error.message : String(error);
|
|
35
|
-
|
|
36
|
+
const absent = typeof error === 'object' && error !== null && 'code' in error && (error.code === 'ENOENT' || error.code === 'ENOTDIR');
|
|
37
|
+
const category = absent ? 'scenario-invalid' : (0, executionControl_1.classifyFailure)(error).category;
|
|
38
|
+
throw new executionControl_1.ExecutionFailure(category, `入力ファイル "${inputPath}" を読み取れません: ${reason}`, { cause: error });
|
|
36
39
|
}
|
|
37
40
|
return absolute;
|
|
38
41
|
}
|
|
@@ -48,7 +51,7 @@ async function readableFile(inputPath, projectDir = process.cwd()) {
|
|
|
48
51
|
*/
|
|
49
52
|
function fileIdentity(fileName) {
|
|
50
53
|
if (!fileName || /[\\/:*?"<>|\x00-\x1f]/.test(fileName) || /[. ]$/.test(fileName)) {
|
|
51
|
-
throw new
|
|
54
|
+
throw new executionControl_1.ExecutionFailure('scenario-invalid', `ファイル名 "${fileName}" はパスを含まない名前で指定してください`);
|
|
52
55
|
}
|
|
53
56
|
const dot = fileName.lastIndexOf('.');
|
|
54
57
|
return dot > 0
|
|
@@ -15,6 +15,7 @@ import { FileRelatedListPage } from '../pages/common/FileRelatedListPage';
|
|
|
15
15
|
import { ListViewPage } from '../pages/common/ListViewPage';
|
|
16
16
|
import { LoginAsPage } from '../pages/common/LoginAsPage';
|
|
17
17
|
import { PageButtons } from '../pages/common/PageButtons';
|
|
18
|
+
import { PageLinks } from '../pages/common/PageLinks';
|
|
18
19
|
import { RecordData } from '../pages/common/RecordData';
|
|
19
20
|
import { RecordDetailPage } from '../pages/common/RecordDetailPage';
|
|
20
21
|
import { RecordFormDialog } from '../pages/common/RecordFormDialog';
|
|
@@ -23,6 +24,7 @@ import { FieldValue } from '../pages/common/RecordFields';
|
|
|
23
24
|
import { SaveErrors } from '../pages/common/saveErrors';
|
|
24
25
|
import { ScreenDialog } from '../pages/common/ScreenDialog';
|
|
25
26
|
import { Evidence } from '../pages/common/scrollCapture';
|
|
27
|
+
import { ActivePages } from './activePages';
|
|
26
28
|
import { CreatedRecords } from './createdRecords';
|
|
27
29
|
import { EvidenceId } from './evidenceId';
|
|
28
30
|
import { FileDownloads } from './FileDownloads';
|
|
@@ -48,6 +50,8 @@ export declare const test: import("@playwright/test").TestType<import("@playwrig
|
|
|
48
50
|
browserDialogs: BrowserDialogs;
|
|
49
51
|
screenDialog: ScreenDialog;
|
|
50
52
|
pageButtons: PageButtons;
|
|
53
|
+
activePages: ActivePages;
|
|
54
|
+
pageLinks: PageLinks;
|
|
51
55
|
dataImportWizard: DataImportWizard;
|
|
52
56
|
recordData: RecordData;
|
|
53
57
|
recordPages: RecordPages;
|
|
@@ -71,6 +75,8 @@ declare const bdd: {
|
|
|
71
75
|
browserDialogs: BrowserDialogs;
|
|
72
76
|
screenDialog: ScreenDialog;
|
|
73
77
|
pageButtons: PageButtons;
|
|
78
|
+
activePages: ActivePages;
|
|
79
|
+
pageLinks: PageLinks;
|
|
74
80
|
dataImportWizard: DataImportWizard;
|
|
75
81
|
recordData: RecordData;
|
|
76
82
|
recordPages: RecordPages;
|
|
@@ -92,6 +98,8 @@ declare const bdd: {
|
|
|
92
98
|
browserDialogs: BrowserDialogs;
|
|
93
99
|
screenDialog: ScreenDialog;
|
|
94
100
|
pageButtons: PageButtons;
|
|
101
|
+
activePages: ActivePages;
|
|
102
|
+
pageLinks: PageLinks;
|
|
95
103
|
dataImportWizard: DataImportWizard;
|
|
96
104
|
recordData: RecordData;
|
|
97
105
|
recordPages: RecordPages;
|
|
@@ -113,6 +121,8 @@ declare const bdd: {
|
|
|
113
121
|
browserDialogs: BrowserDialogs;
|
|
114
122
|
screenDialog: ScreenDialog;
|
|
115
123
|
pageButtons: PageButtons;
|
|
124
|
+
activePages: ActivePages;
|
|
125
|
+
pageLinks: PageLinks;
|
|
116
126
|
dataImportWizard: DataImportWizard;
|
|
117
127
|
recordData: RecordData;
|
|
118
128
|
recordPages: RecordPages;
|
|
@@ -134,6 +144,8 @@ declare const bdd: {
|
|
|
134
144
|
browserDialogs: BrowserDialogs;
|
|
135
145
|
screenDialog: ScreenDialog;
|
|
136
146
|
pageButtons: PageButtons;
|
|
147
|
+
activePages: ActivePages;
|
|
148
|
+
pageLinks: PageLinks;
|
|
137
149
|
dataImportWizard: DataImportWizard;
|
|
138
150
|
recordData: RecordData;
|
|
139
151
|
recordPages: RecordPages;
|
|
@@ -165,6 +177,8 @@ declare const bdd: {
|
|
|
165
177
|
browserDialogs: BrowserDialogs;
|
|
166
178
|
screenDialog: ScreenDialog;
|
|
167
179
|
pageButtons: PageButtons;
|
|
180
|
+
activePages: ActivePages;
|
|
181
|
+
pageLinks: PageLinks;
|
|
168
182
|
dataImportWizard: DataImportWizard;
|
|
169
183
|
recordData: RecordData;
|
|
170
184
|
recordPages: RecordPages;
|
|
@@ -185,6 +199,8 @@ declare const bdd: {
|
|
|
185
199
|
browserDialogs: BrowserDialogs;
|
|
186
200
|
screenDialog: ScreenDialog;
|
|
187
201
|
pageButtons: PageButtons;
|
|
202
|
+
activePages: ActivePages;
|
|
203
|
+
pageLinks: PageLinks;
|
|
188
204
|
dataImportWizard: DataImportWizard;
|
|
189
205
|
recordData: RecordData;
|
|
190
206
|
recordPages: RecordPages;
|
|
@@ -209,6 +225,8 @@ declare const bdd: {
|
|
|
209
225
|
browserDialogs: BrowserDialogs;
|
|
210
226
|
screenDialog: ScreenDialog;
|
|
211
227
|
pageButtons: PageButtons;
|
|
228
|
+
activePages: ActivePages;
|
|
229
|
+
pageLinks: PageLinks;
|
|
212
230
|
dataImportWizard: DataImportWizard;
|
|
213
231
|
recordData: RecordData;
|
|
214
232
|
recordPages: RecordPages;
|
|
@@ -230,6 +248,8 @@ declare const bdd: {
|
|
|
230
248
|
browserDialogs: BrowserDialogs;
|
|
231
249
|
screenDialog: ScreenDialog;
|
|
232
250
|
pageButtons: PageButtons;
|
|
251
|
+
activePages: ActivePages;
|
|
252
|
+
pageLinks: PageLinks;
|
|
233
253
|
dataImportWizard: DataImportWizard;
|
|
234
254
|
recordData: RecordData;
|
|
235
255
|
recordPages: RecordPages;
|
|
@@ -250,6 +270,8 @@ declare const bdd: {
|
|
|
250
270
|
browserDialogs: BrowserDialogs;
|
|
251
271
|
screenDialog: ScreenDialog;
|
|
252
272
|
pageButtons: PageButtons;
|
|
273
|
+
activePages: ActivePages;
|
|
274
|
+
pageLinks: PageLinks;
|
|
253
275
|
dataImportWizard: DataImportWizard;
|
|
254
276
|
recordData: RecordData;
|
|
255
277
|
recordPages: RecordPages;
|
|
@@ -274,6 +296,8 @@ declare const bdd: {
|
|
|
274
296
|
browserDialogs: BrowserDialogs;
|
|
275
297
|
screenDialog: ScreenDialog;
|
|
276
298
|
pageButtons: PageButtons;
|
|
299
|
+
activePages: ActivePages;
|
|
300
|
+
pageLinks: PageLinks;
|
|
277
301
|
dataImportWizard: DataImportWizard;
|
|
278
302
|
recordData: RecordData;
|
|
279
303
|
recordPages: RecordPages;
|
|
@@ -305,6 +329,8 @@ declare const bdd: {
|
|
|
305
329
|
browserDialogs: BrowserDialogs;
|
|
306
330
|
screenDialog: ScreenDialog;
|
|
307
331
|
pageButtons: PageButtons;
|
|
332
|
+
activePages: ActivePages;
|
|
333
|
+
pageLinks: PageLinks;
|
|
308
334
|
dataImportWizard: DataImportWizard;
|
|
309
335
|
recordData: RecordData;
|
|
310
336
|
recordPages: RecordPages;
|
|
@@ -325,6 +351,8 @@ declare const bdd: {
|
|
|
325
351
|
browserDialogs: BrowserDialogs;
|
|
326
352
|
screenDialog: ScreenDialog;
|
|
327
353
|
pageButtons: PageButtons;
|
|
354
|
+
activePages: ActivePages;
|
|
355
|
+
pageLinks: PageLinks;
|
|
328
356
|
dataImportWizard: DataImportWizard;
|
|
329
357
|
recordData: RecordData;
|
|
330
358
|
recordPages: RecordPages;
|
|
@@ -349,6 +377,8 @@ declare const bdd: {
|
|
|
349
377
|
browserDialogs: BrowserDialogs;
|
|
350
378
|
screenDialog: ScreenDialog;
|
|
351
379
|
pageButtons: PageButtons;
|
|
380
|
+
activePages: ActivePages;
|
|
381
|
+
pageLinks: PageLinks;
|
|
352
382
|
dataImportWizard: DataImportWizard;
|
|
353
383
|
recordData: RecordData;
|
|
354
384
|
recordPages: RecordPages;
|
|
@@ -370,6 +400,8 @@ declare const bdd: {
|
|
|
370
400
|
browserDialogs: BrowserDialogs;
|
|
371
401
|
screenDialog: ScreenDialog;
|
|
372
402
|
pageButtons: PageButtons;
|
|
403
|
+
activePages: ActivePages;
|
|
404
|
+
pageLinks: PageLinks;
|
|
373
405
|
dataImportWizard: DataImportWizard;
|
|
374
406
|
recordData: RecordData;
|
|
375
407
|
recordPages: RecordPages;
|
|
@@ -390,6 +422,8 @@ declare const bdd: {
|
|
|
390
422
|
browserDialogs: BrowserDialogs;
|
|
391
423
|
screenDialog: ScreenDialog;
|
|
392
424
|
pageButtons: PageButtons;
|
|
425
|
+
activePages: ActivePages;
|
|
426
|
+
pageLinks: PageLinks;
|
|
393
427
|
dataImportWizard: DataImportWizard;
|
|
394
428
|
recordData: RecordData;
|
|
395
429
|
recordPages: RecordPages;
|
|
@@ -414,6 +448,8 @@ declare const bdd: {
|
|
|
414
448
|
browserDialogs: BrowserDialogs;
|
|
415
449
|
screenDialog: ScreenDialog;
|
|
416
450
|
pageButtons: PageButtons;
|
|
451
|
+
activePages: ActivePages;
|
|
452
|
+
pageLinks: PageLinks;
|
|
417
453
|
dataImportWizard: DataImportWizard;
|
|
418
454
|
recordData: RecordData;
|
|
419
455
|
recordPages: RecordPages;
|
|
@@ -435,6 +471,8 @@ declare const bdd: {
|
|
|
435
471
|
browserDialogs: BrowserDialogs;
|
|
436
472
|
screenDialog: ScreenDialog;
|
|
437
473
|
pageButtons: PageButtons;
|
|
474
|
+
activePages: ActivePages;
|
|
475
|
+
pageLinks: PageLinks;
|
|
438
476
|
dataImportWizard: DataImportWizard;
|
|
439
477
|
recordData: RecordData;
|
|
440
478
|
recordPages: RecordPages;
|
|
@@ -455,6 +493,8 @@ declare const bdd: {
|
|
|
455
493
|
browserDialogs: BrowserDialogs;
|
|
456
494
|
screenDialog: ScreenDialog;
|
|
457
495
|
pageButtons: PageButtons;
|
|
496
|
+
activePages: ActivePages;
|
|
497
|
+
pageLinks: PageLinks;
|
|
458
498
|
dataImportWizard: DataImportWizard;
|
|
459
499
|
recordData: RecordData;
|
|
460
500
|
recordPages: RecordPages;
|
|
@@ -479,6 +519,8 @@ declare const bdd: {
|
|
|
479
519
|
browserDialogs: BrowserDialogs;
|
|
480
520
|
screenDialog: ScreenDialog;
|
|
481
521
|
pageButtons: PageButtons;
|
|
522
|
+
activePages: ActivePages;
|
|
523
|
+
pageLinks: PageLinks;
|
|
482
524
|
dataImportWizard: DataImportWizard;
|
|
483
525
|
recordData: RecordData;
|
|
484
526
|
recordPages: RecordPages;
|
|
@@ -500,6 +542,8 @@ declare const bdd: {
|
|
|
500
542
|
browserDialogs: BrowserDialogs;
|
|
501
543
|
screenDialog: ScreenDialog;
|
|
502
544
|
pageButtons: PageButtons;
|
|
545
|
+
activePages: ActivePages;
|
|
546
|
+
pageLinks: PageLinks;
|
|
503
547
|
dataImportWizard: DataImportWizard;
|
|
504
548
|
recordData: RecordData;
|
|
505
549
|
recordPages: RecordPages;
|
|
@@ -520,6 +564,8 @@ declare const bdd: {
|
|
|
520
564
|
browserDialogs: BrowserDialogs;
|
|
521
565
|
screenDialog: ScreenDialog;
|
|
522
566
|
pageButtons: PageButtons;
|
|
567
|
+
activePages: ActivePages;
|
|
568
|
+
pageLinks: PageLinks;
|
|
523
569
|
dataImportWizard: DataImportWizard;
|
|
524
570
|
recordData: RecordData;
|
|
525
571
|
recordPages: RecordPages;
|
|
@@ -544,6 +590,8 @@ declare const bdd: {
|
|
|
544
590
|
browserDialogs: BrowserDialogs;
|
|
545
591
|
screenDialog: ScreenDialog;
|
|
546
592
|
pageButtons: PageButtons;
|
|
593
|
+
activePages: ActivePages;
|
|
594
|
+
pageLinks: PageLinks;
|
|
547
595
|
dataImportWizard: DataImportWizard;
|
|
548
596
|
recordData: RecordData;
|
|
549
597
|
recordPages: RecordPages;
|
|
@@ -555,47 +603,7 @@ declare const bdd: {
|
|
|
555
603
|
inAppGuidance: void;
|
|
556
604
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
557
605
|
};
|
|
558
|
-
export declare const
|
|
559
|
-
evidenceId: EvidenceId;
|
|
560
|
-
evidenceDir: string;
|
|
561
|
-
createdRecords: CreatedRecords;
|
|
562
|
-
saveErrors: SaveErrors;
|
|
563
|
-
fileDownloads: FileDownloads;
|
|
564
|
-
uploadErrors: UploadErrors;
|
|
565
|
-
fileRelatedList: FileRelatedListPage;
|
|
566
|
-
browserDialogs: BrowserDialogs;
|
|
567
|
-
screenDialog: ScreenDialog;
|
|
568
|
-
pageButtons: PageButtons;
|
|
569
|
-
dataImportWizard: DataImportWizard;
|
|
570
|
-
recordData: RecordData;
|
|
571
|
-
recordPages: RecordPages;
|
|
572
|
-
listViewPage: ListViewPage;
|
|
573
|
-
loginAsPage: LoginAsPage;
|
|
574
|
-
recordDetailPage: RecordDetailPage;
|
|
575
|
-
recordFormDialog: RecordFormDialog;
|
|
576
|
-
evidence: Evidence;
|
|
577
|
-
inAppGuidance: void;
|
|
578
|
-
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>, When: import("playwright-bdd").PlaywrightStyleStepCtor<import("playwright-bdd").PlaywrightStyleStepFn<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
579
|
-
evidenceId: EvidenceId;
|
|
580
|
-
evidenceDir: string;
|
|
581
|
-
createdRecords: CreatedRecords;
|
|
582
|
-
saveErrors: SaveErrors;
|
|
583
|
-
fileDownloads: FileDownloads;
|
|
584
|
-
uploadErrors: UploadErrors;
|
|
585
|
-
fileRelatedList: FileRelatedListPage;
|
|
586
|
-
browserDialogs: BrowserDialogs;
|
|
587
|
-
screenDialog: ScreenDialog;
|
|
588
|
-
pageButtons: PageButtons;
|
|
589
|
-
dataImportWizard: DataImportWizard;
|
|
590
|
-
recordData: RecordData;
|
|
591
|
-
recordPages: RecordPages;
|
|
592
|
-
listViewPage: ListViewPage;
|
|
593
|
-
loginAsPage: LoginAsPage;
|
|
594
|
-
recordDetailPage: RecordDetailPage;
|
|
595
|
-
recordFormDialog: RecordFormDialog;
|
|
596
|
-
evidence: Evidence;
|
|
597
|
-
inAppGuidance: void;
|
|
598
|
-
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>, BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
606
|
+
export declare const BeforeStep: (...args: [(this: null, fixtures: import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & import("playwright-bdd").BddTestFixtures & SfTestOptions & {
|
|
599
607
|
evidenceId: EvidenceId;
|
|
600
608
|
evidenceDir: string;
|
|
601
609
|
createdRecords: CreatedRecords;
|
|
@@ -606,6 +614,8 @@ export declare const Given: import("playwright-bdd").PlaywrightStyleStepCtor<imp
|
|
|
606
614
|
browserDialogs: BrowserDialogs;
|
|
607
615
|
screenDialog: ScreenDialog;
|
|
608
616
|
pageButtons: PageButtons;
|
|
617
|
+
activePages: ActivePages;
|
|
618
|
+
pageLinks: PageLinks;
|
|
609
619
|
dataImportWizard: DataImportWizard;
|
|
610
620
|
recordData: RecordData;
|
|
611
621
|
recordPages: RecordPages;
|
|
@@ -626,6 +636,8 @@ export declare const Given: import("playwright-bdd").PlaywrightStyleStepCtor<imp
|
|
|
626
636
|
browserDialogs: BrowserDialogs;
|
|
627
637
|
screenDialog: ScreenDialog;
|
|
628
638
|
pageButtons: PageButtons;
|
|
639
|
+
activePages: ActivePages;
|
|
640
|
+
pageLinks: PageLinks;
|
|
629
641
|
dataImportWizard: DataImportWizard;
|
|
630
642
|
recordData: RecordData;
|
|
631
643
|
recordPages: RecordPages;
|
|
@@ -650,6 +662,8 @@ export declare const Given: import("playwright-bdd").PlaywrightStyleStepCtor<imp
|
|
|
650
662
|
browserDialogs: BrowserDialogs;
|
|
651
663
|
screenDialog: ScreenDialog;
|
|
652
664
|
pageButtons: PageButtons;
|
|
665
|
+
activePages: ActivePages;
|
|
666
|
+
pageLinks: PageLinks;
|
|
653
667
|
dataImportWizard: DataImportWizard;
|
|
654
668
|
recordData: RecordData;
|
|
655
669
|
recordPages: RecordPages;
|
|
@@ -660,36 +674,18 @@ export declare const Given: import("playwright-bdd").PlaywrightStyleStepCtor<imp
|
|
|
660
674
|
evidence: Evidence;
|
|
661
675
|
inAppGuidance: void;
|
|
662
676
|
} & import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures) => unknown]) => void;
|
|
677
|
+
export declare const Given: typeof bdd.Given;
|
|
678
|
+
export declare const When: typeof bdd.When;
|
|
663
679
|
/**
|
|
664
|
-
* sfTest
|
|
665
|
-
*
|
|
680
|
+
* sfTestの検査ステップを定義する。明示的に通知された分類へ共通方針を適用する。
|
|
681
|
+
* 操作の準備にもexpectを使うため、素のexpect例外を自動でNGとはしない。
|
|
666
682
|
*/
|
|
667
|
-
export declare const StandardThen:
|
|
668
|
-
evidenceId: EvidenceId;
|
|
669
|
-
evidenceDir: string;
|
|
670
|
-
createdRecords: CreatedRecords;
|
|
671
|
-
saveErrors: SaveErrors;
|
|
672
|
-
fileDownloads: FileDownloads;
|
|
673
|
-
uploadErrors: UploadErrors;
|
|
674
|
-
fileRelatedList: FileRelatedListPage;
|
|
675
|
-
browserDialogs: BrowserDialogs;
|
|
676
|
-
screenDialog: ScreenDialog;
|
|
677
|
-
pageButtons: PageButtons;
|
|
678
|
-
dataImportWizard: DataImportWizard;
|
|
679
|
-
recordData: RecordData;
|
|
680
|
-
recordPages: RecordPages;
|
|
681
|
-
listViewPage: ListViewPage;
|
|
682
|
-
loginAsPage: LoginAsPage;
|
|
683
|
-
recordDetailPage: RecordDetailPage;
|
|
684
|
-
recordFormDialog: RecordFormDialog;
|
|
685
|
-
evidence: Evidence;
|
|
686
|
-
inAppGuidance: void;
|
|
687
|
-
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & import("playwright-bdd").BddWorkerFixtures>>;
|
|
683
|
+
export declare const StandardThen: typeof bdd.Then;
|
|
688
684
|
/**
|
|
689
|
-
* 利用者が作るステップを定義する
|
|
685
|
+
* 利用者が作るステップを定義するThen。素のexpectの失敗をNGとして受け取る既存の契約を維持する。
|
|
690
686
|
*
|
|
691
687
|
* 利用者の関数を包み、Playwright の expect の失敗(期待と異なる値)は不一致として記録して後続のステップへ進み、
|
|
692
|
-
*
|
|
688
|
+
* 明示的に分類された例外をexpectの失敗へ戻さず、それ以外の例外は実行時エラーとして扱う。
|
|
693
689
|
* playwright-bdd は、関数の文字列(toString)からフィクスチャの名前を、関数の引数の数(length)をステップの文言の引数の数と照合するため、
|
|
694
690
|
* 包む関数のこの2つを元の関数に合わせる(playwright-bdd の更新の際は、この照合の方法が変わっていないことを確かめる)。
|
|
695
691
|
* ステップの定義の位置は、この関数の行として登録される(元の例外の呼び出し履歴には利用者の行が残る)。
|