fix: add data-testid to new project button in EmptyFolder component (#9222)
This commit is contained in:
parent
86c54de508
commit
cb34e4fe80
10 changed files with 80 additions and 60 deletions
3
.github/changes-filter.yaml
vendored
3
.github/changes-filter.yaml
vendored
|
|
@ -84,3 +84,6 @@ database:
|
||||||
- "src/frontend/src/controllers/**"
|
- "src/frontend/src/controllers/**"
|
||||||
- "src/frontend/tests/core/features/**"
|
- "src/frontend/tests/core/features/**"
|
||||||
- "src/frontend/tests/extended/features/**"
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
|
||||||
|
mainpage:
|
||||||
|
- "src/frontend/src/pages/MainPage/**"
|
||||||
|
|
|
||||||
5
.github/workflows/typescript_test.yml
vendored
5
.github/workflows/typescript_test.yml
vendored
|
|
@ -127,6 +127,11 @@ jobs:
|
||||||
TAGS+=("@database")
|
TAGS+=("@database")
|
||||||
echo "Added database suite"
|
echo "Added database suite"
|
||||||
fi
|
fi
|
||||||
|
if [[ "${{ steps.filter.outputs.mainpage }}" == "true" ]]; then
|
||||||
|
SUITES=$(echo $SUITES | jq -c '. += ["mainpage"]')
|
||||||
|
TAGS+=("@mainpage")
|
||||||
|
echo "Added mainpage suite"
|
||||||
|
fi
|
||||||
if [[ "${{ steps.filter.outputs.development }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.development }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq -c '. += ["development"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["development"]')
|
||||||
TAGS+=("@development")
|
TAGS+=("@development")
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ export const EmptyFolder = ({ setOpenModal }: EmptyFolderProps) => {
|
||||||
variant="default"
|
variant="default"
|
||||||
onClick={() => setOpenModal(true)}
|
onClick={() => setOpenModal(true)}
|
||||||
id="new-project-btn"
|
id="new-project-btn"
|
||||||
|
data-testid="new_project_btn_empty_page"
|
||||||
>
|
>
|
||||||
<ForwardedIconComponent
|
<ForwardedIconComponent
|
||||||
name="plus"
|
name="plus"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"select and delete a flow",
|
"select and delete a flow",
|
||||||
{ tag: ["@release", "@api"] },
|
{ tag: ["@release", "@mainpage"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
await awaitBootstrapTest(page);
|
await awaitBootstrapTest(page);
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ test(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
test("search flows", { tag: ["@release"] }, async ({ page }) => {
|
test("search flows", { tag: ["@release", "@mainpage"] }, async ({ page }) => {
|
||||||
await awaitBootstrapTest(page);
|
await awaitBootstrapTest(page);
|
||||||
|
|
||||||
await page.getByTestId("side_nav_options_all-templates").click();
|
await page.getByTestId("side_nav_options_all-templates").click();
|
||||||
|
|
@ -74,67 +74,71 @@ test("search flows", { tag: ["@release"] }, async ({ page }) => {
|
||||||
await page.getByText("Basic Prompting", { exact: true }).isHidden();
|
await page.getByText("Basic Prompting", { exact: true }).isHidden();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("search components", { tag: ["@release"] }, async ({ page }) => {
|
test(
|
||||||
await awaitBootstrapTest(page);
|
"search components",
|
||||||
|
{ tag: ["@release", "@mainpage"] },
|
||||||
|
async ({ page }) => {
|
||||||
|
await awaitBootstrapTest(page);
|
||||||
|
|
||||||
if (await page.getByTestId("components-btn").isVisible()) {
|
if (await page.getByTestId("components-btn").isVisible()) {
|
||||||
await page.getByTestId("side_nav_options_all-templates").click();
|
await page.getByTestId("side_nav_options_all-templates").click();
|
||||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||||
|
|
||||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||||
timeout: 100000,
|
timeout: 100000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.getByTestId("fit_view").click();
|
await page.getByTestId("fit_view").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
|
|
||||||
await page.getByText("Chat Input").first().click();
|
await page.getByText("Chat Input").first().click();
|
||||||
await page.waitForSelector('[data-testid="more-options-modal"]', {
|
await page.waitForSelector('[data-testid="more-options-modal"]', {
|
||||||
timeout: 1000,
|
timeout: 1000,
|
||||||
});
|
});
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await page
|
await page
|
||||||
.getByText("Prompt", {
|
.getByText("Prompt", {
|
||||||
exact: true,
|
exact: true,
|
||||||
})
|
})
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.getByText("OpenAI", {
|
.getByText("OpenAI", {
|
||||||
exact: true,
|
exact: true,
|
||||||
})
|
})
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
|
|
||||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||||
timeout: 100000,
|
timeout: 100000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||||
|
|
||||||
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
||||||
|
|
||||||
if (exitButton > 0) {
|
if (exitButton > 0) {
|
||||||
await page.getByText("Exit", { exact: true }).click();
|
await page.getByText("Exit", { exact: true }).click();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.getByTestId("components-btn").click();
|
||||||
|
await page.getByPlaceholder("Search components").fill("Chat Input");
|
||||||
|
await page.getByText("Chat Input", { exact: true }).isVisible();
|
||||||
|
await page.getByText("Prompt", { exact: true }).isHidden();
|
||||||
|
await page.getByText("OpenAI", { exact: true }).isHidden();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
await page.getByTestId("components-btn").click();
|
);
|
||||||
await page.getByPlaceholder("Search components").fill("Chat Input");
|
|
||||||
await page.getByText("Chat Input", { exact: true }).isVisible();
|
|
||||||
await page.getByText("Prompt", { exact: true }).isHidden();
|
|
||||||
await page.getByText("OpenAI", { exact: true }).isHidden();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { renameFlow } from "../../utils/rename-flow";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"when auto_login is false, admin can CRUD user's and should see just your own flows",
|
"when auto_login is false, admin can CRUD user's and should see just your own flows",
|
||||||
{ tag: ["@release", "@api", "@database"] },
|
{ tag: ["@release", "@api", "@database", "@mainpage"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
await page.route("**/api/v1/auto_login", (route) => {
|
await page.route("**/api/v1/auto_login", (route) => {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ async function getAuthToken(request: any) {
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"vector store from starter projects should have its connections and nodes on the flow",
|
"vector store from starter projects should have its connections and nodes on the flow",
|
||||||
{ tag: ["@release", "@starter-projects"] },
|
{ tag: ["@release", "@starter-projects", "@mainpage"] },
|
||||||
async ({ page, request }) => {
|
async ({ page, request }) => {
|
||||||
// Get authentication token
|
// Get authentication token
|
||||||
const authToken = await getAuthToken(request);
|
const authToken = await getAuthToken(request);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||||
|
|
||||||
test.describe(
|
test.describe(
|
||||||
"Auto_login tests",
|
"Auto_login tests",
|
||||||
{ tag: ["@release", "@api", "@database"] },
|
{ tag: ["@release", "@api", "@database", "@mainpage"] },
|
||||||
|
|
||||||
() => {
|
() => {
|
||||||
test(
|
test(
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"user should be able to select flows with different methods and perform bulk actions",
|
"user should be able to select flows with different methods and perform bulk actions",
|
||||||
{ tag: ["@release", "@workspace"] },
|
{ tag: ["@release", "@workspace", "@mainpage"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
await awaitBootstrapTest(page);
|
await awaitBootstrapTest(page);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { simulateDragAndDrop } from "../../utils/simulate-drag-and-drop";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"user should be able to drag and drop an old collection without crashing the application",
|
"user should be able to drag and drop an old collection without crashing the application",
|
||||||
{ tag: ["@release"] },
|
{ tag: ["@release", "@mainpage"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
await awaitBootstrapTest(page);
|
await awaitBootstrapTest(page);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"user must be able to create a new flow clicking on New Flow button",
|
"user must be able to create a new flow clicking on New Flow button",
|
||||||
{ tag: ["@release"] },
|
{ tag: ["@release", "@mainpage"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
test.skip(
|
test.skip(
|
||||||
!process?.env?.OPENAI_API_KEY,
|
!process?.env?.OPENAI_API_KEY,
|
||||||
|
|
@ -34,7 +34,14 @@ test(
|
||||||
).isVisible(),
|
).isVisible(),
|
||||||
);
|
);
|
||||||
|
|
||||||
await page.getByTestId("new-project-btn").click();
|
expect(
|
||||||
|
await page.waitForSelector("data-testid=new_project_btn_empty_page", {
|
||||||
|
timeout: 5000,
|
||||||
|
state: "visible",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
await page.getByTestId("new_project_btn_empty_page").click();
|
||||||
|
|
||||||
await page.getByTestId("side_nav_options_all-templates").click();
|
await page.getByTestId("side_nav_options_all-templates").click();
|
||||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue