Skip to content

VIDCS-3667: Adding a few more integration tests #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
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
48 changes: 48 additions & 0 deletions integration-tests/tests/meetingroom.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { expect } from '@playwright/test';
import * as crypto from 'crypto';
import { test } from '../fixtures/testWithLogging';
import { openMeetingRoomWithSettings, waitAndClickFirefox } from './utils';

test.describe('meeting room', () => {
test('force mute', async ({ page: pageOne, context, browserName, isMobile }) => {
const roomName = crypto.randomBytes(5).toString('hex');

const pageTwo = await context.newPage();

await openMeetingRoomWithSettings({
page: pageOne,
username: 'User One',
roomName,
audioOff: true,
browserName,
});
// These clicks and waits are needed for firefox
await waitAndClickFirefox(pageOne, browserName);

await openMeetingRoomWithSettings({
page: pageTwo,
username: 'User Two',
roomName,
audioOff: false,
browserName,
});
await expect(pageTwo.getByTestId('MicNoneIcon')).toBeVisible();

if (isMobile) {
await pageOne.getByTestId('MoreVertIcon').click();
await pageOne.mouse.move(0, 0); // Moves cursor to top-left corner to hide tooltip
}

const participantsListButton = await pageOne.getByTestId('PeopleIcon');
await participantsListButton.click();

const participantItem = await pageOne.locator('[data-testid^="participant-list-item"]', {
hasText: 'User Two',
});

await participantItem.getByTestId('MicIcon').click();
await pageOne.getByTestId('popup-dialog-primary-button').click();

await expect(pageTwo.getByTestId('MicOffToolbar')).toBeVisible();
});
});
33 changes: 33 additions & 0 deletions integration-tests/tests/pinning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,38 @@ test.describe('participant pinning', () => {
const publisherRect = await publisher.boundingBox();
expect(userTwoSubscriberRet.width).toBeGreaterThan(1.2 * publisherRect.width);
expect(userTwoSubscriberRet.height).toBeGreaterThan(2 * publisherRect.height);

// unpinning user 2 from the participants list
if (isMobile) {
await pageThree.getByTestId('MoreVertIcon').click();
await pageThree.mouse.move(0, 0); // Moves cursor to top-left corner to hide tooltip
}

const participantsListButton = await pageThree.getByTestId('PeopleIcon');
await participantsListButton.click();

const participantItem = await pageThree.locator('[data-testid^="participant-list-item"]', {
hasText: 'User Two',
});
// Within that list item, find and click the MoreVert button
await participantItem.getByTestId('MoreVertIcon').click();

await pageThree
.locator('[data-testid^="pin-menu-item"]', {
hasText: 'Unpin User Two',
})
.click();

const closeIconButton = pageThree.locator(
'//span[contains(text(),"Participants")]/following-sibling::button'
);
await closeIconButton.click();

const newUserTwoSubscriberRet = await userTwoSubscriber.boundingBox();
const newPublisherRect = await publisher.boundingBox();

await pageThree.waitForTimeout(1000);
expect(newUserTwoSubscriberRet.width).toBeLessThan(1.2 * newPublisherRect.width);
expect(newUserTwoSubscriberRet.height).toBeLessThan(2 * newPublisherRect.height);
});
});
Loading