fix: improve plugins functionality with server management
This commit is contained in:
@@ -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