Skip to content

Commit

Permalink
✨ (Travel Planning Agent.spec.ts): Update end-to-end test for Travel …
Browse files Browse the repository at this point in the history
…Planning Agent to include new interactions and connections for improved test coverage and functionality.
  • Loading branch information
Cristhianzl committed Aug 29, 2024
1 parent a3f8cec commit b3886aa
Showing 1 changed file with 60 additions and 10 deletions.
70 changes: 60 additions & 10 deletions src/frontend/tests/end-to-end/Travel Planning Agent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ test("Travel Planning Agent", async ({ page }) => {
"OPENAI_API_KEY required to run this test",
);

test.skip(
!process?.env?.SEARCH_API_KEY,
"SEARCH_API_KEY required to run this test",
);

if (!process.env.CI) {
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
}
Expand Down Expand Up @@ -61,6 +56,66 @@ test("Travel Planning Agent", async ({ page }) => {
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
}

await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("yahoo finance");
await page.waitForTimeout(1000);

await page.getByText("SearchAPI").last().click();
await page.waitForTimeout(1000);
await page.keyboard.press("Backspace");

await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();
await page
.locator('//*[@id="react-flow-id"]')
.hover()
.then(async () => {
await page.mouse.down();
await page.mouse.move(-100, 100);
});

await page.mouse.up();

await page
.getByTestId("toolsYahoo Finance News Tool")
.dragTo(page.locator('//*[@id="react-flow-id"]'));

await page.getByTitle("fit view").click();

await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();

//connection 1
const yahooElementOutput = await page
.getByTestId("handle-yfinancetool-shownode-tool-right")
.nth(0);
await yahooElementOutput.hover();
await page.mouse.down();
const agentOne = await page
.getByTestId("handle-toolcallingagent-shownode-tools-left")
.nth(0);
await agentOne.hover();
await page.mouse.up();

//connection 2
await yahooElementOutput.hover();
await page.mouse.down();
const agentTwo = await page
.getByTestId("handle-toolcallingagent-shownode-tools-left")
.nth(1);
await agentTwo.hover();
await page.mouse.up();

//connection 3
await yahooElementOutput.hover();
await page.mouse.down();
const agentThree = await page
.getByTestId("handle-toolcallingagent-shownode-tools-left")
.nth(2);
await agentThree.hover();
await page.mouse.up();

await page
.getByTestId("popover-anchor-input-api_key")
.first()
Expand All @@ -71,11 +126,6 @@ test("Travel Planning Agent", async ({ page }) => {

await page.waitForTimeout(1000);

await page
.getByTestId("popover-anchor-input-api_key")
.last()
.fill(process.env.BRAVE_SEARCH_API_KEY ?? "");

await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 60000 * 3 });

Expand Down

0 comments on commit b3886aa

Please sign in to comment.