Unverified 提交 a44a9783 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

New chat e2e (#314)

上级 1dde72e7
chat1
<dyad-chat-summary>Chat 1</dyad-chat-summary>
chat2
<dyad-chat-summary>Chat 2</dyad-chat-summary>
...@@ -163,6 +163,14 @@ class PageObject { ...@@ -163,6 +163,14 @@ class PageObject {
return this.page.getByRole("textbox", { name: "Ask Dyad to build..." }); return this.page.getByRole("textbox", { name: "Ask Dyad to build..." });
} }
clickNewChat({ index = 0 }: { index?: number } = {}) {
// There is two new chat buttons...
return this.page
.getByRole("button", { name: "New Chat" })
.nth(index)
.click();
}
async sendPrompt(prompt: string) { async sendPrompt(prompt: string) {
await this.getChatInput().click(); await this.getChatInput().click();
await this.getChatInput().fill(prompt); await this.getChatInput().fill(prompt);
......
import { test } from "./helpers/test_helper";
const newChatTestCases = [
{ name: "first button", clickOptions: undefined },
{ name: "second button", clickOptions: { index: 1 } },
];
newChatTestCases.forEach(({ name, clickOptions }) => {
test(`new chat (${name})`, async ({ po }) => {
await po.setUp();
await po.sendPrompt("tc=chat1");
await po.snapshotMessages();
await po.clickNewChat(clickOptions);
// Make sure it's empty
await po.snapshotMessages();
await po.sendPrompt("tc=chat2");
await po.snapshotMessages();
});
});
- paragraph: tc=chat1
- paragraph: chat1
- button "Retry":
- img
\ No newline at end of file
- text: No messages yet
\ No newline at end of file
- paragraph: tc=chat2
- paragraph: chat2
- button "Retry":
- img
\ No newline at end of file
- paragraph: tc=chat1
- paragraph: chat1
- button "Retry":
- img
\ No newline at end of file
- text: No messages yet
\ No newline at end of file
- paragraph: tc=chat2
- paragraph: chat2
- button "Retry":
- img
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论