-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Recordings e2e * Fix crash * Bump timeout * CRT support * Media e2e (#347) * Basic media testing * Add sample audio file * Ease parallelization * Full parallelism
- Loading branch information
1 parent
5a25ba6
commit cb53b09
Showing
18 changed files
with
277 additions
and
52 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import {test, expect, chromium} from '@playwright/test'; | ||
|
||
import {userState, baseURL, defaultTeam, pluginID} from '../constants'; | ||
|
||
import {getChannelNameForTest, getUserIdxForTest, startCall} from '../utils'; | ||
|
||
import PlaywrightDevPage from '../page'; | ||
|
||
const userIdx = getUserIdxForTest(); | ||
|
||
test.beforeEach(async ({page, context}) => { | ||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.goto(); | ||
}); | ||
|
||
test.describe('screen sharing', () => { | ||
test.use({storageState: userState.users[userIdx].storageStatePath}); | ||
|
||
test('share screen button', async ({page}) => { | ||
const userPage = await startCall(userState.users[userIdx + 1].storageStatePath); | ||
|
||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.joinCall(); | ||
|
||
await page.locator('#calls-widget-toggle-menu-button').click(); | ||
await page.locator('#calls-widget-menu-screenshare').click(); | ||
|
||
await expect(page.locator('#screen-player')).toBeVisible(); | ||
await expect(userPage.page.locator('#screen-player')).toBeVisible(); | ||
|
||
await devPage.wait(1000); | ||
|
||
const screenStreamID = await userPage.page.evaluate(() => { | ||
return window.callsClient.getRemoteScreenStream()?.getVideoTracks()[0]?.id; | ||
}); | ||
|
||
expect(screenStreamID).toContain('screen_'); | ||
|
||
await page.getByTestId('calls-widget-stop-screenshare').click(); | ||
|
||
await expect(page.locator('#screen-player')).toBeHidden(); | ||
await expect(userPage.page.locator('#screen-player')).toBeHidden(); | ||
|
||
await devPage.leaveCall(); | ||
await userPage.leaveCall(); | ||
}); | ||
|
||
test('share screen keyboard shortcut', async ({page}) => { | ||
const userPage = await startCall(userState.users[userIdx + 1].storageStatePath); | ||
|
||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.joinCall(); | ||
|
||
await devPage.wait(1000); | ||
|
||
if (process.platform === 'darwin') { | ||
await page.keyboard.press('Meta+Shift+E'); | ||
} else { | ||
await page.keyboard.press('Control+Shift+E'); | ||
} | ||
|
||
await expect(page.locator('#screen-player')).toBeVisible(); | ||
await expect(userPage.page.locator('#screen-player')).toBeVisible(); | ||
|
||
await devPage.wait(1000); | ||
|
||
const screenTrackID = await userPage.page.evaluate(() => { | ||
return window.callsClient.getRemoteScreenStream()?.getVideoTracks()[0]?.id; | ||
}); | ||
|
||
expect(screenTrackID).toContain('screen_'); | ||
|
||
if (process.platform === 'darwin') { | ||
await page.keyboard.press('Meta+Shift+E'); | ||
} else { | ||
await page.keyboard.press('Control+Shift+E'); | ||
} | ||
|
||
await expect(page.locator('#screen-player')).toBeHidden(); | ||
await expect(userPage.page.locator('#screen-player')).toBeHidden(); | ||
|
||
await devPage.leaveCall(); | ||
await userPage.leaveCall(); | ||
}); | ||
}); | ||
|
||
test.describe('sending voice', () => { | ||
test.use({storageState: userState.users[userIdx].storageStatePath}); | ||
|
||
test('unmuting', async ({page}) => { | ||
const userPage = await startCall(userState.users[userIdx + 1].storageStatePath); | ||
|
||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.joinCall(); | ||
|
||
await page.locator('#voice-mute-unmute').click(); | ||
|
||
await devPage.wait(1000); | ||
|
||
let voiceTrackID = await userPage.page.evaluate(() => { | ||
return window.callsClient.streams[1]?.getAudioTracks()[0]?.id; | ||
}); | ||
|
||
await expect(userPage.page.getByTestId(voiceTrackID)).toBeHidden(); | ||
await expect(userPage.page.getByTestId(voiceTrackID)).toHaveAttribute('autoplay', ''); | ||
|
||
await userPage.page.locator('#voice-mute-unmute').click(); | ||
|
||
await devPage.wait(1000); | ||
|
||
voiceTrackID = await page.evaluate(() => { | ||
return window.callsClient.streams[1]?.getAudioTracks()[0]?.id; | ||
}); | ||
|
||
await expect(page.getByTestId(voiceTrackID)).toBeHidden(); | ||
await expect(page.getByTestId(voiceTrackID)).toHaveAttribute('autoplay', ''); | ||
|
||
await devPage.leaveCall(); | ||
await userPage.leaveCall(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import {test, expect, chromium} from '@playwright/test'; | ||
|
||
import {userState, baseURL, defaultTeam, pluginID} from '../constants'; | ||
|
||
import {getChannelNameForTest} from '../utils'; | ||
|
||
import PlaywrightDevPage from '../page'; | ||
|
||
test.beforeEach(async ({page, context}) => { | ||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.goto(); | ||
}); | ||
|
||
test.describe('call recordings', () => { | ||
test.use({storageState: userState.users[6].storageStatePath}); | ||
|
||
test('recording - slash command', async ({page}) => { | ||
const channelName = getChannelNameForTest(); | ||
|
||
// start call | ||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.startCall(); | ||
|
||
// start recording | ||
await page.locator('#post_textbox').fill('/call recording start'); | ||
await page.locator('[data-testid=SendMessageButton]').click(); | ||
|
||
// verify recording badge renders correctly | ||
await expect(page.getByTestId('calls-recording-badge')).toBeVisible(); | ||
await expect(page.getByTestId('calls-recording-badge')).toContainText('REC'); | ||
|
||
// very recording start prompt renders correctly | ||
await expect(page.getByTestId('calls-widget-banner-recording')).toBeVisible(); | ||
await expect(page.getByTestId('calls-widget-banner-recording')).toContainText('You are recording'); | ||
|
||
// close prompt | ||
await page.getByTestId('calls-widget-banner-recording').locator('.icon-close').click(); | ||
await expect(page.getByTestId('calls-widget-banner-recording')).toBeHidden(); | ||
|
||
// Give it a few of seconds to produce a decent recording | ||
await devPage.wait(4000); | ||
|
||
// stop recording | ||
await page.locator('#post_textbox').fill('/call recording stop'); | ||
await page.locator('[data-testid=SendMessageButton]').click(); | ||
|
||
// very recording ended prompt renders correctly | ||
await expect(page.getByTestId('calls-widget-banner-recording')).toBeVisible(); | ||
await expect(page.getByTestId('calls-widget-banner-recording')).toContainText('Recording has stopped. Processing...'); | ||
|
||
// verify recording file has been posted by the bot (assumes CRT enabled) | ||
await page.locator('.post__body').last().locator('.ThreadFooter button.ReplyButton').click(); | ||
await expect(page.locator('.ThreadViewer').locator('.post__header').last()).toContainText('calls'); | ||
await expect(page.locator('.ThreadViewer').locator('.post__header').last()).toContainText('BOT'); | ||
await expect(page.locator('.ThreadViewer').locator('.post__body').last().filter({has: page.getByTestId('fileAttachmentList')})).toBeVisible(); | ||
|
||
// leave call | ||
await devPage.leaveCall(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.