Fix flake in e2e chatbot test (#8946)

* Fix flake

* Fix flakes

* Fix test'
This commit is contained in:
Freddy Boulton 2024-07-31 10:59:44 -04:00 committed by GitHub
parent 00dcd1084c
commit a544a66008
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -236,8 +236,11 @@ for (const msg_format of ["tuples", "messages"]) {
await page.getByTestId("textbox").click();
await page.getByTestId("textbox").fill("hello");
await page.keyboard.press("Enter");
await page.getByLabel("like", { exact: true }).click();
await page.getByLabel("dislike", { exact: true }).click();
await expect(
page.getByTestId("bot").first().getByRole("paragraph")
).toBeVisible();
await page.getByLabel("like", { exact: true }).first().click();
await page.getByLabel("dislike", { exact: true }).first().click();
expect(await page.getByLabel("clicked dislike").count()).toEqual(1);
expect(await page.getByLabel("clicked like").count()).toEqual(0);
@ -257,10 +260,7 @@ for (const msg_format of ["tuples", "messages"]) {
"./test/files/cheetah1.jpg",
"./test/files/cheetah1.jpg"
]);
expect
.poll(async () => await page.locator("thumbnail-image").count(), {
timeout: 5000
})
.toEqual(2);
await expect(page.locator(".thumbnail-image")).toHaveCount(2);
});
}