From 2be300b158c250d892051358153fc50ee14150f1 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Tue, 5 Mar 2024 14:42:07 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.?= =?UTF-8?q?ts):=20remove=20unnecessary=20code=20that=20clicks=20and=20chec?= =?UTF-8?q?ks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompo?= =?UTF-8?q?nent.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20?= =?UTF-8?q?and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeArea?= =?UTF-8?q?ModalComponent.spec.ts):=20remove=20unnecessary=20code=20that?= =?UTF-8?q?=20clicks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20?= =?UTF-8?q?fix(codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20c?= =?UTF-8?q?ode=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20that=20clicks=20and=20checks?= =?UTF-8?q?=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaModalCompone?= =?UTF-8?q?nt.spec.ts):=20remove=20unnecessary=20code=20that=20clicks=20an?= =?UTF-8?q?d=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(codeAreaMo?= =?UTF-8?q?dalComponent.spec.ts):=20remove=20unnecessary=20code=20that=20c?= =?UTF-8?q?licks=20and=20checks=20showcode=20element=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?codeAreaModalComponent.spec.ts):=20remove=20unnecessary=20code?= =?UTF-8?q?=20that=20clicks=20and=20checks=20showcode=20element=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts):=20remove=20?= =?UTF-8?q?unnecessary=20code=20that=20clicks=20and=20checks=20showcode=20?= =?UTF-8?q?element=20=F0=9F=94=A7=20fix(codeAreaModalComponent.spec.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 fix(intComponent.spec.ts): fix test case for IntComponent to use correct input field and update assertions ✨ feat(intComponent.spec.ts): add additional test cases for IntComponent to cover more scenarios and improve test coverage --- .../end-to-end/codeAreaModalComponent.spec.ts | 31 ---- .../end-to-end/dropdownComponent.spec.ts | 124 +++++++++++++-- .../tests/end-to-end/flowPage.spec.ts | 2 +- .../tests/end-to-end/intComponent.spec.ts | 142 ++++++++++++++---- 4 files changed, 224 insertions(+), 75 deletions(-) diff --git a/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts b/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts index 1f0c2f4ac..5e509cb01 100644 --- a/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts +++ b/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts @@ -37,9 +37,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.getByTestId("more-options-modal").click(); await page.getByTestId("edit-button-modal").click(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); - await page.locator('//*[@id="showdescription"]').click(); expect( await page.locator('//*[@id="showdescription"]').isChecked() @@ -53,9 +50,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="showreturn_direct"]').isChecked() ).toBeFalsy(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); - await page.locator('//*[@id="showdescription"]').click(); expect( await page.locator('//*[@id="showdescription"]').isChecked() @@ -69,9 +63,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="showreturn_direct"]').isChecked() ).toBeTruthy(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); - await page.locator('//*[@id="showdescription"]').click(); expect( await page.locator('//*[@id="showdescription"]').isChecked() @@ -85,9 +76,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="showreturn_direct"]').isChecked() ).toBeFalsy(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); - await page.locator('//*[@id="showdescription"]').click(); expect( await page.locator('//*[@id="showdescription"]').isChecked() @@ -101,9 +89,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="showreturn_direct"]').isChecked() ).toBeTruthy(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); - await page.locator('//*[@id="saveChangesBtn"]').click(); const plusButtonLocator = page.locator('//*[@id="code-input-0"]'); @@ -114,22 +99,6 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.getByTestId("more-options-modal").click(); await page.getByTestId("edit-button-modal").click(); - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); - - await page.locator('//*[@id="code-area-editcode"]').click(); - - let value = await page.locator('//*[@id="codeValue"]').inputValue(); - - if ( - value != - 'def python_function(text: str) -> str: """This is a default python function that returns the input text""" return text' - ) { - expect(false).toBeTruthy(); - } - - await page.locator('//*[@id="checkAndSaveBtn"]').click(); - await page.locator('//*[@id="saveChangesBtn"]').click(); await page.getByTestId("div-generic-node").click(); diff --git a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts index 3fdb49d54..e8b462266 100644 --- a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts @@ -43,36 +43,132 @@ test("dropDownComponent", async ({ page }) => { expect(false).toBeTruthy(); } - // showcode - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); + await page.locator('//*[@id="showcache"]').click(); + expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy(); + + await page.locator('//*[@id="showcache"]').click(); + expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy(); + + await page.locator('//*[@id="showcredentials_profile_name"]').click(); + expect( + await page.locator('//*[@id="showcredentials_profile_name"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showcredentials_profile_name"]').click(); + expect( + await page.locator('//*[@id="showcredentials_profile_name"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showendpoint_url"]').click(); + expect( + await page.locator('//*[@id="showendpoint_url"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showendpoint_url"]').click(); + expect( + await page.locator('//*[@id="showendpoint_url"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showregion_name"]').click(); + expect( + await page.locator('//*[@id="showregion_name"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showregion_name"]').click(); + expect( + await page.locator('//*[@id="showregion_name"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showstreaming"]').click(); + expect( + await page.locator('//*[@id="showstreaming"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showstreaming"]').click(); + expect( + await page.locator('//*[@id="showstreaming"]').isChecked() + ).toBeTruthy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy(); - // showcode - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); - // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); expect( await page.locator('//*[@id="showmodel_id"]').isChecked() ).toBeTruthy(); - // showcode - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); + await page.locator('//*[@id="showcache"]').click(); + expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy(); + + await page.locator('//*[@id="showcache"]').click(); + expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy(); + + await page.locator('//*[@id="showcredentials_profile_name"]').click(); + expect( + await page.locator('//*[@id="showcredentials_profile_name"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showcredentials_profile_name"]').click(); + expect( + await page.locator('//*[@id="showcredentials_profile_name"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showendpoint_url"]').click(); + expect( + await page.locator('//*[@id="showendpoint_url"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showendpoint_url"]').click(); + expect( + await page.locator('//*[@id="showendpoint_url"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showregion_name"]').click(); + expect( + await page.locator('//*[@id="showregion_name"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showregion_name"]').click(); + expect( + await page.locator('//*[@id="showregion_name"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showstreaming"]').click(); + expect( + await page.locator('//*[@id="showstreaming"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showstreaming"]').click(); + expect( + await page.locator('//*[@id="showstreaming"]').isChecked() + ).toBeTruthy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy(); - // showcode - await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); - // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); expect( diff --git a/src/frontend/tests/end-to-end/flowPage.spec.ts b/src/frontend/tests/end-to-end/flowPage.spec.ts index 7b509864f..78c7b3280 100644 --- a/src/frontend/tests/end-to-end/flowPage.spec.ts +++ b/src/frontend/tests/end-to-end/flowPage.spec.ts @@ -19,7 +19,7 @@ test.describe("Flow Page tests", () => { await page.waitForTimeout(2000); await page - .locator('//*[@id="custom_componentsCustomComponent"]') + .locator('//*[@id="utilitiesCustomComponent"]') .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.mouse.up(); await page.mouse.down(); diff --git a/src/frontend/tests/end-to-end/intComponent.spec.ts b/src/frontend/tests/end-to-end/intComponent.spec.ts index 0cf355832..1acd958a7 100644 --- a/src/frontend/tests/end-to-end/intComponent.spec.ts +++ b/src/frontend/tests/end-to-end/intComponent.spec.ts @@ -8,32 +8,32 @@ test("IntComponent", async ({ page }) => { await page.waitForTimeout(2000); await page.getByPlaceholder("Search").click(); - await page.getByPlaceholder("Search").fill("getrequest"); + await page.getByPlaceholder("Search").fill("openai"); await page.waitForTimeout(2000); await page - .getByTestId("utilitiesGET Request") + .getByTestId("modelsOpenAI Model") .first() .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.mouse.up(); await page.mouse.down(); - await page.getByTestId("int-input-timeout").click(); + await page.getByTestId("int-input-max_tokens").click(); await page - .getByTestId("int-input-timeout") + .getByTestId("int-input-max_tokens") .fill("123456789123456789123456789"); - let value = await page.getByTestId("int-input-timeout").inputValue(); + let value = await page.getByTestId("int-input-max_tokens").inputValue(); if (value != "123456789123456789123456789") { expect(false).toBeTruthy(); } - await page.getByTestId("int-input-timeout").click(); - await page.getByTestId("int-input-timeout").fill("0"); + await page.getByTestId("int-input-max_tokens").click(); + await page.getByTestId("int-input-max_tokens").fill("0"); - value = await page.getByTestId("int-input-timeout").inputValue(); + value = await page.getByTestId("int-input-max_tokens").inputValue(); if (value != "0") { expect(false).toBeTruthy(); @@ -42,35 +42,119 @@ test("IntComponent", async ({ page }) => { await page.getByTestId("more-options-modal").click(); await page.getByTestId("edit-button-modal").click(); - value = await page.getByTestId("edit-int-input-timeout").inputValue(); + value = await page.getByTestId("edit-int-input-max_tokens").inputValue(); if (value != "0") { expect(false).toBeTruthy(); } - await page.getByTestId("edit-int-input-timeout").click(); + await page.getByTestId("edit-int-input-max_tokens").click(); await page - .getByTestId("edit-int-input-timeout") + .getByTestId("edit-int-input-max_tokens") .fill("123456789123456789123456789"); - await page.locator('//*[@id="showheaders"]').click(); - expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeFalsy(); + await page.locator('//*[@id="showinput_value"]').click(); + expect( + await page.locator('//*[@id="showinput_value"]').isChecked() + ).toBeFalsy(); - await page.locator('//*[@id="showtimeout"]').click(); - expect(await page.locator('//*[@id="showtimeout"]').isChecked()).toBeFalsy(); + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeTruthy(); - await page.locator('//*[@id="showurl"]').click(); - expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeFalsy(); + await page.locator('//*[@id="showmodel_name"]').click(); + expect( + await page.locator('//*[@id="showmodel_name"]').isChecked() + ).toBeFalsy(); - await page.locator('//*[@id="showheaders"]').click(); - expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeTruthy(); + await page.locator('//*[@id="showopenai_api_base"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_base"]').isChecked() + ).toBeFalsy(); - await page.locator('//*[@id="showurl"]').click(); - expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeTruthy(); + await page.locator('//*[@id="showopenai_api_key"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_key"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showstream"]').click(); + expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy(); + + await page.locator('//*[@id="showtemperature"]').click(); + expect( + await page.locator('//*[@id="showtemperature"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showinput_value"]').click(); + expect( + await page.locator('//*[@id="showinput_value"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showmodel_name"]').click(); + expect( + await page.locator('//*[@id="showmodel_name"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showopenai_api_base"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_base"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showopenai_api_key"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_key"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showstream"]').click(); + expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeTruthy(); + + await page.locator('//*[@id="showtemperature"]').click(); + expect( + await page.locator('//*[@id="showtemperature"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showinput_value"]').click(); + expect( + await page.locator('//*[@id="showinput_value"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showmodel_kwargs"]').click(); + expect( + await page.locator('//*[@id="showmodel_kwargs"]').isChecked() + ).toBeTruthy(); + + await page.locator('//*[@id="showmodel_name"]').click(); + expect( + await page.locator('//*[@id="showmodel_name"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showopenai_api_base"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_base"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showopenai_api_key"]').click(); + expect( + await page.locator('//*[@id="showopenai_api_key"]').isChecked() + ).toBeFalsy(); + + await page.locator('//*[@id="showstream"]').click(); + expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy(); + + await page.locator('//*[@id="showtemperature"]').click(); + expect( + await page.locator('//*[@id="showtemperature"]').isChecked() + ).toBeFalsy(); await page.locator('//*[@id="saveChangesBtn"]').click(); - const plusButtonLocator = page.getByTestId("int-input-timeout"); + const plusButtonLocator = page.getByTestId("int-input-max_tokens"); const elementCount = await plusButtonLocator.count(); if (elementCount === 0) { expect(true).toBeTruthy(); @@ -84,7 +168,7 @@ test("IntComponent", async ({ page }) => { ).toBeTruthy(); const valueEditNode = await page - .getByTestId("edit-int-input-timeout") + .getByTestId("edit-int-input-max_tokens") .inputValue(); if (valueEditNode != "123456789123456789123456789") { @@ -92,19 +176,19 @@ test("IntComponent", async ({ page }) => { } await page.locator('//*[@id="saveChangesBtn"]').click(); - await page.getByTestId("int-input-timeout").click(); - await page.getByTestId("int-input-timeout").fill("3"); + await page.getByTestId("int-input-max_tokens").click(); + await page.getByTestId("int-input-max_tokens").fill("3"); - let value = await page.getByTestId("int-input-timeout").inputValue(); + let value = await page.getByTestId("int-input-max_tokens").inputValue(); if (value != "3") { expect(false).toBeTruthy(); } - await page.getByTestId("int-input-timeout").click(); - await page.getByTestId("int-input-timeout").fill("-3"); + await page.getByTestId("int-input-max_tokens").click(); + await page.getByTestId("int-input-max_tokens").fill("-3"); - value = await page.getByTestId("int-input-timeout").inputValue(); + value = await page.getByTestId("int-input-max_tokens").inputValue(); if (value != "0") { expect(false).toBeTruthy();