Compare commits

...

1 Commits

Author SHA1 Message Date
damencho
ff6f0ee949 debug 2025-10-21 14:48:16 -05:00
5 changed files with 565 additions and 419 deletions

View File

@@ -261,9 +261,9 @@ export class Participant {
await this.switchToIFrame();
}
if (!options.skipWaitToJoin) {
await this.waitForMucJoinedOrError();
}
// if (!options.skipWaitToJoin) {
// await this.waitForMucJoinedOrError();
// }
await this.postLoadProcess();
@@ -306,7 +306,7 @@ export class Participant {
}
}, this._name, driver.sessionId, LOG_PREFIX));
await Promise.all(parallel);
// await Promise.all(parallel);
}
/**

View File

@@ -34,11 +34,11 @@ export async function ensureOneParticipant(
* @returns {Promise<void>}
*/
export async function ensureThreeParticipants(options?: IJoinOptions): Promise<void> {
await ensureOneParticipant(options);
// await ensureOneParticipant(options);
// these need to be all, so we get the error when one fails
await Promise.all([
joinParticipant({ name: P2 }, options),
// joinParticipant({ name: P2 }, options),
joinParticipant({ name: P3 }, options)
]);
@@ -46,16 +46,16 @@ export async function ensureThreeParticipants(options?: IJoinOptions): Promise<v
return Promise.resolve();
}
await Promise.all([
ctx.p1.waitForIceConnected(),
ctx.p2.waitForIceConnected(),
ctx.p3.waitForIceConnected()
]);
await Promise.all([
ctx.p1.waitForSendReceiveData().then(() => ctx.p1.waitForRemoteStreams(1)),
ctx.p2.waitForSendReceiveData().then(() => ctx.p2.waitForRemoteStreams(1)),
ctx.p3.waitForSendReceiveData().then(() => ctx.p3.waitForRemoteStreams(1)),
]);
// await Promise.all([
// ctx.p1.waitForIceConnected(),
// ctx.p2.waitForIceConnected(),
// ctx.p3.waitForIceConnected()
// ]);
// await Promise.all([
// ctx.p1.waitForSendReceiveData().then(() => ctx.p1.waitForRemoteStreams(1)),
// ctx.p2.waitForSendReceiveData().then(() => ctx.p2.waitForRemoteStreams(1)),
// ctx.p3.waitForSendReceiveData().then(() => ctx.p3.waitForRemoteStreams(1)),
// ]);
}
/**
@@ -173,6 +173,9 @@ async function joinParticipant( // eslint-disable-line max-params
}
if (await p.isInMuc()) {
console.log('return because it is in muc', p.name);
return p;
}

View File

@@ -119,7 +119,7 @@ class BreakoutRoom extends BasePageObject {
await listItem.click();
const button = listItem.$(`aria/${MORE_LABEL}`);
const button = listItem.$(`button[title="${MORE_LABEL}"]`);
await button.waitForClickable();
await button.click();
@@ -140,7 +140,36 @@ export default class BreakoutRooms extends BasePageObject {
await participantsPane.open();
}
return await this.participant.driver.$$(`.${BREAKOUT_ROOMS_CLASS}`).length;
// 2025-10-21T16:28:20.737Z INFO webdriver: BIDI RESULT {"id":48,"result":{"nodes":[{"sharedId":"f.CC595D3B0EA529D11DA54EA54EC8E1A9.d.AC4B929B2F37714F6A7D1AFFBDAC2B04.e.103","type":"node","value":{"attributes":{"class":"css-169oaf-participantsPane","id":"participants-pane"},"childNodeCount":3,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
//
//
//
// start query 2025-10-21T16:28:28.875Z
// end query 2025-10-21T16:28:28.875Z
// 2025-10-21T16:28:20.738Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function1111[function anonymous(\n) {\nreturn (/* __wdio script__ */function anonymous(\n) {\nconsole.log(\"start query\", new Date().toISOString()); const res = document.querySelectorAll(`#participants-pane .breakout-room-container`).length; console.log(\"end query\",new Date().toISOString()); return res;\n}/* __wdio script end__ */).apply(this, arguments);\n} bytes] anonymous>","awaitPromise":true,"arguments":[],"target":{"context":"CC595D3B0EA529D11DA54EA54EC8E1A9"}}
// 2025-10-21T16:28:29.080Z INFO webdriver: BIDI RESULT {"id":49,"result":{"realm":"4934028136633545550.-854534272777004590","result":{"type":"number","value":2},"type":"success"},"type":"success"}
//
//
//
//
// 2025-10-21T16:28:29.086Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"css","value":"#participants-pane .breakout-room-container"},"context":"CC595D3B0EA529D11DA54EA54EC8E1A9"}
// [8546:62532126:1021/140916.958361:INFO:CONSOLE:12] "start query 2025-10-21T19:09:16.958Z", source: (12)
// [8546:62532126:1021/140916.958526:INFO:CONSOLE:12] "end query 2025-10-21T19:09:16.958Z", source: (12)
const st = Date.now();
console.log(`${new Date().toISOString()} took: start query`);
// const b = await this.participant.driver.$$(`#participants-pane .${BREAKOUT_ROOMS_CLASS}`).length;
const b = await this.participant.driver.execute(
'console.log("start query", new Date().toISOString()); const res = document.querySelectorAll(`#participants-pane .breakout-room-container`).length; console.log("end query",new Date().toISOString()); return res;');
console.log(`${new Date().toISOString()} took: `, Date.now() - st, 'ms to get breakout rooms count: ', b, this.participant.name, this.participant.driver.sessionId);
return b;
}
/**
@@ -153,7 +182,7 @@ export default class BreakoutRooms extends BasePageObject {
await participantsPane.open();
}
const addBreakoutButton = this.participant.driver.$(`aria/${ADD_BREAKOUT_ROOM}`);
const addBreakoutButton = this.participant.driver.$(`button=${ADD_BREAKOUT_ROOM}`);
await addBreakoutButton.waitForDisplayed();
await addBreakoutButton.click();
@@ -163,7 +192,10 @@ export default class BreakoutRooms extends BasePageObject {
* Returns all breakout rooms.
*/
async getRooms(): Promise<BreakoutRoom[]> {
const rooms = this.participant.driver.$$(`.${BREAKOUT_ROOMS_CLASS}`);
const st = Date.now();
const rooms = this.participant.driver.$$(`#participants-pane .${BREAKOUT_ROOMS_CLASS}`);
console.log('took: ', Date.now() - st, 'ms to get breakout rooms');
return rooms.map(async room => new BreakoutRoom(
this.participant, await room.$('span').getText(), await room.getAttribute('data-testid')));
@@ -179,7 +211,7 @@ export default class BreakoutRooms extends BasePageObject {
await participantsPane.open();
}
const leaveButton = this.participant.driver.$(`aria/${LEAVE_ROOM_LABEL}`);
const leaveButton = this.participant.driver.$(`button=${LEAVE_ROOM_LABEL}`);
await leaveButton.isClickable();
await leaveButton.click();
@@ -189,7 +221,7 @@ export default class BreakoutRooms extends BasePageObject {
* Auto assign participants to breakout rooms.
*/
async autoAssignToBreakoutRooms() {
const button = this.participant.driver.$(`aria/${AUTO_ASSIGN_LABEL}`);
const button = this.participant.driver.$(`button=${AUTO_ASSIGN_LABEL}`);
await button.waitForClickable();
await button.click();
@@ -204,7 +236,7 @@ export default class BreakoutRooms extends BasePageObject {
await participantsPane.selectParticipant(participant);
await participantsPane.openParticipantContextMenu(participant);
const sendButton = this.participant.driver.$(`aria/${roomName}`);
const sendButton = this.participant.driver.$(`button=${roomName}`);
await sendButton.waitForClickable();
await sendButton.click();

View File

@@ -26,148 +26,171 @@ describe('Breakout rooms', () => {
}
});
it('add breakout room', async () => {
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// it('add breakout room', async () => {
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // there should be no breakout rooms initially, list is sent with a small delay
// await p1.driver.pause(2000);
// expect(await p1BreakoutRooms.getRoomsCount()).toBe(0);
//
// // add one breakout room
// await p1BreakoutRooms.addBreakoutRoom();
//
// await p1.driver.waitUntil(
// async () => await p1BreakoutRooms.getRoomsCount() === 1, {
// timeout: 3000,
// timeoutMsg: 'No breakout room added for p1'
// });
//
//
// // second participant should also see one breakout room
// await p2.driver.waitUntil(
// async () => await p2.getBreakoutRooms().getRoomsCount() === 1, {
// timeout: 3000,
// timeoutMsg: 'No breakout room seen by p2'
// });
// });
//
// it('join breakout room', async () => {
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // there should be one breakout room
// await p1.driver.waitUntil(
// async () => await p1BreakoutRooms.getRoomsCount() === 1, {
// timeout: 3000,
// timeoutMsg: 'No breakout room seen by p1'
// });
//
// const roomsList = await p1BreakoutRooms.getRooms();
//
// expect(roomsList.length).toBe(1);
//
// // join the room
// await roomsList[0].joinRoom();
//
// // the participant should see the main room as the only breakout room
// await p1.driver.waitUntil(
// async () => {
// if (await p1BreakoutRooms.getRoomsCount() !== 1) {
// return false;
// }
//
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].name === MAIN_ROOM_NAME;
// }, {
// timeout: 5000,
// timeoutMsg: 'P1 did not join breakout room'
// });
//
// // the second participant should see one participant in the breakout room
// await p2.driver.waitUntil(
// async () => {
// const list = await p2.getBreakoutRooms().getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 1;
// }, {
// timeout: 3000,
// timeoutMsg: 'P2 is not seeing p1 in the breakout room'
// });
// });
//
// it('leave breakout room', async () => {
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // leave room
// await p1BreakoutRooms.leaveBreakoutRoom();
//
// // there should be one breakout room and that should not be the main room
// await p1.driver.waitUntil(
// async () => {
// if (await p1BreakoutRooms.getRoomsCount() !== 1) {
// return false;
// }
//
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].name !== MAIN_ROOM_NAME;
// }, {
// timeout: 5000,
// timeoutMsg: 'P1 did not leave breakout room'
// });
//
// // the second participant should see no participants in the breakout room
// await p2.driver.waitUntil(
// async () => {
// const list = await p2.getBreakoutRooms().getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 0;
// }, {
// timeout: 3000,
// timeoutMsg: 'P2 is seeing p1 in the breakout room'
// });
// });
//
// it('remove breakout room', async () => {
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // remove the room
// await (await p1BreakoutRooms.getRooms())[0].removeRoom();
//
// // there should be no breakout rooms
// await p1.driver.waitUntil(
// async () => await p1BreakoutRooms.getRoomsCount() === 0, {
// timeout: 3000,
// timeoutMsg: 'Breakout room was not removed for p1'
// });
//
// // the second participant should also see no breakout rooms
// await p2.driver.waitUntil(
// async () => await p2.getBreakoutRooms().getRoomsCount() === 0, {
// timeout: 3000,
// timeoutMsg: 'Breakout room was not removed for p2'
// });
// });
// there should be no breakout rooms initially, list is sent with a small delay
await p1.driver.pause(2000);
expect(await p1BreakoutRooms.getRoomsCount()).toBe(0);
// const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
//
// async function waitForCondition(conditionFn, options = {}) {
// const {
// timeout = 5000,
// interval = 500,
// timeoutMsg = 'Condition not met within timeout'
// } = options;
//
// const startTime = Date.now();
//
// while (Date.now() - startTime < timeout) {
// if (await conditionFn()) {
// return; // Condition met - pass!
// }
// await delay(interval);
// }
//
// // Timeout occurred - throw error
// throw new Error(timeoutMsg);
// }
// add one breakout room
await p1BreakoutRooms.addBreakoutRoom();
await p1.driver.waitUntil(
async () => await p1BreakoutRooms.getRoomsCount() === 1, {
timeout: 3000,
timeoutMsg: 'No breakout room added for p1'
});
// second participant should also see one breakout room
await p2.driver.waitUntil(
async () => await p2.getBreakoutRooms().getRoomsCount() === 1, {
timeout: 3000,
timeoutMsg: 'No breakout room seen by p2'
});
});
it('join breakout room', async () => {
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// there should be one breakout room
await p1.driver.waitUntil(
async () => await p1BreakoutRooms.getRoomsCount() === 1, {
timeout: 3000,
timeoutMsg: 'No breakout room seen by p1'
});
const roomsList = await p1BreakoutRooms.getRooms();
expect(roomsList.length).toBe(1);
// join the room
await roomsList[0].joinRoom();
// the participant should see the main room as the only breakout room
await p1.driver.waitUntil(
async () => {
if (await p1BreakoutRooms.getRoomsCount() !== 1) {
return false;
}
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].name === MAIN_ROOM_NAME;
}, {
timeout: 5000,
timeoutMsg: 'P1 did not join breakout room'
});
// the second participant should see one participant in the breakout room
await p2.driver.waitUntil(
async () => {
const list = await p2.getBreakoutRooms().getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 1;
}, {
timeout: 3000,
timeoutMsg: 'P2 is not seeing p1 in the breakout room'
});
});
it('leave breakout room', async () => {
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// leave room
await p1BreakoutRooms.leaveBreakoutRoom();
// there should be one breakout room and that should not be the main room
await p1.driver.waitUntil(
async () => {
if (await p1BreakoutRooms.getRoomsCount() !== 1) {
return false;
}
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].name !== MAIN_ROOM_NAME;
}, {
timeout: 5000,
timeoutMsg: 'P1 did not leave breakout room'
});
// the second participant should see no participants in the breakout room
await p2.driver.waitUntil(
async () => {
const list = await p2.getBreakoutRooms().getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 0;
}, {
timeout: 3000,
timeoutMsg: 'P2 is seeing p1 in the breakout room'
});
});
it('remove breakout room', async () => {
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// remove the room
await (await p1BreakoutRooms.getRooms())[0].removeRoom();
// there should be no breakout rooms
await p1.driver.waitUntil(
async () => await p1BreakoutRooms.getRoomsCount() === 0, {
timeout: 3000,
timeoutMsg: 'Breakout room was not removed for p1'
});
// the second participant should also see no breakout rooms
await p2.driver.waitUntil(
async () => await p2.getBreakoutRooms().getRoomsCount() === 0, {
timeout: 3000,
timeoutMsg: 'Breakout room was not removed for p2'
});
});
it('auto assign', async () => {
await ensureThreeParticipants();
@@ -179,6 +202,14 @@ describe('Breakout rooms', () => {
await p1BreakoutRooms.addBreakoutRoom();
// there should be two breakout rooms
// await waitForCondition(
// async () => await p1BreakoutRooms.getRoomsCount() === 2,
// {
// timeout: 3000,
// interval: 500,
// timeoutMsg: 'Breakout room was not created by p1'
// }
// );
await p1.driver.waitUntil(
async () => await p1BreakoutRooms.getRoomsCount() === 2, {
timeout: 3000,
@@ -206,6 +237,29 @@ describe('Breakout rooms', () => {
timeout: 5000,
timeoutMsg: 'P1 did not auto assigned participants to breakout rooms'
});
console.log('stopppppp');
await browser.debug()
// await waitForCondition(
// async () => {
// if (await p1BreakoutRooms.getRoomsCount() !== 2) {
// return false;
// }
//
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// return false;
// }
//
// return list[0].participantCount === 1 && list[1].participantCount === 1;
// },
// {
// timeout: 5000,
// interval: 500,
// timeoutMsg: 'P1 did not auto assigned participants to breakout rooms'
// }
// );
// the second participant should see one participant in the main room
const p2BreakoutRooms = p2.getBreakoutRooms();
@@ -228,259 +282,311 @@ describe('Breakout rooms', () => {
timeout: 3000,
timeoutMsg: 'P2 is not seeing p1 in the main room'
});
// await waitForCondition(
// async () => {
// if (await p2BreakoutRooms.getRoomsCount() !== 2) {
// return false;
// }
//
// const list = await p2BreakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// return false;
// }
//
// return list[0].participantCount === 1 && list[1].participantCount === 1
// && (list[0].name === MAIN_ROOM_NAME || list[1].name === MAIN_ROOM_NAME);
// },
// {
// timeout: 3000,
// interval: 500,
// timeoutMsg: 'P2 is not seeing p1 in the main room'
// }
// );
});
it('close breakout room', async () => {
const { p1, p2, p3 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// there should be two non-empty breakout rooms
await p1.driver.waitUntil(
async () => {
if (await p1BreakoutRooms.getRoomsCount() !== 2) {
return false;
}
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 2) {
return false;
}
return list[0].participantCount === 1 && list[1].participantCount === 1;
}, {
timeout: 3000,
timeoutMsg: 'P1 is not seeing two breakout rooms'
});
// close the first room
await (await p1BreakoutRooms.getRooms())[0].closeRoom();
// there should be two rooms and first one should be empty
await p1.driver.waitUntil(
async () => {
if (await p1BreakoutRooms.getRoomsCount() !== 2) {
return false;
}
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 2) {
return false;
}
return list[0].participantCount === 0 || list[1].participantCount === 0;
}, {
timeout: 5000,
timeoutMsg: 'P1 is not seeing an empty breakout room'
});
// there should be two participants in the main room, either p2 or p3 got moved to the main room
const checkParticipants = (p: Participant) =>
p.driver.waitUntil(
async () => {
const isInBreakoutRoom = await p.isInBreakoutRoom();
const breakoutRooms = p.getBreakoutRooms();
if (isInBreakoutRoom) {
if (await breakoutRooms.getRoomsCount() !== 2) {
return false;
}
const list = await breakoutRooms.getRooms();
if (list?.length !== 2) {
return false;
}
return list.every(r => { // eslint-disable-line arrow-body-style
return r.name === MAIN_ROOM_NAME ? r.participantCount === 2 : r.participantCount === 0;
});
}
if (await breakoutRooms.getRoomsCount() !== 2) {
return false;
}
const list = await breakoutRooms.getRooms();
if (list?.length !== 2) {
return false;
}
return list[0].participantCount + list[1].participantCount === 1;
}, {
timeout: 3000,
timeoutMsg: `${p.name} is not seeing an empty breakout room and one with one participant`
});
await checkParticipants(p2);
await checkParticipants(p3);
});
it('send participants to breakout room', async () => {
await hangupAllParticipants();
// because the participants rejoin so fast, the meeting is not properly ended,
// so the previous breakout rooms would still be there.
// To avoid this issue we use a different meeting
// Respect room name suffix as it is important in multi-shard testing
ctx.roomName += `new-${ctx.roomName}`;
await ensureTwoParticipants();
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// there should be no breakout rooms
expect(await p1BreakoutRooms.getRoomsCount()).toBe(0);
// add one breakout room
await p1BreakoutRooms.addBreakoutRoom();
// there should be one empty room
await p1.driver.waitUntil(
async () => await p1BreakoutRooms.getRoomsCount() === 1
&& (await p1BreakoutRooms.getRooms())[0].participantCount === 0, {
timeout: 3000,
timeoutMsg: 'No breakout room added for p1'
});
// send the second participant to the first breakout room
await p1BreakoutRooms.sendParticipantToBreakoutRoom(p2, (await p1BreakoutRooms.getRooms())[0].name);
// there should be one room with one participant
await p1.driver.waitUntil(
async () => {
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 1;
}, {
timeout: 5000,
timeoutMsg: 'P1 is not seeing p2 in the breakout room'
});
});
it('collapse breakout room', async () => {
const { p1 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// there should be one breakout room with one participant
await p1.driver.waitUntil(
async () => {
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 1;
}, {
timeout: 3000,
timeoutMsg: 'P1 is not seeing p2 in the breakout room'
});
// get id of the breakout room participant
const breakoutList = p1.driver.$(`#${BREAKOUT_ROOMS_LIST_ID}`);
const breakoutRoomItem = await breakoutList.$$(`.${LIST_ITEM_CONTAINER}`).find(
async el => {
const id = await el.getAttribute('id');
return id !== '' && id !== null;
}) as ChainablePromiseElement;
const pId = await breakoutRoomItem.getAttribute('id');
const breakoutParticipant = p1.driver.$(`//div[@id="${pId}"]`);
expect(await breakoutParticipant.isDisplayed()).toBe(true);
// collapse the first
await (await p1BreakoutRooms.getRooms())[0].collapse();
// the participant should not be visible
expect(await breakoutParticipant.isDisplayed()).toBe(false);
// the collapsed room should still have one participant
expect((await p1BreakoutRooms.getRooms())[0].participantCount).toBe(1);
});
it('rename breakout room', async () => {
const myNewRoomName = `breakout-${crypto.randomUUID()}`;
const { p1, p2 } = ctx;
const p1BreakoutRooms = p1.getBreakoutRooms();
// let's rename breakout room and see it in local and remote
await (await p1BreakoutRooms.getRooms())[0].renameRoom(myNewRoomName);
await p1.driver.waitUntil(
async () => {
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].name === myNewRoomName;
}, {
timeout: 3000,
timeoutMsg: 'The breakout room was not renamed for p1'
});
await checkSubject(p2, myNewRoomName);
const p2BreakoutRooms = p2.getBreakoutRooms();
// leave room
await p2BreakoutRooms.leaveBreakoutRoom();
// there should be one empty room
await p1.driver.waitUntil(
async () => {
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 0;
}, {
timeout: 3000,
timeoutMsg: 'The breakout room not found or not empty for p1'
});
await p2.driver.waitUntil(
async () => {
const list = await p2BreakoutRooms.getRooms();
return list?.length === 1;
}, {
timeout: 3000,
timeoutMsg: 'The breakout room not seen by p2'
});
expect((await p2BreakoutRooms.getRooms())[0].name).toBe(myNewRoomName);
// send the second participant to the first breakout room
await p1BreakoutRooms.sendParticipantToBreakoutRoom(p2, myNewRoomName);
// there should be one room with one participant
await p1.driver.waitUntil(
async () => {
const list = await p1BreakoutRooms.getRooms();
if (list?.length !== 1) {
return false;
}
return list[0].participantCount === 1;
}, {
timeout: 5000,
timeoutMsg: 'The breakout room was not rename for p1'
});
await checkSubject(p2, myNewRoomName);
});
// it('close breakout room', async () => {
// const { p1, p2, p3 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // there should be two non-empty breakout rooms
// await p1.driver.waitUntil(
// async () => {
// if (await p1BreakoutRooms.getRoomsCount() !== 2) {
// return false;
// }
//
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// return false;
// }
//
// return list[0].participantCount === 1 && list[1].participantCount === 1;
// }, {
// timeout: 3000,
// timeoutMsg: 'P1 is not seeing two breakout rooms'
// });
//
// // close the first room
// await (await p1BreakoutRooms.getRooms())[0].closeRoom();
//
// // there should be two rooms and first one should be empty
// await p1.driver.waitUntil(
// async () => {
// const c1 = await p1BreakoutRooms.getRoomsCount();
//
// if (c1 !== 2) {
// console.log('c1 for p1:', c1);
//
// return false;
// }
//
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// console.log('list len for p1:', list?.length);
//
// return false;
// }
//
// const b = list[0].participantCount === 0 || list[1].participantCount === 0;
//
// console.log('p1:', list[0].participantCount, list[1].participantCount, b);
//
// return b;
// }, {
// timeout: 10000,
// timeoutMsg: 'P1 is not seeing an empty breakout room'
// });
//
// // there should be two participants in the main room, either p2 or p3 got moved to the main room
// const checkParticipants = (p: Participant) =>
// p.driver.waitUntil(
// async () => {
// const isInBreakoutRoom = await p.isInBreakoutRoom();
// const breakoutRooms = p.getBreakoutRooms();
//
// console.log('isInBreakoutRoom:', isInBreakoutRoom, 'p:', p.name);
//
// if (isInBreakoutRoom) {
// const c = await breakoutRooms.getRoomsCount();
//
// if (c !== 2) {
// console.log(`Breakout room count is ${c}`);
//
// return false;
// }
//
// const list = await breakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// console.log(`Breakout room count is ${c}`);
//
// return false;
// }
//
// return list.every(r => { // eslint-disable-line arrow-body-style
// console.log(`Breakout room count is ${r.name} p: ${r.participantCount}`);
//
// return r.name === MAIN_ROOM_NAME ? r.participantCount === 2 : r.participantCount === 0;
// });
// }
//
// const c2 = await breakoutRooms.getRoomsCount();
//
// if (await breakoutRooms.getRoomsCount() !== 2) {
// console.log(`Breakout room count c2 ${c2}`);
//
// return false;
// }
//
// const list = await breakoutRooms.getRooms();
//
// if (list?.length !== 2) {
// console.log(`Breakout room count len2 ${list?.length}`);
//
// return false;
// }
//
// console.log('oooo ', list[0].participantCount + list[1].participantCount);
//
// return list[0].participantCount + list[1].participantCount === 1;
// }, {
// timeout: 3000,
// timeoutMsg: `${p.name} is not seeing an empty breakout room and one with one participant`
// });
//
// console.log('before check p2');
// await checkParticipants(p2);
// console.log('after check p2 and before p3');
// await checkParticipants(p3);
// console.log('before after p3');
// });
//
// it('send participants to breakout room', async () => {
// await hangupAllParticipants();
//
// // because the participants rejoin so fast, the meeting is not properly ended,
// // so the previous breakout rooms would still be there.
// // To avoid this issue we use a different meeting
// // Respect room name suffix as it is important in multi-shard testing
// ctx.roomName += `new-${ctx.roomName}`;
//
// await ensureTwoParticipants();
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // there should be no breakout rooms
// expect(await p1BreakoutRooms.getRoomsCount()).toBe(0);
//
// // add one breakout room
// await p1BreakoutRooms.addBreakoutRoom();
//
// // there should be one empty room
// await p1.driver.waitUntil(
// async () => await p1BreakoutRooms.getRoomsCount() === 1
// && (await p1BreakoutRooms.getRooms())[0].participantCount === 0, {
// timeout: 3000,
// timeoutMsg: 'No breakout room added for p1'
// });
//
// // send the second participant to the first breakout room
// await p1BreakoutRooms.sendParticipantToBreakoutRoom(p2, (await p1BreakoutRooms.getRooms())[0].name);
//
// // there should be one room with one participant
// await p1.driver.waitUntil(
// async () => {
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 1;
// }, {
// timeout: 5000,
// timeoutMsg: 'P1 is not seeing p2 in the breakout room'
// });
// });
//
// it('collapse breakout room', async () => {
// const { p1 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // there should be one breakout room with one participant
// await p1.driver.waitUntil(
// async () => {
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 1;
// }, {
// timeout: 3000,
// timeoutMsg: 'P1 is not seeing p2 in the breakout room'
// });
//
// // get id of the breakout room participant
// const breakoutList = p1.driver.$(`#${BREAKOUT_ROOMS_LIST_ID}`);
// const breakoutRoomItem = await breakoutList.$$(`.${LIST_ITEM_CONTAINER}`).find(
// async el => {
// const id = await el.getAttribute('id');
//
// return id !== '' && id !== null;
// }) as ChainablePromiseElement;
//
// const pId = await breakoutRoomItem.getAttribute('id');
// const breakoutParticipant = p1.driver.$(`//div[@id="${pId}"]`);
//
// expect(await breakoutParticipant.isDisplayed()).toBe(true);
//
// // collapse the first
// await (await p1BreakoutRooms.getRooms())[0].collapse();
//
// // the participant should not be visible
// expect(await breakoutParticipant.isDisplayed()).toBe(false);
//
// // the collapsed room should still have one participant
// expect((await p1BreakoutRooms.getRooms())[0].participantCount).toBe(1);
// });
//
// it('rename breakout room', async () => {
// const myNewRoomName = `breakout-${crypto.randomUUID()}`;
// const { p1, p2 } = ctx;
// const p1BreakoutRooms = p1.getBreakoutRooms();
//
// // let's rename breakout room and see it in local and remote
// await (await p1BreakoutRooms.getRooms())[0].renameRoom(myNewRoomName);
//
// await p1.driver.waitUntil(
// async () => {
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].name === myNewRoomName;
// }, {
// timeout: 3000,
// timeoutMsg: 'The breakout room was not renamed for p1'
// });
//
// await checkSubject(p2, myNewRoomName);
//
// const p2BreakoutRooms = p2.getBreakoutRooms();
//
// // leave room
// await p2BreakoutRooms.leaveBreakoutRoom();
//
// // there should be one empty room
// await p1.driver.waitUntil(
// async () => {
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 0;
// }, {
// timeout: 3000,
// timeoutMsg: 'The breakout room not found or not empty for p1'
// });
//
// await p2.driver.waitUntil(
// async () => {
// const list = await p2BreakoutRooms.getRooms();
//
// return list?.length === 1;
// }, {
// timeout: 3000,
// timeoutMsg: 'The breakout room not seen by p2'
// });
//
// expect((await p2BreakoutRooms.getRooms())[0].name).toBe(myNewRoomName);
//
// // send the second participant to the first breakout room
// await p1BreakoutRooms.sendParticipantToBreakoutRoom(p2, myNewRoomName);
//
// // there should be one room with one participant
// await p1.driver.waitUntil(
// async () => {
// const list = await p1BreakoutRooms.getRooms();
//
// if (list?.length !== 1) {
// return false;
// }
//
// return list[0].participantCount === 1;
// }, {
// timeout: 5000,
// timeoutMsg: 'The breakout room was not rename for p1'
// });
//
// await checkSubject(p2, myNewRoomName);
// });
});

View File

@@ -53,6 +53,9 @@ if (process.env.VIDEO_CAPTURE_FILE) {
chromeArgs.push(`--use-file-for-fake-video-capture=${process.env.VIDEO_CAPTURE_FILE}`);
}
// chromeArgs.push('--enable-logging');
// chromeArgs.push('--v=99');
const chromePreferences = {
'intl.accept_languages': 'en-US'
};
@@ -224,9 +227,9 @@ export const config: WebdriverIO.MultiremoteConfig = {
initLogger(bInstance, `${instance}-${cid}-${testName}`, TEST_RESULTS_DIR);
// setup keepalive
keepAlive.push(setInterval(async () => {
await bInstance.execute(() => console.log(`${new Date().toISOString()} keep-alive`));
}, 20_000));
// keepAlive.push(setInterval(async () => {
// await bInstance.execute(() => console.log(`${new Date().toISOString()} keep-alive`));
// }, 20_000));
if (bInstance.isFirefox) {
return;
@@ -341,6 +344,7 @@ export const config: WebdriverIO.MultiremoteConfig = {
return;
}
console.log(`${new Date().toISOString()} ---=== Start test ${test.title} ===---`);
multiremotebrowser.instances.forEach((instance: string) => {
logInfo(multiremotebrowser.getInstance(instance), `---=== Start test ${test.title} ===---`);
});
@@ -355,6 +359,7 @@ export const config: WebdriverIO.MultiremoteConfig = {
* @returns {Promise<void>}
*/
async afterTest(test, context, { error }) {
console.log(`${new Date().toISOString()}---=== End test ${test.title} ===---`);
multiremotebrowser.instances.forEach((instance: string) =>
logInfo(multiremotebrowser.getInstance(instance), `---=== End test ${test.title} ===---`));