ref: URL and File components with Dataframe output (#8117)
* url component update. * update to url component and tests * Make directory component legacy * Only output dataframe from file component * Update base_file.py * Update description and output * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Deprecate Processing Components. * Move Tool and CQL Astra to bundle * Comprehensive improvements to Save to File * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Clean up description, dont unlink file * Remove print statement * fix: Clean up the text output of the URL component (#8158) * Clean text output from url component * [autofix.ci] apply automated fixes * Update data.py * Make a visible function * URL component cleaning refactor * Update data.py * [autofix.ci] apply automated fixes * Update with chat output fixes and template updates * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Fix linting issues --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * revert datastax component bundle * Restore the two tools as well * Two more template updates * Update Vector Store RAG.json * Update Vector Store RAG.json * Update __init__.py * Update directory.py * Update url.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update test_basic_prompting.py * Unit test updates * Fix unit tests one more time * Fix conversion in safe convert * Update chat.py * Temporary disabling of save to file tests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Fix some more unit tests * Update test_split_text_component.py * [autofix.ci] apply automated fixes * Update test_url_component.py * Update file component outputs in tests * Fix starter projects with old data to message * Update test_split_text_component.py * fix slider inputs * Update data.py * [autofix.ci] apply automated fixes * Update data.py * 🐛 (typescript_test.yml): increase the maximum shard count to 40 to improve test distribution and performance * Rename safe file component * [autofix.ci] apply automated fixes * Make sure we import the right save to file * 🔧 (freeze.spec.ts): update test description to match the changed element's test ID 🔧 (Blog Writer.spec.ts): add click event to test file input element 🔧 (edit-tools.spec.ts): update assertion to check if rowsCount is greater than 2 instead of 3 🔧 (loop-component.spec.ts): add import statement for uploadFile function 🔧 (tool-mode.spec.ts): update targetPosition coordinates for dragTo action 🔧 (chatInputOutputUser-shard-1.spec.ts): update test description to match the changed element's test ID * ✨ (stop-building.spec.ts): update click target for better test coverage and accuracy ✨ (fileUploadComponent.spec.ts): adjust drag target position and update click targets for improved testing flow and coverage * 🐛 (typescript_test.yml): adjust the maximum shard count to 10 to prevent excessive parallelization and improve test performance * Two url component types * Update ruff formatting * [autofix.ci] apply automated fixes * Revert name of method * 🐛 (typescript_test.yml): increase the maximum shard count to 40 to improve test distribution and performance * ✨ (freeze.spec.ts): update test to use correct testid for element ✨ (stop-building.spec.ts): update test to use correct testid for element ✨ (loop-component.spec.ts): update test to use correct testid for element ✨ (chatInputOutputUser-shard-1.spec.ts): update tests to use correct testid for element * ✨ (freeze.spec.ts, stop-building.spec.ts, loop-component.spec.ts, chatInputOutputUser-shard-1.spec.ts): update test selectors to match changes in the frontend UI, improving test reliability and maintainability. * ✨ (stop-building.spec.ts): update test to use correct testId for clicking element ✨ (loop-component.spec.ts): update test to use correct testId for clicking element ✨ (chatInputOutputUser-shard-1.spec.ts): update multiple tests to use correct testId for clicking element * 📝 (freeze.spec.ts): update test selector to match the correct element on the page for better test accuracy * 🔧 (typescript_test.yml): adjust optimal shard count calculation to ensure a maximum of 10 shards for test execution 🔧 (chatInputOutputUser-shard-1.spec.ts): update test selectors to match changes in the frontend output structure for integration tests * ✨ (chatInputOutputUser-shard-1.spec.ts): update test selectors for better clarity and consistency in the integration tests. --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
631bd49e14
commit
fd73cdcd7e
59 changed files with 2139 additions and 1524 deletions
|
|
@ -114,7 +114,7 @@ test(
|
|||
|
||||
//connection 1
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-data-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ test(
|
|||
await zoomOut(page, 2);
|
||||
|
||||
//connection 1
|
||||
await page.getByTestId("handle-urlcomponent-shownode-data-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page
|
||||
.getByTestId("handle-splittext-shownode-data or dataframe-left")
|
||||
.click();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ withEventDeliveryModes(
|
|||
.fill(
|
||||
"https://www.natgeokids.com/uk/discover/animals/sea-life/turtle-facts/",
|
||||
);
|
||||
|
||||
await page.getByTestId("input-list-plus-btn_urls-0").click();
|
||||
|
||||
await page
|
||||
.getByTestId("inputlist_str_urls_1")
|
||||
.nth(0)
|
||||
|
|
|
|||
|
|
@ -245,57 +245,36 @@ test(
|
|||
.getByTestId("input_outputChat Output")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 0, y: 0 },
|
||||
targetPosition: { x: 200, y: 200 },
|
||||
});
|
||||
|
||||
await adjustScreenView(page);
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("data to message");
|
||||
await page
|
||||
.getByTestId("processingData to Message")
|
||||
.getByTestId("handle-file-shownode-loaded files-right")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 300, y: 400 },
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByTestId("processingParser")
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.getByTestId("add-component-button-parser").click();
|
||||
});
|
||||
|
||||
let visibleElementHandle;
|
||||
|
||||
const elementsFile = await page
|
||||
.getByTestId("handle-file-shownode-data-right")
|
||||
.all();
|
||||
|
||||
for (const element of elementsFile) {
|
||||
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 parseDataElement = await page
|
||||
.getByTestId("handle-parsedata-shownode-data-left")
|
||||
.all();
|
||||
|
||||
for (const element of parseDataElement) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
await adjustScreenView(page);
|
||||
await page
|
||||
.getByTestId("handle-file-shownode-loaded files-right")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.getByTestId("handle-parsercomponent-shownode-data or dataframe-left")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByTestId("handle-parsercomponent-shownode-parsed text-right")
|
||||
.first()
|
||||
.click();
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ test(
|
|||
|
||||
const rowsCount = await page.getByRole("gridcell").count();
|
||||
|
||||
expect(rowsCount).toBeGreaterThan(3);
|
||||
expect(rowsCount).toBeGreaterThan(2);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(0).isChecked(),
|
||||
|
|
@ -58,10 +58,6 @@ test(
|
|||
await page.locator('input[data-ref="eInput"]').nth(3).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
|
@ -70,10 +66,6 @@ test(
|
|||
await page.locator('input[data-ref="eInput"]').nth(3).isChecked(),
|
||||
).toBe(false);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(false);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
|
@ -143,18 +135,8 @@ test(
|
|||
await page.locator('input[data-ref="eInput"]').nth(3).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(false);
|
||||
|
||||
await page.getByRole("gridcell").nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
|
@ -202,9 +184,5 @@ test(
|
|||
expect(
|
||||
await page.locator('[data-testid="tool_fetch_content"]').isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="tool_as_dataframe"]').isVisible(),
|
||||
).toBe(true);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { uploadFile } from "../../utils/upload-file";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
||||
test(
|
||||
|
|
@ -127,7 +128,7 @@ test(
|
|||
|
||||
// URL -> Loop Data
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-data-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.first()
|
||||
.click();
|
||||
await page
|
||||
|
|
@ -156,13 +157,6 @@ test(
|
|||
.first()
|
||||
.click();
|
||||
|
||||
//Loop to File
|
||||
|
||||
await page
|
||||
.getByTestId("handle-loopcomponent-shownode-item-left")
|
||||
.first()
|
||||
.click();
|
||||
await page.getByTestId("handle-file-shownode-data-right").first().click();
|
||||
await zoomOut(page, 3);
|
||||
|
||||
await page.getByTestId("div-generic-node").nth(5).click();
|
||||
|
|
@ -202,14 +196,12 @@ test(
|
|||
await page.getByTestId("keypair0").fill("text");
|
||||
await page.getByTestId("keypair100").fill("modified_value");
|
||||
|
||||
await uploadFile(page, "test_file.txt");
|
||||
|
||||
// Build and run, expect the wrong loop message
|
||||
await page.getByTestId("button_run_file").click();
|
||||
await page.waitForSelector("text=The flow has an incomplete loop.", {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByText("The flow has an incomplete loop.").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
// Delete the second parse data used to test
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ test(
|
|||
await page
|
||||
.getByTestId("agentsAgent")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 350, y: 100 },
|
||||
targetPosition: { x: 0, y: 500 },
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ test(
|
|||
targetPosition: { x: 300, y: 200 },
|
||||
});
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Get URL node ID
|
||||
const urlNode = await page.locator(".react-flow__node").first();
|
||||
const urlNodeId = await urlNode.getAttribute("data-id");
|
||||
|
|
@ -78,12 +80,16 @@ test(
|
|||
timeout: 1000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("input_outputChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 700, y: 200 },
|
||||
});
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("input_outputChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
|
|
@ -97,13 +103,8 @@ test(
|
|||
.getByTestId("inputlist_str_urls_0")
|
||||
.fill("https://www.example.com");
|
||||
|
||||
await page.getByTestId("dropdown-output-urlcomponent").click();
|
||||
await page.getByTestId("dropdown-item-output-urlcomponent-message").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-message-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
await page
|
||||
|
|
@ -127,23 +128,12 @@ test(
|
|||
exact: true,
|
||||
});
|
||||
await page.getByText("Close").first().click();
|
||||
|
||||
// Connect dataframe output to second chat output
|
||||
await page.getByTestId("dropdown-output-urlcomponent").click();
|
||||
await page
|
||||
.getByTestId("dropdown-item-output-urlcomponent-dataframe")
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-dataframe-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
await page.waitForTimeout(600);
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.waitForTimeout(600);
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Run and verify text output is still shown
|
||||
await page.getByTestId("button_run_url").first().click();
|
||||
|
|
@ -151,12 +141,15 @@ test(
|
|||
timeout: 30000 * 3,
|
||||
});
|
||||
|
||||
await page.getByTestId("dropdown-output-urlcomponent").click();
|
||||
await page
|
||||
.getByTestId("dropdown-item-output-urlcomponent-dataframe")
|
||||
.click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.waitForTimeout(600);
|
||||
await page.getByTestId("output-inspection-dataframe-urlcomponent").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
|
||||
await page
|
||||
.getByTestId("output-inspection-result-urlcomponent")
|
||||
.nth(0)
|
||||
.click();
|
||||
|
||||
await page.getByText(`Inspect the output of the component below.`, {
|
||||
exact: true,
|
||||
});
|
||||
|
|
@ -168,7 +161,7 @@ test(
|
|||
await page.waitForTimeout(600);
|
||||
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-dataframe-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
|
||||
|
|
@ -183,7 +176,7 @@ test(
|
|||
timeout: 30000 * 3,
|
||||
});
|
||||
await page.waitForTimeout(600);
|
||||
await page.getByTestId("output-inspection-dataframe-urlcomponent").click();
|
||||
await page.getByTestId("output-inspection-result-urlcomponent").click();
|
||||
await page.getByText(`Inspect the output of the component below.`, {
|
||||
exact: true,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue