merge fix
This commit is contained in:
commit
cfc2913e9c
87 changed files with 4957 additions and 485 deletions
|
|
@ -1,28 +1,28 @@
|
|||
import { test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(16000);
|
||||
test.setTimeout(140000);
|
||||
// await page.waitForTimeout(16000);
|
||||
// test.setTimeout(140000);
|
||||
});
|
||||
test.describe("Auto_login tests", () => {
|
||||
test("auto_login sign in", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
});
|
||||
|
||||
test("auto_login block_admin", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("http:localhost:3000/login");
|
||||
await page.goto("/login");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("http:localhost:3000/admin");
|
||||
await page.goto("/admin");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("http:localhost:3000/admin/login");
|
||||
await page.goto("/admin/login");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(5000);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,20 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.waitForTimeout(1000);
|
||||
test.setTimeout(120000);
|
||||
});
|
||||
test("CodeAreaModalComponent", async ({ page }) => {
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
// await page.waitForTimeout(2000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("CodeAreaModalComponent", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(3000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(3000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test.describe("drag and drop test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("drop collection", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(4000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(4000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("dropDownComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
@ -195,4 +200,66 @@ test("dropDownComponent", async ({ page }) => {
|
|||
if (value !== "ai21.j2-ultra-v1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.getByTestId("code-button-modal").click();
|
||||
await page
|
||||
.locator("#CodeEditor div")
|
||||
.filter({ hasText: "from typing import" })
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.locator("textarea").press("Control+a");
|
||||
const emptyOptionsCode = `from typing import Optional
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain_community.llms.bedrock import Bedrock
|
||||
|
||||
from langflow.interface.custom.custom_component import CustomComponent
|
||||
|
||||
|
||||
class AmazonBedrockComponent(CustomComponent):
|
||||
display_name: str = "Amazon Bedrock"
|
||||
description: str = "LLM model from Amazon Bedrock."
|
||||
icon = "Amazon"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
"model_id": {
|
||||
"display_name": "Model Id",
|
||||
"options": [],
|
||||
},
|
||||
"credentials_profile_name": {"display_name": "Credentials Profile Name"},
|
||||
"streaming": {"display_name": "Streaming", "field_type": "bool"},
|
||||
"endpoint_url": {"display_name": "Endpoint URL"},
|
||||
"region_name": {"display_name": "Region Name"},
|
||||
"model_kwargs": {"display_name": "Model Kwargs"},
|
||||
"cache": {"display_name": "Cache"},
|
||||
"code": {"advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
self,
|
||||
model_id: str = "anthropic.claude-instant-v1",
|
||||
credentials_profile_name: Optional[str] = None,
|
||||
region_name: Optional[str] = None,
|
||||
model_kwargs: Optional[dict] = None,
|
||||
endpoint_url: Optional[str] = None,
|
||||
streaming: bool = False,
|
||||
cache: Optional[bool] = None,
|
||||
) -> BaseLLM:
|
||||
try:
|
||||
output = Bedrock(
|
||||
credentials_profile_name=credentials_profile_name,
|
||||
model_id=model_id,
|
||||
region_name=region_name,
|
||||
model_kwargs=model_kwargs,
|
||||
endpoint_url=endpoint_url,
|
||||
streaming=streaming,
|
||||
cache=cache,
|
||||
) # type: ignore
|
||||
except Exception as e:
|
||||
raise ValueError("Could not connect to AmazonBedrock API.") from e
|
||||
return output
|
||||
|
||||
`;
|
||||
await page.locator("textarea").fill(emptyOptionsCode);
|
||||
await page.getByRole("button", { name: "Check & Save" }).click();
|
||||
await page.getByText("No parameters are available for display.").isVisible();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(5000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(5000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("FloatComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,23 @@
|
|||
import { Page, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(6000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(6000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
|
||||
test.describe("Flow Page tests", () => {
|
||||
async function goToFlowPage(page: Page) {
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.getByRole("button", { name: "New Project" }).click();
|
||||
}
|
||||
|
||||
test("save", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(7000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(7000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test.describe("group node test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("group and ungroup updating values", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(8000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(8000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("InputComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
@ -120,7 +125,7 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.getByTestId("input-collection_name-edit").click();
|
||||
await page
|
||||
.getByTestId("input-collection_name-edit")
|
||||
.fill("NEW_collection_name_test_123123123!@#$&*(&%$@");
|
||||
.fill("NEW_collection_name_test_123123123!@#$&*(&%$@ÇÇÇÀõe");
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
|
|
@ -143,7 +148,7 @@ test("InputComponent", async ({ page }) => {
|
|||
|
||||
let value = await page.getByTestId("input-collection_name").inputValue();
|
||||
|
||||
if (value != "NEW_collection_name_test_123123123!@#$&*(&%$@") {
|
||||
if (value != "NEW_collection_name_test_123123123!@#$&*(&%$@ÇÇÇÀõe") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(9000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(9000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("IntComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(20000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(20000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("KeypairListComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(11000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(11000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("LangflowShortcuts", async ({ page }) => {
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
|
|
@ -13,7 +13,7 @@ test("LangflowShortcuts", async ({ page }) => {
|
|||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(12000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(12000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("NestedComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(13000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(13000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("PromptTemplateComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Page, expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(14000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(14000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test.describe("save component tests", () => {
|
||||
async function saveComponent(page: Page, pattern: RegExp, n: number) {
|
||||
|
|
@ -14,7 +14,7 @@ test.describe("save component tests", () => {
|
|||
|
||||
/// <reference lib="dom"/>
|
||||
test("save group component tests", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(15000);
|
||||
test.setTimeout(120000);
|
||||
// await page.waitForTimeout(15000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("ToggleComponent", async ({ page }) => {
|
||||
<<<<<<< HEAD
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(1000);
|
||||
=======
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
>>>>>>> zustand/io/migration
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
25
src/frontend/tests/globalTeardown.ts
Normal file
25
src/frontend/tests/globalTeardown.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// tests/globalTeardown.ts
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export default async () => {
|
||||
try {
|
||||
console.log("Removing the temp database");
|
||||
// Check if the file exists in the path
|
||||
// this file is in src/frontend/tests/globalTeardown.ts
|
||||
// temp is in src/frontend/temp
|
||||
const tempDbPath = path.join(__dirname, "..", "temp");
|
||||
console.log("tempDbPath", tempDbPath);
|
||||
// Remove the temp database
|
||||
fs.rmSync(tempDbPath);
|
||||
// Check if the file is removed
|
||||
if (!fs.existsSync(tempDbPath)) {
|
||||
console.log("Successfully removed the temp database");
|
||||
} else {
|
||||
console.error("Error while removing the temp database");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error while removing the temp database:", error);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue