Merge branch 'dev' into fixHook
This commit is contained in:
commit
8362187107
52 changed files with 1281 additions and 965 deletions
6
.github/workflows/docker-build.yml
vendored
6
.github/workflows/docker-build.yml
vendored
|
|
@ -11,7 +11,7 @@ on:
|
|||
pre_release:
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
default: false
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
|
|
@ -86,10 +86,10 @@ jobs:
|
|||
include:
|
||||
- component: backend
|
||||
dockerfile: ./docker/build_and_push_backend.Dockerfile
|
||||
tags: langflowai/langflow-backend:${{ inputs.version }},langflowai/langflow-backend:1.0-alpha
|
||||
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-backend:{0}', inputs.version) || format('langflowai/langflow-backend:{0},langflowai/langflow-backend:latest', inputs.version) }}
|
||||
- component: frontend
|
||||
dockerfile: ./docker/frontend/build_and_push_frontend.Dockerfile
|
||||
tags: langflowai/langflow-frontend:${{ inputs.version }},langflowai/langflow-frontend:1.0-alpha
|
||||
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-frontend:{0}', inputs.version) || format('langflowai/langflow-frontend:{0},langflowai/langflow-frontend:latest', inputs.version) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
|
|
|
|||
5
.github/workflows/lint-py.yml
vendored
5
.github/workflows/lint-py.yml
vendored
|
|
@ -3,11 +3,6 @@ name: Lint Python
|
|||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- "poetry.lock"
|
||||
- "pyproject.toml"
|
||||
- "src/backend/**"
|
||||
- "tests/**"
|
||||
merge_group:
|
||||
types: [checks_requested]
|
||||
env:
|
||||
|
|
|
|||
4
.github/workflows/python_test.yml
vendored
4
.github/workflows/python_test.yml
vendored
|
|
@ -4,10 +4,6 @@ on:
|
|||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches: [dev, main]
|
||||
paths:
|
||||
- "poetry.lock"
|
||||
- "pyproject.toml"
|
||||
- "src/backend/**"
|
||||
merge_group:
|
||||
types: [checks_requested]
|
||||
env:
|
||||
|
|
|
|||
7
.github/workflows/style-check-py.yml
vendored
7
.github/workflows/style-check-py.yml
vendored
|
|
@ -1,12 +1,7 @@
|
|||
name: Ruff Style Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "poetry.lock"
|
||||
- "pyproject.toml"
|
||||
- "src/backend/**"
|
||||
- "tests/**"
|
||||
pull_request: {}
|
||||
merge_group:
|
||||
branches: [dev]
|
||||
|
||||
|
|
|
|||
35
.github/workflows/typescript_test.yml
vendored
35
.github/workflows/typescript_test.yml
vendored
|
|
@ -1,16 +1,11 @@
|
|||
name: Run Frontend Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: "Branch to run tests on"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
pull_request:
|
||||
merge_group:
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.8.2"
|
||||
POETRY_VERSION: "1.8.3"
|
||||
NODE_VERSION: "21"
|
||||
PYTHON_VERSION: "3.12"
|
||||
# Define the directory where Playwright browsers will be installed.
|
||||
|
|
@ -19,18 +14,19 @@ env:
|
|||
|
||||
jobs:
|
||||
setup-and-test:
|
||||
name: Run Frontend Tests on branch ${{ inputs.branch }}
|
||||
name: Run Playwright Tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shardIndex: [1, 2, 3, 4]
|
||||
shardTotal: [4]
|
||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
shardTotal: [8]
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
STORE_API_KEY: ${{ secrets.STORE_API_KEY }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
|
|
@ -52,14 +48,15 @@ jobs:
|
|||
cd src/frontend
|
||||
npm ci
|
||||
if: ${{ steps.setup-node.outputs.cache-hit != 'true' }}
|
||||
|
||||
- name: Cache playwright binaries
|
||||
uses: actions/cache@v4
|
||||
- name: Get Playwright version
|
||||
run: echo "PLAYWRIGHT_VERSION=$(jq '.devDependencies["@playwright/test"]' src/frontend/package.json -r)" >> $GITHUB_ENV
|
||||
- name: Cache Playwright binaries
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/package-lock.json') }}
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }}
|
||||
|
||||
- name: Install Frontend dependencies
|
||||
run: |
|
||||
cd src/frontend
|
||||
|
|
|
|||
|
|
@ -93,5 +93,7 @@ ENV PATH="/app/.venv/bin:${PATH}"
|
|||
USER user
|
||||
WORKDIR /app
|
||||
|
||||
ENTRYPOINT ["python", "-m", "langflow", "run"]
|
||||
CMD ["--host", "0.0.0.0", "--port", "7860"]
|
||||
ENV LANGFLOW_HOST=0.0.0.0
|
||||
ENV LANGFLOW_PORT=7860
|
||||
|
||||
ENTRYPOINT ["python", "-m", "langflow", "run"]
|
||||
|
|
@ -5,4 +5,4 @@ ARG LANGFLOW_IMAGE
|
|||
FROM $LANGFLOW_IMAGE
|
||||
|
||||
RUN rm -rf /app/.venv/langflow/frontend
|
||||
CMD ["--host", "0.0.0.0", "--port", "7860", "--backend-only"]
|
||||
CMD ["--backend-only"]
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ USER user
|
|||
# Install the package from the .tar.gz
|
||||
RUN python -m pip install /app/src/backend/base/dist/*.tar.gz --user
|
||||
|
||||
ENV LANGFLOW_HOST=0.0.0.0
|
||||
ENV LANGFLOW_PORT=7860
|
||||
|
||||
ENTRYPOINT ["python", "-m", "langflow", "run"]
|
||||
CMD ["--host", "0.0.0.0", "--port", "7860"]
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ services:
|
|||
environment:
|
||||
- LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow
|
||||
# This variable defines where the logs, file storage, monitor data and secret keys are stored.
|
||||
- LANGFLOW_CONFIG_DIR=/var/lib/langflow
|
||||
- LANGFLOW_CONFIG_DIR=/app/langflow
|
||||
volumes:
|
||||
- langflow-data:/var/lib/langflow
|
||||
- langflow-data:/app/langflow
|
||||
|
||||
postgres:
|
||||
image: postgres:16
|
||||
|
|
|
|||
10
poetry.lock
generated
10
poetry.lock
generated
|
|
@ -2446,8 +2446,8 @@ files = [
|
|||
[package.dependencies]
|
||||
cffi = {version = ">=1.12.2", markers = "platform_python_implementation == \"CPython\" and sys_platform == \"win32\""}
|
||||
greenlet = [
|
||||
{version = ">=2.0.0", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""},
|
||||
{version = ">=3.0rc3", markers = "platform_python_implementation == \"CPython\" and python_version >= \"3.11\""},
|
||||
{version = ">=2.0.0", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""},
|
||||
]
|
||||
"zope.event" = "*"
|
||||
"zope.interface" = "*"
|
||||
|
|
@ -2606,12 +2606,12 @@ files = [
|
|||
google-auth = ">=2.14.1,<3.0.dev0"
|
||||
googleapis-common-protos = ">=1.56.2,<2.0.dev0"
|
||||
grpcio = [
|
||||
{version = ">=1.33.2,<2.0dev", optional = true, markers = "python_version < \"3.11\" and extra == \"grpc\""},
|
||||
{version = ">=1.49.1,<2.0dev", optional = true, markers = "python_version >= \"3.11\" and extra == \"grpc\""},
|
||||
{version = ">=1.33.2,<2.0dev", optional = true, markers = "python_version < \"3.11\" and extra == \"grpc\""},
|
||||
]
|
||||
grpcio-status = [
|
||||
{version = ">=1.33.2,<2.0.dev0", optional = true, markers = "python_version < \"3.11\" and extra == \"grpc\""},
|
||||
{version = ">=1.49.1,<2.0.dev0", optional = true, markers = "python_version >= \"3.11\" and extra == \"grpc\""},
|
||||
{version = ">=1.33.2,<2.0.dev0", optional = true, markers = "python_version < \"3.11\" and extra == \"grpc\""},
|
||||
]
|
||||
proto-plus = ">=1.22.3,<2.0.0dev"
|
||||
protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0"
|
||||
|
|
@ -4626,8 +4626,8 @@ psutil = ">=5.9.1"
|
|||
pywin32 = {version = "*", markers = "platform_system == \"Windows\""}
|
||||
pyzmq = ">=25.0.0"
|
||||
requests = [
|
||||
{version = ">=2.26.0", markers = "python_version <= \"3.11\""},
|
||||
{version = ">=2.32.2", markers = "python_version > \"3.11\""},
|
||||
{version = ">=2.26.0", markers = "python_version <= \"3.11\""},
|
||||
]
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.11\""}
|
||||
|
|
@ -6092,9 +6092,9 @@ files = [
|
|||
|
||||
[package.dependencies]
|
||||
numpy = [
|
||||
{version = ">=1.26.0,<2", markers = "python_version >= \"3.12\""},
|
||||
{version = ">=1.22.4,<2", markers = "python_version < \"3.11\""},
|
||||
{version = ">=1.23.2,<2", markers = "python_version == \"3.11\""},
|
||||
{version = ">=1.26.0,<2", markers = "python_version >= \"3.12\""},
|
||||
]
|
||||
python-dateutil = ">=2.8.2"
|
||||
pytz = ">=2020.1"
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ export default defineConfig({
|
|||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
retries: process.env.CI ? 2 : 3,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: 1,
|
||||
workers: 2,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
timeout: 120 * 1000,
|
||||
// reporter: [
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export default function HandleRenderComponent({
|
|||
side={left ? "left" : "right"}
|
||||
>
|
||||
<Handle
|
||||
data-test-id={`handle-${title.toLowerCase()}-${
|
||||
data-testid={`handle-${title.toLowerCase()}-${
|
||||
!showNode ? (left ? "target" : "source") : left ? "left" : "right"
|
||||
}`}
|
||||
type={left ? "target" : "source"}
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ export default function CollectionCardComponent({
|
|||
render={({ field }) => (
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
data-testid={`checkbox-component`}
|
||||
aria-label="checkbox-component"
|
||||
checked={field.value}
|
||||
onCheckedChange={field.onChange}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ export default function FlowToolbar(): JSX.Element {
|
|||
? "button-disable text-muted-foreground"
|
||||
: "",
|
||||
)}
|
||||
data-testid="shared-button-flow"
|
||||
>
|
||||
<ForwardedIconComponent
|
||||
name="Share3"
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ test("should able to see and interact with logs", async ({ page }) => {
|
|||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByTestId("button_run_chat output").first().click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
|
@ -45,6 +45,7 @@ const TextAreaWrapper = ({
|
|||
|
||||
return (
|
||||
<Textarea
|
||||
data-testid="input-chat-playground"
|
||||
onFocus={(e) => {
|
||||
setInputFocus(true);
|
||||
e.target.style.borderTopWidth = "0";
|
||||
|
|
|
|||
90
src/frontend/tests/end-to-end/Basic Prompting.ts
Normal file
90
src/frontend/tests/end-to-end/Basic Prompting.ts
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Basic Prompting (Hello, World)", async ({ page }) => {
|
||||
if (!process?.env?.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill("Say hello as a pirate");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("Ahoy").last().isVisible();
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("input-chat-playground").last().isVisible();
|
||||
});
|
||||
109
src/frontend/tests/end-to-end/Blog Writer.spec.ts
Normal file
109
src/frontend/tests/end-to-end/Blog Writer.spec.ts
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Blog Writer", async ({ page }) => {
|
||||
if (!process?.env?.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Blog Writer" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page
|
||||
.getByTestId("input-list-input_urls-0")
|
||||
.nth(0)
|
||||
.fill(
|
||||
"https://www.natgeokids.com/uk/discover/animals/sea-life/turtle-facts/",
|
||||
);
|
||||
await page
|
||||
.getByTestId("input-list-input_urls-1")
|
||||
.nth(0)
|
||||
.fill("https://www.originaldiving.com/blog/top-ten-turtle-facts");
|
||||
|
||||
await page
|
||||
.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.",
|
||||
);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByPlaceholder(
|
||||
"No chat input variables found. Click to run your flow.",
|
||||
{ exact: true },
|
||||
)
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("turtles").last().isVisible();
|
||||
await page.getByText("sea").last().isVisible();
|
||||
await page.getByText("survival").last().isVisible();
|
||||
|
||||
await page.getByText("Instructions").last().click();
|
||||
|
||||
const value = await page
|
||||
.getByPlaceholder("Enter text...")
|
||||
.last()
|
||||
.inputValue();
|
||||
|
||||
expect(value).toBe(
|
||||
"Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
|
||||
);
|
||||
|
||||
await page.getByTestId("icon-ExternalLink").last().click();
|
||||
|
||||
const count = await page
|
||||
.getByText(
|
||||
"Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
|
||||
)
|
||||
.count();
|
||||
|
||||
if (count <= 1) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
});
|
||||
96
src/frontend/tests/end-to-end/Document QA.spec.ts
Normal file
96
src/frontend/tests/end-to-end/Document QA.spec.ts
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Document QA", async ({ page }) => {
|
||||
if (!process?.env?.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Document QA" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||
await page.getByTestId("icon-FileSearch2").click();
|
||||
const fileChooser = await fileChooserPromise;
|
||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
||||
await page.getByText("test_file.txt").isVisible();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill("whats the text in the file?");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("this is a test file").last().isVisible();
|
||||
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("input-chat-playground").last().isVisible();
|
||||
});
|
||||
102
src/frontend/tests/end-to-end/Memory Chatbot.spec.ts
Normal file
102
src/frontend/tests/end-to-end/Memory Chatbot.spec.ts
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Memory Chatbot", async ({ page }) => {
|
||||
if (!process?.env?.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Memory Chatbot" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill("Remember that I'm a lion");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill("try reproduce the sound I made in words");
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
await page.waitForSelector("text=roar", { timeout: 30000 });
|
||||
await page.getByText("roar").last().isVisible();
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("input-chat-playground").last().isVisible();
|
||||
});
|
||||
129
src/frontend/tests/end-to-end/Vector Store.spec.ts
Normal file
129
src/frontend/tests/end-to-end/Vector Store.spec.ts
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Vector Store RAG", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Vector Store RAG" }).click();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
// if (
|
||||
// !process.env.OPENAI_API_KEY ||
|
||||
// !process.env.ASTRA_DB_API_ENDPOINT ||
|
||||
// !process.env.ASTRA_DB_APPLICATION_TOKEN
|
||||
// ) {
|
||||
// //You must set the OPENAI_API_KEY, ASTRA_DB_API_ENDPOINT and ASTRA_DB_APPLICATION_TOKEN on .env file to run this test
|
||||
// expect(false).toBe(true);
|
||||
// }
|
||||
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-openai_api_key")
|
||||
// .nth(0)
|
||||
// .fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-openai_api_key")
|
||||
// .nth(1)
|
||||
// .fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-openai_api_key")
|
||||
// .nth(2)
|
||||
// .fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-token")
|
||||
// .nth(0)
|
||||
// .fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? "");
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-token")
|
||||
// .nth(1)
|
||||
// .fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? "");
|
||||
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-api_endpoint")
|
||||
// .nth(0)
|
||||
// .fill(process.env.ASTRA_DB_API_ENDPOINT ?? "");
|
||||
// await page
|
||||
// .getByTestId("popover-anchor-input-api_endpoint")
|
||||
// .nth(1)
|
||||
// .fill(process.env.ASTRA_DB_API_ENDPOINT ?? "");
|
||||
|
||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||
await page.getByTestId("icon-FileSearch2").last().click();
|
||||
const fileChooser = await fileChooserPromise;
|
||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
||||
await page.getByText("test_file.txt").isVisible();
|
||||
|
||||
// await page.getByTestId("button_run_astra db").first().click();
|
||||
// await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
// await page.getByText("built successfully").last().click({
|
||||
// timeout: 30000,
|
||||
// });
|
||||
|
||||
// await page.getByTestId("button_run_chat output").click();
|
||||
// await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
// await page.getByText("built successfully").last().click({
|
||||
// timeout: 30000,
|
||||
// });
|
||||
|
||||
// await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
// await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
// timeout: 100000,
|
||||
// });
|
||||
|
||||
// await page.getByTestId("input-chat-playground").last().fill("hello");
|
||||
|
||||
// await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
// await page
|
||||
// .getByText("This is a test file.", { exact: true })
|
||||
// .last()
|
||||
// .isVisible();
|
||||
|
||||
// await page.getByText("Memories", { exact: true }).last().click();
|
||||
// await page.getByText("Default Session").last().click();
|
||||
|
||||
// await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
// await page.getByText("text", { exact: true }).last().isVisible();
|
||||
// await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
// await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
// await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
// await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
// await page.getByRole("gridcell").last().isVisible();
|
||||
// await page.getByTestId("icon-Trash2").first().click();
|
||||
|
||||
// await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
// timeout: 100000,
|
||||
// });
|
||||
|
||||
// await page.getByTestId("input-chat-playground").last().isVisible();
|
||||
});
|
||||
|
|
@ -89,6 +89,10 @@ test("search components", async ({ page }) => {
|
|||
}
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -157,6 +161,11 @@ test("user should be able to download a flow or a component", async ({
|
|||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -234,6 +243,9 @@ test("user should be able to duplicate a flow or a component", async ({
|
|||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -1,440 +0,0 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import path from "path";
|
||||
|
||||
test("Basic Prompting (Hello, World)", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
await page
|
||||
.getByPlaceholder("Send a message...")
|
||||
.last()
|
||||
.fill("Say hello as a pirate");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("Ahoy").last().isVisible();
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.getByPlaceholder("Send a message...").last().isVisible();
|
||||
});
|
||||
|
||||
test("Memory Chatbot", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Memory Chatbot" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
await page
|
||||
.getByPlaceholder("Send a message...")
|
||||
.last()
|
||||
.fill("Remember that I'm a lion");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page
|
||||
.getByPlaceholder("Send a message...")
|
||||
.last()
|
||||
.fill("try reproduce the sound I made in words");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.getByText("roar").last().isVisible();
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.getByPlaceholder("Send a message...").last().isVisible();
|
||||
});
|
||||
|
||||
test("Document QA", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Document QA" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||
await page.getByTestId("icon-FileSearch2").click();
|
||||
const fileChooser = await fileChooserPromise;
|
||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
||||
await page.getByText("test_file.txt").isVisible();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByText("No input message provided.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Send a message...")
|
||||
.last()
|
||||
.fill("whats the text in the file?");
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("this is a test file").last().isVisible();
|
||||
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.getByPlaceholder("Send a message...").last().isVisible();
|
||||
});
|
||||
|
||||
test("Blog Writer", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Blog Writer" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page
|
||||
.getByTestId("input-list-input_urls-0")
|
||||
.nth(0)
|
||||
.fill(
|
||||
"https://www.natgeokids.com/uk/discover/animals/sea-life/turtle-facts/",
|
||||
);
|
||||
await page
|
||||
.getByTestId("input-list-input_urls-1")
|
||||
.nth(0)
|
||||
.fill("https://www.originaldiving.com/blog/top-ten-turtle-facts");
|
||||
|
||||
await page
|
||||
.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.",
|
||||
);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page
|
||||
.getByPlaceholder(
|
||||
"No chat input variables found. Click to run your flow.",
|
||||
{ exact: true },
|
||||
)
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.getByText("turtles").last().isVisible();
|
||||
await page.getByText("sea").last().isVisible();
|
||||
await page.getByText("survival").last().isVisible();
|
||||
|
||||
await page.getByText("Instructions").last().click();
|
||||
|
||||
const value = await page
|
||||
.getByPlaceholder("Enter text...")
|
||||
.last()
|
||||
.inputValue();
|
||||
|
||||
expect(value).toBe(
|
||||
"Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
|
||||
);
|
||||
|
||||
await page.getByTestId("icon-ExternalLink").last().click();
|
||||
|
||||
const count = await page
|
||||
.getByText(
|
||||
"Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
|
||||
)
|
||||
.count();
|
||||
|
||||
if (count <= 1) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test("Vector Store RAG", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Vector Store RAG" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (
|
||||
!process.env.OPENAI_API_KEY ||
|
||||
!process.env.ASTRA_DB_API_ENDPOINT ||
|
||||
!process.env.ASTRA_DB_APPLICATION_TOKEN
|
||||
) {
|
||||
//You must set the OPENAI_API_KEY, ASTRA_DB_API_ENDPOINT and ASTRA_DB_APPLICATION_TOKEN on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.nth(0)
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.nth(1)
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.nth(2)
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-token")
|
||||
.nth(0)
|
||||
.fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? "");
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-token")
|
||||
.nth(1)
|
||||
.fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? "");
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-api_endpoint")
|
||||
.nth(0)
|
||||
.fill(process.env.ASTRA_DB_API_ENDPOINT ?? "");
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-api_endpoint")
|
||||
.nth(1)
|
||||
.fill(process.env.ASTRA_DB_API_ENDPOINT ?? "");
|
||||
|
||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||
await page.getByTestId("icon-FileSearch2").last().click();
|
||||
const fileChooser = await fileChooserPromise;
|
||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
||||
await page.getByText("test_file.txt").isVisible();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
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: 30000,
|
||||
});
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
await page.getByPlaceholder("Send a message...").last().fill("hello");
|
||||
|
||||
await page.getByTestId("icon-LucideSend").last().click();
|
||||
|
||||
await page
|
||||
.getByText("This is a test file.", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.getByText("Memories", { exact: true }).last().click();
|
||||
await page.getByText("Default Session").last().click();
|
||||
|
||||
await page.getByText("timestamp", { exact: true }).last().isVisible();
|
||||
await page.getByText("text", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender", { exact: true }).last().isVisible();
|
||||
await page.getByText("sender_name", { exact: true }).last().isVisible();
|
||||
await page.getByText("session_id", { exact: true }).last().isVisible();
|
||||
await page.getByText("files", { exact: true }).last().isVisible();
|
||||
|
||||
await page.getByRole("gridcell").last().isVisible();
|
||||
await page.getByTestId("icon-Trash2").first().click();
|
||||
await page.getByPlaceholder("Send a message...").last().isVisible();
|
||||
});
|
||||
|
|
@ -28,7 +28,11 @@ test("chat_io_teste", async ({ page }) => {
|
|||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
|
|
@ -50,6 +54,10 @@ test("chat_io_teste", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -79,8 +87,11 @@ test("chat_io_teste", async ({ page }) => {
|
|||
|
||||
await page.getByLabel("fit view").click();
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page.getByPlaceholder("Send a message...").click();
|
||||
await page.getByPlaceholder("Send a message...").fill("teste");
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("input-chat-playground").click();
|
||||
await page.getByTestId("input-chat-playground").fill("teste");
|
||||
await page.getByRole("button").nth(1).click();
|
||||
const chat_output = page.getByTestId("chat-message-AI-teste");
|
||||
const chat_input = page.getByTestId("chat-message-User-teste");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,108 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
test("user must be able to send an image on chat", async ({ page }) => {
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForSelector("text=Chat Input", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
await page.getByText("Save Changes").click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
// Read the image file as a binary string
|
||||
const filePath = "tests/end-to-end/assets/chain.png";
|
||||
const fileContent = readFileSync(filePath, "base64");
|
||||
|
||||
// Create the DataTransfer and File objects within the browser context
|
||||
const dataTransfer = await page.evaluateHandle(
|
||||
({ fileContent }) => {
|
||||
const dt = new DataTransfer();
|
||||
const byteCharacters = atob(fileContent);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const file = new File([byteArray], "chain.png", { type: "image/png" });
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
},
|
||||
{ fileContent },
|
||||
);
|
||||
|
||||
// Locate the target element
|
||||
const element = await page.getByTestId("input-chat-playground");
|
||||
|
||||
// Dispatch the drop event on the target element
|
||||
await element.dispatchEvent("drop", { dataTransfer });
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
|
||||
await page.waitForSelector("text=chain.png", { timeout: 30000 });
|
||||
|
||||
await page.getByText("chain.png").isVisible();
|
||||
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ScanEye"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ScanEye").nth(4).click();
|
||||
|
||||
await page.getByText("Restart").isHidden();
|
||||
});
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
test("user must be able to see output inspection", async ({ page }) => {
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByTestId("button_run_chat output").last().click();
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ScanEye"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ScanEye").nth(4).click();
|
||||
|
||||
await page.getByText("Sender", { exact: true }).isVisible();
|
||||
await page.getByText("Type", { exact: true }).isVisible();
|
||||
await page.getByText("User", { exact: true }).last().isVisible();
|
||||
});
|
||||
|
|
@ -29,7 +29,9 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -44,8 +46,23 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page.getByPlaceholder("Send a message...").fill("Hello, how are you?");
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("input-chat-playground").fill("Hello, how are you?");
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
let valueUser = await page.getByTestId("sender_name_user").textContent();
|
||||
|
||||
|
|
@ -67,6 +84,11 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
|
||||
);
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
|
|
@ -89,6 +111,11 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
.fill("TestSenderNameAI");
|
||||
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
|
||||
valueUser = await page
|
||||
|
|
@ -110,153 +137,3 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
.isVisible(),
|
||||
);
|
||||
});
|
||||
|
||||
test("user must be able to see output inspection", async ({ page }) => {
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("button_run_chat output").last().click();
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ScanEye"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ScanEye").nth(4).click();
|
||||
|
||||
await page.getByText("Sender", { exact: true }).isVisible();
|
||||
await page.getByText("Type", { exact: true }).isVisible();
|
||||
await page.getByText("User", { exact: true }).last().isVisible();
|
||||
});
|
||||
|
||||
test("user must be able to send an image on chat", async ({ page }) => {
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
if (!process.env.OPENAI_API_KEY) {
|
||||
//You must set the OPENAI_API_KEY on .env file to run this test
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
await page.getByText("Save Changes").click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
// Read the image file as a binary string
|
||||
const filePath = "tests/end-to-end/assets/chain.png";
|
||||
const fileContent = readFileSync(filePath, "base64");
|
||||
|
||||
// Create the DataTransfer and File objects within the browser context
|
||||
const dataTransfer = await page.evaluateHandle(
|
||||
({ fileContent }) => {
|
||||
const dt = new DataTransfer();
|
||||
const byteCharacters = atob(fileContent);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const file = new File([byteArray], "chain.png", { type: "image/png" });
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
},
|
||||
{ fileContent },
|
||||
);
|
||||
|
||||
// Locate the target element
|
||||
const element = await page.getByPlaceholder("Send a message...");
|
||||
|
||||
// Dispatch the drop event on the target element
|
||||
await element.dispatchEvent("drop", { dataTransfer });
|
||||
|
||||
await page.waitForTimeout(4000);
|
||||
|
||||
await page.getByText("chain.png").isVisible();
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("chain.png").isVisible();
|
||||
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ScanEye"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ScanEye").nth(4).click();
|
||||
await page.getByText("Restart").isHidden();
|
||||
});
|
||||
|
|
@ -23,7 +23,11 @@ test("CodeAreaModalComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("python function");
|
||||
|
|
|
|||
|
|
@ -9,21 +9,34 @@ test("should delete a flow", async ({ page }) => {
|
|||
await page
|
||||
.getByPlaceholder("Insert your API Key", { exact: true })
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
||||
await page.waitForSelector("text=Save", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Save").last().click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
await page.waitForSelector("text=Store", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Store").nth(0).click();
|
||||
|
||||
await page.getByTestId("install-Website Content QA").click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.getByText("My Collection").nth(0).click();
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
|
||||
await page.getByLabel("checkbox-component").last().waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000, // Timeout of 30 seconds
|
||||
await page.waitForSelector('[data-testid="install-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByLabel("checkbox-component").first().click();
|
||||
await page.getByTestId("install-Website Content QA").click();
|
||||
|
||||
await page.waitForSelector("text=My Collection", { timeout: 30000 });
|
||||
|
||||
await page.getByText("My Collection").nth(0).click();
|
||||
|
||||
await page.waitForSelector("text=Website Content QA", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="checkbox-component"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("checkbox-component").first().click();
|
||||
|
||||
await page.getByTestId("icon-Trash2").click();
|
||||
await page
|
||||
|
|
@ -44,12 +57,12 @@ test("should delete a component", async ({ page }) => {
|
|||
await page.getByText("Components").first().click();
|
||||
await page.getByText("Basic RAG").first().isVisible();
|
||||
|
||||
await page.getByLabel("checkbox-component").last().waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000, // Timeout of 30 seconds
|
||||
await page.waitForSelector('[data-testid="checkbox-component"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByLabel("checkbox-component").first().click();
|
||||
await page.getByTestId("checkbox-component").first().click();
|
||||
|
||||
await page.getByTestId("icon-Trash2").click();
|
||||
await page
|
||||
.getByText("Are you sure you want to delete the selected component?")
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ test("dropDownComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon");
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ test("should be able to upload a file", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
|
|
|||
109
src/frontend/tests/end-to-end/filterSidebar.spec.ts
Normal file
109
src/frontend/tests/end-to-end/filterSidebar.spec.ts
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("LLMChain - Filter", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("llmchain");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByTestId("chainsLLMChain")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("chainsLLMChain").first()).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("langchain_utilitiesSearchApi").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("memoriesAstra DB Message Reader").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("prototypesFlow as Tool").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("retrieversAmazon Kendra Retriever").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("textsplittersCharacterTextSplitter").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("toolkitsVectorStoreInfo").first(),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("toolsSearchApi").first()).toBeVisible();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
||||
await expect(page.getByTestId("model_specsVertexAI")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsCTransformers")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsAmazon Bedrock")).not.toBeVisible();
|
||||
await expect(page.getByTestId("modelsAzure OpenAI")).not.toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("model_specsAzureChatOpenAI"),
|
||||
).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatAnthropic")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatLiteLLM")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatOllama")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatOpenAI")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatVertexAI")).not.toBeVisible();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[4]/div/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-chains")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();
|
||||
});
|
||||
|
|
@ -22,7 +22,9 @@ test("FloatComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test.describe("Flow Page tests", () => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom");
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ test("CRUD folders", async ({ page }) => {
|
|||
}
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
|
||||
await page.getByText("My Collection").nth(2).isVisible();
|
||||
|
|
@ -35,9 +39,18 @@ test("CRUD folders", async ({ page }) => {
|
|||
await page.getByText("New Folder").last().isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("New Folder").last().dblclick();
|
||||
await page.getByTestId("input-folder").fill("new folder test name");
|
||||
await page.keyboard.press("Enter");
|
||||
await page.getByText("new folder test name").last().isVisible();
|
||||
|
||||
const element = await page.getByTestId("input-folder");
|
||||
await element.fill("new folder test name");
|
||||
|
||||
await page.getByText("My Projects").last().click({
|
||||
force: true,
|
||||
});
|
||||
|
||||
await page.getByText("new folder test name").last().waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByText("new folder test name")
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("should interact with api request", async ({ page }) => {
|
|||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("api request");
|
||||
|
|
@ -81,8 +83,23 @@ test("erase button should clear the chat messages", async ({ page }) => {
|
|||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page.getByPlaceholder("Send a message...").fill("Hello, how are you?");
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("input-chat-playground").fill("Hello, how are you?");
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-LucideSend"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
let valueUser = await page.getByTestId("sender_name_user").textContent();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("GlobalVariables", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
|
|
@ -35,6 +37,10 @@ test("GlobalVariables", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("LLMChain - Tooltip", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
|
@ -33,6 +35,10 @@ test("LLMChain - Tooltip", async ({ page }) => {
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -101,6 +107,11 @@ test("LLMChain - Tooltip", async ({ page }) => {
|
|||
|
||||
await page.waitForTimeout(500);
|
||||
});
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -146,112 +157,3 @@ test("LLMChain - Tooltip", async ({ page }) => {
|
|||
).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test("LLMChain - Filter", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId(
|
||||
"input-list-plus-btn-edit_metadata_indexing_include-2",
|
||||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("llmchain");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByTestId("chainsLLMChain")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("modelsGoogle Generative AI").first(),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("chainsLLMChain").first()).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("langchain_utilitiesSearchApi").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("memoriesAstra DB Message Reader").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("prototypesFlow as Tool").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("retrieversAmazon Kendra Retriever").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("textsplittersCharacterTextSplitter").first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("toolkitsVectorStoreInfo").first(),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("toolsSearchApi").first()).toBeVisible();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
||||
await expect(page.getByTestId("model_specsVertexAI")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsCTransformers")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsAmazon Bedrock")).not.toBeVisible();
|
||||
await expect(page.getByTestId("modelsAzure OpenAI")).not.toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("model_specsAzureChatOpenAI"),
|
||||
).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatAnthropic")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatLiteLLM")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatOllama")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatOpenAI")).not.toBeVisible();
|
||||
await expect(page.getByTestId("model_specsChatVertexAI")).not.toBeVisible();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[4]/div/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-chains")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();
|
||||
});
|
||||
|
|
@ -22,7 +22,9 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
|
|
@ -34,6 +36,10 @@ test("InputComponent", async ({ page }) => {
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("InputListComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("url");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("IntComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
|
|
@ -35,6 +37,10 @@ test("IntComponent", async ({ page }) => {
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -66,6 +72,11 @@ test("IntComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("title-OpenAI").click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@ import { expect, test } from "@playwright/test";
|
|||
import uaParser from "ua-parser-js";
|
||||
test("LangflowShortcuts", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
let control = "Control";
|
||||
|
||||
if (userAgentInfo.os.name.includes("Mac")) {
|
||||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -28,8 +21,18 @@ test("LangflowShortcuts", async ({ page }) => {
|
|||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
let control = "Control";
|
||||
|
||||
if (userAgentInfo.os.name.includes("Mac")) {
|
||||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
|
|
@ -43,6 +46,11 @@ test("LangflowShortcuts", async ({ page }) => {
|
|||
await page.mouse.down();
|
||||
|
||||
await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("NestedComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("pinecone");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
|
|
|
|||
|
|
@ -93,8 +93,9 @@ test.describe("save component tests", () => {
|
|||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("group");
|
||||
|
|
|
|||
|
|
@ -18,111 +18,6 @@ test("should not have an API key", async ({ page }) => {
|
|||
await page.getByText("API Key Error").isVisible();
|
||||
});
|
||||
|
||||
test("should find a searched Component on Store", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("search-store-input").fill("File Loader");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("Basic RAG");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("YouTube QA");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("YouTube QA").isVisible();
|
||||
});
|
||||
|
||||
test("should filter by tag", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("tag-selector-Agent").click();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
await page.getByTestId("tag-selector-Agent").click();
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
|
||||
await page.getByTestId("tag-selector-Memory").click();
|
||||
await page.getByText("MP3 QA12").isVisible();
|
||||
|
||||
await page.getByTestId("tag-selector-Chain").click();
|
||||
await page.getByText("There are no").isVisible();
|
||||
await page.getByTestId("tag-selector-Chain").click();
|
||||
|
||||
await page.getByTestId("tag-selector-Vector Store").click();
|
||||
await page.getByText("MP3 QA12").isVisible();
|
||||
await page.getByTestId("tag-selector-Vector Store").click();
|
||||
await page.getByTestId("tag-selector-Memory").click();
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
});
|
||||
|
||||
test("should order the visualization", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Alphabetical").click();
|
||||
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.getByText("Popular").click();
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
});
|
||||
|
||||
test("should filter by type", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Website Content QA").isVisible();
|
||||
|
||||
await page.getByTestId("flows-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
let iconGroup = await page.getByTestId("icon-Group")?.count();
|
||||
expect(iconGroup).not.toBe(0);
|
||||
|
||||
await page.getByText("icon-ToyBrick").last().isHidden();
|
||||
|
||||
await page.getByTestId("components-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
await page.getByTestId("icon-Group").last().isHidden();
|
||||
let toyBrick = await page.getByTestId("icon-ToyBrick")?.count();
|
||||
expect(toyBrick).not.toBe(0);
|
||||
|
||||
await page.getByTestId("all-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
let iconGroupAllCount = await page.getByTestId("icon-Group")?.count();
|
||||
await page.waitForTimeout(2000);
|
||||
let toyBrickAllCount = await page.getByTestId("icon-ToyBrick")?.count();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
if (iconGroupAllCount === 0 || toyBrickAllCount === 0) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test("should add API-KEY", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
@ -140,9 +35,6 @@ test("should add API-KEY", async ({ page }) => {
|
|||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API Key Error").isVisible();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
|
@ -224,6 +116,53 @@ test("should like and add components and flows", async ({ page }) => {
|
|||
await page.getByText("Basic RAG").first().isVisible();
|
||||
});
|
||||
|
||||
test("should find a searched Component on Store", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("search-store-input").fill("File Loader");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("Basic RAG");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("YouTube QA");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("YouTube QA").isVisible();
|
||||
});
|
||||
|
||||
test("should filter by tag", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("tag-selector-Agent").click();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
await page.getByTestId("tag-selector-Agent").click();
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
|
||||
await page.getByTestId("tag-selector-Memory").click();
|
||||
await page.getByText("MP3 QA12").isVisible();
|
||||
|
||||
await page.getByTestId("tag-selector-Chain").click();
|
||||
await page.getByText("There are no").isVisible();
|
||||
await page.getByTestId("tag-selector-Chain").click();
|
||||
|
||||
await page.getByTestId("tag-selector-Vector Store").click();
|
||||
await page.getByText("MP3 QA12").isVisible();
|
||||
await page.getByTestId("tag-selector-Vector Store").click();
|
||||
await page.getByTestId("tag-selector-Memory").click();
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
});
|
||||
|
||||
test("should share component with share button", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
|
@ -259,11 +198,11 @@ test("should share component with share button", async ({ page }) => {
|
|||
await page.getByText("Save").last().click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-Share3"]', {
|
||||
await page.waitForSelector('[data-testid="shared-button-flow"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-Share3").first().click();
|
||||
await page.getByTestId("shared-button-flow").first().click();
|
||||
await page.getByText("Name:").isVisible();
|
||||
await page.getByText("Description:").isVisible();
|
||||
await page.getByText("Set workflow status to public").isVisible();
|
||||
|
|
@ -288,3 +227,61 @@ test("should share component with share button", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Flow shared successfully").last().isVisible();
|
||||
});
|
||||
|
||||
test("should order the visualization", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Alphabetical").click();
|
||||
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.getByText("Popular").click();
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
});
|
||||
|
||||
test("should filter by type", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Website Content QA").isVisible();
|
||||
|
||||
await page.getByTestId("flows-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
let iconGroup = await page.getByTestId("icon-Group")?.count();
|
||||
expect(iconGroup).not.toBe(0);
|
||||
|
||||
await page.getByText("icon-ToyBrick").last().isHidden();
|
||||
|
||||
await page.getByTestId("components-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
await page.getByTestId("icon-Group").last().isHidden();
|
||||
let toyBrick = await page.getByTestId("icon-ToyBrick")?.count();
|
||||
expect(toyBrick).not.toBe(0);
|
||||
|
||||
await page.getByTestId("all-button-store").click();
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
let iconGroupAllCount = await page.getByTestId("icon-Group")?.count();
|
||||
await page.waitForTimeout(2000);
|
||||
let toyBrickAllCount = await page.getByTestId("icon-ToyBrick")?.count();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
if (iconGroupAllCount === 0 || toyBrickAllCount === 0) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ test("TextAreaModalComponent", async ({ page }) => {
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -60,42 +60,42 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[5]/button/div[1]',
|
||||
)
|
||||
.waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
const component1 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]',
|
||||
);
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[5]/button/div[1]',
|
||||
)
|
||||
.hover();
|
||||
const element1 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[5]/button/div[1]',
|
||||
);
|
||||
|
||||
const component2 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]',
|
||||
);
|
||||
|
||||
const element2 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
|
||||
);
|
||||
|
||||
// ensure elements popups are not blocking
|
||||
component1.blur();
|
||||
component2.blur();
|
||||
|
||||
await page.mouse.up();
|
||||
|
||||
await element1.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
// Move to the second element
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.hover();
|
||||
await element2.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
|
@ -109,43 +109,40 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[15]/button/div[1]',
|
||||
)
|
||||
.waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
const component3 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]',
|
||||
);
|
||||
|
||||
// Click and hold on the first element
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[15]/button/div[1]',
|
||||
)
|
||||
.hover();
|
||||
const element3 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div[1]',
|
||||
);
|
||||
|
||||
const element4 = await page.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[16]/button/div[1]',
|
||||
);
|
||||
|
||||
// ensure elements popups are not blocking
|
||||
component2.blur();
|
||||
component3.blur();
|
||||
|
||||
await page.mouse.up();
|
||||
|
||||
await element4.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
// Move to the second element
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div[1]',
|
||||
)
|
||||
.hover();
|
||||
await element3.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
|
@ -163,6 +160,11 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("dropdown-model_name").click();
|
||||
await page.getByTestId("gpt-4o-0-option").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
await page.getByText("Run Flow", { exact: true }).click();
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ test("ToggleComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -58,6 +62,10 @@ test("ToggleComponent", async ({ page }) => {
|
|||
|
||||
await page.getByText("Save Changes", { exact: true }).click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
|
|
@ -77,6 +85,10 @@ test("ToggleComponent", async ({ page }) => {
|
|||
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -82,7 +82,9 @@ test("check if tweaks are updating when someothing on the flow changes", async (
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
|
|
@ -94,6 +96,11 @@ test("check if tweaks are updating when someothing on the flow changes", async (
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
|
|||
|
|
@ -17,5 +17,41 @@
|
|||
"jsx": "react-jsx",
|
||||
"noImplicitAny": false
|
||||
},
|
||||
"include": ["src"]
|
||||
"include": [
|
||||
"src",
|
||||
"tests/end-to-end/saveComponents.spec.ts",
|
||||
"tests/end-to-end/actionsMainPage.spec.ts",
|
||||
"tests/end-to-end/auto_login.spec.ts",
|
||||
"tests/end-to-end/chatInputOutput.spec.ts",
|
||||
"tests/end-to-end/chatInputOutputUser - Interact.spec.ts",
|
||||
"tests/end-to-end/codeAreaModalComponent.spec.ts",
|
||||
"tests/end-to-end/curlApiGeneration.spec.ts",
|
||||
"tests/end-to-end/deleteComponentFlows.spec.ts",
|
||||
"tests/end-to-end/dragAndDrop.spec.ts",
|
||||
"tests/end-to-end/dropdownComponent.spec.ts",
|
||||
"tests/end-to-end/fileUploadComponent.spec.ts",
|
||||
"tests/end-to-end/filterEdge.spec.ts",
|
||||
"tests/end-to-end/floatComponent.spec.ts",
|
||||
"tests/end-to-end/flowPage.spec.ts",
|
||||
"tests/end-to-end/flowSettings.spec.ts",
|
||||
"tests/end-to-end/generalBugs.spec.ts",
|
||||
"tests/end-to-end/globalVariables.spec.ts",
|
||||
"tests/end-to-end/group.spec.ts",
|
||||
"tests/end-to-end/folders.spec.ts",
|
||||
"tests/end-to-end/inputComponent.spec.ts",
|
||||
"tests/end-to-end/inputListComponent.spec.ts",
|
||||
"tests/end-to-end/intComponent.spec.ts",
|
||||
"tests/end-to-end/keyPairListComponent.spec.ts",
|
||||
"tests/end-to-end/langflowShortcuts.spec.ts",
|
||||
"tests/end-to-end/nestedComponent.spec.ts",
|
||||
"tests/end-to-end/promptModalComponent.spec.ts",
|
||||
"tests/end-to-end/python_api_generation.spec.ts",
|
||||
"tests/end-to-end/textAreaModalComponent.spec.ts",
|
||||
"tests/end-to-end/textInputOutput.spec.ts",
|
||||
"tests/end-to-end/toggleComponent.spec.ts",
|
||||
"tests/end-to-end/tweaks_test.spec.ts",
|
||||
"tests/end-to-end/twoEdges.spec.ts",
|
||||
"tests/end-to-end/userSettings.spec.ts",
|
||||
"tests/end-to-end/store.spec.ts"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue