Files
twenty/packages/twenty-e2e-testing/lib/pom/settings/generalSection.ts
BOHEUS 15a2cb5141 Update playwright (#10927)
Update twenty-e2e-testing to reflect actual state of app
2025-03-19 11:29:36 +01:00

44 lines
1.3 KiB
TypeScript

import { Locator, Page } from '@playwright/test';
export class GeneralSection {
private readonly workspaceNameField: Locator;
private readonly supportSwitch: Locator;
private readonly deleteWorkspaceButton: Locator;
private readonly customizeDomainButton: Locator;
private readonly subdomainInput: Locator;
constructor(public readonly page: Page) {
this.page = page;
this.workspaceNameField = page.getByPlaceholder('Apple');
this.supportSwitch = page.getByRole('checkbox').nth(1);
this.deleteWorkspaceButton = page.getByRole('button', {
name: 'Delete workspace',
});
this.customizeDomainButton = page.getByRole('button', {
name: 'Customize domain',
});
this.subdomainInput = page.locator(
'//div[contains(.,".twenty-main.com")]/../input',
);
}
async changeWorkspaceName(workspaceName: string) {
await this.workspaceNameField.clear();
await this.workspaceNameField.fill(workspaceName);
}
async changeSupportSwitchState() {
await this.supportSwitch.click();
}
async clickDeleteWorkSpaceButton() {
await this.deleteWorkspaceButton.click();
}
async changeSubdomain(subdomain: string) {
await this.customizeDomainButton.click();
await this.subdomainInput.fill(subdomain);
await this.page.getByRole('button', { name: 'Save' }).click();
}
}