Files
n8n-enterprise-unlocked/packages/testing/playwright/pages/SettingsPage.ts
2025-09-02 10:16:32 +01:00

49 lines
1.1 KiB
TypeScript

import { BasePage } from './BasePage';
export class SettingsPage extends BasePage {
getMenuItems() {
return this.page.getByTestId('menu-item');
}
getMenuItem(id: string) {
return this.page.getByTestId('menu-item').getByTestId(id);
}
getMenuItemByText(text: string) {
return this.page.getByTestId('menu-item').getByText(text, { exact: true });
}
async goToSettings() {
await this.page.goto('/settings');
}
async goToPersonalSettings() {
await this.page.goto('/settings/personal');
}
getPersonalDataForm() {
return this.page.getByTestId('personal-data-form');
}
getFirstNameField() {
return this.getPersonalDataForm().locator('input[name="firstName"]');
}
getLastNameField() {
return this.getPersonalDataForm().locator('input[name="lastName"]');
}
getSaveSettingsButton() {
return this.page.getByTestId('save-settings-button');
}
async fillPersonalData(firstName: string, lastName: string) {
await this.getFirstNameField().fill(firstName);
await this.getLastNameField().fill(lastName);
}
async saveSettings() {
await this.getSaveSettingsButton().click();
}
}