✅ (tests): add model selection step in end-to-end tests

Add steps to select "gpt-4o" model in various end-to-end tests to ensure
consistency and accuracy in test execution.
This commit is contained in:
cristhianzl 2024-06-26 16:11:37 -03:00 • committed by Gabriel Luiz Freitas Almeida
commit 6a93147067
5 changed files with 34 additions and 0 deletions

View file

@ -41,6 +41,9 @@ test("Basic Prompting (Hello, World)", async ({ page }) => {
.getByTestId("popover-anchor-input-openai_api_key")
.fill(process.env.OPENAI_API_KEY ?? "");
await page.getByTestId("dropdown-model_name").click();
await page.getByText("gpt-4o", { exact: true }).click();
await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });
@ -121,6 +124,9 @@ test("Memory Chatbot", async ({ page }) => {
.getByTestId("popover-anchor-input-openai_api_key")
.fill(process.env.OPENAI_API_KEY ?? "");
await page.getByTestId("dropdown-model_name").click();
await page.getByText("gpt-4o", { exact: true }).click();
await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });
@ -211,6 +217,9 @@ test("Document QA", async ({ page }) => {
.getByTestId("popover-anchor-input-openai_api_key")
.fill(process.env.OPENAI_API_KEY ?? "");
await page.getByTestId("dropdown-model_name").click();
await page.getByText("gpt-4o", { exact: true }).click();
const fileChooserPromise = page.waitForEvent("filechooser");
await page.getByTestId("icon-FileSearch2").click();
const fileChooser = await fileChooserPromise;
@ -301,6 +310,9 @@ test("Blog Writer", async ({ page }) => {
.getByTestId("popover-anchor-input-openai_api_key")
.fill(process.env.OPENAI_API_KEY ?? "");
await page.getByTestId("dropdown-model_name").click();
await page.getByText("gpt-4o", { exact: true }).click();
await page
.getByTestId("input-list-input_urls-0")
.nth(0)