test: Refactor page objects and reuse locators (#19191)

This commit is contained in:
Suguru Inoue
2025-09-08 11:12:43 +02:00
committed by GitHub
parent 89b61ae2c1
commit 8f99f092ff
19 changed files with 530 additions and 575 deletions

View File

@@ -1,8 +1,11 @@
import type { Locator } from '@playwright/test';
import { BasePage } from './BasePage';
import { LogsPanel } from './components/LogsPanel';
export class ExecutionsPage extends BasePage {
readonly logsPanel = new LogsPanel(this.getPreviewIframe().getByTestId('logs-panel'));
async clickDebugInEditorButton(): Promise<void> {
await this.clickButtonByName('Debug in editor');
}
@@ -28,18 +31,6 @@ export class ExecutionsPage extends BasePage {
return this.page.getByTestId('workflow-preview-iframe').contentFrame();
}
getManualChatMessages(): Locator {
return this.getPreviewIframe().locator('.chat-messages-list .chat-message');
}
getLogsOverviewStatus() {
return this.getPreviewIframe().getByTestId('logs-overview-status');
}
getLogEntries(): Locator {
return this.getPreviewIframe().getByTestId('logs-overview-body').getByRole('treeitem');
}
async clickLastExecutionItem(): Promise<void> {
const executionItem = this.getLastExecutionItem();
await executionItem.click();