(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)

View file

@ -46,6 +46,10 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
await 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.getByText("Playground", { exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
@ -162,6 +166,9 @@ test("user must be able to see output inspection", 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").last().click();
await page.waitForTimeout(5000);
@ -221,6 +228,9 @@ test("user must be able to send an image on chat", 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.getByText("Chat Input", { exact: true }).click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();

View file

@ -83,6 +83,10 @@ test("erase button should clear the chat messages", async ({ page }) => {
await 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.getByText("Playground", { exact: true }).click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {

View file

@ -33,6 +33,10 @@ test("should able to see and interact with logs", async ({ page }) => {
await 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").first().click();
await page.waitForTimeout(2000);

View file

@ -164,6 +164,10 @@ test("TextInputOutputComponent", async ({ page }) => {
await 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.getByText("Playground", { exact: true }).click();
await page.getByText("Run Flow", { exact: true }).click();