mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
Minor test fixes (#16577)
* test: Increase password dialog timeout. * test: Try to fix hangup().
This commit is contained in:
@@ -722,32 +722,32 @@ export class Participant {
|
||||
* Hangups the participant by leaving the page. base.html is an empty page on all deployments.
|
||||
*/
|
||||
async hangup() {
|
||||
const current = await this.driver.getUrl();
|
||||
console.log('Hanging up');
|
||||
if ((await this.driver.getUrl()).endsWith('/base.html')) {
|
||||
console.log('Already hung up');
|
||||
|
||||
// already hangup
|
||||
if (current.endsWith('/base.html')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// do a hangup, to make sure unavailable presence is sent
|
||||
await this.execute(() => typeof APP !== 'undefined' && APP.conference?.hangup());
|
||||
await this.execute(() => APP?.conference?.hangup());
|
||||
|
||||
// let's give it some time to leave the muc, we redirect after hangup so we should wait for the
|
||||
// change of url
|
||||
// Wait until _room is unset, which is one of the last things hangup() does.
|
||||
await this.driver.waitUntil(
|
||||
async () => {
|
||||
const u = await this.driver.getUrl();
|
||||
|
||||
// trying to debug some failures of reporting not leaving, where we see the close page in screenshot
|
||||
console.log(`initialUrl: ${current} currentUrl: ${u}`);
|
||||
|
||||
return current !== u;
|
||||
try {
|
||||
return await this.driver.execute(() => APP?.conference?._room === undefined);
|
||||
} catch (e) {
|
||||
// There seems to be a race condition with hangup() causing the page to change, and execute()
|
||||
// might fail with a Bidi error. Retry.
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
timeout: 8000,
|
||||
timeoutMsg: `${this.name} did not leave the muc in 8s initialUrl: ${current}`
|
||||
timeoutMsg: `${this.name} failed to hang up`
|
||||
}
|
||||
);
|
||||
console.log('Hung up');
|
||||
|
||||
await this.driver.url('/base.html')
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class PasswordDialog extends BaseDialog {
|
||||
const passwordInput = this.participant.driver.$(INPUT_KEY_XPATH);
|
||||
|
||||
await passwordInput.waitForExist();
|
||||
await passwordInput.waitForClickable();
|
||||
await passwordInput.waitForClickable({ timeout: 2000 });
|
||||
await passwordInput.click();
|
||||
await passwordInput.clearValue();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user