mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(editor): Update project settings to use new table component and role selector (#19152)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { BasePage } from './BasePage';
|
||||
|
||||
export class ProjectSettingsPage extends BasePage {
|
||||
@@ -5,7 +7,73 @@ export class ProjectSettingsPage extends BasePage {
|
||||
await this.page.getByTestId('project-settings-name-input').locator('input').fill(name);
|
||||
}
|
||||
|
||||
async fillProjectDescription(description: string) {
|
||||
await this.page
|
||||
.getByTestId('project-settings-description-input')
|
||||
.locator('textarea')
|
||||
.fill(description);
|
||||
}
|
||||
|
||||
async clickSaveButton() {
|
||||
await this.clickButtonByName('Save');
|
||||
}
|
||||
|
||||
async clickCancelButton() {
|
||||
await this.page.getByTestId('project-settings-cancel-button').click();
|
||||
}
|
||||
|
||||
async clearMemberSearch() {
|
||||
const searchInput = this.page.getByTestId('project-members-search');
|
||||
const clearButton = searchInput.locator('+ span');
|
||||
if (await clearButton.isVisible()) {
|
||||
await clearButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
getMembersTable() {
|
||||
return this.page.getByTestId('project-members-table');
|
||||
}
|
||||
|
||||
async getMemberRowCount() {
|
||||
const table = this.getMembersTable();
|
||||
const rows = table.locator('tbody tr');
|
||||
return await rows.count();
|
||||
}
|
||||
|
||||
async expectTableHasMemberCount(expectedCount: number) {
|
||||
const actualCount = await this.getMemberRowCount();
|
||||
expect(actualCount).toBe(expectedCount);
|
||||
}
|
||||
|
||||
async expectSearchInputValue(expectedValue: string) {
|
||||
const searchInput = this.page.getByTestId('project-members-search').locator('input');
|
||||
await expect(searchInput).toHaveValue(expectedValue);
|
||||
}
|
||||
|
||||
// Robust value assertions on inner form controls
|
||||
getNameInput() {
|
||||
return this.page.locator('#projectName input');
|
||||
}
|
||||
|
||||
getDescriptionTextarea() {
|
||||
return this.page.locator('#projectDescription textarea');
|
||||
}
|
||||
|
||||
async expectProjectNameValue(value: string) {
|
||||
await expect(this.getNameInput()).toHaveValue(value);
|
||||
}
|
||||
|
||||
async expectProjectDescriptionValue(value: string) {
|
||||
await expect(this.getDescriptionTextarea()).toHaveValue(value);
|
||||
}
|
||||
|
||||
async expectTableIsVisible() {
|
||||
const table = this.getMembersTable();
|
||||
await expect(table).toBeVisible();
|
||||
}
|
||||
|
||||
async expectMembersSelectIsVisible() {
|
||||
const select = this.page.getByTestId('project-members-select');
|
||||
await expect(select).toBeVisible();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user