test: Add 8 people voice tests
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
export class ServerSearchPage {
|
||||
readonly searchInput: Locator;
|
||||
readonly createServerButton: Locator;
|
||||
readonly railCreateServerButton: Locator;
|
||||
readonly searchCreateServerButton: Locator;
|
||||
readonly settingsButton: Locator;
|
||||
|
||||
// Create server dialog
|
||||
@@ -21,7 +23,9 @@ export class ServerSearchPage {
|
||||
|
||||
constructor(private page: Page) {
|
||||
this.searchInput = page.getByPlaceholder('Search servers...');
|
||||
this.createServerButton = page.getByRole('button', { name: 'Create New Server' });
|
||||
this.railCreateServerButton = page.locator('button[title="Create Server"]');
|
||||
this.searchCreateServerButton = page.getByRole('button', { name: 'Create New Server' });
|
||||
this.createServerButton = this.searchCreateServerButton;
|
||||
this.settingsButton = page.locator('button[title="Settings"]');
|
||||
|
||||
// Create dialog elements
|
||||
@@ -39,8 +43,20 @@ export class ServerSearchPage {
|
||||
await this.page.goto('/search');
|
||||
}
|
||||
|
||||
async createServer(name: string, options?: { description?: string; topic?: string }) {
|
||||
await this.createServerButton.click();
|
||||
async createServer(name: string, options?: { description?: string; topic?: string; sourceId?: string }) {
|
||||
if (!await this.serverNameInput.isVisible()) {
|
||||
if (await this.searchCreateServerButton.isVisible()) {
|
||||
await this.searchCreateServerButton.click();
|
||||
} else {
|
||||
await this.railCreateServerButton.click();
|
||||
|
||||
if (!await this.serverNameInput.isVisible()) {
|
||||
await expect(this.searchCreateServerButton).toBeVisible({ timeout: 10_000 });
|
||||
await this.searchCreateServerButton.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await expect(this.serverNameInput).toBeVisible();
|
||||
await this.serverNameInput.fill(name);
|
||||
|
||||
@@ -52,6 +68,10 @@ export class ServerSearchPage {
|
||||
await this.serverTopicInput.fill(options.topic);
|
||||
}
|
||||
|
||||
if (options?.sourceId) {
|
||||
await this.signalEndpointSelect.selectOption(options.sourceId);
|
||||
}
|
||||
|
||||
await this.dialogCreateButton.click();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user