add tests improvements

This commit is contained in:
cristhianzl 2024-06-27 14:39:00 -03:00 committed by Gabriel Luiz Freitas Almeida
commit 5d58e796d4
31 changed files with 818 additions and 517 deletions

View file

@ -15,7 +15,7 @@ dotenv.config({ path: path.resolve(__dirname, "../../.env") });
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: false,
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */

View file

@ -21,6 +21,7 @@ export default function HandleRenderComponent({
colors,
setFilterEdge,
showNode,
testIdComplement,
}: {
left: boolean;
nodes: any;
@ -33,7 +34,10 @@ export default function HandleRenderComponent({
colors: string[];
setFilterEdge: any;
showNode: any;
testIdComplement?: string;
}) {
console.log(myData);
return (
<Button
unstyled

View file

@ -248,6 +248,8 @@ export default function ParameterComponent({
}
}, [disabledOutput]);
console.log(data);
return !showNode ? (
left && LANGFLOW_SUPPORTED_TYPES.has(type ?? "") && !optionalHandle ? (
<></>
@ -264,6 +266,7 @@ export default function ParameterComponent({
colors={colors}
setFilterEdge={setFilterEdge}
showNode={showNode}
testIdComplement={`${data?.type?.toLowerCase()}-noshownode`}
/>
)
) : (
@ -390,6 +393,7 @@ export default function ParameterComponent({
colors={colors}
setFilterEdge={setFilterEdge}
showNode={showNode}
testIdComplement={`${data?.type?.toLowerCase()}-shownode`}
/>
)}

View file

@ -1,5 +1,4 @@
import { expect, test } from "@playwright/test";
import { readFileSync } from "fs";
test("chat_io_teste", async ({ page }) => {
await page.goto("/");
@ -22,10 +21,9 @@ test("chat_io_teste", async ({ page }) => {
modalCount = await page.getByTestId("modal-title")?.count();
}
const jsonContent = readFileSync(
"tests/end-to-end/assets/ChatTest.json",
"utf-8",
);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
@ -67,20 +65,37 @@ test("chat_io_teste", async ({ page }) => {
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
const elementsChatInput = await page
.locator('[data-testid="handle-chatinput-shownode-message-right"]')
.all();
let visibleElementHandle;
for (const element of elementsChatInput) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
// 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[9]/button/div[1]',
)
.hover();
await visibleElementHandle.hover();
await page.mouse.down();
// Move to the second element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[3]/div/button/div[1]',
)
.hover();
const elementsChatOutput = await page
.getByTestId("handle-chatoutput-shownode-text-left")
.all();
for (const element of elementsChatOutput) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover();
// Release the mouse
await page.mouse.up();

View file

@ -20,7 +20,9 @@ test("CodeAreaModalComponent", async ({ page }) => {
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();

View file

@ -19,7 +19,9 @@ test("dropDownComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {

View file

@ -20,8 +20,9 @@ test("should be able to upload a file", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,
@ -77,38 +78,70 @@ test("should be able to upload a file", async ({ page }) => {
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
let visibleElementHandle;
const elementsFile = await page
.getByTestId("handle-file-shownode-data-right")
.all();
for (const element of elementsFile) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
// Click and hold on the first element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div[1]',
)
.hover();
await visibleElementHandle.hover();
await page.mouse.down();
// Move to the second element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]/div/div[2]/div[4]/div/button/div[1]',
)
.hover();
const parseDataElement = await page
.getByTestId("handle-parsedata-shownode-data-left")
.all();
for (const element of parseDataElement) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover();
// Release the mouse
await page.mouse.up();
// Click and hold on the first element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]/div/div[2]/div[7]/button/div[1]',
)
.hover();
const parseDataOutputElement = await page
.getByTestId("handle-parsedata-shownode-text-right")
.all();
for (const element of parseDataOutputElement) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover();
await page.mouse.down();
// Move to the second element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
)
.hover();
const textOutputElement = await page
.getByTestId("handle-textoutput-shownode-text-left")
.all();
for (const element of textOutputElement) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover();
// Release the mouse
await page.mouse.up();

View file

@ -0,0 +1,175 @@
import { expect, test } from "@playwright/test";
test("LLMChain - Tooltip", async ({ page }) => {
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.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 30000,
});
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();
const llmChainOutputElements = await page
.getByTestId("handle-llmchain-shownode-text-right")
.all();
let visibleElementHandle;
for (const element of llmChainOutputElements) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover().then(async () => {
await expect(
page.getByTestId("available-output-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-textsplitters").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-retrievers").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-prototypes").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-tools").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-memories").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-toolkits").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-agents").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-helpers").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-langchain_utilities").first(),
).toBeVisible();
await page.getByTestId("icon-X").click();
await page.waitForTimeout(500);
});
await page.getByTitle("fit view").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
const llmChainInputElements1 = await page
.getByTestId("handle-llmchain-shownode-llm-left")
.all();
for (const element of llmChainInputElements1) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover().then(async () => {
await expect(
page.getByTestId("available-input-models").first(),
).toBeVisible();
await page.waitForTimeout(2000);
await page.getByTestId("icon-Search").click();
await page.waitForTimeout(500);
});
await page.getByTitle("fit view").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
const llmChainInputElements0 = await page
.getByTestId("handle-llmchain-shownode-template-left")
.all();
for (const element of llmChainInputElements0) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover().then(async () => {
await page.waitForTimeout(2000);
await expect(
page.getByTestId("available-input-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-prototypes").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-agents").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-helpers").first(),
).toBeVisible();
await page.waitForTimeout(500);
});
await page.getByTitle("fit view").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
const llmChainInputElements2 = await page
.getByTestId("handle-llmchain-shownode-memory-left")
.all();
for (const element of llmChainInputElements2) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.hover().then(async () => {
await expect(
page.getByTestId("empty-tooltip-filter").first(),
).toBeVisible();
});
});

View file

@ -0,0 +1,148 @@
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(
"input-list-plus-btn-edit_metadata_indexing_include-2",
);
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 30000,
});
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);
let visibleElementHandle;
const llmChainOutputElements = await page
.getByTestId("handle-llmchain-shownode-text-right")
.all();
for (const element of llmChainOutputElements) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.click({
force: true,
});
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-utilities")).toBeVisible();
await expect(page.getByTestId("disclosure-memories")).toBeVisible();
await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();
await expect(page.getByTestId("disclosure-retrievers")).toBeVisible();
await expect(page.getByTestId("disclosure-text splitters")).toBeVisible();
await expect(page.getByTestId("disclosure-toolkits")).toBeVisible();
await expect(page.getByTestId("disclosure-tools")).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();
const llmChainInputElements1 = await page
.getByTestId("handle-llmchain-shownode-llm-left")
.all();
for (const element of llmChainInputElements1) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.blur();
await visibleElementHandle.click({
force: true,
});
await expect(page.getByTestId("disclosure-models")).toBeVisible();
const llmChainInputElements0 = await page
.getByTestId("handle-llmchain-shownode-template-left")
.all();
for (const element of llmChainInputElements0) {
if (await element.isVisible()) {
visibleElementHandle = element;
break;
}
}
await visibleElementHandle.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();
});

View file

@ -19,8 +19,9 @@ test("FloatComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -19,8 +19,9 @@ test("flowSettings", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);

View file

@ -19,8 +19,9 @@ test("GlobalVariables", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -1,159 +0,0 @@
import { expect, test } from "@playwright/test";
test("LLMChain - Tooltip", async ({ page }) => {
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.getByTestId("blank-flow").click();
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.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[1]/div/div[2]/div/div/div[2]/div[7]/button/div[1]',
)
.hover()
.then(async () => {
await expect(
page.getByTestId("available-output-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-textsplitters").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-retrievers").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-prototypes").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-tools").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-memories").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-toolkits").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-agents").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-helpers").first(),
).toBeVisible();
await expect(
page.getByTestId("available-output-langchain_utilities").first(),
).toBeVisible();
await page.getByTestId("icon-X").click();
await page.waitForTimeout(500);
});
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[1]/div/div[2]/div/div/div[2]/div[4]/div/button/div[1]',
)
.hover()
.then(async () => {
await expect(
page.getByTestId("available-input-models").first(),
).toBeVisible();
await page.waitForTimeout(2000);
await page.getByTestId("icon-Search").click();
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();
await page.getByTitle("zoom out").click();
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div[1]',
)
.hover()
.then(async () => {
await page.waitForTimeout(2000);
await expect(
page.getByTestId("available-input-chains").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-prototypes").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-agents").first(),
).toBeVisible();
await expect(
page.getByTestId("available-input-helpers").first(),
).toBeVisible();
await page.waitForTimeout(500);
});
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[1]/div/div[2]/div/div/div[2]/div[5]/div/button/div[1]',
)
.hover()
.then(async () => {
await expect(
page.getByTestId("empty-tooltip-filter").first(),
).toBeVisible();
});
});

View file

@ -19,8 +19,9 @@ test("InputComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -19,8 +19,9 @@ test("IntComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -19,10 +19,13 @@ test("KeypairListComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(3000);
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 30000,
});
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("amazon bedrock");

View file

@ -67,11 +67,9 @@ test("LangflowShortcuts", async ({ page }) => {
expect(false).toBeTruthy();
}
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]',
)
.click();
const ollamaTitleElement = await page.getByTestId("title-Ollama").last();
await ollamaTitleElement.click();
await page.keyboard.press("Backspace");
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
@ -90,11 +88,7 @@ test("LangflowShortcuts", async ({ page }) => {
expect(false).toBeTruthy();
}
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]',
)
.click();
await ollamaTitleElement.click();
await page.keyboard.press("Backspace");
await page.getByTestId("title-Ollama").click();

View file

@ -19,7 +19,9 @@ test("NestedComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -19,7 +19,9 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 100000,

View file

@ -20,7 +20,9 @@ test.describe("save component tests", () => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);

View file

@ -0,0 +1,19 @@
import { test } from "@playwright/test";
test("should exists Store", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").isVisible();
await page.getByTestId("button-store").isEnabled();
});
test("should not have an API key", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isVisible();
});

View file

@ -0,0 +1,119 @@
import { expect, test } from "@playwright/test";
test("should add API-KEY", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("testtesttesttesttesttest");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
});
test("should like and add components and flows", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
await page.waitForTimeout(2000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(5000);
const likedValue = await page
.getByTestId("likes-Website Content QA")
.innerText();
await page.getByTestId("like-Website Content QA").click();
await page.waitForTimeout(5000);
const likedValueAfter = await page
.getByTestId("likes-Website Content QA")
.innerText();
if (Number(likedValue) === Number(likedValueAfter)) {
expect(false).toBe(true);
}
const downloadValue = await page
.getByTestId("downloads-Website Content QA")
.innerText();
await page.getByTestId("install-Website Content QA").click();
await page.waitForTimeout(2000);
await page.getByText("Flow Installed Successfully").isVisible();
await page.waitForTimeout(5000);
const downloadValueAfter = await page
.getByTestId("downloads-Website Content QA")
.innerText();
if (Number(downloadValue) === Number(downloadValueAfter)) {
expect(false).toBe(true);
}
await page.getByTestId("install-Basic RAG").click();
await page.waitForTimeout(2000);
await page.getByText("Component Installed Successfully").isVisible();
await page.waitForTimeout(5000);
await page.getByText("My Collection").click();
await page.getByText("Website Content QA").first().isVisible();
await page.getByText("Components").first().click();
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();
});

View file

@ -0,0 +1,122 @@
import { expect, test } from "@playwright/test";
test("should add API-KEY", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("testtesttesttesttesttest");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
});
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);
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);
const randomName = Math.random().toString(36).substring(2);
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForTimeout(1000);
const flowName = await page.getByTestId("flow_name").innerText();
await page.getByTestId("flow_name").click();
await page.getByText("Settings").click();
const flowDescription = await page
.getByPlaceholder("Flow description")
.inputValue();
await page.getByPlaceholder("Flow name").fill(randomName);
await page.getByText("Save").last().click();
await page.getByText("Close").last().click();
await page.waitForSelector('[data-testid="shared-button-flow"]', {
timeout: 100000,
});
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();
await page
.getByText(
"Attention: API keys in specified fields are automatically removed upon sharing.",
)
.isVisible();
await page.getByText("Export").first().isVisible();
await page.getByText("Share Flow").first().isVisible();
await page.waitForTimeout(5000);
await page.getByText("Agent").first().isVisible();
await page.getByText("Memory").first().isVisible();
await page.getByText("Chain").first().isVisible();
await page.getByText("Vector Store").first().isVisible();
await page.getByText("Prompt").last().isVisible();
await page.getByTestId("public-checkbox").isChecked();
await page.getByText(flowName).last().isVisible();
await page.getByText(flowDescription).last().isVisible();
await page.waitForTimeout(1000);
await page.getByText("Flow shared successfully").last().isVisible();
});

View file

@ -0,0 +1,88 @@
import { expect, test } from "@playwright/test";
test("should add API-KEY", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("testtesttesttesttesttest");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
});
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);
}
});

View file

@ -1,287 +0,0 @@
import { expect, test } from "@playwright/test";
test("should exists Store", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").isVisible();
await page.getByTestId("button-store").isEnabled();
});
test("should not have an API key", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isVisible();
});
test("should add API-KEY", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("testtesttesttesttesttest");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
});
test("should like and add components and flows", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill(process.env.STORE_API_KEY ?? "");
await page.getByTestId("api-key-save-button-store").click();
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").isHidden();
await page.waitForTimeout(2000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(5000);
const likedValue = await page
.getByTestId("likes-Website Content QA")
.innerText();
await page.getByTestId("like-Website Content QA").click();
await page.waitForTimeout(5000);
const likedValueAfter = await page
.getByTestId("likes-Website Content QA")
.innerText();
if (Number(likedValue) === Number(likedValueAfter)) {
expect(false).toBe(true);
}
const downloadValue = await page
.getByTestId("downloads-Website Content QA")
.innerText();
await page.getByTestId("install-Website Content QA").click();
await page.waitForTimeout(2000);
await page.getByText("Flow Installed Successfully").isVisible();
await page.waitForTimeout(5000);
const downloadValueAfter = await page
.getByTestId("downloads-Website Content QA")
.innerText();
if (Number(downloadValue) === Number(downloadValueAfter)) {
expect(false).toBe(true);
}
await page.getByTestId("install-Basic RAG").click();
await page.waitForTimeout(2000);
await page.getByText("Component Installed Successfully").isVisible();
await page.waitForTimeout(5000);
await page.getByText("My Collection").click();
await page.getByText("Website Content QA").first().isVisible();
await page.getByText("Components").first().click();
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);
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);
const randomName = Math.random().toString(36).substring(2);
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForTimeout(1000);
const flowName = await page.getByTestId("flow_name").innerText();
await page.getByTestId("flow_name").click();
await page.getByText("Settings").click();
const flowDescription = await page
.getByPlaceholder("Flow description")
.inputValue();
await page.getByPlaceholder("Flow name").fill(randomName);
await page.getByText("Save").last().click();
await page.getByText("Close").last().click();
await page.waitForSelector('[data-testid="shared-button-flow"]', {
timeout: 100000,
});
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();
await page
.getByText(
"Attention: API keys in specified fields are automatically removed upon sharing.",
)
.isVisible();
await page.getByText("Export").first().isVisible();
await page.getByText("Share Flow").first().isVisible();
await page.waitForTimeout(5000);
await page.getByText("Agent").first().isVisible();
await page.getByText("Memory").first().isVisible();
await page.getByText("Chain").first().isVisible();
await page.getByText("Vector Store").first().isVisible();
await page.getByText("Prompt").last().isVisible();
await page.getByTestId("public-checkbox").isChecked();
await page.getByText(flowName).last().isVisible();
await page.getByText(flowDescription).last().isVisible();
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);
}
});

View file

@ -19,7 +19,9 @@ test("TextAreaModalComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {

View file

@ -26,8 +26,9 @@ test("TextInputOutputComponent", async ({ page }) => {
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {
timeout: 30000,

View file

@ -19,7 +19,9 @@ test("ToggleComponent", async ({ page }) => {
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {

View file

@ -79,7 +79,10 @@ test("check if tweaks are updating when someothing on the flow changes", async (
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="extended-disclosure"]', {