Skip to content

Commit

Permalink
🔧 add repeat time to E2E test in playground
Browse files Browse the repository at this point in the history
  • Loading branch information
hemedani committed Jul 21, 2023
1 parent b070418 commit d3871ed
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
26 changes: 14 additions & 12 deletions src/server/playground/comp/E2E.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,20 @@ export function E2E({
body: JSON.stringify(parsedHeaderBody.body),
};

const jsonSendedRequest = await lesanAPI({
baseUrl: "http://localhost:8000/",
options: body,
});
let jsonSendedRequest: any;
for (let repeat = 0; repeat < e2eForm.repeat; repeat++) {
jsonSendedRequest = await lesanAPI({
baseUrl: "http://localhost:8000/",
options: body,
});
setResults((
results,
) => [...results, {
id: uid(),
request: { ...body, body: parsedHeaderBody.body },
response: jsonSendedRequest,
}]);
}

const captures = [...e2eForm.captures].filter(
capture => (capture.key && capture.value),
Expand Down Expand Up @@ -128,14 +138,6 @@ export function E2E({
parsedCaptures.add({ key: capture.key, value: getedValue });
}
});

setResults((
results,
) => [...results, {
id: uid(),
request: { ...body, body: parsedHeaderBody.body },
response: jsonSendedRequest,
}]);
}
};

Expand Down
33 changes: 18 additions & 15 deletions src/server/playground/dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,24 @@ function E2E({ configUrl }) {
},
body: JSON.stringify(parsedHeaderBody.body)
};
const jsonSendedRequest = await lesanAPI({
baseUrl: "http://localhost:8000/",
options: body
});
let jsonSendedRequest;
for(let repeat = 0; repeat < e2eForm.repeat; repeat++){
jsonSendedRequest = await lesanAPI({
baseUrl: "http://localhost:8000/",
options: body
});
setResults((results)=>[
...results,
{
id: uid(),
request: {
...body,
body: parsedHeaderBody.body
},
response: jsonSendedRequest
}
]);
}
const captures = [
...e2eForm.captures
].filter((capture)=>capture.key && capture.value);
Expand Down Expand Up @@ -1005,17 +1019,6 @@ function E2E({ configUrl }) {
});
}
});
setResults((results)=>[
...results,
{
id: uid(),
request: {
...body,
body: parsedHeaderBody.body
},
response: jsonSendedRequest
}
]);
}
};
return Z("div", {
Expand Down

0 comments on commit d3871ed

Please sign in to comment.