refactor: Improve Reactflow wrapping around toolbars, canvas controls, etc (#8130)

* update the wrapping of the reactflow

* [autofix.ci] apply automated fixes

* test button fix

* [autofix.ci] apply automated fixes

* selector fix

* fix slash

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mike Fortman 2025-05-21 13:46:46 -05:00 • committed by GitHub
commit 3889d5ff3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 101 additions and 106 deletions

View file

@ -33,8 +33,7 @@ test(
await page.getByText("Chat Input", { exact: true }).click();
await page.getByTestId("edit-button-modal").last().click();
await page.getByText("Close").last().click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
// Read the image file as a binary string
const filePath = "tests/assets/chain.png";

View file

@ -71,7 +71,7 @@ test(
await page.getByTestId("handle-textoutput-shownode-message-right").click();
await page.getByTestId("handle-chatoutput-noshownode-text-target").click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,
});

View file

@ -35,7 +35,7 @@ test.describe("save component tests", () => {
// Now dispatch
await page.dispatchEvent(
"//*[@id='react-flow-id']/div[1]/div[1]/div",
"//*[@data-testid='rf__wrapper']/div[1]/div",
"drop",
{
dataTransfer,
@ -48,9 +48,8 @@ test.describe("save component tests", () => {
expect(true).toBeTruthy();
}
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[3]')
.click();
// Log button element
await page.getByTestId("fit_view").click();
await zoomOut(page, 2);

View file

@ -32,7 +32,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -50,7 +50,7 @@ withEventDeliveryModes(
timeout: 30000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByPlaceholder(
"No chat input variables found. Click to run your flow.",

View file

@ -38,7 +38,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -42,7 +42,7 @@ test.skip(
await page.getByText("built successfully").last().click({
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForTimeout(1000);
expect(page.getByText("apple").last()).toBeVisible();
const textContents = await page

View file

@ -48,7 +48,7 @@ test.skip(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
expect(await page.locator(".markdown").count()).toBeGreaterThan(0);

View file

@ -39,7 +39,7 @@ withEventDeliveryModes(
await initialGPTsetup(page);
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,

View file

@ -50,7 +50,7 @@ test(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -44,7 +44,7 @@ test(
});
// Switch to Playground
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
// Wait for the playground to be ready
const inputPlaceholder = page

View file

@ -50,7 +50,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -31,7 +31,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })

View file

@ -39,7 +39,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -39,7 +39,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -39,7 +39,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -37,7 +37,7 @@ test.skip(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
expect(await page.locator(".markdown").count()).toBeGreaterThan(0);

View file

@ -50,7 +50,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("Add a Chat Input component to your flow to send messages.", {
exact: true,

View file

@ -71,7 +71,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector("text=default session", {
timeout: 30000,

View file

@ -41,7 +41,7 @@ withEventDeliveryModes(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page
.getByText("No input message provided.", { exact: true })
.last()

View file

@ -254,7 +254,7 @@ withEventDeliveryModes(
timeout: 30000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 60000,
});

View file

@ -350,7 +350,7 @@ test(
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();
await page.getByTestId("fit_view").click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,
});

View file

@ -144,7 +144,7 @@ test.skip(
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();
await page.waitForTimeout(1000);
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.getByTestId("button_run_text_output").click();
await page
.getByTestId(/^rf__node-TextOutput-[a-zA-Z0-9]+$/)
@ -167,7 +167,7 @@ test.skip(
.getByTestId(/^rf__node-TextInput-[a-zA-Z0-9]+$/)
.getByTestId("textarea_str_input_value")
.fill("This is a test, again just to be sure!");
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.getByText("Run Flow", { exact: true }).click();
await page.waitForTimeout(5000);
textInputContent = await page

View file

@ -105,7 +105,7 @@ AI:
await page.locator('//*[@id="react-flow-id"]').hover();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="button-send"]', {
timeout: 100000,

View file

@ -303,7 +303,7 @@ test(
.first()
.click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector("text=Run Flow", {
timeout: 30000,
@ -369,7 +369,9 @@ test(
timeout: 1000,
});
await page.getByTestId(`remove-file-button-${renamedTxtFile}`).click();
await page.getByText("Playground", { exact: true }).last().click();
await page
.getByRole("button", { name: "Playground", exact: true })
.click();
await page.getByTestId("icon-MoreHorizontal").last().click();
await page.getByText("Delete", { exact: true }).last().click();

View file

@ -26,7 +26,7 @@ test(
await page.mouse.up();
await page.mouse.down();
await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click();
await page.getByTestId("fit_view").click();
await adjustScreenView(page);
await page.getByTestId("generic-node-title-arrangement").click();

View file

@ -44,7 +44,7 @@ test(
await page.getByTestId("edit-button-modal").last().click();
await page.getByText("Close").last().click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
// Read the image file as a binary string
const filePath = "tests/assets/chain.png";

View file

@ -109,7 +109,7 @@ class CustomComponent(Component):
await page.getByTestId("button_run_chat output").click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="button-stop"]', {
timeout: 30000,

View file

@ -24,7 +24,7 @@ test(
await initialGPTsetup(page);
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,
@ -56,7 +56,7 @@ test(
.fill(
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
);
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="button-send"]', {
timeout: 100000,
@ -83,7 +83,7 @@ test(
.nth(0)
.fill("TestSenderNameAI");
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="button-send"]', {
timeout: 100000,

View file

@ -41,7 +41,7 @@ test(
timeout: 15000,
});
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="button-send"]', {
timeout: 100000,

View file

@ -81,7 +81,7 @@ test(
.click();
await page.getByTestId("fit_view").click();
await page.getByText("Playground", { exact: true }).last().click();
await page.getByRole("button", { name: "Playground", exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,
});