testeranto.tiposkripto 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.DS_Store +0 -0
- package/dist/module/Node.js +1394 -824
- package/dist/module/Web.js +1405 -825
- package/dist/module/index.js +243 -841
- package/dist/types/Types.d.ts +55 -10
- package/dist/types/lib/tiposkripto/src/Adapters.d.ts +3 -0
- package/dist/types/lib/tiposkripto/src/BaseExpected.d.ts +1 -1
- package/dist/types/lib/tiposkripto/src/BaseTiposkripto.d.ts +22 -18
- package/dist/types/lib/tiposkripto/src/CoreTypes.d.ts +27 -28
- package/dist/types/lib/tiposkripto/src/Node.d.ts +4 -4
- package/dist/types/lib/tiposkripto/src/Web.d.ts +9 -3
- package/dist/types/lib/tiposkripto/src/index.d.ts +21 -29
- package/dist/types/lib/tiposkripto/src/interop/index.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/jest.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/mocha.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/nodeNative.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/vite.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/types.d.ts +18 -26
- package/dist/types/lib/tiposkripto/src/verbs/BaseSuite.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/verbs/aaa/BaseDescribe.d.ts +39 -0
- package/dist/types/lib/tiposkripto/src/verbs/aaa/BaseIt.d.ts +22 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseGiven.d.ts +48 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseThen.d.ts +38 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseWhen.d.ts +37 -0
- package/dist/types/lib/tiposkripto/src/verbs/internal/CommonUtils.d.ts +45 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseConfirm.d.ts +26 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseExpected.d.ts +27 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseShould.d.ts +24 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseValue.d.ts +38 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -1
package/dist/module/Web.js
CHANGED
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
// src/Adapters.ts
|
|
2
|
+
var BaseAdapter = () => ({
|
|
3
|
+
prepareAll: async (input, testResource, artifactory) => {
|
|
4
|
+
return input;
|
|
5
|
+
},
|
|
6
|
+
prepareEach: async function(subject, initializer, testResource, initialValues, artifactory) {
|
|
7
|
+
return subject;
|
|
8
|
+
},
|
|
9
|
+
cleanupEach: async (store, key, artifactory) => Promise.resolve(store),
|
|
10
|
+
cleanupAll: (store, artifactory) => void 0,
|
|
11
|
+
verify: async (store, checkCb, testResource, artifactory) => {
|
|
12
|
+
return checkCb(store);
|
|
13
|
+
},
|
|
14
|
+
execute: async (store, actionCB, testResource, artifactory) => {
|
|
15
|
+
return actionCB(store);
|
|
16
|
+
},
|
|
17
|
+
assert: (x) => x
|
|
18
|
+
});
|
|
19
|
+
var DefaultAdapter = (p) => {
|
|
20
|
+
const base = BaseAdapter();
|
|
21
|
+
const adapter = {
|
|
22
|
+
prepareAll: p.prepareAll || base.prepareAll,
|
|
23
|
+
prepareEach: p.prepareEach || base.prepareEach,
|
|
24
|
+
execute: p.execute || base.execute,
|
|
25
|
+
verify: p.verify || base.verify,
|
|
26
|
+
cleanupEach: p.cleanupEach || base.cleanupEach,
|
|
27
|
+
cleanupAll: p.cleanupAll || base.cleanupAll,
|
|
28
|
+
assert: p.assert || base.assert
|
|
29
|
+
};
|
|
30
|
+
return adapter;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/types.ts
|
|
34
|
+
var defaultTestResourceRequirement = {
|
|
35
|
+
ports: 0
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// src/verbs/internal/CommonUtils.ts
|
|
39
|
+
var CommonUtils = class {
|
|
40
|
+
/**
|
|
41
|
+
* Normalize a path string for consistent artifact storage
|
|
42
|
+
*/
|
|
43
|
+
static normalizePath(path) {
|
|
20
44
|
if (typeof path !== "string") {
|
|
21
45
|
throw new Error(
|
|
22
46
|
`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(
|
|
@@ -24,42 +48,100 @@ var BaseSetup = class {
|
|
|
24
48
|
)}`
|
|
25
49
|
);
|
|
26
50
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
return path.replace(/\\/g, "/");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Add an artifact with path normalization
|
|
55
|
+
*/
|
|
56
|
+
static addArtifact(artifacts, path) {
|
|
57
|
+
artifacts.push(this.normalizePath(path));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a fallback artifactory for logging
|
|
61
|
+
*/
|
|
62
|
+
static createFallbackArtifactory(context, basePath) {
|
|
63
|
+
const { suiteIndex, givenKey, whenIndex, thenIndex, valueKey, rowIndex } = context;
|
|
64
|
+
const actualBasePath = basePath || "testeranto";
|
|
31
65
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
writeFileSync: (filename, payload) => {
|
|
67
|
+
let path = "";
|
|
68
|
+
if (suiteIndex !== void 0) {
|
|
69
|
+
path += `suite-${suiteIndex}/`;
|
|
70
|
+
}
|
|
71
|
+
if (givenKey !== void 0) {
|
|
72
|
+
path += `given-${givenKey}/`;
|
|
73
|
+
}
|
|
74
|
+
if (whenIndex !== void 0) {
|
|
75
|
+
path += `when-${whenIndex}/`;
|
|
76
|
+
}
|
|
77
|
+
if (thenIndex !== void 0) {
|
|
78
|
+
path += `then-${thenIndex}/`;
|
|
79
|
+
}
|
|
80
|
+
if (valueKey !== void 0) {
|
|
81
|
+
path += `value-${valueKey}/`;
|
|
82
|
+
}
|
|
83
|
+
if (rowIndex !== void 0) {
|
|
84
|
+
path += `row-${rowIndex}/`;
|
|
85
|
+
}
|
|
86
|
+
path += filename;
|
|
87
|
+
const fullPath = `${actualBasePath}/${path}`;
|
|
88
|
+
console.log(`[Artifactory] Would write to ${fullPath}: ${payload.substring(0, 100)}...`);
|
|
89
|
+
},
|
|
90
|
+
screenshot: (filename, payload) => {
|
|
91
|
+
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
92
|
+
}
|
|
44
93
|
};
|
|
45
94
|
}
|
|
46
|
-
|
|
47
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Standard error handling for test operations
|
|
97
|
+
*/
|
|
98
|
+
static handleTestError(error, target) {
|
|
99
|
+
target.failed = true;
|
|
100
|
+
target.fails++;
|
|
101
|
+
target.error = error;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Standard method to create an object representation
|
|
105
|
+
*/
|
|
106
|
+
static toObj(target, additionalProps = {}) {
|
|
107
|
+
const baseObj = {
|
|
108
|
+
key: target.key,
|
|
109
|
+
name: target.name,
|
|
110
|
+
error: target.error ? [target.error, target.error.stack] : null,
|
|
111
|
+
failed: target.failed,
|
|
112
|
+
features: target.features || [],
|
|
113
|
+
artifacts: target.artifacts,
|
|
114
|
+
status: target.status
|
|
115
|
+
};
|
|
116
|
+
if (target.fails !== void 0) {
|
|
117
|
+
baseObj.fails = target.fails;
|
|
118
|
+
}
|
|
119
|
+
return { ...baseObj, ...additionalProps };
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/verbs/aaa/BaseDescribe.ts
|
|
124
|
+
var BaseDescribe = class {
|
|
125
|
+
constructor(features, its, describeCB, initialValues) {
|
|
126
|
+
this.error = null;
|
|
127
|
+
this.store = null;
|
|
128
|
+
this.key = "";
|
|
129
|
+
this.failed = false;
|
|
130
|
+
this.artifacts = [];
|
|
131
|
+
this.fails = 0;
|
|
132
|
+
this.features = features;
|
|
133
|
+
this.its = its;
|
|
134
|
+
this.describeCB = describeCB;
|
|
135
|
+
this.initialValues = initialValues;
|
|
48
136
|
}
|
|
49
|
-
|
|
137
|
+
addArtifact(path) {
|
|
138
|
+
CommonUtils.addArtifact(this.artifacts, path);
|
|
139
|
+
}
|
|
140
|
+
async describe(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
50
141
|
this.key = key;
|
|
51
142
|
this.fails = 0;
|
|
52
|
-
const actualArtifactory = artifactory || ((fPath, value) => {
|
|
53
|
-
});
|
|
54
|
-
const setupArtifactory = (fPath, value) => actualArtifactory(`setup-${key}/${fPath}`, value);
|
|
55
143
|
try {
|
|
56
|
-
this.store = await this.
|
|
57
|
-
subject,
|
|
58
|
-
testResourceConfiguration,
|
|
59
|
-
setupArtifactory,
|
|
60
|
-
this.setupCB,
|
|
61
|
-
this.initialValues
|
|
62
|
-
);
|
|
144
|
+
this.store = await this.describeCB("x");
|
|
63
145
|
this.status = true;
|
|
64
146
|
} catch (e) {
|
|
65
147
|
this.status = false;
|
|
@@ -69,39 +151,16 @@ var BaseSetup = class {
|
|
|
69
151
|
return this.store;
|
|
70
152
|
}
|
|
71
153
|
try {
|
|
72
|
-
for (const [
|
|
73
|
-
try {
|
|
74
|
-
const actionArtifactory = this.createArtifactoryForAction(
|
|
75
|
-
key,
|
|
76
|
-
actionNdx,
|
|
77
|
-
suiteNdx
|
|
78
|
-
);
|
|
79
|
-
this.store = await actionStep.test(
|
|
80
|
-
this.store,
|
|
81
|
-
testResourceConfiguration,
|
|
82
|
-
actionArtifactory
|
|
83
|
-
);
|
|
84
|
-
} catch (e) {
|
|
85
|
-
this.failed = true;
|
|
86
|
-
this.fails++;
|
|
87
|
-
this.error = e;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
for (const [checkNdx, checkStep] of this.checks.entries()) {
|
|
154
|
+
for (const [itNdx, it] of this.its.entries()) {
|
|
91
155
|
try {
|
|
92
|
-
const
|
|
93
|
-
const checkArtifactory = this.createArtifactoryForCheck(
|
|
94
|
-
key,
|
|
95
|
-
checkNdx,
|
|
96
|
-
suiteNdx
|
|
97
|
-
);
|
|
98
|
-
const t = await checkStep.test(
|
|
156
|
+
const result = await it.test(
|
|
99
157
|
this.store,
|
|
100
158
|
testResourceConfiguration,
|
|
101
|
-
|
|
102
|
-
checkArtifactory
|
|
159
|
+
artifactory
|
|
103
160
|
);
|
|
104
|
-
|
|
161
|
+
if (result !== void 0) {
|
|
162
|
+
tester(result);
|
|
163
|
+
}
|
|
105
164
|
} catch (e) {
|
|
106
165
|
this.failed = true;
|
|
107
166
|
this.fails++;
|
|
@@ -112,128 +171,89 @@ var BaseSetup = class {
|
|
|
112
171
|
this.error = e;
|
|
113
172
|
this.failed = true;
|
|
114
173
|
this.fails++;
|
|
115
|
-
} finally {
|
|
116
|
-
try {
|
|
117
|
-
await this.afterEach(this.store, this.key, setupArtifactory);
|
|
118
|
-
} catch (e) {
|
|
119
|
-
this.failed = true;
|
|
120
|
-
this.fails++;
|
|
121
|
-
this.error = e;
|
|
122
|
-
}
|
|
123
174
|
}
|
|
124
175
|
return this.store;
|
|
125
176
|
}
|
|
126
|
-
|
|
127
|
-
const self = this;
|
|
128
|
-
if (self._parent && self._parent.createArtifactory) {
|
|
129
|
-
return self._parent.createArtifactory({
|
|
130
|
-
givenKey: key,
|
|
131
|
-
whenIndex: actionIndex,
|
|
132
|
-
suiteIndex: suiteNdx
|
|
133
|
-
});
|
|
134
|
-
}
|
|
177
|
+
toObj() {
|
|
135
178
|
return {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
145
|
-
},
|
|
146
|
-
screenshot: (filename, payload) => {
|
|
147
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
148
|
-
}
|
|
179
|
+
key: this.key,
|
|
180
|
+
its: this.its.map((it) => it.toObj()),
|
|
181
|
+
error: this.error ? [this.error.message, this.error.stack] : null,
|
|
182
|
+
failed: this.failed,
|
|
183
|
+
features: this.features || [],
|
|
184
|
+
artifacts: this.artifacts,
|
|
185
|
+
status: this.status,
|
|
186
|
+
fails: this.fails
|
|
149
187
|
};
|
|
150
188
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/verbs/aaa/BaseIt.ts
|
|
192
|
+
var BaseIt = class {
|
|
193
|
+
constructor(name, itCB) {
|
|
194
|
+
this.error = null;
|
|
195
|
+
this.artifacts = [];
|
|
196
|
+
this.name = name;
|
|
197
|
+
this.itCB = itCB;
|
|
198
|
+
}
|
|
199
|
+
addArtifact(path) {
|
|
200
|
+
CommonUtils.addArtifact(this.artifacts, path);
|
|
201
|
+
}
|
|
202
|
+
async test(store, testResourceConfiguration, artifactory) {
|
|
203
|
+
try {
|
|
204
|
+
const result = await this.itCB(store);
|
|
205
|
+
this.status = true;
|
|
206
|
+
return result;
|
|
207
|
+
} catch (e) {
|
|
208
|
+
this.status = false;
|
|
209
|
+
this.error = e;
|
|
210
|
+
throw e;
|
|
159
211
|
}
|
|
212
|
+
}
|
|
213
|
+
toObj() {
|
|
160
214
|
return {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
path += `setup-${key}/`;
|
|
167
|
-
path += `check-${checkIndex} ${filename}`;
|
|
168
|
-
console.log(`[Artifactory] Would write to: ${path}`);
|
|
169
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
170
|
-
},
|
|
171
|
-
screenshot: (filename, payload) => {
|
|
172
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
173
|
-
}
|
|
215
|
+
name: this.name,
|
|
216
|
+
status: this.status,
|
|
217
|
+
error: this.error ? `${this.error.name}: ${this.error.message}
|
|
218
|
+
${this.error.stack}` : null,
|
|
219
|
+
artifacts: this.artifacts
|
|
174
220
|
};
|
|
175
221
|
}
|
|
176
222
|
};
|
|
177
223
|
|
|
178
|
-
// src/BaseGiven.ts
|
|
179
|
-
var BaseGiven = class
|
|
224
|
+
// src/verbs/bdd/BaseGiven.ts
|
|
225
|
+
var BaseGiven = class {
|
|
180
226
|
constructor(features, whens, thens, givenCB, initialValues) {
|
|
181
|
-
|
|
227
|
+
this.error = null;
|
|
228
|
+
this.store = null;
|
|
229
|
+
this.key = "";
|
|
230
|
+
this.failed = false;
|
|
182
231
|
this.artifacts = [];
|
|
183
232
|
this.fails = 0;
|
|
184
|
-
this.
|
|
233
|
+
this.testResourceConfiguration = null;
|
|
234
|
+
this.features = features;
|
|
185
235
|
this.whens = whens || [];
|
|
186
236
|
this.thens = thens || [];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
console.log(`[BaseGiven.constructor] thens:`, this.thens.length);
|
|
237
|
+
this.givenCB = givenCB;
|
|
238
|
+
this.initialValues = initialValues;
|
|
190
239
|
}
|
|
191
240
|
addArtifact(path) {
|
|
192
|
-
|
|
193
|
-
throw new Error(
|
|
194
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(
|
|
195
|
-
path
|
|
196
|
-
)}`
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
200
|
-
this.artifacts.push(normalizedPath);
|
|
241
|
+
CommonUtils.addArtifact(this.artifacts, path);
|
|
201
242
|
}
|
|
202
|
-
// Set the parent explicitly
|
|
203
243
|
setParent(parent) {
|
|
204
244
|
this._parent = parent;
|
|
205
|
-
console.log(`[BaseGiven.setParent] _parent set to:`, parent);
|
|
206
|
-
}
|
|
207
|
-
beforeAll(store) {
|
|
208
|
-
return store;
|
|
209
245
|
}
|
|
210
246
|
toObj() {
|
|
211
247
|
const whens = this.whens || [];
|
|
212
248
|
const thens = this.thens || [];
|
|
213
|
-
return {
|
|
214
|
-
|
|
215
|
-
actions: whens.map((w) => {
|
|
249
|
+
return CommonUtils.toObj(this, {
|
|
250
|
+
whens: whens.map((w) => {
|
|
216
251
|
if (w && w.toObj) return w.toObj();
|
|
217
252
|
console.error("When step is not as expected!", JSON.stringify(w));
|
|
218
253
|
return {};
|
|
219
254
|
}),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
failed: this.failed,
|
|
223
|
-
features: this.features || [],
|
|
224
|
-
artifacts: this.artifacts,
|
|
225
|
-
status: this.status
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
// Implement BaseSetup's abstract method
|
|
229
|
-
async setupThat(subject, testResourceConfiguration, artifactory, setupCB, initialValues) {
|
|
230
|
-
return this.givenThat(
|
|
231
|
-
subject,
|
|
232
|
-
testResourceConfiguration,
|
|
233
|
-
artifactory,
|
|
234
|
-
setupCB,
|
|
235
|
-
initialValues
|
|
236
|
-
);
|
|
255
|
+
thens: thens.map((t) => t && t.toObj ? t.toObj() : {})
|
|
256
|
+
});
|
|
237
257
|
}
|
|
238
258
|
async afterEach(store, key, artifactory) {
|
|
239
259
|
return store;
|
|
@@ -241,8 +261,9 @@ var BaseGiven = class extends BaseSetup {
|
|
|
241
261
|
async give(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
242
262
|
this.key = key;
|
|
243
263
|
this.fails = 0;
|
|
264
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
244
265
|
this._suiteIndex = suiteNdx;
|
|
245
|
-
const actualArtifactory = artifactory
|
|
266
|
+
const actualArtifactory = artifactory;
|
|
246
267
|
try {
|
|
247
268
|
this.store = await this.givenThat(
|
|
248
269
|
subject,
|
|
@@ -254,9 +275,7 @@ var BaseGiven = class extends BaseSetup {
|
|
|
254
275
|
this.status = true;
|
|
255
276
|
} catch (e) {
|
|
256
277
|
this.status = false;
|
|
257
|
-
|
|
258
|
-
this.fails++;
|
|
259
|
-
this.error = e;
|
|
278
|
+
CommonUtils.handleTestError(e, this);
|
|
260
279
|
return this.store;
|
|
261
280
|
}
|
|
262
281
|
try {
|
|
@@ -275,9 +294,7 @@ var BaseGiven = class extends BaseSetup {
|
|
|
275
294
|
whenArtifactory
|
|
276
295
|
);
|
|
277
296
|
} catch (e) {
|
|
278
|
-
|
|
279
|
-
this.fails++;
|
|
280
|
-
this.error = e;
|
|
297
|
+
CommonUtils.handleTestError(e, this);
|
|
281
298
|
}
|
|
282
299
|
}
|
|
283
300
|
} else {
|
|
@@ -301,205 +318,104 @@ var BaseGiven = class extends BaseSetup {
|
|
|
301
318
|
);
|
|
302
319
|
tester(t);
|
|
303
320
|
} catch (e) {
|
|
304
|
-
|
|
305
|
-
this.fails++;
|
|
306
|
-
this.error = e;
|
|
321
|
+
CommonUtils.handleTestError(e, this);
|
|
307
322
|
}
|
|
308
323
|
}
|
|
309
324
|
} else {
|
|
310
325
|
console.warn(`[BaseGiven.give] thens is not an array:`, thens);
|
|
311
326
|
}
|
|
312
327
|
} catch (e) {
|
|
313
|
-
|
|
314
|
-
this.failed = true;
|
|
315
|
-
this.fails++;
|
|
328
|
+
CommonUtils.handleTestError(e, this);
|
|
316
329
|
} finally {
|
|
317
330
|
try {
|
|
318
331
|
await this.afterEach(this.store, this.key, actualArtifactory);
|
|
319
332
|
} catch (e) {
|
|
320
|
-
|
|
321
|
-
this.fails++;
|
|
322
|
-
this.error = e;
|
|
333
|
+
CommonUtils.handleTestError(e, this);
|
|
323
334
|
}
|
|
324
335
|
}
|
|
325
336
|
return this.store;
|
|
326
337
|
}
|
|
327
|
-
|
|
338
|
+
createArtifactoryForWhen(givenKey, whenIndex, suiteNdx) {
|
|
328
339
|
const self = this;
|
|
329
|
-
console.log(`[BaseGiven.createDefaultArtifactory] self._parent:`, self._parent);
|
|
330
|
-
console.log(`[BaseGiven.createDefaultArtifactory] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
331
340
|
if (self._parent && self._parent.createArtifactory) {
|
|
332
|
-
|
|
341
|
+
return self._parent.createArtifactory({
|
|
333
342
|
givenKey,
|
|
343
|
+
whenIndex,
|
|
334
344
|
suiteIndex: suiteNdx
|
|
335
345
|
});
|
|
336
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Created artifactory from parent:`, artifactory);
|
|
337
|
-
return artifactory;
|
|
338
|
-
}
|
|
339
|
-
let basePath = "testeranto";
|
|
340
|
-
if (self._parent && self._parent.testResourceConfiguration?.fs) {
|
|
341
|
-
basePath = self._parent.testResourceConfiguration.fs;
|
|
342
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Using base path from parent: ${basePath}`);
|
|
343
|
-
} else {
|
|
344
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Using default base path: ${basePath}`);
|
|
345
346
|
}
|
|
346
|
-
return
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
path += `suite-${suiteNdx}/`;
|
|
351
|
-
}
|
|
352
|
-
path += `given-${givenKey}/`;
|
|
353
|
-
path += filename;
|
|
354
|
-
if (!path.match(/\.[a-zA-Z0-9]+$/)) {
|
|
355
|
-
path += ".txt";
|
|
356
|
-
}
|
|
357
|
-
const fullPath = `${basePath}/${path}`;
|
|
358
|
-
console.log(`[Artifactory] Writing to: ${fullPath}`);
|
|
359
|
-
if (self._parent && typeof self._parent.writeFileSync === "function") {
|
|
360
|
-
self._parent.writeFileSync(fullPath, payload);
|
|
361
|
-
} else {
|
|
362
|
-
console.log(`[Artifactory] Would write to: ${fullPath}`);
|
|
363
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
screenshot: (filename, payload) => {
|
|
367
|
-
let path = "";
|
|
368
|
-
if (suiteNdx !== void 0) {
|
|
369
|
-
path += `suite-${suiteNdx}/`;
|
|
370
|
-
}
|
|
371
|
-
path += `given-${givenKey}/`;
|
|
372
|
-
path += filename;
|
|
373
|
-
if (!path.match(/\.[a-zA-Z0-9]+$/)) {
|
|
374
|
-
path += ".png";
|
|
375
|
-
}
|
|
376
|
-
const fullPath = `${basePath}/${path}`;
|
|
377
|
-
console.log(`[Artifactory] Would take screenshot: ${fullPath}`);
|
|
378
|
-
if (self._parent && typeof self._parent.screenshot === "function") {
|
|
379
|
-
self._parent.screenshot(fullPath, payload || "");
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
};
|
|
347
|
+
return CommonUtils.createFallbackArtifactory(
|
|
348
|
+
{ givenKey, whenIndex, suiteIndex: suiteNdx },
|
|
349
|
+
this.testResourceConfiguration?.fs
|
|
350
|
+
);
|
|
383
351
|
}
|
|
384
|
-
|
|
352
|
+
createArtifactoryForThen(givenKey, thenIndex, suiteNdx) {
|
|
385
353
|
const self = this;
|
|
386
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] self._parent:`, self._parent);
|
|
387
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
388
354
|
if (self._parent && self._parent.createArtifactory) {
|
|
389
|
-
|
|
355
|
+
return self._parent.createArtifactory({
|
|
390
356
|
givenKey,
|
|
391
|
-
|
|
357
|
+
thenIndex,
|
|
392
358
|
suiteIndex: suiteNdx
|
|
393
359
|
});
|
|
394
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] Created artifactory:`, artifactory);
|
|
395
|
-
return artifactory;
|
|
396
360
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
if (suiteNdx !== void 0) {
|
|
402
|
-
path += `suite-${suiteNdx}/`;
|
|
403
|
-
}
|
|
404
|
-
path += `given-${givenKey}/`;
|
|
405
|
-
path += `when-${whenIndex} ${filename}`;
|
|
406
|
-
console.log(`[Artifactory] Would write to: ${path}`);
|
|
407
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
408
|
-
},
|
|
409
|
-
screenshot: (filename, payload) => {
|
|
410
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
createArtifactoryForThen(givenKey, thenIndex, suiteNdx) {
|
|
415
|
-
const self = this;
|
|
416
|
-
console.log(`[BaseGiven.createArtifactoryForThen] self._parent:`, self._parent);
|
|
417
|
-
console.log(`[BaseGiven.createArtifactoryForThen] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
418
|
-
if (self._parent && self._parent.createArtifactory) {
|
|
419
|
-
const artifactory = self._parent.createArtifactory({
|
|
420
|
-
givenKey,
|
|
421
|
-
thenIndex,
|
|
422
|
-
suiteIndex: suiteNdx
|
|
423
|
-
});
|
|
424
|
-
console.log(`[BaseGiven.createArtifactoryForThen] Created artifactory:`, artifactory);
|
|
425
|
-
return artifactory;
|
|
426
|
-
}
|
|
427
|
-
console.log(`[BaseGiven.createArtifactoryForThen] Using fallback artifactory`);
|
|
428
|
-
return {
|
|
429
|
-
writeFileSync: (filename, payload) => {
|
|
430
|
-
let path = "";
|
|
431
|
-
if (suiteNdx !== void 0) {
|
|
432
|
-
path += `suite-${suiteNdx}/`;
|
|
433
|
-
}
|
|
434
|
-
path += `given-${givenKey}/`;
|
|
435
|
-
path += `then-${thenIndex} ${filename}`;
|
|
436
|
-
console.log(`[Artifactory] Would write to: ${path}`);
|
|
437
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
438
|
-
},
|
|
439
|
-
screenshot: (filename, payload) => {
|
|
440
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
441
|
-
}
|
|
442
|
-
};
|
|
361
|
+
return CommonUtils.createFallbackArtifactory(
|
|
362
|
+
{ givenKey, thenIndex, suiteIndex: suiteNdx },
|
|
363
|
+
this.testResourceConfiguration?.fs
|
|
364
|
+
);
|
|
443
365
|
}
|
|
444
366
|
};
|
|
445
367
|
|
|
446
|
-
// src/
|
|
447
|
-
var
|
|
448
|
-
constructor(name,
|
|
368
|
+
// src/verbs/bdd/BaseThen.ts
|
|
369
|
+
var BaseThen = class {
|
|
370
|
+
constructor(name, thenCB) {
|
|
449
371
|
this.error = null;
|
|
450
|
-
this.artifacts = [];
|
|
451
372
|
this.name = name;
|
|
452
|
-
this.
|
|
453
|
-
}
|
|
454
|
-
addArtifact(path) {
|
|
455
|
-
if (typeof path !== "string") {
|
|
456
|
-
throw new Error(
|
|
457
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(
|
|
458
|
-
path
|
|
459
|
-
)}`
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
463
|
-
this.artifacts.push(normalizedPath);
|
|
464
|
-
}
|
|
465
|
-
toObj() {
|
|
466
|
-
const obj = {
|
|
467
|
-
name: this.name,
|
|
468
|
-
status: this.status,
|
|
469
|
-
error: this.error ? `${this.error.name}: ${this.error.message}
|
|
470
|
-
${this.error.stack}` : null,
|
|
471
|
-
artifacts: this.artifacts
|
|
472
|
-
};
|
|
473
|
-
return obj;
|
|
373
|
+
this.thenCB = thenCB;
|
|
474
374
|
}
|
|
475
|
-
async test(store, testResourceConfiguration, artifactory) {
|
|
375
|
+
async test(store, testResourceConfiguration, filepath, artifactory) {
|
|
476
376
|
try {
|
|
477
|
-
const
|
|
377
|
+
const x = await this.butThen(
|
|
478
378
|
store,
|
|
479
|
-
|
|
379
|
+
async (s) => {
|
|
380
|
+
try {
|
|
381
|
+
if (typeof this.thenCB === "function") {
|
|
382
|
+
const result = await this.thenCB(s);
|
|
383
|
+
return result;
|
|
384
|
+
} else {
|
|
385
|
+
return this.thenCB;
|
|
386
|
+
}
|
|
387
|
+
} catch (e) {
|
|
388
|
+
this.error = e;
|
|
389
|
+
throw e;
|
|
390
|
+
}
|
|
391
|
+
},
|
|
480
392
|
testResourceConfiguration,
|
|
481
393
|
artifactory
|
|
482
394
|
);
|
|
483
395
|
this.status = true;
|
|
484
|
-
return
|
|
396
|
+
return x;
|
|
485
397
|
} catch (e) {
|
|
486
398
|
this.status = false;
|
|
487
399
|
this.error = e;
|
|
488
400
|
throw e;
|
|
489
401
|
}
|
|
490
402
|
}
|
|
403
|
+
toObj() {
|
|
404
|
+
return {
|
|
405
|
+
name: this.name,
|
|
406
|
+
status: this.status,
|
|
407
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null
|
|
408
|
+
};
|
|
409
|
+
}
|
|
491
410
|
};
|
|
492
411
|
|
|
493
|
-
// src/BaseWhen.ts
|
|
494
|
-
var BaseWhen = class
|
|
412
|
+
// src/verbs/bdd/BaseWhen.ts
|
|
413
|
+
var BaseWhen = class {
|
|
495
414
|
constructor(name, whenCB) {
|
|
496
|
-
|
|
415
|
+
this.error = null;
|
|
416
|
+
this.name = name;
|
|
497
417
|
this.whenCB = whenCB;
|
|
498
418
|
}
|
|
499
|
-
// Implement BaseAction's abstract method
|
|
500
|
-
async performAction(store, actionCB, testResource) {
|
|
501
|
-
return this.andWhen(store, actionCB, testResource);
|
|
502
|
-
}
|
|
503
419
|
async test(store, testResourceConfiguration, artifactory) {
|
|
504
420
|
try {
|
|
505
421
|
const result = await this.andWhen(
|
|
@@ -516,416 +432,402 @@ var BaseWhen = class extends BaseAction {
|
|
|
516
432
|
throw e;
|
|
517
433
|
}
|
|
518
434
|
}
|
|
435
|
+
toObj() {
|
|
436
|
+
return {
|
|
437
|
+
name: this.name,
|
|
438
|
+
status: this.status,
|
|
439
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null
|
|
440
|
+
};
|
|
441
|
+
}
|
|
519
442
|
};
|
|
520
443
|
|
|
521
|
-
// src/
|
|
522
|
-
var
|
|
523
|
-
constructor(
|
|
524
|
-
this.
|
|
525
|
-
this.
|
|
526
|
-
this.checkCB = checkCB;
|
|
527
|
-
this.error = false;
|
|
444
|
+
// src/verbs/tdt/BaseConfirm.ts
|
|
445
|
+
var BaseConfirm = class {
|
|
446
|
+
constructor(features, testCases, confirmCB, initialValues) {
|
|
447
|
+
this.key = "";
|
|
448
|
+
this.failed = false;
|
|
528
449
|
this.artifacts = [];
|
|
450
|
+
this.fails = 0;
|
|
451
|
+
this.error = null;
|
|
452
|
+
this.store = null;
|
|
453
|
+
this.features = features;
|
|
454
|
+
this.testCases = testCases || [];
|
|
455
|
+
this.confirmCB = confirmCB;
|
|
456
|
+
this.initialValues = initialValues;
|
|
529
457
|
}
|
|
530
458
|
addArtifact(path) {
|
|
531
|
-
|
|
532
|
-
throw new Error(
|
|
533
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(
|
|
534
|
-
path
|
|
535
|
-
)}`
|
|
536
|
-
);
|
|
537
|
-
}
|
|
538
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
539
|
-
this.artifacts.push(normalizedPath);
|
|
459
|
+
CommonUtils.addArtifact(this.artifacts, path);
|
|
540
460
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
name: this.name,
|
|
544
|
-
error: this.error,
|
|
545
|
-
artifacts: this.artifacts,
|
|
546
|
-
status: this.status
|
|
547
|
-
};
|
|
548
|
-
return obj;
|
|
461
|
+
setParent(parent) {
|
|
462
|
+
this._parent = parent;
|
|
549
463
|
}
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
464
|
+
toObj() {
|
|
465
|
+
const testCases = this.testCases || [];
|
|
466
|
+
return CommonUtils.toObj(this, {
|
|
467
|
+
testCases: testCases.map((testCase) => {
|
|
468
|
+
if (Array.isArray(testCase) && testCase.length >= 2) {
|
|
469
|
+
const [value, should] = testCase;
|
|
470
|
+
let inputData = null;
|
|
556
471
|
try {
|
|
557
|
-
if (typeof
|
|
558
|
-
|
|
559
|
-
|
|
472
|
+
if (typeof value === "function") {
|
|
473
|
+
inputData = value();
|
|
474
|
+
} else if (value && typeof value.toObj === "function") {
|
|
475
|
+
const obj = value.toObj();
|
|
476
|
+
inputData = obj.features || obj;
|
|
560
477
|
} else {
|
|
561
|
-
|
|
478
|
+
inputData = value;
|
|
562
479
|
}
|
|
563
480
|
} catch (e) {
|
|
564
|
-
|
|
565
|
-
throw e;
|
|
481
|
+
inputData = `Error: ${e.message}`;
|
|
566
482
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
483
|
+
let testDescription = null;
|
|
484
|
+
try {
|
|
485
|
+
if (should) {
|
|
486
|
+
if (typeof should === "function") {
|
|
487
|
+
if (should.name && should.name !== "") {
|
|
488
|
+
testDescription = should.name;
|
|
489
|
+
} else {
|
|
490
|
+
const funcStr = should.toString();
|
|
491
|
+
if (funcStr.includes("beEqualTo")) {
|
|
492
|
+
testDescription = "beEqualTo";
|
|
493
|
+
} else if (funcStr.includes("beGreaterThan")) {
|
|
494
|
+
testDescription = "beGreaterThan";
|
|
495
|
+
} else if (funcStr.includes("whenMultipliedAreAtLeast")) {
|
|
496
|
+
testDescription = "whenMultipliedAreAtLeast";
|
|
497
|
+
} else if (funcStr.includes("equal")) {
|
|
498
|
+
testDescription = "equal";
|
|
499
|
+
} else {
|
|
500
|
+
testDescription = "Test function";
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} else if (should && typeof should.toObj === "function") {
|
|
504
|
+
const obj = should.toObj();
|
|
505
|
+
testDescription = obj.name || "Should";
|
|
506
|
+
} else {
|
|
507
|
+
testDescription = String(should);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
} catch (e) {
|
|
511
|
+
testDescription = `Error: ${e.message}`;
|
|
512
|
+
}
|
|
513
|
+
return {
|
|
514
|
+
input: inputData,
|
|
515
|
+
test: testDescription
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
return testCase;
|
|
519
|
+
})
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
async confirm(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
523
|
+
this.key = key;
|
|
524
|
+
this.fails = 0;
|
|
525
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
526
|
+
this._suiteIndex = suiteNdx;
|
|
527
|
+
const actualArtifactory = artifactory;
|
|
528
|
+
this.store = null;
|
|
529
|
+
this.status = true;
|
|
530
|
+
try {
|
|
531
|
+
for (const [caseIndex, testCase] of this.testCases.entries()) {
|
|
532
|
+
try {
|
|
533
|
+
if (Array.isArray(testCase) && testCase.length >= 2) {
|
|
534
|
+
const [value, should] = testCase;
|
|
535
|
+
console.log("[BaseConfirm] value:", value);
|
|
536
|
+
console.log("[BaseConfirm] should:", should);
|
|
537
|
+
console.log("[BaseConfirm] value type:", typeof value);
|
|
538
|
+
console.log("[BaseConfirm] should type:", typeof should);
|
|
539
|
+
let input;
|
|
540
|
+
if (typeof value === "function") {
|
|
541
|
+
input = value();
|
|
542
|
+
console.log("[BaseConfirm] input from function:", input);
|
|
543
|
+
} else {
|
|
544
|
+
input = value;
|
|
545
|
+
console.log("[BaseConfirm] input direct:", input);
|
|
546
|
+
}
|
|
547
|
+
if (typeof should === "function") {
|
|
548
|
+
console.log("[BaseConfirm] input:", input);
|
|
549
|
+
console.log("[BaseConfirm] confirmCB:", this.confirmCB);
|
|
550
|
+
console.log("[BaseConfirm] should function:", should);
|
|
551
|
+
let testFn;
|
|
552
|
+
if (typeof this.confirmCB === "function") {
|
|
553
|
+
const potentialTestFn = this.confirmCB();
|
|
554
|
+
if (typeof potentialTestFn === "function") {
|
|
555
|
+
testFn = potentialTestFn;
|
|
556
|
+
} else {
|
|
557
|
+
testFn = this.confirmCB;
|
|
558
|
+
}
|
|
559
|
+
} else {
|
|
560
|
+
testFn = this.confirmCB;
|
|
561
|
+
}
|
|
562
|
+
const actualResult = Array.isArray(input) ? testFn(...input) : testFn(input);
|
|
563
|
+
console.log("[BaseConfirm] actualResult:", actualResult);
|
|
564
|
+
const passed = should(actualResult);
|
|
565
|
+
tester(passed);
|
|
566
|
+
} else if (should && typeof should.processRow === "function") {
|
|
567
|
+
const actualResult = Array.isArray(input) ? this.confirmCB(...input) : this.confirmCB(input);
|
|
568
|
+
console.log("[BaseConfirm] actualResult:", actualResult);
|
|
569
|
+
const passed = await should.processRow(
|
|
570
|
+
actualResult,
|
|
571
|
+
testResourceConfiguration,
|
|
572
|
+
artifactory
|
|
573
|
+
);
|
|
574
|
+
tester(passed);
|
|
575
|
+
} else {
|
|
576
|
+
tester(true);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
} catch (e) {
|
|
580
|
+
CommonUtils.handleTestError(e, this);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
573
583
|
} catch (e) {
|
|
574
|
-
|
|
575
|
-
this.error = true;
|
|
576
|
-
throw e;
|
|
584
|
+
CommonUtils.handleTestError(e, this);
|
|
577
585
|
}
|
|
586
|
+
return this.store;
|
|
587
|
+
}
|
|
588
|
+
// Alias for run to match BaseSuite expectations
|
|
589
|
+
async run(subject, testResourceConfiguration, artifactory) {
|
|
590
|
+
return this.confirm(
|
|
591
|
+
subject,
|
|
592
|
+
this.key || "confirm",
|
|
593
|
+
testResourceConfiguration,
|
|
594
|
+
(t) => !!t,
|
|
595
|
+
artifactory
|
|
596
|
+
);
|
|
578
597
|
}
|
|
579
598
|
};
|
|
580
599
|
|
|
581
|
-
// src/
|
|
582
|
-
var
|
|
583
|
-
constructor(name,
|
|
584
|
-
|
|
585
|
-
this.
|
|
600
|
+
// src/verbs/tdt/BaseExpected.ts
|
|
601
|
+
var BaseExpected = class {
|
|
602
|
+
constructor(name, expectedCB) {
|
|
603
|
+
this.expectedValue = null;
|
|
604
|
+
this.error = null;
|
|
605
|
+
this.name = name;
|
|
606
|
+
this.expectedCB = expectedCB;
|
|
607
|
+
}
|
|
608
|
+
// Set expected value for current row
|
|
609
|
+
setExpectedValue(expected) {
|
|
610
|
+
this.expectedValue = expected;
|
|
586
611
|
}
|
|
587
612
|
async test(store, testResourceConfiguration, filepath, artifactory) {
|
|
588
613
|
try {
|
|
589
|
-
const
|
|
590
|
-
store,
|
|
591
|
-
async (s) => {
|
|
592
|
-
try {
|
|
593
|
-
if (typeof this.thenCB === "function") {
|
|
594
|
-
const result = await this.thenCB(s);
|
|
595
|
-
return result;
|
|
596
|
-
} else {
|
|
597
|
-
return this.thenCB;
|
|
598
|
-
}
|
|
599
|
-
} catch (e) {
|
|
600
|
-
this.error = true;
|
|
601
|
-
throw e;
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
testResourceConfiguration,
|
|
605
|
-
artifactory
|
|
606
|
-
);
|
|
614
|
+
const result = await this.expectedCB(store);
|
|
607
615
|
this.status = true;
|
|
608
|
-
return
|
|
616
|
+
return result;
|
|
609
617
|
} catch (e) {
|
|
610
618
|
this.status = false;
|
|
611
|
-
this.error =
|
|
619
|
+
this.error = e;
|
|
612
620
|
throw e;
|
|
613
621
|
}
|
|
614
622
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
},
|
|
622
|
-
prepareEach: async function(subject, initializer, testResource, initialValues, artifactory) {
|
|
623
|
-
return subject;
|
|
624
|
-
},
|
|
625
|
-
cleanupEach: async (store, key, artifactory) => Promise.resolve(store),
|
|
626
|
-
cleanupAll: (store, artifactory) => void 0,
|
|
627
|
-
verify: async (store, checkCb, testResource, artifactory) => {
|
|
628
|
-
return checkCb(store);
|
|
629
|
-
},
|
|
630
|
-
execute: async (store, actionCB, testResource, artifactory) => {
|
|
631
|
-
return actionCB(store);
|
|
632
|
-
},
|
|
633
|
-
assert: (x) => x
|
|
634
|
-
});
|
|
635
|
-
var DefaultAdapter = (p) => {
|
|
636
|
-
const base = BaseAdapter();
|
|
637
|
-
const mapped = { ...p };
|
|
638
|
-
if (p.beforeAll && !p.prepareAll) {
|
|
639
|
-
mapped.prepareAll = async (input, testResource, artifactory) => {
|
|
640
|
-
if (p.beforeAll.length >= 3) {
|
|
641
|
-
return await p.beforeAll(input, testResource, artifactory);
|
|
642
|
-
} else if (p.beforeAll.length >= 2) {
|
|
643
|
-
return await p.beforeAll(input, testResource);
|
|
644
|
-
} else {
|
|
645
|
-
return await p.beforeAll(input);
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
if (p.beforeEach && !p.prepareEach) {
|
|
650
|
-
mapped.prepareEach = async (subject, initializer, testResource, initialValues, artifactory) => {
|
|
651
|
-
if (p.beforeEach.length >= 5) {
|
|
652
|
-
return await p.beforeEach(subject, initializer, testResource, initialValues, artifactory);
|
|
653
|
-
} else if (p.beforeEach.length >= 4) {
|
|
654
|
-
return await p.beforeEach(subject, initializer, testResource, initialValues);
|
|
655
|
-
} else if (p.beforeEach.length >= 3) {
|
|
656
|
-
return await p.beforeEach(subject, initializer, testResource);
|
|
657
|
-
} else if (p.beforeEach.length >= 2) {
|
|
658
|
-
return await p.beforeEach(subject, initializer);
|
|
659
|
-
} else {
|
|
660
|
-
return await p.beforeEach(subject);
|
|
661
|
-
}
|
|
623
|
+
toObj() {
|
|
624
|
+
return {
|
|
625
|
+
name: this.name,
|
|
626
|
+
status: this.status,
|
|
627
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null,
|
|
628
|
+
expectedValue: this.expectedValue
|
|
662
629
|
};
|
|
663
630
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
// src/verbs/tdt/BaseShould.ts
|
|
634
|
+
var BaseShould = class {
|
|
635
|
+
constructor(name, shouldCB) {
|
|
636
|
+
this.currentRow = [];
|
|
637
|
+
this.rowIndex = -1;
|
|
638
|
+
this.error = null;
|
|
639
|
+
this.name = name;
|
|
640
|
+
this.shouldCB = shouldCB;
|
|
674
641
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
} else {
|
|
680
|
-
return p.afterAll(store);
|
|
681
|
-
}
|
|
682
|
-
};
|
|
642
|
+
// Set current row data
|
|
643
|
+
setRowData(rowIndex, rowData) {
|
|
644
|
+
this.rowIndex = rowIndex;
|
|
645
|
+
this.currentRow = rowData;
|
|
683
646
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
return await p.andWhen(store, actionCB);
|
|
692
|
-
} else {
|
|
693
|
-
return await p.andWhen(store);
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
if (p.butThen && !p.verify) {
|
|
698
|
-
mapped.verify = async (store, checkCB, testResource, artifactory) => {
|
|
699
|
-
if (p.butThen.length >= 4) {
|
|
700
|
-
return await p.butThen(store, checkCB, testResource, artifactory);
|
|
701
|
-
} else if (p.butThen.length >= 3) {
|
|
702
|
-
return await p.butThen(store, checkCB, testResource);
|
|
703
|
-
} else if (p.butThen.length >= 2) {
|
|
704
|
-
return await p.butThen(store, checkCB);
|
|
647
|
+
// Process the current row
|
|
648
|
+
async processRow(actualResult, testResourceConfiguration, artifactory) {
|
|
649
|
+
try {
|
|
650
|
+
let success = false;
|
|
651
|
+
if (typeof this.shouldCB === "function") {
|
|
652
|
+
const result = await this.shouldCB(actualResult);
|
|
653
|
+
success = !!result;
|
|
705
654
|
} else {
|
|
706
|
-
|
|
655
|
+
success = actualResult === this.shouldCB;
|
|
707
656
|
}
|
|
708
|
-
|
|
657
|
+
this.status = success;
|
|
658
|
+
return success;
|
|
659
|
+
} catch (e) {
|
|
660
|
+
this.status = false;
|
|
661
|
+
this.error = e;
|
|
662
|
+
throw e;
|
|
663
|
+
}
|
|
709
664
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
665
|
+
toObj() {
|
|
666
|
+
return {
|
|
667
|
+
name: this.name,
|
|
668
|
+
status: this.status,
|
|
669
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null,
|
|
670
|
+
rowIndex: this.rowIndex,
|
|
671
|
+
currentRow: this.currentRow
|
|
717
672
|
};
|
|
718
673
|
}
|
|
719
|
-
return {
|
|
720
|
-
...base,
|
|
721
|
-
...mapped
|
|
722
|
-
};
|
|
723
674
|
};
|
|
724
675
|
|
|
725
|
-
// src/
|
|
726
|
-
var
|
|
727
|
-
constructor(
|
|
728
|
-
this.
|
|
729
|
-
this.testResourceConfiguration = null;
|
|
730
|
-
this.index = 0;
|
|
676
|
+
// src/verbs/tdt/BaseValue.ts
|
|
677
|
+
var BaseValue = class {
|
|
678
|
+
constructor(features, tableRows, confirmCB, initialValues) {
|
|
679
|
+
this.key = "";
|
|
731
680
|
this.failed = false;
|
|
732
|
-
this.fails = 0;
|
|
733
|
-
this.parent = null;
|
|
734
|
-
// Reference to parent BaseTiposkripto instance
|
|
735
681
|
this.artifacts = [];
|
|
736
|
-
const suiteName = name || "testSuite";
|
|
737
|
-
if (!suiteName) {
|
|
738
|
-
throw new Error("BaseSuite requires a non-empty name");
|
|
739
|
-
}
|
|
740
|
-
this.name = suiteName;
|
|
741
|
-
this.index = index;
|
|
742
|
-
this.givens = givens;
|
|
743
682
|
this.fails = 0;
|
|
744
|
-
this.
|
|
683
|
+
this.error = null;
|
|
684
|
+
this.store = null;
|
|
685
|
+
this.testResourceConfiguration = null;
|
|
686
|
+
this.features = features;
|
|
687
|
+
this.tableRows = tableRows;
|
|
688
|
+
this.confirmCB = confirmCB;
|
|
689
|
+
this.initialValues = initialValues;
|
|
690
|
+
}
|
|
691
|
+
setParent(parent) {
|
|
692
|
+
this._parent = parent;
|
|
745
693
|
}
|
|
746
694
|
addArtifact(path) {
|
|
747
|
-
|
|
748
|
-
throw new Error(
|
|
749
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(
|
|
750
|
-
path
|
|
751
|
-
)}`
|
|
752
|
-
);
|
|
753
|
-
}
|
|
754
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
755
|
-
this.artifacts.push(normalizedPath);
|
|
695
|
+
CommonUtils.addArtifact(this.artifacts, path);
|
|
756
696
|
}
|
|
757
|
-
|
|
697
|
+
async value(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
698
|
+
this.key = key;
|
|
699
|
+
this.fails = 0;
|
|
700
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
701
|
+
const actualArtifactory = artifactory || ((fPath, value) => {
|
|
702
|
+
});
|
|
703
|
+
const valueArtifactory = (fPath, value) => actualArtifactory(`value-${key}/${fPath}`, value);
|
|
758
704
|
try {
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
705
|
+
const result = this.confirmCB();
|
|
706
|
+
if (typeof result === "function") {
|
|
707
|
+
this.store = await result();
|
|
708
|
+
} else {
|
|
709
|
+
this.store = await result;
|
|
710
|
+
}
|
|
711
|
+
this.status = true;
|
|
712
|
+
} catch (e) {
|
|
713
|
+
this.status = false;
|
|
714
|
+
this.failed = true;
|
|
715
|
+
this.fails++;
|
|
716
|
+
this.error = e;
|
|
717
|
+
return this.store;
|
|
718
|
+
}
|
|
719
|
+
try {
|
|
720
|
+
for (const [rowIndex, row] of (this.tableRows || []).entries()) {
|
|
721
|
+
try {
|
|
722
|
+
const rowArtifactory = this.createArtifactoryForRow(
|
|
723
|
+
key,
|
|
724
|
+
rowIndex,
|
|
725
|
+
suiteNdx
|
|
726
|
+
);
|
|
727
|
+
const rowResult = await this.processRow(
|
|
728
|
+
row,
|
|
729
|
+
rowIndex,
|
|
730
|
+
rowArtifactory,
|
|
731
|
+
testResourceConfiguration
|
|
732
|
+
);
|
|
733
|
+
if (rowResult !== void 0) {
|
|
734
|
+
tester(rowResult);
|
|
735
|
+
}
|
|
736
|
+
} catch (e) {
|
|
737
|
+
this.failed = true;
|
|
738
|
+
this.fails++;
|
|
739
|
+
this.error = e;
|
|
769
740
|
}
|
|
770
|
-
}
|
|
771
|
-
return stringFeatures || [];
|
|
741
|
+
}
|
|
772
742
|
} catch (e) {
|
|
773
|
-
|
|
774
|
-
|
|
743
|
+
this.error = e;
|
|
744
|
+
this.failed = true;
|
|
745
|
+
this.fails++;
|
|
746
|
+
} finally {
|
|
747
|
+
try {
|
|
748
|
+
await this.afterEach(this.store, this.key, valueArtifactory);
|
|
749
|
+
} catch (e) {
|
|
750
|
+
this.failed = true;
|
|
751
|
+
this.fails++;
|
|
752
|
+
this.error = e;
|
|
753
|
+
}
|
|
775
754
|
}
|
|
755
|
+
return this.store;
|
|
776
756
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
757
|
+
async processRow(row, rowIndex, artifactory, testResourceConfiguration) {
|
|
758
|
+
return row;
|
|
759
|
+
}
|
|
760
|
+
createArtifactoryForRow(key, rowIndex, suiteNdx) {
|
|
761
|
+
const self = this;
|
|
762
|
+
if (self._parent && self._parent.createArtifactory) {
|
|
763
|
+
return self._parent.createArtifactory({
|
|
764
|
+
valueKey: key,
|
|
765
|
+
rowIndex,
|
|
766
|
+
suiteIndex: suiteNdx
|
|
767
|
+
});
|
|
768
|
+
}
|
|
782
769
|
return {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
770
|
+
writeFileSync: (filename, payload) => {
|
|
771
|
+
let path = "";
|
|
772
|
+
if (suiteNdx !== void 0) {
|
|
773
|
+
path += `suite-${suiteNdx}/`;
|
|
774
|
+
}
|
|
775
|
+
path += `value-${key}/`;
|
|
776
|
+
path += `row-${rowIndex} ${filename}`;
|
|
777
|
+
console.log(`[Artifactory] Would write to: ${path}`);
|
|
778
|
+
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
779
|
+
},
|
|
780
|
+
screenshot: (filename, payload) => {
|
|
781
|
+
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
782
|
+
}
|
|
789
783
|
};
|
|
790
784
|
}
|
|
791
|
-
|
|
792
|
-
console.log("mark9");
|
|
793
|
-
return new Promise((res) => res(s));
|
|
794
|
-
}
|
|
795
|
-
assertThat(t) {
|
|
796
|
-
return !!t;
|
|
797
|
-
}
|
|
798
|
-
afterAll(store, artifactory) {
|
|
785
|
+
async afterEach(store, key, artifactory) {
|
|
799
786
|
return store;
|
|
800
787
|
}
|
|
801
|
-
|
|
802
|
-
this.
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
});
|
|
809
|
-
} else {
|
|
810
|
-
const basePath = this.testResourceConfiguration?.fs || "testeranto";
|
|
811
|
-
suiteArtifactory = {
|
|
812
|
-
writeFileSync: (filename, payload) => {
|
|
813
|
-
console.log(
|
|
814
|
-
`[BaseSuite] Would write to ${basePath}/suite-${sNdx}/${filename}: ${payload.substring(0, 100)}...`
|
|
815
|
-
);
|
|
816
|
-
},
|
|
817
|
-
screenshot: (filename, payload) => {
|
|
818
|
-
console.log(`[BaseSuite] Would take screenshot: ${filename}`);
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration);
|
|
823
|
-
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
824
|
-
const giver = this.givens[gKey];
|
|
825
|
-
try {
|
|
826
|
-
let givenArtifactory;
|
|
827
|
-
if (this.parent && this.parent.createArtifactory) {
|
|
828
|
-
givenArtifactory = this.parent.createArtifactory({
|
|
829
|
-
givenKey: gKey,
|
|
830
|
-
suiteIndex: sNdx
|
|
831
|
-
});
|
|
832
|
-
} else {
|
|
833
|
-
const basePath = this.testResourceConfiguration?.fs || "testeranto";
|
|
834
|
-
givenArtifactory = {
|
|
835
|
-
writeFileSync: (filename, payload) => {
|
|
836
|
-
const path = `suite-${sNdx}/given-${gKey}/${filename}`;
|
|
837
|
-
const fullPath = `${basePath}/${path}`;
|
|
838
|
-
console.log(`[BaseSuite] Would write to ${fullPath}: ${payload.substring(0, 100)}...`);
|
|
839
|
-
},
|
|
840
|
-
screenshot: (filename, payload) => {
|
|
841
|
-
console.log(`[BaseSuite] Would take screenshot: ${filename}`);
|
|
788
|
+
toObj() {
|
|
789
|
+
const processedRows = (this.tableRows || []).map((row) => {
|
|
790
|
+
if (Array.isArray(row)) {
|
|
791
|
+
return row.map((item) => {
|
|
792
|
+
if (item && typeof item === "object") {
|
|
793
|
+
if (item.toObj) {
|
|
794
|
+
return item.toObj();
|
|
842
795
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
);
|
|
853
|
-
this.fails += giver.fails || 0;
|
|
854
|
-
} catch (e) {
|
|
855
|
-
this.failed = true;
|
|
856
|
-
this.fails += 1;
|
|
857
|
-
if (giver.fails) {
|
|
858
|
-
this.fails += giver.fails;
|
|
859
|
-
}
|
|
860
|
-
console.error(`Error in given ${gKey}:`, e);
|
|
796
|
+
const result = {};
|
|
797
|
+
for (const [key, value] of Object.entries(item)) {
|
|
798
|
+
if (key !== "_parent" && key !== "testResourceConfiguration") {
|
|
799
|
+
result[key] = value;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
return result;
|
|
803
|
+
}
|
|
804
|
+
return item;
|
|
805
|
+
});
|
|
861
806
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
this.
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
807
|
+
return row;
|
|
808
|
+
});
|
|
809
|
+
return {
|
|
810
|
+
key: this.key,
|
|
811
|
+
values: processedRows,
|
|
812
|
+
tableRows: this.tableRows || [],
|
|
813
|
+
error: this.error ? [this.error, this.error.stack] : null,
|
|
814
|
+
failed: this.failed,
|
|
815
|
+
features: this.features || [],
|
|
816
|
+
artifacts: this.artifacts,
|
|
817
|
+
status: this.status
|
|
818
|
+
};
|
|
872
819
|
}
|
|
873
820
|
};
|
|
874
821
|
|
|
875
|
-
// src/types.ts
|
|
876
|
-
var defaultTestResourceRequirement = {
|
|
877
|
-
ports: 0
|
|
878
|
-
};
|
|
879
|
-
|
|
880
822
|
// src/BaseTiposkripto.ts
|
|
881
823
|
var BaseTiposkripto = class {
|
|
882
|
-
constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration
|
|
824
|
+
constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration) {
|
|
883
825
|
this.totalTests = 0;
|
|
884
826
|
this.artifacts = [];
|
|
885
|
-
this.assertThis = () => {
|
|
886
|
-
};
|
|
887
827
|
this.testResourceConfiguration = testResourceConfiguration;
|
|
888
828
|
const fullAdapter = DefaultAdapter(testAdapter);
|
|
889
829
|
const instance = this;
|
|
890
|
-
|
|
891
|
-
throw new Error(
|
|
892
|
-
`testImplementation.suites must be an object, got ${typeof testImplementation.suites}: ${JSON.stringify(
|
|
893
|
-
testImplementation.suites
|
|
894
|
-
)}`
|
|
895
|
-
);
|
|
896
|
-
}
|
|
897
|
-
const classySuites = Object.entries(testImplementation.suites).reduce(
|
|
898
|
-
(a, [key], index) => {
|
|
899
|
-
a[key] = (somestring, setups) => {
|
|
900
|
-
const capturedFullAdapter = fullAdapter;
|
|
901
|
-
return new class extends BaseSuite {
|
|
902
|
-
afterAll(store, artifactory) {
|
|
903
|
-
let suiteArtifactory = artifactory;
|
|
904
|
-
if (!suiteArtifactory) {
|
|
905
|
-
if (this.parent && this.parent.createArtifactory) {
|
|
906
|
-
suiteArtifactory = this.parent.createArtifactory({
|
|
907
|
-
suiteIndex: this.index
|
|
908
|
-
});
|
|
909
|
-
} else {
|
|
910
|
-
suiteArtifactory = instance.createArtifactory({
|
|
911
|
-
suiteIndex: this.index
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return capturedFullAdapter.cleanupAll(store, suiteArtifactory);
|
|
916
|
-
}
|
|
917
|
-
assertThat(t) {
|
|
918
|
-
return capturedFullAdapter.assert(t);
|
|
919
|
-
}
|
|
920
|
-
async setup(s, artifactory, tr) {
|
|
921
|
-
return capturedFullAdapter.prepareAll?.(s, tr, artifactory) ?? s;
|
|
922
|
-
}
|
|
923
|
-
}(somestring, index, setups, instance);
|
|
924
|
-
};
|
|
925
|
-
return a;
|
|
926
|
-
},
|
|
927
|
-
{}
|
|
928
|
-
);
|
|
830
|
+
const classySuites = {};
|
|
929
831
|
const classyGivens = {};
|
|
930
832
|
if (testImplementation.givens) {
|
|
931
833
|
Object.entries(testImplementation.givens).forEach(([key, g]) => {
|
|
@@ -970,52 +872,65 @@ var BaseTiposkripto = class {
|
|
|
970
872
|
}
|
|
971
873
|
const classyWhens = {};
|
|
972
874
|
if (testImplementation.whens) {
|
|
973
|
-
Object.entries(testImplementation.whens).forEach(
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
875
|
+
Object.entries(testImplementation.whens).forEach(
|
|
876
|
+
([key, whEn]) => {
|
|
877
|
+
classyWhens[key] = (...payload) => {
|
|
878
|
+
const capturedFullAdapter = fullAdapter;
|
|
879
|
+
const whenInstance = new class extends BaseWhen {
|
|
880
|
+
async andWhen(store, whenCB, testResource, artifactory) {
|
|
881
|
+
return await capturedFullAdapter.execute(
|
|
882
|
+
store,
|
|
883
|
+
whenCB,
|
|
884
|
+
testResource,
|
|
885
|
+
artifactory
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
}(`${key}: ${payload && payload.toString()}`, whEn(...payload));
|
|
889
|
+
return whenInstance;
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
);
|
|
989
893
|
}
|
|
990
894
|
const classyThens = {};
|
|
991
895
|
if (testImplementation.thens) {
|
|
992
|
-
Object.entries(testImplementation.thens).forEach(
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
896
|
+
Object.entries(testImplementation.thens).forEach(
|
|
897
|
+
([key, thEn]) => {
|
|
898
|
+
classyThens[key] = (...args) => {
|
|
899
|
+
const capturedFullAdapter = fullAdapter;
|
|
900
|
+
const thenInstance = new class extends BaseThen {
|
|
901
|
+
async butThen(store, thenCB, testResourceConfiguration2, artifactory) {
|
|
902
|
+
return capturedFullAdapter.verify(
|
|
903
|
+
store,
|
|
904
|
+
thenCB,
|
|
905
|
+
testResourceConfiguration2,
|
|
906
|
+
artifactory
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
}(`${key}: ${args && args.toString()}`, thEn(...args));
|
|
910
|
+
return thenInstance;
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
);
|
|
1008
914
|
}
|
|
1009
915
|
const classyConfirms = {};
|
|
1010
916
|
if (testImplementation.confirms) {
|
|
1011
917
|
Object.entries(testImplementation.confirms).forEach(([key, val]) => {
|
|
1012
|
-
classyConfirms[key] = (
|
|
1013
|
-
return
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
918
|
+
classyConfirms[key] = () => {
|
|
919
|
+
return (testCases, features) => {
|
|
920
|
+
let actualConfirmCB;
|
|
921
|
+
if (typeof val === "function") {
|
|
922
|
+
actualConfirmCB = val();
|
|
923
|
+
} else {
|
|
924
|
+
actualConfirmCB = val;
|
|
925
|
+
}
|
|
926
|
+
return new BaseConfirm(
|
|
927
|
+
features,
|
|
928
|
+
testCases,
|
|
929
|
+
actualConfirmCB,
|
|
930
|
+
void 0
|
|
931
|
+
// initialValues
|
|
932
|
+
);
|
|
933
|
+
};
|
|
1019
934
|
};
|
|
1020
935
|
});
|
|
1021
936
|
}
|
|
@@ -1034,40 +949,83 @@ var BaseTiposkripto = class {
|
|
|
1034
949
|
}
|
|
1035
950
|
const classyShoulds = {};
|
|
1036
951
|
if (testImplementation.shoulds) {
|
|
1037
|
-
Object.entries(testImplementation.shoulds).forEach(
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
952
|
+
Object.entries(testImplementation.shoulds).forEach(
|
|
953
|
+
([key, shouldCB]) => {
|
|
954
|
+
classyShoulds[key] = (...args) => {
|
|
955
|
+
return new BaseShould(
|
|
956
|
+
`${key}: ${args && args.toString()}`,
|
|
957
|
+
shouldCB(...args)
|
|
958
|
+
);
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
);
|
|
1042
962
|
}
|
|
1043
963
|
const classyExpecteds = {};
|
|
1044
964
|
if (testImplementation.expecteds) {
|
|
1045
|
-
Object.entries(testImplementation.expecteds).forEach(
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
965
|
+
Object.entries(testImplementation.expecteds).forEach(
|
|
966
|
+
([key, expectedCB]) => {
|
|
967
|
+
classyExpecteds[key] = (...args) => {
|
|
968
|
+
return new BaseExpected(
|
|
969
|
+
`${key}: ${args && args.toString()}`,
|
|
970
|
+
expectedCB(...args)
|
|
971
|
+
);
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
);
|
|
1050
975
|
}
|
|
1051
976
|
const classyDescribes = {};
|
|
1052
|
-
if (testImplementation.describes) {
|
|
977
|
+
if (testImplementation.describes && typeof testImplementation.describes === "object") {
|
|
1053
978
|
Object.entries(testImplementation.describes).forEach(([key, desc]) => {
|
|
1054
979
|
classyDescribes[key] = (features, its, describeCB, initialValues) => {
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
980
|
+
try {
|
|
981
|
+
let actualDescribeCB;
|
|
982
|
+
if (describeCB) {
|
|
983
|
+
actualDescribeCB = describeCB;
|
|
984
|
+
} else if (typeof desc === "function") {
|
|
985
|
+
actualDescribeCB = desc();
|
|
986
|
+
} else {
|
|
987
|
+
actualDescribeCB = desc;
|
|
988
|
+
}
|
|
989
|
+
if (typeof actualDescribeCB !== "function") {
|
|
990
|
+
console.warn(`Describe implementation for "${key}" is not a function, got:`, typeof actualDescribeCB);
|
|
991
|
+
actualDescribeCB = () => {
|
|
992
|
+
throw new Error(`Describe implementation for "${key}" is not a valid function`);
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
return new BaseDescribe(
|
|
996
|
+
features,
|
|
997
|
+
its,
|
|
998
|
+
actualDescribeCB,
|
|
999
|
+
initialValues
|
|
1000
|
+
);
|
|
1001
|
+
} catch (error) {
|
|
1002
|
+
console.error(`Error creating Describe for "${key}":`, error);
|
|
1003
|
+
return new BaseDescribe(
|
|
1004
|
+
features,
|
|
1005
|
+
its,
|
|
1006
|
+
() => {
|
|
1007
|
+
throw new Error(`Describe implementation for "${key}" failed: ${error.message}`);
|
|
1008
|
+
},
|
|
1009
|
+
initialValues
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1061
1012
|
};
|
|
1062
1013
|
});
|
|
1014
|
+
} else {
|
|
1015
|
+
console.warn("testImplementation.describes is not defined or not an object");
|
|
1063
1016
|
}
|
|
1064
1017
|
const classyIts = {};
|
|
1065
1018
|
if (testImplementation.its) {
|
|
1066
|
-
Object.entries(testImplementation.its).forEach(
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1019
|
+
Object.entries(testImplementation.its).forEach(
|
|
1020
|
+
([key, itCB]) => {
|
|
1021
|
+
classyIts[key] = (...args) => {
|
|
1022
|
+
return new BaseIt(
|
|
1023
|
+
`${key}: ${args && args.toString()}`,
|
|
1024
|
+
itCB(...args)
|
|
1025
|
+
);
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
1071
1029
|
}
|
|
1072
1030
|
this.suitesOverrides = classySuites;
|
|
1073
1031
|
this.givenOverrides = classyGivens;
|
|
@@ -1081,76 +1039,192 @@ var BaseTiposkripto = class {
|
|
|
1081
1039
|
this.confirmsOverrides = classyConfirms;
|
|
1082
1040
|
this.testResourceRequirement = testResourceRequirement;
|
|
1083
1041
|
this.testSpecification = testSpecification;
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1042
|
+
let topLevelVerbs = [];
|
|
1043
|
+
let specError = null;
|
|
1044
|
+
try {
|
|
1045
|
+
topLevelVerbs = testSpecification(
|
|
1046
|
+
this.Given(),
|
|
1047
|
+
this.When(),
|
|
1048
|
+
this.Then(),
|
|
1049
|
+
this.Describe(),
|
|
1050
|
+
this.It(),
|
|
1051
|
+
this.Confirm(),
|
|
1052
|
+
this.Value(),
|
|
1053
|
+
this.Should()
|
|
1054
|
+
);
|
|
1055
|
+
} catch (error) {
|
|
1056
|
+
console.error("Error during test specification:", error);
|
|
1057
|
+
specError = error;
|
|
1058
|
+
topLevelVerbs = [];
|
|
1059
|
+
}
|
|
1060
|
+
this.specs = topLevelVerbs;
|
|
1061
|
+
this.totalTests = this.calculateTotalTestsDirectly();
|
|
1062
|
+
this.testJobs = [];
|
|
1063
|
+
for (let index = 0; index < this.specs.length; index++) {
|
|
1064
|
+
const step = this.specs[index];
|
|
1065
|
+
try {
|
|
1066
|
+
const testJob = this.createTestJobForStep(step, index, input);
|
|
1067
|
+
this.testJobs.push(testJob);
|
|
1068
|
+
} catch (stepError) {
|
|
1069
|
+
console.error(`Error creating test job for step ${index}:`, stepError);
|
|
1070
|
+
const errorMessage = `Step ${index} failed to create test job: ${stepError.message}`;
|
|
1071
|
+
const errorStep = {
|
|
1072
|
+
constructor: { name: "ErrorStep" },
|
|
1073
|
+
features: [],
|
|
1074
|
+
artifacts: [],
|
|
1075
|
+
fails: 1,
|
|
1076
|
+
failed: true,
|
|
1077
|
+
error: new Error(errorMessage),
|
|
1078
|
+
toObj: () => ({
|
|
1079
|
+
name: `Step_${index}_Error`,
|
|
1080
|
+
type: "Error",
|
|
1081
|
+
error: errorMessage
|
|
1082
|
+
})
|
|
1083
|
+
};
|
|
1084
|
+
const errorTestJob = this.createErrorTestJob(errorStep, index, new Error(errorMessage));
|
|
1085
|
+
this.testJobs.push(errorTestJob);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
if (this.testJobs.length === 0) {
|
|
1089
|
+
const errorMessage = specError ? `Test specification failed: ${specError.message}` : "No test steps were created by the specification";
|
|
1090
|
+
const errorStep = {
|
|
1091
|
+
constructor: { name: "ErrorStep" },
|
|
1092
|
+
features: [],
|
|
1093
|
+
artifacts: [],
|
|
1094
|
+
fails: 1,
|
|
1095
|
+
failed: true,
|
|
1096
|
+
error: new Error(errorMessage),
|
|
1097
|
+
toObj: () => ({
|
|
1098
|
+
name: "Specification_Error",
|
|
1099
|
+
type: "Error",
|
|
1100
|
+
error: errorMessage
|
|
1101
|
+
})
|
|
1106
1102
|
};
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1103
|
+
const errorTestJob = this.createErrorTestJob(errorStep, 0, new Error(errorMessage));
|
|
1104
|
+
this.testJobs.push(errorTestJob);
|
|
1105
|
+
}
|
|
1106
|
+
if (this.testJobs.length > 0) {
|
|
1107
|
+
const runAllTests = async () => {
|
|
1108
|
+
const allResults = [];
|
|
1109
|
+
let totalFails = 0;
|
|
1110
|
+
let anyFailed = false;
|
|
1111
|
+
const allFeatures = [];
|
|
1112
|
+
const allArtifacts = [];
|
|
1113
|
+
for (let i = 0; i < this.testJobs.length; i++) {
|
|
1116
1114
|
try {
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
tests: 0,
|
|
1128
|
-
runTimeTests: totalTests,
|
|
1129
|
-
testJob: testJob.toObj()
|
|
1130
|
-
};
|
|
1115
|
+
const result = await this.testJobs[i].receiveTestResourceConfig(testResourceConfiguration);
|
|
1116
|
+
allResults.push(result);
|
|
1117
|
+
totalFails += result.fails;
|
|
1118
|
+
anyFailed = anyFailed || result.failed;
|
|
1119
|
+
if (result.features && Array.isArray(result.features)) {
|
|
1120
|
+
allFeatures.push(...result.features);
|
|
1121
|
+
}
|
|
1122
|
+
if (result.artifacts && Array.isArray(result.artifacts)) {
|
|
1123
|
+
allArtifacts.push(...result.artifacts);
|
|
1124
|
+
}
|
|
1131
1125
|
} catch (e) {
|
|
1132
|
-
console.error(e
|
|
1133
|
-
|
|
1126
|
+
console.error(`Error running test job ${i}:`, e);
|
|
1127
|
+
totalFails++;
|
|
1128
|
+
anyFailed = true;
|
|
1129
|
+
allResults.push({
|
|
1134
1130
|
failed: true,
|
|
1135
|
-
fails:
|
|
1136
|
-
artifacts: [],
|
|
1131
|
+
fails: 1,
|
|
1137
1132
|
features: [],
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1133
|
+
artifacts: [],
|
|
1134
|
+
error: {
|
|
1135
|
+
message: e.message,
|
|
1136
|
+
stack: e.stack,
|
|
1137
|
+
name: e.name
|
|
1138
|
+
},
|
|
1139
|
+
stepName: `Job_${i}`,
|
|
1140
|
+
stepType: "Error",
|
|
1141
|
+
testJob: { name: `Job_${i}_Error` }
|
|
1142
|
+
});
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1145
|
+
const combinedResults = {
|
|
1146
|
+
failed: anyFailed,
|
|
1147
|
+
fails: totalFails,
|
|
1148
|
+
artifacts: allArtifacts,
|
|
1149
|
+
features: [...new Set(allFeatures)],
|
|
1150
|
+
// Remove duplicates
|
|
1151
|
+
tests: this.testJobs.length,
|
|
1152
|
+
runTimeTests: this.totalTests,
|
|
1153
|
+
testJob: { name: "CombinedResults" },
|
|
1154
|
+
timestamp: Date.now(),
|
|
1155
|
+
individualResults: allResults.map((result, idx) => ({
|
|
1156
|
+
index: idx,
|
|
1157
|
+
failed: result.failed,
|
|
1158
|
+
fails: result.fails,
|
|
1159
|
+
features: result.features || [],
|
|
1160
|
+
error: result.error,
|
|
1161
|
+
stepName: result.stepName,
|
|
1162
|
+
stepType: result.stepType,
|
|
1163
|
+
testJob: result.testJob
|
|
1164
|
+
}))
|
|
1165
|
+
};
|
|
1166
|
+
combinedResults.summary = {
|
|
1167
|
+
totalTests: this.testJobs.length,
|
|
1168
|
+
passed: this.testJobs.length - totalFails,
|
|
1169
|
+
failed: totalFails,
|
|
1170
|
+
successRate: totalFails === this.testJobs.length ? "0%" : ((this.testJobs.length - totalFails) / this.testJobs.length * 100).toFixed(2) + "%"
|
|
1171
|
+
};
|
|
1172
|
+
console.log("testResourceConfiguration", testResourceConfiguration);
|
|
1173
|
+
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1174
|
+
this.writeFileSync(reportJson, JSON.stringify(combinedResults, null, 2));
|
|
1175
|
+
};
|
|
1176
|
+
runAllTests().catch((error) => {
|
|
1177
|
+
console.error("Error running all test jobs:", error);
|
|
1178
|
+
const errorResults = {
|
|
1179
|
+
failed: true,
|
|
1180
|
+
fails: -1,
|
|
1181
|
+
artifacts: [],
|
|
1182
|
+
features: [],
|
|
1183
|
+
tests: 0,
|
|
1184
|
+
runTimeTests: -1,
|
|
1185
|
+
testJob: {},
|
|
1186
|
+
timestamp: Date.now(),
|
|
1187
|
+
error: {
|
|
1188
|
+
message: error.message,
|
|
1189
|
+
stack: error.stack,
|
|
1190
|
+
name: error.name
|
|
1191
|
+
},
|
|
1192
|
+
individualResults: [],
|
|
1193
|
+
summary: {
|
|
1194
|
+
totalTests: 0,
|
|
1195
|
+
passed: 0,
|
|
1196
|
+
failed: 1,
|
|
1197
|
+
successRate: "0%"
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1201
|
+
this.writeFileSync(reportJson, JSON.stringify(errorResults, null, 2));
|
|
1202
|
+
});
|
|
1203
|
+
} else {
|
|
1204
|
+
const emptyResults = {
|
|
1205
|
+
failed: true,
|
|
1206
|
+
fails: -1,
|
|
1207
|
+
artifacts: [],
|
|
1208
|
+
features: [],
|
|
1209
|
+
tests: 0,
|
|
1210
|
+
runTimeTests: -1,
|
|
1211
|
+
testJob: {},
|
|
1212
|
+
timestamp: Date.now(),
|
|
1213
|
+
error: {
|
|
1214
|
+
message: "No test jobs were created",
|
|
1215
|
+
name: "ConfigurationError"
|
|
1216
|
+
},
|
|
1217
|
+
individualResults: [],
|
|
1218
|
+
summary: {
|
|
1219
|
+
totalTests: 0,
|
|
1220
|
+
passed: 0,
|
|
1221
|
+
failed: 1,
|
|
1222
|
+
successRate: "0%"
|
|
1223
|
+
}
|
|
1144
1224
|
};
|
|
1145
|
-
return testJob;
|
|
1146
|
-
});
|
|
1147
|
-
this.testJobs[0].receiveTestResourceConfig(
|
|
1148
|
-
testResourceConfiguration
|
|
1149
|
-
).then((results) => {
|
|
1150
|
-
console.log("testResourceConfiguration", testResourceConfiguration);
|
|
1151
1225
|
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1152
|
-
this.writeFileSync(reportJson, JSON.stringify(
|
|
1153
|
-
}
|
|
1226
|
+
this.writeFileSync(reportJson, JSON.stringify(emptyResults, null, 2));
|
|
1227
|
+
}
|
|
1154
1228
|
}
|
|
1155
1229
|
// Create an artifactory that tracks context
|
|
1156
1230
|
createArtifactory(context = {}) {
|
|
@@ -1160,7 +1234,12 @@ var BaseTiposkripto = class {
|
|
|
1160
1234
|
const basePath = this.testResourceConfiguration?.fs || "testeranto";
|
|
1161
1235
|
console.log("[Artifactory] Base path:", basePath);
|
|
1162
1236
|
console.log("[Artifactory] Context:", context);
|
|
1163
|
-
if (context.
|
|
1237
|
+
if (context.stepIndex !== void 0) {
|
|
1238
|
+
path += `step-${context.stepIndex}/`;
|
|
1239
|
+
if (context.stepType) {
|
|
1240
|
+
path += `${context.stepType}/`;
|
|
1241
|
+
}
|
|
1242
|
+
} else if (context.suiteIndex !== void 0) {
|
|
1164
1243
|
path += `suite-${context.suiteIndex}/`;
|
|
1165
1244
|
}
|
|
1166
1245
|
if (context.givenKey) {
|
|
@@ -1188,7 +1267,56 @@ var BaseTiposkripto = class {
|
|
|
1188
1267
|
}
|
|
1189
1268
|
async receiveTestResourceConfig(testResourceConfig) {
|
|
1190
1269
|
if (this.testJobs && this.testJobs.length > 0) {
|
|
1191
|
-
|
|
1270
|
+
const allResults = [];
|
|
1271
|
+
let totalFails = 0;
|
|
1272
|
+
let anyFailed = false;
|
|
1273
|
+
const allFeatures = [];
|
|
1274
|
+
const allArtifacts = [];
|
|
1275
|
+
for (let i = 0; i < this.testJobs.length; i++) {
|
|
1276
|
+
try {
|
|
1277
|
+
const result = await this.testJobs[i].receiveTestResourceConfig(testResourceConfig);
|
|
1278
|
+
allResults.push(result);
|
|
1279
|
+
totalFails += result.fails;
|
|
1280
|
+
anyFailed = anyFailed || result.failed;
|
|
1281
|
+
if (result.features && Array.isArray(result.features)) {
|
|
1282
|
+
allFeatures.push(...result.features);
|
|
1283
|
+
}
|
|
1284
|
+
if (result.artifacts && Array.isArray(result.artifacts)) {
|
|
1285
|
+
allArtifacts.push(...result.artifacts);
|
|
1286
|
+
}
|
|
1287
|
+
} catch (e) {
|
|
1288
|
+
console.error(`Error running test job ${i}:`, e);
|
|
1289
|
+
totalFails++;
|
|
1290
|
+
anyFailed = true;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return {
|
|
1294
|
+
failed: anyFailed,
|
|
1295
|
+
fails: totalFails,
|
|
1296
|
+
artifacts: allArtifacts,
|
|
1297
|
+
features: [...new Set(allFeatures)],
|
|
1298
|
+
// Remove duplicates
|
|
1299
|
+
tests: this.testJobs.length,
|
|
1300
|
+
runTimeTests: this.totalTests,
|
|
1301
|
+
testJob: { name: "CombinedResults" },
|
|
1302
|
+
timestamp: Date.now(),
|
|
1303
|
+
individualResults: allResults.map((result, idx) => ({
|
|
1304
|
+
index: idx,
|
|
1305
|
+
failed: result.failed,
|
|
1306
|
+
fails: result.fails,
|
|
1307
|
+
features: result.features || [],
|
|
1308
|
+
error: result.error,
|
|
1309
|
+
stepName: result.stepName,
|
|
1310
|
+
stepType: result.stepType,
|
|
1311
|
+
testJob: result.testJob
|
|
1312
|
+
})),
|
|
1313
|
+
summary: {
|
|
1314
|
+
totalTests: this.testJobs.length,
|
|
1315
|
+
passed: this.testJobs.length - totalFails,
|
|
1316
|
+
failed: totalFails,
|
|
1317
|
+
successRate: totalFails === 0 ? "100%" : ((this.testJobs.length - totalFails) / this.testJobs.length * 100).toFixed(2) + "%"
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1192
1320
|
} else {
|
|
1193
1321
|
throw new Error("No test jobs available");
|
|
1194
1322
|
}
|
|
@@ -1197,59 +1325,501 @@ var BaseTiposkripto = class {
|
|
|
1197
1325
|
return this.specs;
|
|
1198
1326
|
}
|
|
1199
1327
|
Suites() {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
`suitesOverrides is undefined. classySuites: ${JSON.stringify(
|
|
1203
|
-
Object.keys(this.suitesOverrides || {})
|
|
1204
|
-
)}`
|
|
1205
|
-
);
|
|
1206
|
-
}
|
|
1207
|
-
return this.suitesOverrides;
|
|
1328
|
+
console.warn("Suites() is deprecated and returns an empty object");
|
|
1329
|
+
return {};
|
|
1208
1330
|
}
|
|
1209
1331
|
Given() {
|
|
1210
|
-
|
|
1332
|
+
const overrides = this.givenOverrides || {};
|
|
1333
|
+
return new Proxy(overrides, {
|
|
1334
|
+
get(target, prop) {
|
|
1335
|
+
if (typeof prop === "string") {
|
|
1336
|
+
if (prop in target) {
|
|
1337
|
+
return target[prop];
|
|
1338
|
+
} else {
|
|
1339
|
+
return (features = [], whens = [], thens = [], givenCB = () => {
|
|
1340
|
+
}, initialValues = void 0) => {
|
|
1341
|
+
console.error(`Given.${prop} is not defined in test implementation`);
|
|
1342
|
+
try {
|
|
1343
|
+
return new class extends BaseGiven {
|
|
1344
|
+
async givenThat(subject, testResource, artifactory, initializer, initialValues2) {
|
|
1345
|
+
throw new Error(`Given.${prop} is not implemented`);
|
|
1346
|
+
}
|
|
1347
|
+
}(
|
|
1348
|
+
features,
|
|
1349
|
+
whens,
|
|
1350
|
+
thens,
|
|
1351
|
+
givenCB,
|
|
1352
|
+
initialValues
|
|
1353
|
+
);
|
|
1354
|
+
} catch (e) {
|
|
1355
|
+
console.error(`Error creating Given.${prop}:`, e);
|
|
1356
|
+
return {
|
|
1357
|
+
features,
|
|
1358
|
+
whens,
|
|
1359
|
+
thens,
|
|
1360
|
+
givenCB,
|
|
1361
|
+
initialValues,
|
|
1362
|
+
give: async () => {
|
|
1363
|
+
throw new Error(`Given.${prop} creation failed: ${e.message}`);
|
|
1364
|
+
},
|
|
1365
|
+
toObj: () => ({
|
|
1366
|
+
key: `Given_${prop}_error`,
|
|
1367
|
+
error: `Given.${prop} creation failed: ${e.message}`,
|
|
1368
|
+
failed: true,
|
|
1369
|
+
features
|
|
1370
|
+
})
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
return target[prop];
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1211
1379
|
}
|
|
1212
1380
|
When() {
|
|
1213
|
-
|
|
1381
|
+
const overrides = this.whenOverrides || {};
|
|
1382
|
+
return new Proxy(overrides, {
|
|
1383
|
+
get(target, prop) {
|
|
1384
|
+
if (typeof prop === "string") {
|
|
1385
|
+
if (prop in target) {
|
|
1386
|
+
return target[prop];
|
|
1387
|
+
} else {
|
|
1388
|
+
return (...args) => {
|
|
1389
|
+
console.error(`When.${prop} is not defined in test implementation`);
|
|
1390
|
+
try {
|
|
1391
|
+
return new class extends BaseWhen {
|
|
1392
|
+
async andWhen(store, whenCB, testResource, artifactory) {
|
|
1393
|
+
throw new Error(`When.${prop} is not implemented`);
|
|
1394
|
+
}
|
|
1395
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1396
|
+
throw new Error(`When.${prop} is not implemented`);
|
|
1397
|
+
});
|
|
1398
|
+
} catch (e) {
|
|
1399
|
+
console.error(`Error creating When.${prop}:`, e);
|
|
1400
|
+
return {
|
|
1401
|
+
name: `${prop}_error`,
|
|
1402
|
+
test: async () => {
|
|
1403
|
+
throw new Error(`When.${prop} creation failed: ${e.message}`);
|
|
1404
|
+
},
|
|
1405
|
+
toObj: () => ({
|
|
1406
|
+
name: `When_${prop}_error`,
|
|
1407
|
+
error: `When.${prop} creation failed: ${e.message}`,
|
|
1408
|
+
status: false
|
|
1409
|
+
})
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
return target[prop];
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1214
1418
|
}
|
|
1215
1419
|
Then() {
|
|
1216
|
-
|
|
1420
|
+
const overrides = this.thenOverrides || {};
|
|
1421
|
+
return new Proxy(overrides, {
|
|
1422
|
+
get(target, prop) {
|
|
1423
|
+
if (typeof prop === "string") {
|
|
1424
|
+
if (prop in target) {
|
|
1425
|
+
return target[prop];
|
|
1426
|
+
} else {
|
|
1427
|
+
return (...args) => {
|
|
1428
|
+
console.error(`Then.${prop} is not defined in test implementation`);
|
|
1429
|
+
return new class extends BaseThen {
|
|
1430
|
+
async butThen(store, thenCB, testResourceConfiguration, artifactory) {
|
|
1431
|
+
throw new Error(`Then.${prop} is not implemented`);
|
|
1432
|
+
}
|
|
1433
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1434
|
+
throw new Error(`Then.${prop} is not implemented`);
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
return target[prop];
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1217
1442
|
}
|
|
1218
1443
|
Describe() {
|
|
1219
|
-
|
|
1444
|
+
const overrides = this.describesOverrides || {};
|
|
1445
|
+
return new Proxy(overrides, {
|
|
1446
|
+
get(target, prop) {
|
|
1447
|
+
if (typeof prop === "string") {
|
|
1448
|
+
if (prop in target) {
|
|
1449
|
+
return target[prop];
|
|
1450
|
+
} else {
|
|
1451
|
+
return () => {
|
|
1452
|
+
console.error(`Describe.${prop} is not defined in test implementation`);
|
|
1453
|
+
return (features, its, describeCB, initialValues) => {
|
|
1454
|
+
return new BaseDescribe(
|
|
1455
|
+
features,
|
|
1456
|
+
its,
|
|
1457
|
+
() => {
|
|
1458
|
+
throw new Error(`Describe.${prop} is not implemented`);
|
|
1459
|
+
},
|
|
1460
|
+
initialValues
|
|
1461
|
+
);
|
|
1462
|
+
};
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
return target[prop];
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1220
1469
|
}
|
|
1221
1470
|
It() {
|
|
1222
|
-
|
|
1471
|
+
const overrides = this.itsOverrides || {};
|
|
1472
|
+
return new Proxy(overrides, {
|
|
1473
|
+
get(target, prop) {
|
|
1474
|
+
if (typeof prop === "string") {
|
|
1475
|
+
if (prop in target) {
|
|
1476
|
+
return target[prop];
|
|
1477
|
+
} else {
|
|
1478
|
+
return (...args) => {
|
|
1479
|
+
console.error(`It.${prop} is not defined in test implementation`);
|
|
1480
|
+
return new class extends BaseIt {
|
|
1481
|
+
constructor(name, itCB) {
|
|
1482
|
+
super(name, itCB);
|
|
1483
|
+
}
|
|
1484
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1485
|
+
throw new Error(`It.${prop} is not implemented`);
|
|
1486
|
+
});
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
return target[prop];
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1223
1493
|
}
|
|
1224
1494
|
Confirm() {
|
|
1225
|
-
|
|
1495
|
+
const overrides = this.confirmsOverrides || {};
|
|
1496
|
+
return new Proxy(overrides, {
|
|
1497
|
+
get(target, prop) {
|
|
1498
|
+
if (typeof prop === "string") {
|
|
1499
|
+
if (prop in target) {
|
|
1500
|
+
return target[prop];
|
|
1501
|
+
} else {
|
|
1502
|
+
return () => {
|
|
1503
|
+
console.error(`Confirm.${prop} is not defined in test implementation`);
|
|
1504
|
+
return (testCases, features) => {
|
|
1505
|
+
return new class extends BaseConfirm {
|
|
1506
|
+
constructor(features2, testCases2, confirmCB, initialValues) {
|
|
1507
|
+
super(features2, testCases2, confirmCB, initialValues);
|
|
1508
|
+
}
|
|
1509
|
+
}(
|
|
1510
|
+
features,
|
|
1511
|
+
testCases,
|
|
1512
|
+
() => {
|
|
1513
|
+
throw new Error(`Confirm.${prop} is not implemented`);
|
|
1514
|
+
},
|
|
1515
|
+
void 0
|
|
1516
|
+
);
|
|
1517
|
+
};
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
return target[prop];
|
|
1522
|
+
}
|
|
1523
|
+
});
|
|
1226
1524
|
}
|
|
1227
1525
|
Value() {
|
|
1228
|
-
|
|
1526
|
+
const overrides = this.valuesOverrides || {};
|
|
1527
|
+
return new Proxy(overrides, {
|
|
1528
|
+
get(target, prop) {
|
|
1529
|
+
if (typeof prop === "string") {
|
|
1530
|
+
if (prop in target) {
|
|
1531
|
+
return target[prop];
|
|
1532
|
+
} else {
|
|
1533
|
+
return () => {
|
|
1534
|
+
console.error(`Value.${prop} is not defined in test implementation`);
|
|
1535
|
+
return (features, tableRows, confirmCB, initialValues) => {
|
|
1536
|
+
return new class extends BaseValue {
|
|
1537
|
+
constructor(features2, tableRows2, confirmCB2, initialValues2) {
|
|
1538
|
+
super(features2, tableRows2, confirmCB2, initialValues2);
|
|
1539
|
+
}
|
|
1540
|
+
}(
|
|
1541
|
+
features,
|
|
1542
|
+
tableRows,
|
|
1543
|
+
() => {
|
|
1544
|
+
throw new Error(`Value.${prop} is not implemented`);
|
|
1545
|
+
},
|
|
1546
|
+
initialValues
|
|
1547
|
+
);
|
|
1548
|
+
};
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
return target[prop];
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1229
1555
|
}
|
|
1230
1556
|
Should() {
|
|
1231
|
-
|
|
1557
|
+
const overrides = this.shouldsOverrides || {};
|
|
1558
|
+
return new Proxy(overrides, {
|
|
1559
|
+
get(target, prop) {
|
|
1560
|
+
if (typeof prop === "string") {
|
|
1561
|
+
if (prop in target) {
|
|
1562
|
+
return target[prop];
|
|
1563
|
+
} else {
|
|
1564
|
+
return (...args) => {
|
|
1565
|
+
console.error(`Should.${prop} is not defined in test implementation`);
|
|
1566
|
+
return new class extends BaseShould {
|
|
1567
|
+
constructor(name, shouldCB) {
|
|
1568
|
+
super(name, shouldCB);
|
|
1569
|
+
}
|
|
1570
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1571
|
+
throw new Error(`Should.${prop} is not implemented`);
|
|
1572
|
+
});
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
return target[prop];
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1232
1579
|
}
|
|
1233
1580
|
Expect() {
|
|
1234
|
-
|
|
1581
|
+
const overrides = this.expectedsOverrides || {};
|
|
1582
|
+
return new Proxy(overrides, {
|
|
1583
|
+
get(target, prop) {
|
|
1584
|
+
if (typeof prop === "string") {
|
|
1585
|
+
if (prop in target) {
|
|
1586
|
+
return target[prop];
|
|
1587
|
+
} else {
|
|
1588
|
+
return (...args) => {
|
|
1589
|
+
console.error(`Expect.${prop} is not defined in test implementation`);
|
|
1590
|
+
return new class extends BaseExpected {
|
|
1591
|
+
constructor(name, expectedCB) {
|
|
1592
|
+
super(name, expectedCB);
|
|
1593
|
+
}
|
|
1594
|
+
async validateRow(store, testResourceConfiguration, filepath, expectedValue, artifactory) {
|
|
1595
|
+
throw new Error(`Expect.${prop} is not implemented`);
|
|
1596
|
+
}
|
|
1597
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1598
|
+
throw new Error(`Expect.${prop} is not implemented`);
|
|
1599
|
+
});
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
return target[prop];
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
Expected() {
|
|
1608
|
+
const overrides = this.expectedsOverrides || {};
|
|
1609
|
+
return new Proxy(overrides, {
|
|
1610
|
+
get(target, prop) {
|
|
1611
|
+
if (typeof prop === "string") {
|
|
1612
|
+
if (prop in target) {
|
|
1613
|
+
return target[prop];
|
|
1614
|
+
} else {
|
|
1615
|
+
return (...args) => {
|
|
1616
|
+
console.error(`Expected.${prop} is not defined in test implementation`);
|
|
1617
|
+
return new class extends BaseExpected {
|
|
1618
|
+
constructor(name, expectedCB) {
|
|
1619
|
+
super(name, expectedCB);
|
|
1620
|
+
}
|
|
1621
|
+
async validateRow(store, testResourceConfiguration, filepath, expectedValue, artifactory) {
|
|
1622
|
+
throw new Error(`Expected.${prop} is not implemented`);
|
|
1623
|
+
}
|
|
1624
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1625
|
+
throw new Error(`Expected.${prop} is not implemented`);
|
|
1626
|
+
});
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return target[prop];
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1235
1633
|
}
|
|
1236
1634
|
// Add a method to access test jobs which can be used by receiveTestResourceConfig
|
|
1237
1635
|
getTestJobs() {
|
|
1238
1636
|
return this.testJobs;
|
|
1239
1637
|
}
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1638
|
+
createTestJobForStep(step, index, input) {
|
|
1639
|
+
const stepRunner = async (testResourceConfiguration) => {
|
|
1640
|
+
try {
|
|
1641
|
+
let result;
|
|
1642
|
+
const constructorName = step.constructor.name;
|
|
1643
|
+
const stepArtifactory = this.createArtifactory({
|
|
1644
|
+
stepIndex: index,
|
|
1645
|
+
stepType: constructorName.toLowerCase().replace("base", "")
|
|
1646
|
+
});
|
|
1647
|
+
if (constructorName === "BaseGiven") {
|
|
1648
|
+
result = await step.give(
|
|
1649
|
+
input,
|
|
1650
|
+
`step_${index}`,
|
|
1651
|
+
testResourceConfiguration,
|
|
1652
|
+
(t) => !!t,
|
|
1653
|
+
// Simple tester function
|
|
1654
|
+
stepArtifactory,
|
|
1655
|
+
index
|
|
1656
|
+
);
|
|
1657
|
+
} else if (constructorName === "BaseDescribe") {
|
|
1658
|
+
result = await step.describe(
|
|
1659
|
+
input,
|
|
1660
|
+
`step_${index}`,
|
|
1661
|
+
testResourceConfiguration,
|
|
1662
|
+
(t) => !!t,
|
|
1663
|
+
// Simple tester function
|
|
1664
|
+
stepArtifactory,
|
|
1665
|
+
index
|
|
1666
|
+
);
|
|
1667
|
+
} else if (constructorName === "BaseConfirm" || constructorName === "BaseValue") {
|
|
1668
|
+
if (typeof step.run === "function") {
|
|
1669
|
+
result = await step.run(
|
|
1670
|
+
input,
|
|
1671
|
+
testResourceConfiguration,
|
|
1672
|
+
stepArtifactory
|
|
1673
|
+
);
|
|
1674
|
+
} else if (typeof step.confirm === "function") {
|
|
1675
|
+
result = await step.confirm(
|
|
1676
|
+
input,
|
|
1677
|
+
`step_${index}`,
|
|
1678
|
+
testResourceConfiguration,
|
|
1679
|
+
(t) => !!t,
|
|
1680
|
+
// Simple tester function
|
|
1681
|
+
stepArtifactory,
|
|
1682
|
+
index
|
|
1683
|
+
);
|
|
1684
|
+
} else if (typeof step.value === "function") {
|
|
1685
|
+
result = await step.value(
|
|
1686
|
+
input,
|
|
1687
|
+
`step_${index}`,
|
|
1688
|
+
testResourceConfiguration,
|
|
1689
|
+
(t) => !!t,
|
|
1690
|
+
// Simple tester function
|
|
1691
|
+
stepArtifactory,
|
|
1692
|
+
index
|
|
1693
|
+
);
|
|
1694
|
+
}
|
|
1695
|
+
} else {
|
|
1696
|
+
if (typeof step.run === "function") {
|
|
1697
|
+
result = await step.run(
|
|
1698
|
+
input,
|
|
1699
|
+
testResourceConfiguration,
|
|
1700
|
+
stepArtifactory
|
|
1701
|
+
);
|
|
1702
|
+
} else if (typeof step.test === "function") {
|
|
1703
|
+
result = await step.test(
|
|
1704
|
+
input,
|
|
1705
|
+
testResourceConfiguration,
|
|
1706
|
+
stepArtifactory
|
|
1707
|
+
);
|
|
1708
|
+
} else {
|
|
1709
|
+
throw new Error(`Step type ${constructorName} has no runnable method`);
|
|
1248
1710
|
}
|
|
1249
1711
|
}
|
|
1712
|
+
return { step, result, fails: step.fails || 0, failed: step.failed || false };
|
|
1713
|
+
} catch (e) {
|
|
1714
|
+
console.error(e.stack);
|
|
1715
|
+
throw e;
|
|
1250
1716
|
}
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1717
|
+
};
|
|
1718
|
+
const runner = stepRunner;
|
|
1719
|
+
const totalTests = this.totalTests;
|
|
1720
|
+
const testJob = {
|
|
1721
|
+
test: step,
|
|
1722
|
+
toObj: () => {
|
|
1723
|
+
return step.toObj ? step.toObj() : { name: `Step_${index}`, type: step.constructor.name };
|
|
1724
|
+
},
|
|
1725
|
+
runner,
|
|
1726
|
+
receiveTestResourceConfig: async (testResourceConfiguration) => {
|
|
1727
|
+
try {
|
|
1728
|
+
const stepResult = await runner(testResourceConfiguration);
|
|
1729
|
+
const fails = stepResult.fails;
|
|
1730
|
+
const stepObj = stepResult.step;
|
|
1731
|
+
let features = [];
|
|
1732
|
+
if (stepObj.features && Array.isArray(stepObj.features)) {
|
|
1733
|
+
features = stepObj.features;
|
|
1734
|
+
}
|
|
1735
|
+
let artifacts = [];
|
|
1736
|
+
if (stepObj.artifacts && Array.isArray(stepObj.artifacts)) {
|
|
1737
|
+
artifacts = stepObj.artifacts;
|
|
1738
|
+
}
|
|
1739
|
+
let errorDetails = null;
|
|
1740
|
+
if (stepObj.error) {
|
|
1741
|
+
errorDetails = {
|
|
1742
|
+
message: stepObj.error.message,
|
|
1743
|
+
stack: stepObj.error.stack,
|
|
1744
|
+
name: stepObj.error.name
|
|
1745
|
+
};
|
|
1746
|
+
} else if (stepResult.error) {
|
|
1747
|
+
errorDetails = {
|
|
1748
|
+
message: stepResult.error.message,
|
|
1749
|
+
stack: stepResult.error.stack,
|
|
1750
|
+
name: stepResult.error.name
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
return {
|
|
1754
|
+
failed: stepResult.failed || fails > 0,
|
|
1755
|
+
fails,
|
|
1756
|
+
artifacts,
|
|
1757
|
+
features,
|
|
1758
|
+
tests: 1,
|
|
1759
|
+
runTimeTests: totalTests,
|
|
1760
|
+
testJob: testJob.toObj(),
|
|
1761
|
+
error: errorDetails,
|
|
1762
|
+
stepName: stepObj.key || stepObj.name || `Step_${index}`,
|
|
1763
|
+
stepType: stepObj.constructor?.name || "Unknown"
|
|
1764
|
+
};
|
|
1765
|
+
} catch (e) {
|
|
1766
|
+
console.error(e.stack);
|
|
1767
|
+
return {
|
|
1768
|
+
failed: true,
|
|
1769
|
+
fails: -1,
|
|
1770
|
+
artifacts: [],
|
|
1771
|
+
features: [],
|
|
1772
|
+
tests: 0,
|
|
1773
|
+
runTimeTests: -1,
|
|
1774
|
+
testJob: testJob.toObj(),
|
|
1775
|
+
error: {
|
|
1776
|
+
message: e.message,
|
|
1777
|
+
stack: e.stack,
|
|
1778
|
+
name: e.name
|
|
1779
|
+
},
|
|
1780
|
+
stepName: `Step_${index}`,
|
|
1781
|
+
stepType: "Error"
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
return testJob;
|
|
1787
|
+
}
|
|
1788
|
+
createErrorTestJob(errorStep, index, error) {
|
|
1789
|
+
const totalTests = this.totalTests;
|
|
1790
|
+
const uniqueError = new Error(error.message);
|
|
1791
|
+
uniqueError.stack = error.stack;
|
|
1792
|
+
uniqueError.name = error.name;
|
|
1793
|
+
return {
|
|
1794
|
+
test: errorStep,
|
|
1795
|
+
toObj: () => {
|
|
1796
|
+
return errorStep.toObj();
|
|
1797
|
+
},
|
|
1798
|
+
runner: async () => {
|
|
1799
|
+
throw uniqueError;
|
|
1800
|
+
},
|
|
1801
|
+
receiveTestResourceConfig: async (testResourceConfiguration) => {
|
|
1802
|
+
return {
|
|
1803
|
+
failed: true,
|
|
1804
|
+
fails: 1,
|
|
1805
|
+
artifacts: [],
|
|
1806
|
+
features: [],
|
|
1807
|
+
tests: 1,
|
|
1808
|
+
runTimeTests: totalTests,
|
|
1809
|
+
testJob: errorStep.toObj(),
|
|
1810
|
+
error: {
|
|
1811
|
+
message: uniqueError.message,
|
|
1812
|
+
stack: uniqueError.stack,
|
|
1813
|
+
name: uniqueError.name
|
|
1814
|
+
},
|
|
1815
|
+
stepName: errorStep.toObj().name || `ErrorStep_${index}`,
|
|
1816
|
+
stepType: "Error"
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
}
|
|
1821
|
+
calculateTotalTestsDirectly() {
|
|
1822
|
+
return this.specs ? this.specs.length : 0;
|
|
1253
1823
|
}
|
|
1254
1824
|
};
|
|
1255
1825
|
|
|
@@ -1269,7 +1839,9 @@ var WebTiposkripto = class extends BaseTiposkripto {
|
|
|
1269
1839
|
const encodedConfig = urlParams.get("config");
|
|
1270
1840
|
if (encodedConfig) {
|
|
1271
1841
|
try {
|
|
1272
|
-
testResourceConfig = JSON.parse(
|
|
1842
|
+
testResourceConfig = JSON.parse(
|
|
1843
|
+
decodeURIComponent(encodedConfig)
|
|
1844
|
+
);
|
|
1273
1845
|
} catch (e) {
|
|
1274
1846
|
console.error("Failed to parse config from URL:", e);
|
|
1275
1847
|
testResourceConfig = {};
|
|
@@ -1304,9 +1876,14 @@ var WebTiposkripto = class extends BaseTiposkripto {
|
|
|
1304
1876
|
}
|
|
1305
1877
|
}
|
|
1306
1878
|
testResourceConfig.fs = `testeranto/reports/webtests/${testPath}`;
|
|
1307
|
-
console.log(
|
|
1879
|
+
console.log(
|
|
1880
|
+
`[WebTiposkripto] Constructed default fs path: ${testResourceConfig.fs}`
|
|
1881
|
+
);
|
|
1308
1882
|
}
|
|
1309
|
-
console.log(
|
|
1883
|
+
console.log(
|
|
1884
|
+
"[WebTiposkripto] testResourceConfig:",
|
|
1885
|
+
JSON.stringify(testResourceConfig)
|
|
1886
|
+
);
|
|
1310
1887
|
super(
|
|
1311
1888
|
"web",
|
|
1312
1889
|
input,
|
|
@@ -1316,7 +1893,10 @@ var WebTiposkripto = class extends BaseTiposkripto {
|
|
|
1316
1893
|
testAdapter,
|
|
1317
1894
|
testResourceConfig
|
|
1318
1895
|
);
|
|
1319
|
-
console.log(
|
|
1896
|
+
console.log(
|
|
1897
|
+
"[WebTiposkripto] testResourceConfiguration.fs:",
|
|
1898
|
+
this.testResourceConfiguration?.fs
|
|
1899
|
+
);
|
|
1320
1900
|
}
|
|
1321
1901
|
writeFileSync(filename, payload) {
|
|
1322
1902
|
if (isBrowser) {
|