mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
test: Migrate Langchain e2e tests to Playwright (#19161)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user