|
|
|
@ -23,6 +23,9 @@ async function clearServerData({ request }) {
|
|
|
|
|
async function getWebhookResponses({ request, count = 1 }) { |
|
|
|
|
let response; |
|
|
|
|
|
|
|
|
|
// kludge- add delay to allow server to process webhook
|
|
|
|
|
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) { |
|
|
|
|
// kludge- add delay to allow server to process webhook
|
|
|
|
|
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'); |
|
|
|
|