Browse Source

test: kludge- webhook CI failure

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
feat/export-nest
Raju Udava 2 years ago
parent
commit
0768183c55
  1. 6
      tests/playwright/tests/db/01-webhook.spec.ts

6
tests/playwright/tests/db/01-webhook.spec.ts

@ -23,6 +23,9 @@ async function clearServerData({ request }) {
async function getWebhookResponses({ request, count = 1 }) {
let response;
// add delay ensuring the server has received the request
await new Promise(resolve => setTimeout(resolve, 1000));
// retry since there can be lag between the time the hook is triggered and the time the server receives the request
for (let i = 0; i < 20; i++) {
response = await request.get(hookPath + '/count');
@ -425,6 +428,9 @@ test.describe.serial('Webhook', () => {
test('Bulk operations', async ({ request, page }) => {
async function verifyBulkOperationTrigger(rsp, type) {
// add delay to make sure bulk operation is completed
await new Promise(resolve => setTimeout(resolve, 1000));
for (let i = 0; i < rsp.length; i++) {
expect(rsp[i].type).toBe(type);
expect(rsp[i].data.table_name).toBe('Test');

Loading…
Cancel
Save