💡 (index.tsx): remove trailing commas for cleaner code formatting
✅ (tests): remove unnecessary keyboard press and fix formatting in chatInputOutputUser.spec.ts ✅ (tests): update selector for copy button in curl_api_generation.spec.ts ✅ (tests): fix formatting in intComponent.spec.ts ✅ (tests): update end-to-end tests for improved stability and clarity - Remove redundant "Close" button clicks in logs and textInputOutput tests - Add "more-options-modal" click in promptModalComponent and saveComponents tests - Replace role-based selectors with test ID selectors for "Copy Code" button - Update API key section text in userSettings test for consistency
This commit is contained in:
parent
aa94e42e0d
commit
742f93e229
12 changed files with 87 additions and 91 deletions
|
|
@ -52,13 +52,11 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
expect(valueUser).toBe("User");
|
||||
expect(valueAI).toBe("AI");
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
await page
|
||||
.getByTestId("textarea-input_value")
|
||||
.nth(1)
|
||||
.fill(
|
||||
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
|
||||
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!"
|
||||
);
|
||||
await page.getByTestId("icon-LucideSend").click();
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
|
|
@ -89,9 +87,9 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
|
|||
await page
|
||||
.getByText(
|
||||
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
|
||||
{ exact: true },
|
||||
{ exact: true }
|
||||
)
|
||||
.isVisible(),
|
||||
.isVisible()
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -195,17 +193,13 @@ test("user must be able to send an image on chat", async ({ page }) => {
|
|||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
await page.getByTestId("toggle-edit-return_record").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-edit-return_record").isChecked(),
|
||||
).toBeTruthy();
|
||||
await page.getByText("Save Changes").click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).click();
|
||||
|
||||
const jsonContent = readFileSync(
|
||||
"src/frontend/tests/end-to-end/assets/chain.png",
|
||||
"utf-8",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Create the DataTransfer and File
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ test("curl_api_generation", async ({ page, context }) => {
|
|||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
await page.getByTestId("icon-Copy").last().click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
|
|
|
|||
|
|
@ -87,77 +87,77 @@ test("IntComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
|
||||
).toBeFalsy();
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked(),
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
|
||||
).toBeTruthy();
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked(),
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked(),
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
|
||||
).toBeFalsy();
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked(),
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.getByText("Save Changes", { exact: true }).click();
|
||||
|
|
@ -172,7 +172,7 @@ test("IntComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="showtimeout"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtimeout"]').isChecked(),
|
||||
await page.locator('//*[@id="showtimeout"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
const valueEditNode = await page
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ test("should able to see and interact with logs", async ({ page }) => {
|
|||
await page.getByText("No Data Available", { exact: true }).isVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-openai_api_key")
|
||||
.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByTestId("save-button-modal").click();
|
||||
|
||||
const replace = await page.getByTestId("replace-button").isVisible();
|
||||
|
|
@ -138,7 +140,7 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="showtemplate"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemplate"]').isChecked(),
|
||||
await page.locator('//*[@id="showtemplate"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showprompt"]').click();
|
||||
|
|
@ -158,7 +160,7 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="showtemplate"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemplate"]').isChecked(),
|
||||
await page.locator('//*[@id="showtemplate"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showprompt"]').click();
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ test("python_api_generation", async ({ page, context }) => {
|
|||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ test.describe("save component tests", () => {
|
|||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
"src/frontend/tests/end-to-end/assets/flow_group_test.json",
|
||||
"utf-8",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Create the DataTransfer and File
|
||||
|
|
@ -49,7 +49,7 @@ test.describe("save component tests", () => {
|
|||
"drop",
|
||||
{
|
||||
dataTransfer,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const genericNoda = page.getByTestId("div-generic-node");
|
||||
|
|
@ -84,6 +84,8 @@ test.describe("save component tests", () => {
|
|||
}
|
||||
|
||||
await page.getByTestId("title-Group").click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByTestId("icon-SaveAll").click();
|
||||
|
||||
const replaceButton = await page.getByTestId("replace-button").isVisible();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
// 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/div',
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div/div'
|
||||
)
|
||||
.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -68,7 +68,7 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
// 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[9]/div/button/div/div',
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[9]/div/button/div/div'
|
||||
)
|
||||
.hover();
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
// Click and hold on the first element
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[13]/button/div/div',
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[13]/button/div/div'
|
||||
)
|
||||
.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -100,7 +100,7 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
// 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[3]/div/button/div/div',
|
||||
'//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div/div'
|
||||
)
|
||||
.hover();
|
||||
|
||||
|
|
@ -137,8 +137,6 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
await page.getByText("Close", { exact: true }).last().click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-input_value")
|
||||
.nth(0)
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ test("curl_api_generation", async ({ page, context }) => {
|
|||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
const oldValue = clipboardContent;
|
||||
|
|
@ -48,9 +48,9 @@ test("curl_api_generation", async ({ page, context }) => {
|
|||
.first()
|
||||
.fill("teste");
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle2 = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent2 = await handle2.jsonValue();
|
||||
const newValue = clipboardContent2;
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ test("should interact with API Keys", async ({ page }) => {
|
|||
await page.waitForTimeout(2000);
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.getByText("Settings").click();
|
||||
await page.getByText("API Keys").click();
|
||||
await page.getByText("API Keys", { exact: true }).nth(1).isVisible();
|
||||
await page.getByText("Langflow API").click();
|
||||
await page.getByText("Langflow API", { exact: true }).nth(1).isVisible();
|
||||
await page.getByText("Add New").click();
|
||||
await page.getByPlaceholder("Insert a name for your API Key").isVisible();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue