Updating Tests and Fixing Related Bugs (#2319)

* 🐛 (tableNodeCellRender): fix templateValue check to use Object.keys
✨ (textAreaComponent): add Case component for conditional rendering
♻️ (editNodeModal): remove commented-out useEffect code
✅ (basicExamples.spec): update test selectors and increase timeout values

✅ (filterEdge.spec.ts): update test IDs to match new naming conventions

✅ (inputListComponent.spec.ts, intComponent.spec.ts): update test IDs and streamline test steps for consistency and clarity

✅ (keyPairListComponent.spec.ts): update test ID for model element
✅ (keyPairListComponent.spec.ts): add steps to test editing model options and saving changes

* ✅ (tests): update end-to-end tests for chat input/output and modal components

- Update test selectors for better accuracy
- Add keyboard interaction in chatInputOutputUser.spec.ts
- Improve file handling in chat image upload test
- Refine prompt modal component tests for better validation
- Enhance twoEdges.spec.ts with additional view controls

* ♻️ (tests): refactor repeated click actions into reusable function in e2e tests

* ✅ (tests): replace waitForTimeout with waitForSelector in end-to-end tests

* ✅ (typescript_test.yml): add --debug flag to Playwright test command for better debugging

* ✅ (typescript_test.yml): enable trace option in Playwright tests for better debugging

* ✅ (typescript_test.yml): reduce Playwright test workers from 2 to 1 to improve stability
✅ (textInputOutput.spec.ts): add waitFor visibility checks to ensure elements are visible before interaction

* ✅ (tests): update paths for test assets to correct locations
✅ (tests): add waitForSelector to ensure elements are loaded before interaction

* ✅ (typescript_test.yml): increase Playwright workers from 1 to 2 to speed up tests
✅ (chatInputOutputUser.spec.ts): increase timeout for AI response to 100000ms
✅ (chatInputOutputUser.spec.ts): correct file path for image upload test
✅ (deleteComponentFlows.spec.ts): change waitFor to target last checkbox-component
✅ (store.spec.ts): increase timeout for share button to 100000ms

* 🐛 (flows.py): ensure flow names are unique by appending a number if necessary

* Apply Ruff formatting

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Cristhianzl <Cristhianzl@users.noreply.github.com>
This commit is contained in:
Cristhian Zanforlin Lousa 2024-06-25 13:23:11 -03:00 • committed by Gabriel Luiz Freitas Almeida
commit 4077135ba7
26 changed files with 381 additions and 222 deletions

View file

@ -270,12 +270,12 @@ test("Blog Writer", async ({ page }) => {
"https://www.natgeokids.com/uk/discover/animals/sea-life/turtle-facts/",
);
await page
.getByTestId("input-list-input_urls-0")
.nth(1)
.getByTestId("input-list-input_urls-1")
.nth(0)
.fill("https://www.originaldiving.com/blog/top-ten-turtle-facts");
await page
.getByTestId("textarea-input_value")
.getByTestId("popover-anchor-input-input_value")
.nth(0)
.fill(
"Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
@ -284,7 +284,7 @@ test("Blog Writer", async ({ page }) => {
await page.getByTestId("button_run_chat output").click();
await page.waitForTimeout(5000);
await page.getByText("built successfully").last().click({
timeout: 15000,
timeout: 30000,
});
await page.getByText("Playground", { exact: true }).click();
@ -403,17 +403,14 @@ test("Vector Store RAG", async ({ page }) => {
await page.getByText("test_file.txt").isVisible();
await page.waitForTimeout(2000);
await page.getByTestId("button_run_astra db vector store").first().click();
await page
.getByText("Astra DB Vector Store built successfully")
.last()
.click({
timeout: 15000,
});
await page.getByTestId("button_run_astra db").first().click();
await page.getByText("built successfully").last().click({
timeout: 30000,
});
await page.getByTestId("button_run_chat output").click();
await page.getByText("built successfully").last().click({
timeout: 15000,
timeout: 30000,
});
await page.getByText("Playground", { exact: true }).click();
@ -427,15 +424,6 @@ test("Vector Store RAG", async ({ page }) => {
.last()
.isVisible();
await page.getByText("Extracted Chunks", { exact: true }).last().click();
const inputChunksValues = await page.getByPlaceholder("Empty").inputValue();
expect(inputChunksValues).toBe(
"this is a test file---this is a test file---this is a test file---this is a test file",
);
await page.getByTestId("icon-ExternalLink").last().click();
await page.getByPlaceholder("Send a message...").last().isHidden();
await page.getByText("Memories", { exact: true }).last().click();
await page.getByText("Default Session").last().click();