gradio/js/app/test/chatbot_with_tools.spec.ts
Freddy Boulton 4221290d84
Support Message API for chatbot and chatinterface (#8422)
* first commit

* Add code

* Tests + code

* lint

* Add code

* notebook

* add changeset

* type

* Add client test

* type

* Add code

* Chatbot type

* Add code

* test chatbot

* fix e2e test

* js tests

* Consolidate Error and Tool message. Allow Messages in postprocess

* Rename to messages

* fix tests

* notebook clean

* More tests and messages

* add changeset

* notebook

* client test

* Fix issues

* Chatbot docs

* add changeset

* Add image

* Add img tag

* Address comments

* Add code

* Revert chatinterface streaming change. Use title in metadata. Address pngwn comments

* Add code

* changelog highlight

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-10 11:08:06 +00:00

17 lines
542 B
TypeScript

import { test, expect } from "@gradio/tootils";
test("Chatbot can support agentic demos by displaying messages with metadata", async ({
page
}) => {
await page.getByRole("button", { name: "Get San Francisco Weather" }).click();
await expect(
await page.locator("button").filter({ hasText: "💥 Error" }).nth(1)
).toBeVisible();
await expect(
page.locator("span").filter({ hasText: "🛠️ Used tool" })
).toBeVisible();
await expect(
page.locator("button").filter({ hasText: "It's a sunny day in San" })
).toBeVisible();
});