fix: improve plugins functionality with server management
This commit is contained in:
@@ -10,7 +10,9 @@ export class LoginPage {
|
||||
readonly registerLink: Locator;
|
||||
|
||||
constructor(private page: Page) {
|
||||
this.form = page.locator('#login-username').locator('xpath=ancestor::div[contains(@class, "space-y-3")]').first();
|
||||
this.form = page.locator('#login-username').locator('xpath=ancestor::div[contains(@class, "space-y-3")]')
|
||||
.first();
|
||||
|
||||
this.usernameInput = page.locator('#login-username');
|
||||
this.passwordInput = page.locator('#login-password');
|
||||
this.serverSelect = page.locator('#login-server');
|
||||
|
||||
@@ -79,12 +79,19 @@ export class ServerSearchPage {
|
||||
await this.page.getByRole('button', { name }).click();
|
||||
}
|
||||
|
||||
async joinServerFromSearch(name: string) {
|
||||
async joinServerFromSearch(name: string, options: { acceptPluginDownloads?: boolean } = {}) {
|
||||
await this.searchInput.fill(name);
|
||||
|
||||
const serverCard = this.page.locator('div[title]', { hasText: name }).first();
|
||||
|
||||
await expect(serverCard).toBeVisible({ timeout: 15_000 });
|
||||
await serverCard.dblclick();
|
||||
|
||||
if (options.acceptPluginDownloads) {
|
||||
const pluginConsentDialog = this.page.getByRole('dialog', { name: /uses plugins/ });
|
||||
|
||||
await expect(pluginConsentDialog).toBeVisible({ timeout: 20_000 });
|
||||
await pluginConsentDialog.getByRole('button', { name: 'Accept and join' }).click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user