mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* ref: Don't use global context for local state. * ref: Don't use global context to store the pin. * feat: Add a test for setting passcode via settings provisioning. * Use local state. * Remove "data" from context. * ref: Rename a function. * test: Fail quick when join muc fails, assert specific errors (e.g. "token expired").
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import BaseDialog from './BaseDialog';
|
|
|
|
const INPUT_KEY_XPATH = '//input[@name="lockKey"]';
|
|
|
|
/**
|
|
* Represents the password dialog in a particular participant.
|
|
*/
|
|
export default class PasswordDialog extends BaseDialog {
|
|
/**
|
|
* Waiting for the dialog to appear.
|
|
*/
|
|
async waitForDialog() {
|
|
const input = this.participant.driver.$(INPUT_KEY_XPATH);
|
|
|
|
await input.waitForExist({
|
|
timeout: 5000,
|
|
timeoutMsg: 'Password dialog not found'
|
|
});
|
|
await input.waitForDisplayed();
|
|
await input.waitForStable();
|
|
}
|
|
|
|
async isOpen() {
|
|
const input = this.participant.driver.$(INPUT_KEY_XPATH);
|
|
|
|
try {
|
|
await input.isExisting();
|
|
|
|
return await input.isDisplayed();
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sets a password and submits the dialog.
|
|
* @param password
|
|
*/
|
|
async submitPassword(password: string) {
|
|
const passwordInput = this.participant.driver.$(INPUT_KEY_XPATH);
|
|
|
|
await passwordInput.waitForExist();
|
|
await passwordInput.click();
|
|
await passwordInput.clearValue();
|
|
|
|
await this.participant.driver.keys(password);
|
|
|
|
await this.clickOkButton();
|
|
}
|
|
}
|