From 14a02735beab0135418b2bf6a9669e1559874da0 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Fri, 27 Jan 2023 19:27:53 +0700 Subject: [PATCH] fix: uncomment testsuite (#234) * fix: uncomment testsuite * fix: uncomment testsuite * fix: unstable testcases * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: unstable testcase * fix: uncomment testsuite * wip: test * wip: test * wip: test Co-authored-by: Quan HL --- test/dial-tests.js | 15 ++++++--------- test/index.js | 22 +++++++++++----------- test/play-tests.js | 1 - 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/test/dial-tests.js b/test/dial-tests.js index 048faad2..55348dad 100644 --- a/test/dial-tests.js +++ b/test/dial-tests.js @@ -22,6 +22,8 @@ test('\'dial-phone\'', async(t) => { const {srf, disconnect} = require('../app'); try { await connect(srf); + // wait for fs connected to drachtio server. + await new Promise(r => setTimeout(r, 1000)); // GIVEN const from = "dial_success"; @@ -46,15 +48,12 @@ test('\'dial-phone\'', async(t) => { const p = sippUac('uas-dial.xml', '172.38.0.10', undefined, undefined, 2); let account_sid = '622f62e4-303a-49f2-bbe0-eb1e1714e37a'; - let post = bent('http://127.0.0.1:3000/', 'POST', 'json', 201); post('v1/createCall', { 'account_sid':account_sid, "call_hook": { "url": "http://127.0.0.1:3100/", "method": "POST", - "username": "username", - "password": "password" }, "from": from, "to": { @@ -82,7 +81,8 @@ test('\'dial-sip\'', async(t) => { const {srf, disconnect} = require('../app'); try { await connect(srf); - + // wait for fs connected to drachtio server. + await new Promise(r => setTimeout(r, 1000)); // GIVEN const from = "dial_sip"; let verbs = [ @@ -113,8 +113,6 @@ test('\'dial-sip\'', async(t) => { "call_hook": { "url": "http://127.0.0.1:3100/", "method": "POST", - "username": "username", - "password": "password" }, "from": from, "to": { @@ -151,7 +149,8 @@ test('\'dial-user\'', async(t) => { const {srf, disconnect} = require('../app'); try { await connect(srf); - + // wait for fs connected to drachtio server. + await new Promise(r => setTimeout(r, 1000)); // GIVEN const from = "dial_user"; let verbs = [ @@ -181,8 +180,6 @@ test('\'dial-user\'', async(t) => { "call_hook": { "url": "http://127.0.0.1:3100/", "method": "POST", - "username": "username", - "password": "password" }, "from": from, "to": { diff --git a/test/index.js b/test/index.js index 20f4210f..e8b467e6 100644 --- a/test/index.js +++ b/test/index.js @@ -1,16 +1,16 @@ require('./unit-tests'); require('./docker_start'); require('./create-test-db'); -// require('./account-validation-tests'); -// require('./dial-tests'); -// require('./webhooks-tests'); -// require('./say-tests'); -// require('./gather-tests'); -// require('./transcribe-tests'); -// require('./sip-request-tests'); -// require('./create-call-test'); +require('./account-validation-tests'); +require('./dial-tests'); +require('./webhooks-tests'); +require('./say-tests'); +require('./gather-tests'); +require('./transcribe-tests'); +require('./sip-request-tests'); +require('./create-call-test'); require('./play-tests'); -// require('./sip-refer-tests'); -// require('./listen-tests'); +require('./sip-refer-tests'); +require('./listen-tests'); require('./remove-test-db'); -require('./docker_stop'); +require('./docker_stop'); \ No newline at end of file diff --git a/test/play-tests.js b/test/play-tests.js index 25127f6d..ac4524a3 100644 --- a/test/play-tests.js +++ b/test/play-tests.js @@ -223,7 +223,6 @@ test('\'play\' tests with earlymedia', async(t) => { // THEN await sippUac('uac-invite-expect-183-cancel.xml', '172.38.0.10', from); const obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}_callStatus`); - console.log(obj); t.ok(obj.body.sip_status === 487, "play: actionHook success received"); t.ok(obj.body.sip_reason === 'Request Terminated', "play: actionHook success received"); t.ok(obj.body.call_termination_by === 'caller', "play: actionHook success received");