From 97820472adde88bee9e6201fc42c9a0aafdea7e4 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 22 Aug 2024 10:19:41 -0300 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=85=20(dropdownComponent.spec.ts):=20?= =?UTF-8?q?add=20missing=20test=20case=20for=20dropdownComponent=20to=20im?= =?UTF-8?q?prove=20test=20coverage=20and=20ensure=20functionality=20?= =?UTF-8?q?=F0=9F=94=A7=20(dropdownComponent.spec.ts):=20update=20test=20c?= =?UTF-8?q?ase=20to=20include=20additional=20interactions=20with=20the=20p?= =?UTF-8?q?age=20to=20simulate=20user=20behavior=20and=20improve=20test=20?= =?UTF-8?q?robustness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dropdownComponent.spec.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts index f9b7a2f7c06..acde63a1c7f 100644 --- a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts @@ -145,11 +145,23 @@ test("dropDownComponent", async ({ page }) => { expect(false).toBeTruthy(); } await page.getByTestId("code-button-modal").click(); + await page.waitForTimeout(1000); + await page + .locator(".ace_content") + .hover() + .then(async () => { + await page.waitForTimeout(1000); + await page.mouse.wheel(0, 1000); + }); + + const element = page .locator("#CodeEditor div") .filter({ hasText: "import ChatBedrock" }) - .nth(1) - .click(); + .nth(1); + + await element.click(); + await page.locator("textarea").press("Control+a"); const emptyOptionsCode = `from langchain_community.chat_models.bedrock import BedrockChat From 0e330d94b4bafa3468636eca2579a43ca4b43dcf Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 22 Aug 2024 10:22:17 -0300 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20(dropdownComponent.spec.ts):=20?= =?UTF-8?q?update=20mouse=20wheel=20scroll=20distance=20to=20800=20to=20im?= =?UTF-8?q?prove=20test=20reliability=20=F0=9F=93=9D=20(dropdownComponent.?= =?UTF-8?q?spec.ts):=20add=20additional=20wait=20time=20to=20ensure=20stab?= =?UTF-8?q?ility=20in=20test=20execution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/scheduled-end-to-end/dropdownComponent.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts index acde63a1c7f..5f5a25cfeca 100644 --- a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts @@ -152,9 +152,11 @@ test("dropDownComponent", async ({ page }) => { .hover() .then(async () => { await page.waitForTimeout(1000); - await page.mouse.wheel(0, 1000); + await page.mouse.wheel(0, 800); }); + await page.waitForTimeout(1000); + const element = page .locator("#CodeEditor div") .filter({ hasText: "import ChatBedrock" }) From 9037681698fd0f1b83a0ed45acca95523c7b8279 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 22 Aug 2024 10:56:54 -0300 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A7=20(dropdownComponent.spec.ts):?= =?UTF-8?q?=20remove=20unnecessary=20code=20related=20to=20hovering=20and?= =?UTF-8?q?=20scrolling=20in=20the=20dropdown=20component=20test=20to=20im?= =?UTF-8?q?prove=20test=20readability=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dropdownComponent.spec.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts index 5f5a25cfeca..765ac39cc32 100644 --- a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts @@ -147,23 +147,6 @@ test("dropDownComponent", async ({ page }) => { await page.getByTestId("code-button-modal").click(); await page.waitForTimeout(1000); - await page - .locator(".ace_content") - .hover() - .then(async () => { - await page.waitForTimeout(1000); - await page.mouse.wheel(0, 800); - }); - - await page.waitForTimeout(1000); - - const element = page - .locator("#CodeEditor div") - .filter({ hasText: "import ChatBedrock" }) - .nth(1); - - await element.click(); - await page.locator("textarea").press("Control+a"); const emptyOptionsCode = `from langchain_community.chat_models.bedrock import BedrockChat