Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/e2e-client/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createcXMLScriptResource,
createRelayAppResource,
createSWMLAppResource,
createVideoRoomResource,
createCallSessionResource,
deleteResource,
disconnectClient,
enablePageLogs,
Expand All @@ -26,7 +26,7 @@ type CustomFixture = {
resource: {
createcXMLExternalURLResource: typeof createcXMLExternalURLResource
createcXMLScriptResource: typeof createcXMLScriptResource
createVideoRoomResource: typeof createVideoRoomResource
createCallSessionResource: typeof createCallSessionResource
createSWMLAppResource: typeof createSWMLAppResource
createRelayAppResource: typeof createRelayAppResource
resources: Resource[]
Expand Down Expand Up @@ -89,8 +89,8 @@ const test = baseTest.extend<CustomFixture>({
const resources: Resource[] = []

const resource = {
createVideoRoomResource: async (params?: string) => {
const data = await createVideoRoomResource(params)
createCallSessionResource: async (params?: string) => {
const data = await createCallSessionResource(params)
resources.push(data)
return data
},
Expand Down
12 changes: 6 additions & 6 deletions internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { OverlayMap, LocalVideoOverlay, CallSession } from '@signalwire/client'
import { test, expect, Page } from '../fixtures'
import {
Expand Down Expand Up @@ -34,7 +34,7 @@
const page = await createCustomPage({ name: '[page]' })
await page.goto(SERVER_URL)
const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand All @@ -57,7 +57,7 @@
const page = await createCustomPage({ name: '[page]' })
await page.goto(SERVER_URL)
const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand All @@ -68,7 +68,7 @@
})

// Build a video element
const { element } = await page.evaluate(async () => {

Check failure on line 71 in internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts

View workflow job for this annotation

GitHub Actions / Browser Client SDK production / Run E2E tests (20.x, VideoElement)

[VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:53:7 › buildVideoElement with Call SDK › should return the rootElement

1) [VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:53:7 › buildVideoElement with Call SDK › should return the rootElement Error: page.evaluate: Execution context was destroyed, most likely because of a navigation. 69 | 70 | // Build a video element > 71 | const *** element *** = await page.evaluate(async () => *** | ^ 72 | return new Promise<any>(async (resolve, _reject) => *** 73 | // @ts-expect-error 74 | const call = window._callObj at /home/runner/work/signalwire-js/signalwire-js/internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts:71:36

Check failure on line 71 in internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts

View workflow job for this annotation

GitHub Actions / Browser Client SDK staging / Run E2E tests (20.x, VideoElement)

[VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:53:7 › buildVideoElement with Call SDK › should return the rootElement

1) [VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:53:7 › buildVideoElement with Call SDK › should return the rootElement Error: page.evaluate: Execution context was destroyed, most likely because of a navigation. 69 | 70 | // Build a video element > 71 | const *** element *** = await page.evaluate(async () => *** | ^ 72 | return new Promise<any>(async (resolve, _reject) => *** 73 | // @ts-expect-error 74 | const call = window._callObj at /home/runner/work/signalwire-js/signalwire-js/internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts:71:36
return new Promise<any>(async (resolve, _reject) => {
// @ts-expect-error
const call = window._callObj
Expand Down Expand Up @@ -117,7 +117,7 @@
const page = await createCustomPage({ name: '[page]' })
await page.goto(SERVER_URL)
const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -256,12 +256,12 @@
const page = await createCustomPage({ name: '[page]' })
await page.goto(SERVER_URL)
const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

// Create and expect 1 video elements
await page.evaluate(

Check failure on line 264 in internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts

View workflow job for this annotation

GitHub Actions / Browser Client SDK production / Run E2E tests (20.x, VideoElement)

[VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:252:7 › buildVideoElement with Call SDK › should render the video even if the function is called before call.start

3) [VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:252:7 › buildVideoElement with Call SDK › should render the video even if the function is called before call.start Error: page.evaluate: Test timeout of 120000ms exceeded. 262 | 263 | // Create and expect 1 video elements > 264 | await page.evaluate( | ^ 265 | async (*** roomName ***) => *** 266 | return new Promise<any>(async (resolve, _reject) => *** 267 | const client = window._client! at /home/runner/work/signalwire-js/signalwire-js/internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts:264:16

Check failure on line 264 in internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts

View workflow job for this annotation

GitHub Actions / Browser Client SDK staging / Run E2E tests (20.x, VideoElement)

[VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:252:7 › buildVideoElement with Call SDK › should render the video even if the function is called before call.start

3) [VideoElement] › tests/buildVideoWithFabricSDK.spec.ts:252:7 › buildVideoElement with Call SDK › should render the video even if the function is called before call.start Error: page.evaluate: Test timeout of 120000ms exceeded. 262 | 263 | // Create and expect 1 video elements > 264 | await page.evaluate( | ^ 265 | async (*** roomName ***) => *** 266 | return new Promise<any>(async (resolve, _reject) => *** 267 | const client = window._client! at /home/runner/work/signalwire-js/signalwire-js/internal/e2e-client/tests/buildVideoWithFabricSDK.spec.ts:264:16
async ({ roomName }) => {
return new Promise<any>(async (resolve, _reject) => {
const client = window._client!
Expand Down Expand Up @@ -308,7 +308,7 @@
const page = await createCustomPage({ name: '[page]' })
await page.goto(SERVER_URL)
const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -349,7 +349,7 @@
await Promise.all([pageOne.goto(SERVER_URL), pageTwo.goto(SERVER_URL)])

const roomName = randomizeRoomName('bld-vd-el')
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await Promise.all([createCFClient(pageOne), createCFClient(pageTwo)])

Expand Down
4 changes: 2 additions & 2 deletions internal/e2e-client/tests/callfabric/audioFlags.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test.describe('CallCall Audio Flags', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -324,7 +324,7 @@ test.describe('CallCall Audio Flags', () => {
await pageTwo.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)
})

await test.step('[pageOne] create client and join room', async () => {
Expand Down
2 changes: 1 addition & 1 deletion internal/e2e-client/tests/callfabric/cleanup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ test.describe('Clean up', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page, { attachSagaMonitor: true })

Expand Down
2 changes: 1 addition & 1 deletion internal/e2e-client/tests/callfabric/conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.describe('Conversation Room', () => {
await createCFClient(page2)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)
})

await test.step('get room address', async () => {
Expand Down
8 changes: 4 additions & 4 deletions internal/e2e-client/tests/callfabric/deviceEvent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe('CallCall Room Device', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -181,7 +181,7 @@ test.describe('CallCall Room Device', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -242,7 +242,7 @@ test.describe('CallCall Room Device', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -373,7 +373,7 @@ test.describe('CallCall Room Device', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

// Set up initial mock for enumerate devices with default speaker
await expectPageEvalToPass(page, {
Expand Down
4 changes: 2 additions & 2 deletions internal/e2e-client/tests/callfabric/deviceState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.describe('CallCall - Device State', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -169,7 +169,7 @@ test.describe('CallCall - Device State', () => {
await page.goto(SERVER_URL)

roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down
2 changes: 1 addition & 1 deletion internal/e2e-client/tests/callfabric/holdunhold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.describe('CallCall Hold/Unhold Call', () => {
await pageTwo.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await test.step('[page-one] should create a client and dial a call', async () => {
await createCFClient(pageOne)
Expand Down
2 changes: 1 addition & 1 deletion internal/e2e-client/tests/callfabric/mirrorVideo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test.describe('CallCall Mirror Video', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down
2 changes: 1 addition & 1 deletion internal/e2e-client/tests/callfabric/muteUnmuteAll.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const joinAllPages = async (
)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)
const address = `/public/${roomName}?channel=${channel}`

const roomSessions = []
Expand Down
4 changes: 2 additions & 2 deletions internal/e2e-client/tests/callfabric/raiseHand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.describe('CallCall Raise/Lower Hand', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -94,7 +94,7 @@ test.describe('CallCall Raise/Lower Hand', () => {
await pageTwo.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

// Create client, dial an address and join a video room from page-one
await createCFClient(pageOne)
Expand Down
8 changes: 4 additions & 4 deletions internal/e2e-client/tests/callfabric/reattach.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('CallCall Reattach', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -77,7 +77,7 @@ test.describe('CallCall Reattach', () => {
await page.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await createCFClient(page)

Expand Down Expand Up @@ -375,7 +375,7 @@ test.describe('CallCall Reattach', () => {
await pageTwo.goto(SERVER_URL)

const roomName = `e2e_${uuid()}`
await resource.createVideoRoomResource(roomName)
await resource.createCallSessionResource(roomName)

await test.step('[pageOne] create client and join a room', async () => {
await createCFClient(pageOne)
Expand Down Expand Up @@ -663,7 +663,7 @@ test.describe('CallCall Reattach', () => {
// await page.goto(SERVER_URL)

// const roomName = `e2e_${uuid()}`
// await resource.createVideoRoomResource(roomName)
// await resource.createCallSessionResource(roomName)
// const resourceName = `e2e_${uuid()}`
// await resource.createSWMLAppResource({
// name: resourceName,
Expand Down
28 changes: 10 additions & 18 deletions internal/e2e-client/tests/callfabric/relayApp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SERVER_URL,
} from '../../utils'
import { test, expect } from '../../fixtures'
import { CallSession } from '@signalwire/client'

test.describe('CallFabric Relay Application', () => {
test('should connect to the relay app and expect an audio playback', async ({
Expand Down Expand Up @@ -67,8 +68,7 @@
})

const callPlayStarted = page.evaluate(async () => {
// @ts-expect-error
const callObj: Video.RoomSession = window._callObj
const callObj: CallSession = window._callObj!
return new Promise<boolean>((resolve) => {
callObj.on('call.play', (params: any) => {
if (params.state === 'playing') resolve(true)
Expand All @@ -79,8 +79,7 @@
const expectInitialEvents = expectCFInitialEvents(page, [callPlayStarted])

await page.evaluate(async () => {
// @ts-expect-error
const call = window._callObj
const call = window._callObj!

await call.start()
})
Expand All @@ -94,8 +93,7 @@
await expectPageReceiveAudio(page)

const callPlayFinished = page.evaluate(async () => {
// @ts-expect-error
const callObj: Video.RoomSession = window._callObj
const callObj: CallSession = window._callObj!
return new Promise<boolean>((resolve) => {
callObj.on('call.play', (params: any) => {
if (params.state === 'finished') resolve(true)
Expand All @@ -112,8 +110,7 @@

// Hangup the call
await page.evaluate(async () => {
// @ts-expect-error
const call = window._callObj
const call = window._callObj!

await call.hangup()
})
Expand Down Expand Up @@ -174,8 +171,7 @@
})

const callPlayStarted = page.evaluate(async () => {
// @ts-expect-error
const callObj: Video.RoomSession = window._callObj
const callObj: CallSession = window._callObj!
return new Promise<boolean>((resolve) => {
callObj.on('call.play', (params: any) => {
if (params.state === 'playing') resolve(true)
Expand All @@ -186,8 +182,7 @@
const expectInitialEvents = expectCFInitialEvents(page, [callPlayStarted])

await page.evaluate(async () => {
// @ts-expect-error
const call = window._callObj
const call = window._callObj!

await call.start()
})
Expand All @@ -212,10 +207,9 @@
'Warning - totalAudioEnergy was not present in the audioStats.'
)
}
playback!.stop()

Check failure on line 210 in internal/e2e-client/tests/callfabric/relayApp.spec.ts

View workflow job for this annotation

GitHub Actions / Browser Client SDK production / Run E2E tests (20.x, Agent)

[Agent] › tests/callfabric/relayApp.spec.ts:123:7 › CallFabric Relay Application › should connect to the relay app and expect a silence

1) [Agent] › tests/callfabric/relayApp.spec.ts:123:7 › CallFabric Relay Application › should connect to the relay app and expect a silence TypeError: Cannot read properties of undefined (reading 'stop') 208 | ) 209 | *** > 210 | playback!.stop() | ^ 211 | await page.evaluate(async () => *** 212 | const callObj: CallSession = window._callObj! 213 | return new Promise<boolean>((resolve) => *** at /home/runner/work/signalwire-js/signalwire-js/internal/e2e-client/tests/callfabric/relayApp.spec.ts:210:15
await page.evaluate(async () => {
// @ts-expect-error
const callObj: Video.RoomSession = window._callObj
const callObj: CallSession = window._callObj!
return new Promise<boolean>((resolve) => {
callObj.on('call.play', (params: any) => {
if (params.state === 'finished') resolve(true)
Expand All @@ -227,8 +221,7 @@

// Hangup the call
await page.evaluate(async () => {
// @ts-expect-error
const call = window._callObj
const call = window._callObj!

await call.hangup()
})
Expand Down Expand Up @@ -289,8 +282,7 @@
const expectFinalEvents = expectCFFinalEvents(page)

await page.evaluate(async () => {
// @ts-expect-error
const call = window._callObj
const call = window._callObj!

await call.start()
})
Expand Down
Loading
Loading