diff --git a/src/frontend/tests/end-to-end/deleteComponents.spec.ts b/src/frontend/tests/end-to-end/deleteComponents.spec.ts new file mode 100644 index 000000000000..faf906003012 --- /dev/null +++ b/src/frontend/tests/end-to-end/deleteComponents.spec.ts @@ -0,0 +1,55 @@ +import { test } from "@playwright/test"; + +test("should add API-KEY", async ({ page }) => { + await page.goto("/"); + await page.waitForTimeout(1000); + + await page.getByTestId("button-store").click(); + await page.waitForTimeout(1000); + + await page.getByTestId("api-key-button-store").click(); + await page + .getByPlaceholder("Insert your API Key") + .fill("testtesttesttesttesttest"); + + await page.getByTestId("api-key-save-button-store").click(); + + await page.waitForTimeout(2000); + await page.getByText("Success! Your API Key has been saved.").isVisible(); + + await page + .getByPlaceholder("Insert your API Key") + .fill(process.env.STORE_API_KEY ?? ""); + await page.getByTestId("api-key-save-button-store").click(); + + await page.waitForTimeout(2000); + await page.getByText("Success! Your API Key has been saved.").isVisible(); + + await page.waitForTimeout(2000); + await page.getByText("API Key Error").isHidden(); +}); + +test("should delete a component", async ({ page }) => { + await page.goto("/"); + await page.waitForTimeout(2000); + await page.getByText("Store").nth(0).click(); + await page.getByTestId("install-Basic RAG").click(); + await page.waitForTimeout(5000); + await page.getByText("My Collection").nth(0).click(); + await page.getByText("Components").first().click(); + await page.getByText("Basic RAG").first().isVisible(); + + await page.waitForSelector('[data-testid="checkbox-component"]', { + timeout: 100000, + }); + + await page.getByTestId("checkbox-component").first().click(); + + await page.getByTestId("icon-Trash2").click(); + await page + .getByText("Are you sure you want to delete the selected component?") + .isVisible(); + await page.getByText("Delete").nth(1).click(); + await page.waitForTimeout(1000); + await page.getByText("Successfully").first().isVisible(); +}); diff --git a/src/frontend/tests/end-to-end/deleteComponentFlows.spec.ts b/src/frontend/tests/end-to-end/deleteFlows.spec.ts similarity index 70% rename from src/frontend/tests/end-to-end/deleteComponentFlows.spec.ts rename to src/frontend/tests/end-to-end/deleteFlows.spec.ts index e8a96fce015e..0b168e9eec69 100644 --- a/src/frontend/tests/end-to-end/deleteComponentFlows.spec.ts +++ b/src/frontend/tests/end-to-end/deleteFlows.spec.ts @@ -65,28 +65,3 @@ test("should delete a flow", async ({ page }) => { await page.waitForTimeout(1000); await page.getByText("Successfully").first().isVisible(); }); - -test("should delete a component", async ({ page }) => { - await page.goto("/"); - await page.waitForTimeout(2000); - await page.getByText("Store").nth(0).click(); - await page.getByTestId("install-Basic RAG").click(); - await page.waitForTimeout(5000); - await page.getByText("My Collection").nth(0).click(); - await page.getByText("Components").first().click(); - await page.getByText("Basic RAG").first().isVisible(); - - await page.waitForSelector('[data-testid="checkbox-component"]', { - timeout: 100000, - }); - - await page.getByTestId("checkbox-component").first().click(); - - await page.getByTestId("icon-Trash2").click(); - await page - .getByText("Are you sure you want to delete the selected component?") - .isVisible(); - await page.getByText("Delete").nth(1).click(); - await page.waitForTimeout(1000); - await page.getByText("Successfully").first().isVisible(); -}); diff --git a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts index 2f1fb5b34b61..a0a6ee906cba 100644 --- a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts @@ -76,12 +76,6 @@ test("dropDownComponent", async ({ page }) => { expect(false).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(), @@ -92,16 +86,6 @@ test("dropDownComponent", async ({ page }) => { 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="showregion_name"]').click(); expect( await page.locator('//*[@id="showregion_name"]').isChecked(), @@ -122,12 +106,6 @@ test("dropDownComponent", async ({ page }) => { await page.locator('//*[@id="showmodel_id"]').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(), @@ -138,16 +116,6 @@ test("dropDownComponent", async ({ page }) => { 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="showregion_name"]').click(); expect( await page.locator('//*[@id="showregion_name"]').isChecked(), diff --git a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts index b5d532d786aa..94e7934f3d5e 100644 --- a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts +++ b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts @@ -88,8 +88,6 @@ test("KeypairListComponent", async ({ page }) => { await page.getByTestId("more-options-modal").click(); await page.getByTestId("edit-button-modal").click(); - await page.locator('//*[@id="showcache"]').click(); - expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy(); await page.locator('//*[@id="showcredentials_profile_name"]').click(); expect( await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(), @@ -109,8 +107,6 @@ test("KeypairListComponent", async ({ page }) => { expect( await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(), ).toBeTruthy(); - await page.locator('//*[@id="showcache"]').click(); - expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy(); await page.locator('//*[@id="editNodekeypair0"]').click(); await page.locator('//*[@id="editNodekeypair0"]').fill("testtesttesttest"); diff --git a/src/frontend/tests/end-to-end/store-shard-1.spec.ts b/src/frontend/tests/end-to-end/store-shard-1.spec.ts index 9cced09237ec..00bd9025014b 100644 --- a/src/frontend/tests/end-to-end/store-shard-1.spec.ts +++ b/src/frontend/tests/end-to-end/store-shard-1.spec.ts @@ -103,7 +103,10 @@ test("should find a searched Component on Store", async ({ page }) => { await page.waitForTimeout(1000); await page.getByTestId("button-store").click(); - await page.waitForTimeout(1000); + + await page.waitForSelector('[data-testid="search-store-input"]', { + timeout: 100000, + }); await page.getByTestId("search-store-input").fill("File Loader"); await page.getByTestId("search-store-button").click(); diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index 28cdcd18bcc5..bdf14f2c3c87 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -26,7 +26,7 @@ "tests/end-to-end/chatInputOutputUser-shard-2.spec.ts", "tests/end-to-end/codeAreaModalComponent.spec.ts", "tests/end-to-end/curlApiGeneration.spec.ts", - "tests/end-to-end/deleteComponentFlows.spec.ts", + "tests/end-to-end/deleteFlows.spec.ts", "tests/end-to-end/dragAndDrop.spec.ts", "tests/end-to-end/dropdownComponent.spec.ts", "tests/end-to-end/fileUploadComponent.spec.ts",