mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(tests): Adds avatar test. (#15382)
* feat(tests): Adds join options. * fix(tests): Fix opening tests by default with tenant. * fix(tests): Renames a method. * fix(tests): Moves a method from filmstrip to participants pane. * fix(tests): Adds ok button to base dialog. * fix(tests): Adds missing checks for using iframe API. * feat(tests): Prettify the result html on error. * fix(tests): Fixes checking when not in room. * fix(tests): Adds profile button to toolbar. * fix(tests): Adds avatar test. * fix(tests): Fix all execute methods and await. * fix(tests): Fix avatar checks.
This commit is contained in:
62
tests/pageobjects/SettingsDialog.ts
Normal file
62
tests/pageobjects/SettingsDialog.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import BaseDialog from './BaseDialog';
|
||||
|
||||
const EMAIL_FIELD = '#setEmail';
|
||||
const SETTINGS_DIALOG_CONTENT = '.settings-pane';
|
||||
const X_PATH_PROFILE_TAB = '//div[contains(@class, "settings-dialog")]//*[text()="Profile"]';
|
||||
|
||||
/**
|
||||
* The settings dialog.
|
||||
*/
|
||||
export default class SettingsDialog extends BaseDialog {
|
||||
/**
|
||||
* Waits for the settings dialog to be visible.
|
||||
*/
|
||||
async waitForDisplay() {
|
||||
await this.participant.driver.$(SETTINGS_DIALOG_CONTENT).waitForDisplayed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a specific tab in the settings dialog.
|
||||
* @param xpath
|
||||
* @private
|
||||
*/
|
||||
private async openTab(xpath: string) {
|
||||
const elem = this.participant.driver.$(xpath);
|
||||
|
||||
await elem.waitForClickable();
|
||||
await elem.click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the Profile tab to be displayed.
|
||||
*/
|
||||
async openProfileTab() {
|
||||
await this.openTab(X_PATH_PROFILE_TAB);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enters the passed in email into the email field.
|
||||
* @param email
|
||||
*/
|
||||
async setEmail(email: string) {
|
||||
await this.openProfileTab();
|
||||
|
||||
await this.participant.driver.$(EMAIL_FIELD).setValue(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the participant's email displayed in the settings dialog.
|
||||
*/
|
||||
async getEmail() {
|
||||
await this.openProfileTab();
|
||||
|
||||
return await this.participant.driver.$(EMAIL_FIELD).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clicks the OK button on the settings dialog to close the dialog and save any changes made.
|
||||
*/
|
||||
async submit() {
|
||||
await this.clickOkButton();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user