test: Migrate Langchain e2e tests to Playwright (#19161)

This commit is contained in:
oleg
2025-09-08 18:06:00 +02:00
committed by GitHub
parent 574ec6e895
commit 64f260cb72
19 changed files with 1752 additions and 1469 deletions

View File

@@ -52,10 +52,18 @@ export class NodeDetailsViewPage extends BasePage {
await this.clickByTestId('node-execute-button');
}
getOutputPanel() {
return this.page.getByTestId('output-panel');
}
getContainer() {
return this.page.getByTestId('ndv');
}
getInputPanel() {
return this.page.getByTestId('ndv-input-panel');
}
getParameterExpressionPreviewValue() {
return this.page.getByTestId('parameter-expression-preview-value');
}
@@ -81,6 +89,14 @@ export class NodeDetailsViewPage extends BasePage {
return this.page.getByTestId('run-data-pane-header');
}
getOutputTable() {
return this.getOutputPanel().getByTestId('ndv-data-container').locator('table');
}
getOutputDataContainer() {
return this.getOutputPanel().getByTestId('ndv-data-container');
}
async setPinnedData(data: object | string) {
const pinnedData = typeof data === 'string' ? data : JSON.stringify(data);
await this.getEditPinnedDataButton().click();
@@ -373,6 +389,14 @@ export class NodeDetailsViewPage extends BasePage {
await this.page.getByRole('option', { name: nodeName }).click();
}
getInputTableHeader(index: number = 0) {
return this.getInputPanel().locator('table th').nth(index);
}
getInputTbodyCell(row: number, col: number) {
return this.getInputPanel().locator('table tbody tr').nth(row).locator('td').nth(col);
}
getAssignmentName(paramName: string, index = 0) {
return this.getAssignmentCollectionContainer(paramName)
.getByTestId('assignment')
@@ -457,6 +481,14 @@ export class NodeDetailsViewPage extends BasePage {
await input.type(content);
}
getInputTable() {
return this.getInputPanel().locator('table');
}
getInputTableCellSpan(row: number, col: number, dataName: string) {
return this.getInputTbodyCell(row, col).locator(`span[data-name="${dataName}"]`).first();
}
getAddFieldToSortByButton() {
return this.getNodeParameters().getByText('Add Field To Sort By');
}
@@ -493,6 +525,46 @@ export class NodeDetailsViewPage extends BasePage {
await input.fill(value);
}
async clickGetBackToCanvas(): Promise<void> {
await this.clickBackToCanvasButton();
}
getRunDataInfoCallout() {
return this.page.getByTestId('run-data-callout');
}
getOutputPanelTable() {
return this.getOutputTable();
}
async checkParameterCheckboxInputByName(name: string): Promise<void> {
const checkbox = this.getParameterInput(name).locator('.el-switch.switch-input');
await checkbox.click();
}
// Credentials modal helpers
async clickCreateNewCredential(eq: number = 0): Promise<void> {
await this.page.getByTestId('node-credentials-select').nth(eq).click();
await this.page.getByTestId('node-credentials-select-item-new').click();
}
// Run selector and linking helpers
getInputRunSelector() {
return this.page.locator('[data-test-id="ndv-input-panel"] [data-test-id="run-selector"]');
}
getOutputRunSelector() {
return this.page.locator('[data-test-id="output-panel"] [data-test-id="run-selector"]');
}
getInputRunSelectorInput() {
return this.getInputRunSelector().locator('input');
}
async toggleInputRunLinking(): Promise<void> {
await this.getInputPanel().getByTestId('link-run').click();
}
getNodeRunErrorMessage() {
return this.page.getByTestId('node-error-message');
}
@@ -725,6 +797,19 @@ export class NodeDetailsViewPage extends BasePage {
getInputSelect() {
return this.page.getByTestId('ndv-input-select').locator('input');
}
getInputTableRows() {
return this.getInputTable().locator('tr');
}
getOutputRunSelectorInput() {
return this.getOutputPanel().locator('[data-test-id="run-selector"] input');
}
getAiOutputModeToggle() {
return this.page.getByTestId('ai-output-mode-select');
}
getCredentialLabel(credentialType: string) {
return this.page.getByText(credentialType);
}