feat: Quality of Life improvements for Astra Component (#6953)
* feat: Add helper text for Astra DB embedding generation provider * feat: Add helper text support for dropdown and parameter components * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update astradb.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * feat: Add org_id to excluded metadata keys in dropdown component * fix: Update Astra DB component UI and starter project configuration - Improved AstraDB component's embedding provider link with better accessibility attributes - Updated Vector Store RAG starter project JSON with formatted configuration - Refined UI text and link presentation for better user experience * Remove providers that arent configured * feat: Add required field indicator to node parameters - Implemented visual indicator (*) for required node parameters - Updated custom parameter title rendering to show required status - Enhanced UI to provide clearer input requirements * Revert "Merge branch 'lfoss-683-1' of https://github.com/langflow-ai/langflow into lfoss-683-1" This reverts commit 2eb0fcb4d3d347de0df1f021f761ea63e882b757, reversing changes made to 9ea44aca477e8a418ef82722da4b1e0fc2afa2e1. * [autofix.ci] apply automated fixes * Add changes back * Fix some comments * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Update astradb.py * feat: Add dynamic disabled state for node dialog and int component * feat: Add dynamic placeholder for node dialog input * [autofix.ci] apply automated fixes * feat: Enhance IntComponent with disabled state styling and stepper interactions * Fix some db creation params * Update astradb.py * fix: Resolve node dialog input value handling in TypeScript * Update astradb.py * feat: Add required field validation to node dialog submission * Update astradb.py * [autofix.ci] apply automated fixes * Update astradb.py * Clean up functions and add read only flag * feat: Add readonly support to IntComponent and improve node dialog validation * fix: Improve dropdown component disabled and empty options handling * console.log removed * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Read only field and cleanup * Astra DB selector updates * [autofix.ci] apply automated fixes * fix: Improve dropdown component disabled state handling * Fix value of region in create db * [autofix.ci] apply automated fixes * Remove database icon from component * fix: Conditionally render dropdown option icons * Don't show Nvidia if not available * [autofix.ci] apply automated fixes * Exceptions unless pending mean, skip * feat: Enhance AstraDBVectorStoreComponent with HTML sanitization - Added DOMPurify for sanitizing HTML input in the convertStringToHTML function. - Introduced a new sanitizeHTML function to ensure safe rendering of HTML strings. * fix: Correct field key usage in NodeDialog and refactor disabled class name in IntComponent - Updated NodeDialogComponent to use fieldKey instead of underscore for better clarity in mapping field values. - Refactored IntComponent to replace the getDisabledClassName function with a constant for the disabled input class, improving readability. * ✨ (playground.spec.ts): Refactor drag and drop functionality to use hover and click for better interaction 🔧 (chatInputOutput.spec.ts): Update drag and drop functionality to use target position for more precise placement 🔧 (chatInputOutputUser-shard-1.spec.ts): Simplify connecting elements by replacing hover and mouse actions with click for better user experience * 🐛 (generalBugs-prompt.spec.ts): fix issue with selecting the last element with getByTestId to ensure correct element is clicked and tested * ✅ (chatInputOutputUser-shard-1.spec.ts): add 600ms timeout to wait for elements to be interactable before proceeding with the test steps --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
b6333d0e49
commit
4ab4e736be
15 changed files with 1443 additions and 2146 deletions
|
|
@ -28,14 +28,11 @@ test(
|
|||
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.getByTestId("add-component-button-chat-output").click();
|
||||
});
|
||||
|
||||
await adjustScreenView(page);
|
||||
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
|
|
@ -47,13 +44,9 @@ test(
|
|||
|
||||
await page
|
||||
.getByTestId("inputsChat Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 100, y: 100 },
|
||||
});
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text output");
|
||||
|
|
@ -63,92 +56,21 @@ test(
|
|||
|
||||
await page
|
||||
.getByTestId("outputsText Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 300, y: 300 },
|
||||
});
|
||||
|
||||
await adjustScreenView(page);
|
||||
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page
|
||||
.getByTestId("handle-chatinput-noshownode-message-source")
|
||||
.click();
|
||||
|
||||
const elementsChatInput = await page
|
||||
.locator('[data-testid="handle-chatinput-noshownode-message-source"]')
|
||||
.all();
|
||||
await page.getByTestId("handle-textoutput-shownode-text-left").click();
|
||||
|
||||
let visibleElementHandle;
|
||||
await page.getByTestId("handle-textoutput-shownode-message-right").click();
|
||||
await page.getByTestId("handle-chatoutput-noshownode-text-target").click();
|
||||
|
||||
for (const element of elementsChatInput) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Click and hold on the first element
|
||||
await visibleElementHandle.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
// Move to the second element
|
||||
|
||||
const elementsTextOutput = await page
|
||||
.getByTestId("handle-textoutput-shownode-text-left")
|
||||
.all();
|
||||
|
||||
for (const element of elementsTextOutput) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
//
|
||||
|
||||
const elementsTextOutputRight = await page
|
||||
.locator('[data-testid="handle-textoutput-shownode-message-right"]')
|
||||
.all();
|
||||
|
||||
for (const element of elementsTextOutputRight) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Click and hold on the first element
|
||||
await visibleElementHandle.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
//
|
||||
const elementsChatOutput = await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.all();
|
||||
|
||||
for (const element of elementsChatOutput) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ test(
|
|||
|
||||
await page.getByText("Edit Prompt", { exact: true }).click();
|
||||
|
||||
await page.getByTestId("edit-prompt-sanitized").click();
|
||||
await page.getByTestId("edit-prompt-sanitized").last().click();
|
||||
|
||||
await page
|
||||
.getByTestId("modal-promptarea_prompt_template")
|
||||
|
|
@ -52,18 +52,19 @@ test(
|
|||
|
||||
let promptSanitizedText = await page
|
||||
.getByTestId("edit-prompt-sanitized")
|
||||
.last()
|
||||
.textContent();
|
||||
|
||||
expect(promptSanitizedText).toBe("THIS IS A TEST");
|
||||
|
||||
await page.getByTestId("edit-prompt-sanitized").click();
|
||||
await page.getByTestId("edit-prompt-sanitized").last().click();
|
||||
|
||||
await page.keyboard.press(`ControlOrMeta+a`);
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
await page.getByText("Edit Prompt", { exact: true }).click();
|
||||
|
||||
await page.getByTestId("edit-prompt-sanitized").click();
|
||||
await page.getByTestId("edit-prompt-sanitized").last().click();
|
||||
|
||||
await page
|
||||
.getByTestId("modal-promptarea_prompt_template")
|
||||
|
|
@ -73,6 +74,7 @@ test(
|
|||
|
||||
promptSanitizedText = await page
|
||||
.getByTestId("edit-prompt-sanitized")
|
||||
.last()
|
||||
.textContent();
|
||||
|
||||
expect(promptSanitizedText).toBe("THIS IS A TEST 2");
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ test("chat_io_teste", { tag: ["@release", "@workspace"] }, async ({ page }) => {
|
|||
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.getByTestId("add-component-button-chat-output").click();
|
||||
});
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
|
|
@ -32,59 +33,19 @@ test("chat_io_teste", { tag: ["@release", "@workspace"] }, async ({ page }) => {
|
|||
|
||||
await page
|
||||
.getByTestId("inputsChat Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 100, y: 100 },
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
const elementsChatInput = await page
|
||||
.locator('[data-testid="handle-chatinput-noshownode-message-source"]')
|
||||
.all();
|
||||
await page.getByTestId("handle-chatinput-noshownode-message-source").click();
|
||||
await page.getByTestId("handle-chatoutput-noshownode-text-target").click();
|
||||
|
||||
let visibleElementHandle;
|
||||
|
||||
for (const element of elementsChatInput) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Click and hold on the first element
|
||||
await visibleElementHandle.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
// Move to the second element
|
||||
|
||||
const elementsChatOutput = await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.all();
|
||||
|
||||
for (const element of elementsChatOutput) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
|
|
|
|||
|
|
@ -95,17 +95,13 @@ test(
|
|||
.getByTestId("inputlist_str_urls_0")
|
||||
.fill("https://www.example.com");
|
||||
|
||||
// Connect text output to first chat output
|
||||
const urlTextOutput = await page
|
||||
.getByTestId("handle-url-shownode-text-right")
|
||||
.nth(0);
|
||||
await urlTextOutput.hover();
|
||||
await page.mouse.down();
|
||||
const firstChatInput = await page
|
||||
await page.getByTestId("handle-url-shownode-text-right").nth(0).click();
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.nth(0);
|
||||
await firstChatInput.hover();
|
||||
await page.mouse.up();
|
||||
.nth(0)
|
||||
.click();
|
||||
|
||||
// Run flow and test text output inspection
|
||||
await page.getByTestId("button_run_url").first().click();
|
||||
|
|
@ -120,16 +116,16 @@ test(
|
|||
await page.keyboard.press("Escape");
|
||||
|
||||
// Connect dataframe output to second chat output
|
||||
const urlDataframeOutput = await page
|
||||
await page
|
||||
.getByTestId("handle-url-shownode-dataframe-right")
|
||||
.nth(0);
|
||||
await urlDataframeOutput.hover();
|
||||
await page.mouse.down();
|
||||
const secondChatInput = await page
|
||||
.nth(0)
|
||||
.click();
|
||||
await page.waitForTimeout(600);
|
||||
await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.nth(1);
|
||||
await secondChatInput.hover();
|
||||
await page.mouse.up();
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
// Run and verify text output is still shown
|
||||
await page.getByTestId("button_run_url").first().click();
|
||||
|
|
@ -143,6 +139,7 @@ test(
|
|||
},
|
||||
);
|
||||
await page.keyboard.press("Escape");
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
// Remove text connection
|
||||
const textEdge = await page.locator(".react-flow__edge").first();
|
||||
|
|
@ -162,7 +159,7 @@ test(
|
|||
},
|
||||
);
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
await page.waitForTimeout(600);
|
||||
// Remove all connections
|
||||
const dataEdge = await page.locator(".react-flow__edge").first();
|
||||
await dataEdge.click();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue