diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 8ee988d5..3c469bf4 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -44,6 +44,14 @@ jobs: # name: playwright-report # path: playwright-report/ # retention-days: 30 + - name: Slack Notification + if: success() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: sora-js-sdk + SLACK_COLOR: good + SLACK_TITLE: Success test + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - name: Slack Notification if: failure() uses: rtCamp/action-slack-notify@v2 diff --git a/examples/messaging/main.mjs b/examples/messaging/main.mjs index c6c64ab4..4de060aa 100644 --- a/examples/messaging/main.mjs +++ b/examples/messaging/main.mjs @@ -43,6 +43,7 @@ document.querySelector('#start').addEventListener('click', async () => { }) document.querySelector('#stop').addEventListener('click', async () => { await recvonly.disconnect() + document.querySelector('#received-messages').innerHTML = null }) document.querySelector('#send-message').addEventListener('click', async () => { const value = document.querySelector('input[name=message]').value diff --git a/examples/simulcast/main.mjs b/examples/simulcast/main.mjs index 1ca688ea..e072dd83 100644 --- a/examples/simulcast/main.mjs +++ b/examples/simulcast/main.mjs @@ -18,6 +18,7 @@ const sendonly = sora.sendonly(channelId, metadata, { simulcast: true, }) sendonly.on('notify', (event) => { + console.log(event) if (event.event_type === 'connection.created' && event.connection_id === sendonly.connectionId) { document.querySelector('#local-video-connection-id').textContent = `${event.connection_id}` } @@ -93,11 +94,17 @@ document.querySelector('#start').addEventListener('click', async () => { document.querySelector('#stop').addEventListener('click', async () => { await sendonly.disconnect() + document.querySelector('#local-video').srcObject = null // recvonly r0 await recvonlyR0.disconnect() + document.querySelector('#remote-video-r0').srcObject = null + // recvonly r1 await recvonlyR1.disconnect() + document.querySelector('#remote-video-r1').srcObject = null + // recvonly r2 await recvonlyR2.disconnect() + document.querySelector('#remote-video-r2').srcObject = null }) diff --git a/examples/spotlight_recvonly/main.mjs b/examples/spotlight_recvonly/main.mjs index 3aaf0585..c0a979aa 100644 --- a/examples/spotlight_recvonly/main.mjs +++ b/examples/spotlight_recvonly/main.mjs @@ -43,6 +43,7 @@ recvonly.on('track', (event) => { recvonly.on('removetrack', (event) => { const remoteVideo = document.querySelector(`#remotevideo-${event.target.id}`) if (remoteVideo) { + remoteVideo.srcObject = null document.querySelector('#remote-videos').removeChild(remoteVideo) } }) @@ -50,3 +51,8 @@ recvonly.on('removetrack', (event) => { document.querySelector('#start-recvonly').addEventListener('click', async () => { await recvonly.connect() }) + +document.querySelector('#stop-recvonly').addEventListener('click', async () => { + await recvonly.disconnect() + document.querySelector('#remote-videos').innerHTML = null +}) diff --git a/examples/spotlight_sendonly/main.mjs b/examples/spotlight_sendonly/main.mjs index ca0d6dc0..1477cd10 100644 --- a/examples/spotlight_sendonly/main.mjs +++ b/examples/spotlight_sendonly/main.mjs @@ -28,3 +28,8 @@ document.querySelector('#start-sendonly').addEventListener('click', async () => document.querySelector('#sendonly-local-video').srcObject = mediaStream await sendonly.connect(mediaStream) }) + +document.querySelector('#stop-sendonly').addEventListener('click', async () => { + await sendonly.disconnect() + document.querySelector('#sendonly-local-video').srcObject = null +}) diff --git a/examples/spotlight_sendrecv/main.mjs b/examples/spotlight_sendrecv/main.mjs index 3c7d129c..6f583aed 100644 --- a/examples/spotlight_sendrecv/main.mjs +++ b/examples/spotlight_sendrecv/main.mjs @@ -77,6 +77,7 @@ sendrecv2.on('track', (event) => { sendrecv2.on('removetrack', (event) => { const remoteVideo = document.querySelector(`#sendrecv2-remotevideo-${event.target.id}`) if (remoteVideo) { + remoteVideo.srcObject = null document.querySelector('#sendrecv2-remote-videos').removeChild(remoteVideo) } }) @@ -94,15 +95,13 @@ document.querySelector('#start-sendrecv2').addEventListener('click', async () => document.querySelector('#sendrecv2-local-video').srcObject = mediaStream await sendrecv2.connect(mediaStream) }) -document.querySelector('#stop-sendrecv1').addEventListener('click', () => { - sendrecv1.disconnect().then(() => { - document.querySelector('#sendrecv1-local-video').srcObject = null - document.querySelector('#sendrecv1-remote-videos').innerHTML = null - }) +document.querySelector('#stop-sendrecv1').addEventListener('click', async () => { + await sendrecv1.disconnect() + document.querySelector('#sendrecv1-local-video').srcObject = null + document.querySelector('#sendrecv1-remote-videos').innerHTML = null }) -document.querySelector('#stop-sendrecv2').addEventListener('click', () => { - sendrecv2.disconnect().then(() => { - document.querySelector('#sendrecv2-local-video').srcObject = null - document.querySelector('#sendrecv2-remote-videos').innerHTML = null - }) +document.querySelector('#stop-sendrecv2').addEventListener('click', async () => { + sendrecv2.disconnect() + document.querySelector('#sendrecv2-local-video').srcObject = null + document.querySelector('#sendrecv2-remote-videos').innerHTML = null }) diff --git a/tests/e2ee.spec.ts b/tests/e2ee.spec.ts index e092945d..4e0ad62c 100644 --- a/tests/e2ee.spec.ts +++ b/tests/e2ee.spec.ts @@ -35,4 +35,7 @@ test.skip('e2ee sendrecv x2', async ({ browser }) => { await page1.click('#stop-sendrecv') await page2.click('#stop-sendrecv') + + await page1.close() + await page2.close() }) diff --git a/tests/messaging.spec.ts b/tests/messaging.spec.ts index 2689fe1f..a4455161 100644 --- a/tests/messaging.spec.ts +++ b/tests/messaging.spec.ts @@ -1,6 +1,5 @@ import { test } from '@playwright/test' -// FIXME: ローカルだと通る test.skip('messaging pages', async ({ browser }) => { // 新しいページを2つ作成 const page1 = await browser.newPage() @@ -47,4 +46,7 @@ test.skip('messaging pages', async ({ browser }) => { await page1.click('#stop') await page2.click('#stop') + + await page1.close() + await page2.close() }) diff --git a/tests/sendonly_recvonly.spec.ts b/tests/sendonly_recvonly.spec.ts index a5fa92bb..a9dfc32e 100644 --- a/tests/sendonly_recvonly.spec.ts +++ b/tests/sendonly_recvonly.spec.ts @@ -28,4 +28,7 @@ test('sendonly/recvonly pages', async ({ browser }) => { await page1.click('#stop-sendonly') await page2.click('#stop-recvonly') + + await page1.close() + await page2.close() }) diff --git a/tests/spotlight_sendonly_recvonly.spec.ts b/tests/spotlight_sendonly_recvonly.spec.ts index 28cabc8c..e480260b 100644 --- a/tests/spotlight_sendonly_recvonly.spec.ts +++ b/tests/spotlight_sendonly_recvonly.spec.ts @@ -28,4 +28,7 @@ test('spotlight sendonly/recvonly pages', async ({ browser }) => { await page1.click('#stop-sendonly') await page2.click('#stop-recvonly') + + await page1.close() + await page2.close() })