agent-flow / src /frontend /tests /utils /get-all-response-message.ts
Tai Truong
fix readme
d202ada
raw
history blame contribute delete
525 Bytes
import { Page } from "playwright/test";
export const getAllResponseMessage = async (page: Page) => {
const numberOfResponseMessages = await page
.getByTestId("div-chat-message")
.count();
const textContents: string[] = [];
for (let i = 0; i < numberOfResponseMessages; i++) {
const textContent = await page
.getByTestId("div-chat-message")
.nth(i)
.textContent();
if (textContent) {
textContents.push(textContent);
}
}
return textContents.join(" ").toLowerCase();
};