feat: add artifact tests (#859)
This commit is contained in:
parent
9628c54755
commit
8e561dced4
13 changed files with 669 additions and 255 deletions
|
|
@ -27,18 +27,25 @@ export class ChatPage {
|
|||
}
|
||||
|
||||
async sendUserMessage(message: string) {
|
||||
await this.page.getByTestId('multimodal-input').click();
|
||||
await this.page.getByTestId('multimodal-input').fill(message);
|
||||
await this.page.getByTestId('send-button').click();
|
||||
await this.page.getByTestId('message-user').isVisible();
|
||||
expect(await this.page.getByTestId('message-user').innerText()).toContain(
|
||||
message,
|
||||
);
|
||||
await this.multimodalInput.click();
|
||||
await this.multimodalInput.fill(message);
|
||||
await this.sendButton.click();
|
||||
}
|
||||
|
||||
async isGenerationComplete() {
|
||||
await expect(this.page.getByTestId('send-button')).toBeVisible();
|
||||
await this.page.waitForTimeout(2000);
|
||||
const response = await this.page.waitForResponse((response) =>
|
||||
response.url().includes('/api/chat'),
|
||||
);
|
||||
|
||||
await response.finished();
|
||||
}
|
||||
|
||||
async isVoteComplete() {
|
||||
const response = await this.page.waitForResponse((response) =>
|
||||
response.url().includes('/api/vote'),
|
||||
);
|
||||
|
||||
await response.finished();
|
||||
}
|
||||
|
||||
async hasChatIdInUrl() {
|
||||
|
|
@ -123,21 +130,21 @@ export class ChatPage {
|
|||
)
|
||||
.catch(() => null);
|
||||
|
||||
const page = this.page;
|
||||
|
||||
return {
|
||||
element: lastMessageElement,
|
||||
content,
|
||||
reasoning: reasoningElement,
|
||||
async waitForGenerationComplete() {
|
||||
await expect(page.getByTestId('send-button')).toBeVisible();
|
||||
await page.waitForTimeout(2000);
|
||||
},
|
||||
async toggleReasoningVisibility() {
|
||||
await lastMessageElement
|
||||
.getByTestId('message-reasoning-toggle')
|
||||
.click();
|
||||
},
|
||||
async upvote() {
|
||||
await lastMessageElement.getByTestId('message-upvote').click();
|
||||
},
|
||||
async downvote() {
|
||||
await lastMessageElement.getByTestId('message-downvote').click();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue