Skip to content

Commit 15a9fb9

Browse files
Merge pull request #4051 from sparrowapp-dev/release/2.36.0
Release/2.36.0 to development.
2 parents acc7825 + b0bb11e commit 15a9fb9

File tree

24 files changed

+3027
-827
lines changed

24 files changed

+3027
-827
lines changed

apps/@sparrow-desktop/src/adapter/testflow-tab.ts

Lines changed: 198 additions & 183 deletions
Large diffs are not rendered by default.

apps/@sparrow-desktop/src/database/database.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,24 @@ export class RxDB {
465465
39: function (oldDoc: TabDocument) {
466466
return oldDoc;
467467
},
468+
40: function (oldDoc: TabDocument) {
469+
const test = {
470+
testCaseMode: "no-code",
471+
noCode: [],
472+
script: "",
473+
};
474+
if (oldDoc?.property?.testflow?.nodes) {
475+
oldDoc.property.testflow.nodes =
476+
oldDoc.property.testflow.nodes.map((node) => {
477+
if (node?.data?.requestData) {
478+
node.data.requestData.tests = test;
479+
}
480+
return node;
481+
});
482+
}
483+
484+
return oldDoc;
485+
},
468486
},
469487
},
470488
collection: {
@@ -676,6 +694,22 @@ export class RxDB {
676694
}
677695
return oldDoc;
678696
},
697+
2: function (oldDoc) {
698+
if (oldDoc && Array.isArray(oldDoc.nodes)) {
699+
const test = {
700+
testCaseMode: "no-code",
701+
noCode: [],
702+
script: "",
703+
};
704+
oldDoc.nodes = oldDoc.nodes.map((node) => {
705+
if (node?.data?.requestData) {
706+
node.data.requestData.tests = test;
707+
}
708+
return node;
709+
});
710+
}
711+
return oldDoc;
712+
},
679713
},
680714
},
681715
environmenttab: {

apps/@sparrow-desktop/src/models/tab.model.ts

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,43 @@ const requestItems = {
230230
},
231231
},
232232
},
233+
tests: {
234+
type: "object",
235+
properties: {
236+
testCaseMode: {
237+
type: "string",
238+
},
239+
noCode: {
240+
type: "array",
241+
items: {
242+
type: "object",
243+
properties: {
244+
id: {
245+
type: "string",
246+
},
247+
name: {
248+
type: "string",
249+
},
250+
condition: {
251+
type: "string",
252+
},
253+
expectedResult: {
254+
type: "string",
255+
},
256+
testPath: {
257+
type: "string",
258+
},
259+
testTarget: {
260+
type: "string",
261+
},
262+
},
263+
},
264+
},
265+
script: {
266+
type: "string",
267+
},
268+
},
269+
},
233270
};
234271

235272
export const authProfileItemProperties = {
@@ -284,7 +321,7 @@ export const tabSchemaLiteral = {
284321
title: "Opened tabs that will be shown on dashboard",
285322
primaryKey: "tabId",
286323
type: "object",
287-
version: 39,
324+
version: 40,
288325
properties: {
289326
tabId: {
290327
// ---- RxDocumentId

apps/@sparrow-desktop/src/models/testflow.model.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,44 @@ const httpRequestAuth = {
108108
},
109109
};
110110

111+
const tests = {
112+
testCaseMode: {
113+
type: "string",
114+
},
115+
noCode: {
116+
type: "array",
117+
items: {
118+
type: "object",
119+
properties: {
120+
id: {
121+
type: "string",
122+
},
123+
name: {
124+
type: "string",
125+
},
126+
condition: {
127+
type: "string",
128+
},
129+
expectedResult: {
130+
type: "string",
131+
},
132+
testPath: {
133+
type: "string",
134+
},
135+
testTarget: {
136+
type: "string",
137+
},
138+
},
139+
},
140+
},
141+
script: {
142+
type: "string",
143+
},
144+
preScript: {
145+
type: "string",
146+
},
147+
};
148+
111149
const requestItems = {
112150
name: {
113151
type: "string",
@@ -143,13 +181,17 @@ const requestItems = {
143181
type: "array",
144182
properties: params,
145183
},
184+
tests: {
185+
type: "array",
186+
properties: tests,
187+
},
146188
};
147189

148190
const TestflowSchemaLiteral = {
149191
title: "Testflow",
150192
primaryKey: "_id",
151193
type: "object",
152-
version: 1,
194+
version: 2,
153195
properties: {
154196
_id: {
155197
type: "string",

0 commit comments

Comments
 (0)