2021-09-22 11:51:29 +08:00
|
|
|
const e = require('../core/elements');
|
2021-09-22 21:11:56 +08:00
|
|
|
const { getElementLength } = require('../core/util');
|
|
|
|
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
|
2020-03-04 22:50:56 +08:00
|
|
|
|
2020-05-08 04:55:40 +08:00
|
|
|
async function joinAudio(test) {
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitAndClick(e.listenOnlyButton);
|
|
|
|
await test.waitForElementHandleToBeRemoved(e.connectingStatus);
|
2021-02-17 04:57:10 +08:00
|
|
|
const parsedSettings = await test.getSettingsYaml();
|
|
|
|
const listenOnlyCallTimeout = parseInt(parsedSettings.public.media.listenOnlyCallTimeout);
|
2021-09-22 11:51:29 +08:00
|
|
|
await test.waitForSelector(e.leaveAudio, listenOnlyCallTimeout);
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitForSelector(e.whiteboard);
|
2021-09-30 19:51:55 +08:00
|
|
|
return test.hasElement(e.leaveAudio);
|
2020-03-04 22:50:56 +08:00
|
|
|
}
|
|
|
|
|
2020-05-08 04:55:40 +08:00
|
|
|
async function joinMicrophone(test) {
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitAndClick(e.microphoneButton);
|
2021-09-22 11:51:29 +08:00
|
|
|
await test.waitForElementHandleToBeRemoved(e.connectingStatus, ELEMENT_WAIT_LONGER_TIME);
|
2021-02-17 04:57:10 +08:00
|
|
|
const parsedSettings = await test.getSettingsYaml();
|
|
|
|
const listenOnlyCallTimeout = parseInt(parsedSettings.public.media.listenOnlyCallTimeout);
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitAndClick(e.echoYesButton, listenOnlyCallTimeout);
|
|
|
|
await test.waitForSelector(e.whiteboard);
|
2021-09-30 19:51:55 +08:00
|
|
|
return test.hasElement(e.echoYesButton);
|
2020-03-04 22:50:56 +08:00
|
|
|
}
|
|
|
|
|
2020-05-08 04:55:40 +08:00
|
|
|
exports.joinAudio = joinAudio;
|
|
|
|
exports.joinMicrophone = joinMicrophone;
|