tests: organize playwright tests by feature suites and optimize CI runtime (#4687)
* starting realocating components FE * tagging tests * 📝 (.github/workflows/typescript_test.yml): remove unnecessary comment before the Playwright test execution step to improve readability and maintainability * 📝 (.github/changes-filter.yaml): Update paths in changes-filter.yaml to categorize different sections of the project for testing purposes 🔧 (.github/workflows/typescript_test.yml): Refactor workflow to use paths-filter action for determining test suites based on changes in different project sections * ✨ (changes-filter.yaml): reorganize and update paths for test categories, starter projects, components, workspace, api, and database ✨ (components): add new components for GradientWrapper, pageLayout, and paginatorComponent 🔧 (MainPage): update import path for PageLayout component 🔧 (SettingsPage): update import path for PageLayout component 🔧 (StorePage): update import path for PageLayout component * ✨ (frontend): Update import paths for components to use common directory instead of core directory for better organization and consistency 🔧 (frontend): Remove duplicate import of PaginatorComponent in various files and import it from the common directory to reduce redundancy and improve maintainability * 🔧 (changes-filter.yaml): remove unnecessary release section from changes-filter.yaml 🔧 (typescript_test.yml): refactor workflow to support input suites and release flag for test runs * 📝 (changes-filter.yaml): remove unnecessary entries from components section and add missing entries to workspace section for better organization and filtering of changes 🔧 (changes-filter.yaml): update changes-filter.yaml to include missing utils files in the frontend/src/utils directory 🔧 (typescript_test.yml): remove redundant code block that sets SUITES variable to default values as it is no longer needed due to changes in the changes-filter.yaml file * ✨ (actionsMainPage-shard-1.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity 📝 (store-shard-2.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity 📝 (generalBugs-shard-4.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity 📝 (generalBugs-shard-9.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity 📝 (deleteComponents.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity 📝 (deleteFlows.spec.ts): Update test tags to remove unnecessary tags for better organization and clarity ✨ (dragAndDrop.spec.ts): Refactor drag and drop test to improve readability and maintainability ✨ (flowPage.spec.ts): Refactor save test in Flow Page to improve readability and maintainability ✨ (store-shard-0.spec.ts): Refactor Store test to improve readability and maintainability ✨ (store-shard-1.spec.ts): Refactor Store test to improve readability and maintainability ✨ (store-shard-3.spec.ts): Remove unnecessary tags from test descriptions to improve clarity and consistency ✨ (userSettings.spec.ts): Remove unnecessary tags from test descriptions to improve clarity and consistency ✨ (general-bugs-shard-3909.spec.ts): Remove unnecessary tags from test descriptions to improve clarity and consistency 📝 (frontend): Update test tags in regression tests to remove unnecessary tags for better organization and clarity 📝 (frontend): Update test file paths in tsconfig.json to match the new file structure for consistency and maintainability * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Update paths-filter action to v3 and adjust filter configuration file * Add logging to matrix setup in TypeScript test workflow * Refactor decisionFlow.spec.ts to improve test setup and execution flow * Refactor import paths for genericIconComponent and shadTooltipComponent in PlaygroundButton component * feat: add release input to CI workflows for enhanced deployment control * Fix: Correct 'release' input type in CI workflow configuration * [autofix.ci] apply automated fixes * Refactor Blog Writer test: streamline setup and interaction steps * Refactor test cases to improve modal handling and streamline API key input logic * Add test grep pattern to GitHub Actions workflow for targeted test execution - Introduced `test_grep` output in the `determine-test-suite` job to generate a grep pattern based on changed files or input suites. - Updated Playwright test execution to use the generated grep pattern, allowing for more targeted test runs. - Enhanced the `Set Matrix` step to include tag processing for test filtering. * Enhance tag filtering in test workflow with regex lookaheads * Fix syntax for default suite input in GitHub Actions workflow * Update GitHub Actions to handle empty suite input for release builds * Escape regex lookaheads and quotes for GitHub Actions in test workflow * Update regex pattern and quote escaping in TypeScript test workflow * Use single quotes for echo command in GitHub Actions script * Refactor tag handling in GitHub Actions to use OR logic for grep patterns * 🔧 (FlowPage/index.tsx): Remove unnecessary empty line to improve code readability and consistency * 📝 (FlowPage/index.tsx): add missing line break for better code readability * Refactor import path and reorder CSS classes for consistency in UpdateAllComponents component * [autofix.ci] apply automated fixes * Update import path for PaginatorComponent in AdminPage index.tsx * ✨ (logs.spec.ts): introduce a new variable 'modalCount' to keep track of the number of modals opened in the test suite * 📝 (filterSidebar.spec.ts): remove unnecessary test steps related to filter removal and sidebar interactions to simplify and improve test focus on main functionality * ✅ (logs.spec.ts): add tests to ensure proper interaction with logs feature in the frontend application * ✅ (similarity.spec.ts): add a test tag for release and components to categorize the test case 💡 (similarity.spec.ts): add a comment to explain the purpose of the test case and the condition for skipping the test * ✅ (decisionFlow.spec.ts): add missing newline before async function declaration to improve code readability * ✅ (textInputOutput.spec.ts): skip the test for TextInputOutputComponent to exclude it from the test suite temporarily --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
1b3785ee95
commit
989cefd0ac
331 changed files with 10386 additions and 9694 deletions
|
|
@ -1,185 +1,191 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test("user should be able to download a flow or a component", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
test(
|
||||
"user should be able to download a flow or a component",
|
||||
{ tag: ["@release", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
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.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByTestId("icon-SaveAll").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
if (await page.getByTestId("replace-button").isVisible()) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
||||
|
||||
if (exitButton > 0) {
|
||||
await page.getByText("Exit", { exact: true }).click();
|
||||
}
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText(/.*exported successfully/).isVisible();
|
||||
|
||||
await page.getByText("Flows", { exact: true }).click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByText(/.*exported successfully/)
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
await page.getByText("Components", { exact: true }).click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByText(/.*exported successfully/)
|
||||
.last()
|
||||
.isVisible();
|
||||
});
|
||||
|
||||
test("user should be able to upload a flow or a component", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
await page.getByTestId("upload-folder-button").last().click();
|
||||
});
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
test("user should be able to duplicate a flow or a component", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByTestId("icon-SaveAll").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
if (await page.getByTestId("replace-button").isVisible()) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
if (exitButton > 0) {
|
||||
await page.getByText("Exit", { exact: true }).click();
|
||||
}
|
||||
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText(/.*exported successfully/).isVisible();
|
||||
|
||||
await page.getByTestId("icon-SaveAll").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Flows", { exact: true }).click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByText(/.*exported successfully/)
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
if (await page.getByTestId("replace-button").isVisible()) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
await page.getByText("Components", { exact: true }).click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(0).click();
|
||||
await page.getByTestId("btn-download-json").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByText(/.*exported successfully/)
|
||||
.last()
|
||||
.isVisible();
|
||||
},
|
||||
);
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
test(
|
||||
"user should be able to upload a flow or a component",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
if (exitButton > 0) {
|
||||
await page.getByText("Exit", { exact: true }).click();
|
||||
}
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
const replaceButton = await page.getByTestId("replace-button").isVisible();
|
||||
await page.getByTestId("upload-folder-button").last().click();
|
||||
},
|
||||
);
|
||||
|
||||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
test(
|
||||
"user should be able to duplicate a flow or a component",
|
||||
{ tag: ["@release", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(1).click();
|
||||
await page.getByTestId("btn-duplicate-flow").last().click();
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Items duplicated successfully").isVisible();
|
||||
});
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
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.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByTestId("icon-SaveAll").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
if (await page.getByTestId("replace-button").isVisible()) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
const exitButton = await page.getByText("Exit", { exact: true }).count();
|
||||
|
||||
if (exitButton > 0) {
|
||||
await page.getByText("Exit", { exact: true }).click();
|
||||
}
|
||||
|
||||
const replaceButton = await page.getByTestId("replace-button").isVisible();
|
||||
|
||||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.getByTestId("home-dropdown-menu").nth(1).click();
|
||||
await page.getByTestId("btn-duplicate-flow").last().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Items duplicated successfully").isVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,188 +1,190 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user should be able to manually save a flow when the auto_save is off", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
auto_saving: false,
|
||||
frontend_timeout: 0,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
test(
|
||||
"user should be able to manually save a flow when the auto_save is off",
|
||||
{ tag: ["@release", "@api", "@database"] },
|
||||
async ({ page }) => {
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
auto_saving: false,
|
||||
frontend_timeout: 0,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
await page.goto("/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
expect(await page.getByText("Saved").isVisible()).toBeTruthy();
|
||||
|
||||
await page
|
||||
.getByText("Saved")
|
||||
.first()
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Auto-saving is disabled").nth(0).isVisible();
|
||||
await page
|
||||
.getByText("Enable auto-saving to avoid losing progress.")
|
||||
.nth(0)
|
||||
.isVisible();
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
expect(await page.getByTestId("save-flow-button").isEnabled()).toBeTruthy();
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector("text=loading", {
|
||||
state: "hidden",
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
expect(
|
||||
await page
|
||||
.getByText("Unsaved changes will be permanently lost.")
|
||||
.isVisible(),
|
||||
).toBeTruthy();
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByText("Exit Anyway", { exact: true }).click();
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByText("Untitled document").first().click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
expect(await page.getByText("Saved").isVisible()).toBeTruthy();
|
||||
|
||||
expect(await page.getByText("NVIDIA").isVisible()).toBeFalsy();
|
||||
await page
|
||||
.getByText("Saved")
|
||||
.first()
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Auto-saving is disabled").nth(0).isVisible();
|
||||
await page
|
||||
.getByText("Enable auto-saving to avoid losing progress.")
|
||||
.nth(0)
|
||||
.isVisible();
|
||||
});
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
expect(await page.getByTestId("save-flow-button").isEnabled()).toBeTruthy();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector("text=loading", {
|
||||
state: "hidden",
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
expect(
|
||||
await page
|
||||
.getByText("Unsaved changes will be permanently lost.")
|
||||
.isVisible(),
|
||||
).toBeTruthy();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByText("Exit Anyway", { exact: true }).click();
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.getByText("Untitled document").first().click();
|
||||
|
||||
await page.getByText("Save And Exit", { exact: true }).click();
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByText("Untitled document").first().click();
|
||||
expect(await page.getByText("NVIDIA").isVisible()).toBeFalsy();
|
||||
|
||||
await page.waitForSelector("text=loading", {
|
||||
state: "hidden",
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
expect(await page.getByTestId("title-NVIDIA").isVisible()).toBeTruthy();
|
||||
await page
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.getByText("Save And Exit", { exact: true }).click();
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByText("Untitled document").first().click();
|
||||
|
||||
await page.getByTestId("save-flow-button").click();
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
await page.waitForSelector("text=loading", {
|
||||
state: "hidden",
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
const replaceButton = await page.getByTestId("replace-button").isVisible();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
expect(await page.getByTestId("title-NVIDIA").isVisible()).toBeTruthy();
|
||||
|
||||
const saveExitButton = await page
|
||||
.getByText("Save And Exit", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
if (saveExitButton) {
|
||||
await page.getByText("Save And Exit", { exact: true }).last().click();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Untitled document").first().click();
|
||||
await page
|
||||
.getByTestId("modelsNVIDIA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
const nvidiaNumber = await page.getByTestId("title-NVIDIA").count();
|
||||
expect(nvidiaNumber).toBe(2);
|
||||
});
|
||||
await page.getByTestId("save-flow-button").click();
|
||||
await page.getByTestId("icon-ChevronLeft").last().click();
|
||||
|
||||
const replaceButton = await page.getByTestId("replace-button").isVisible();
|
||||
|
||||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
const saveExitButton = await page
|
||||
.getByText("Save And Exit", { exact: true })
|
||||
.last()
|
||||
.isVisible();
|
||||
|
||||
if (saveExitButton) {
|
||||
await page.getByText("Save And Exit", { exact: true }).last().click();
|
||||
}
|
||||
|
||||
await page.getByText("Untitled document").first().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
const nvidiaNumber = await page.getByTestId("title-NVIDIA").count();
|
||||
expect(nvidiaNumber).toBe(2);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,26 +1,39 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test.describe("Auto_login tests", () => {
|
||||
test("auto_login sign in", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
});
|
||||
test.describe(
|
||||
"Auto_login tests",
|
||||
{ tag: ["@release", "@api", "@database"] },
|
||||
|
||||
test("auto_login block_admin", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
() => {
|
||||
test(
|
||||
"auto_login sign in",
|
||||
{ tag: ["@release", "@api", "@database"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto("/login");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
test(
|
||||
"auto_login block_admin",
|
||||
{ tag: ["@release", "@api", "@database"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/admin");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.goto("/login");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/admin/login");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
});
|
||||
});
|
||||
await page.goto("/admin");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/admin/login");
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,31 +1,35 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("curl_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
test(
|
||||
"curl_api_generation",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByTestId("icon-Copy").last().click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
});
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByTestId("icon-Copy").last().click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,45 +2,49 @@ import { test } from "@playwright/test";
|
|||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
test("should delete a component", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
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(process.env.STORE_API_KEY ?? "");
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
test(
|
||||
"should delete a component",
|
||||
{ tag: ["@release", "@api"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
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(process.env.STORE_API_KEY ?? "");
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
|
||||
await page.getByTestId("install-Basic RAG").click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.getByText("Components").first().click();
|
||||
await page.getByText("Basic RAG").first().isVisible();
|
||||
await page.waitForSelector('[data-testid="home-dropdown-menu"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("home-dropdown-menu").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();
|
||||
});
|
||||
await page.getByTestId("install-Basic RAG").click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.getByText("Components").first().click();
|
||||
await page.getByText("Basic RAG").first().isVisible();
|
||||
await page.waitForSelector('[data-testid="home-dropdown-menu"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("home-dropdown-menu").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();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,70 +2,74 @@ import { test } from "@playwright/test";
|
|||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
test("should delete a flow", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
test(
|
||||
"should delete a flow",
|
||||
{ tag: ["@release", "@api"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
|
||||
await page.waitForSelector('[data-testid="button-store"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="button-store"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
// Get and click install button
|
||||
const installButton = await waitForInstallButton(page);
|
||||
await installButton.click();
|
||||
// Get and click install button
|
||||
const installButton = await waitForInstallButton(page);
|
||||
await installButton.click();
|
||||
|
||||
// Handle success message
|
||||
await waitForSuccessMessage(page);
|
||||
// Handle success message
|
||||
await waitForSuccessMessage(page);
|
||||
|
||||
// Wait for navigation button
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
// Wait for navigation button
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
|
||||
await page.waitForSelector("text=Website Content QA", { timeout: 30000 });
|
||||
await page.waitForSelector("text=Website Content QA", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
|
||||
await page.getByTestId("home-dropdown-menu").first().click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId("home-dropdown-menu").first().click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText("Delete").last().click();
|
||||
await page.waitForTimeout(500);
|
||||
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();
|
||||
});
|
||||
await page.getByText("Delete").last().click();
|
||||
await page.waitForTimeout(500);
|
||||
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();
|
||||
},
|
||||
);
|
||||
|
||||
async function waitForInstallButton(page) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { readFileSync } from "fs";
|
|||
|
||||
test.describe("drag and drop test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("drop collection", async ({ page }) => {
|
||||
test("drop collection", { tag: ["@release"] }, async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
let modalCount = 0;
|
||||
|
|
|
|||
|
|
@ -1,185 +1,189 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user must see on handle click the possibility connections - RetrievalQA", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"user must see on handle click the possibility connections - RetrievalQA",
|
||||
{ tag: ["@release", "@api", "@components"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId(
|
||||
"input-list-plus-btn-edit_metadata_indexing_include-2",
|
||||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-legacy-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retrievalqa");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByTestId("langchain_utilitiesRetrieval QA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
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.waitForTimeout(500);
|
||||
|
||||
let visibleElementHandle;
|
||||
|
||||
const outputElements = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-text-right")
|
||||
.all();
|
||||
|
||||
for (const element of outputElements) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await visibleElementHandle.click({
|
||||
force: true,
|
||||
});
|
||||
await page.getByTestId(
|
||||
"input-list-plus-btn-edit_metadata_indexing_include-2",
|
||||
);
|
||||
|
||||
const disclosureTestIds = [
|
||||
"disclosure-inputs",
|
||||
"disclosure-outputs",
|
||||
"disclosure-data",
|
||||
"disclosure-models",
|
||||
"disclosure-helpers",
|
||||
"disclosure-vector stores",
|
||||
"disclosure-embeddings",
|
||||
"disclosure-agents",
|
||||
"disclosure-memories",
|
||||
"disclosure-logic",
|
||||
"disclosure-tools",
|
||||
"disclosure-bundles-langchain",
|
||||
"disclosure-bundles-assemblyai",
|
||||
"disclosure-bundles-datastax",
|
||||
];
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
const elementTestIds = [
|
||||
"inputsChat Input",
|
||||
"outputsChat Output",
|
||||
"dataAPI Request",
|
||||
"modelsAmazon Bedrock",
|
||||
"helpersMessage History",
|
||||
"vectorstoresAstra DB",
|
||||
"embeddingsAmazon Bedrock Embeddings",
|
||||
"langchain_utilitiesTool Calling Agent",
|
||||
"langchain_utilitiesConversationChain",
|
||||
"memoriesAstra DB Chat Memory",
|
||||
"logicCondition",
|
||||
"langchain_utilitiesSelf Query Retriever",
|
||||
"langchain_utilitiesCharacterTextSplitter",
|
||||
];
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await Promise.all(
|
||||
disclosureTestIds.map((id) => expect(page.getByTestId(id)).toBeVisible()),
|
||||
);
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page
|
||||
.getByTestId("sidebar-legacy-switch")
|
||||
.isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await Promise.all(
|
||||
elementTestIds.map((id) =>
|
||||
expect(page.getByTestId(id).first()).toBeVisible(),
|
||||
),
|
||||
);
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retrievalqa");
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
.getByTestId("langchain_utilitiesRetrieval QA")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
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.waitForTimeout(500);
|
||||
|
||||
const visibleModelSpecsTestIds = [
|
||||
"modelsAIML",
|
||||
"modelsAmazon Bedrock",
|
||||
"modelsAnthropic",
|
||||
"modelsAzure OpenAI",
|
||||
"modelsCohere",
|
||||
"modelsGoogle Generative AI",
|
||||
"modelsGroq",
|
||||
"modelsHuggingFace",
|
||||
"modelsLM Studio",
|
||||
"modelsMaritalk",
|
||||
"modelsMistralAI",
|
||||
"modelsNVIDIA",
|
||||
"modelsOllama",
|
||||
"modelsOpenAI",
|
||||
"modelsPerplexity",
|
||||
"modelsQianfan",
|
||||
"modelsVertex AI",
|
||||
];
|
||||
let visibleElementHandle;
|
||||
|
||||
await Promise.all(
|
||||
visibleModelSpecsTestIds.map((id) =>
|
||||
expect(page.getByTestId(id)).toBeVisible(),
|
||||
),
|
||||
);
|
||||
const outputElements = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-text-right")
|
||||
.all();
|
||||
|
||||
const chainInputElements1 = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-llm-left")
|
||||
.all();
|
||||
|
||||
for (const element of chainInputElements1) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
for (const element of outputElements) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.blur();
|
||||
await visibleElementHandle.click({
|
||||
force: true,
|
||||
});
|
||||
|
||||
await visibleElementHandle.click({
|
||||
force: true,
|
||||
});
|
||||
const disclosureTestIds = [
|
||||
"disclosure-inputs",
|
||||
"disclosure-outputs",
|
||||
"disclosure-data",
|
||||
"disclosure-models",
|
||||
"disclosure-helpers",
|
||||
"disclosure-vector stores",
|
||||
"disclosure-embeddings",
|
||||
"disclosure-agents",
|
||||
"disclosure-memories",
|
||||
"disclosure-logic",
|
||||
"disclosure-tools",
|
||||
"disclosure-bundles-langchain",
|
||||
"disclosure-bundles-assemblyai",
|
||||
"disclosure-bundles-datastax",
|
||||
];
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
const elementTestIds = [
|
||||
"inputsChat Input",
|
||||
"outputsChat Output",
|
||||
"dataAPI Request",
|
||||
"modelsAmazon Bedrock",
|
||||
"helpersMessage History",
|
||||
"vectorstoresAstra DB",
|
||||
"embeddingsAmazon Bedrock Embeddings",
|
||||
"langchain_utilitiesTool Calling Agent",
|
||||
"langchain_utilitiesConversationChain",
|
||||
"memoriesAstra DB Chat Memory",
|
||||
"logicCondition",
|
||||
"langchain_utilitiesSelf Query Retriever",
|
||||
"langchain_utilitiesCharacterTextSplitter",
|
||||
];
|
||||
|
||||
const rqaChainInputElements0 = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-template-left")
|
||||
.all();
|
||||
await Promise.all(
|
||||
disclosureTestIds.map((id) => expect(page.getByTestId(id)).toBeVisible()),
|
||||
);
|
||||
|
||||
for (const element of rqaChainInputElements0) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
await Promise.all(
|
||||
elementTestIds.map((id) =>
|
||||
expect(page.getByTestId(id).first()).toBeVisible(),
|
||||
),
|
||||
);
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
|
||||
const visibleModelSpecsTestIds = [
|
||||
"modelsAIML",
|
||||
"modelsAmazon Bedrock",
|
||||
"modelsAnthropic",
|
||||
"modelsAzure OpenAI",
|
||||
"modelsCohere",
|
||||
"modelsGoogle Generative AI",
|
||||
"modelsGroq",
|
||||
"modelsHuggingFace",
|
||||
"modelsLM Studio",
|
||||
"modelsMaritalk",
|
||||
"modelsMistralAI",
|
||||
"modelsNVIDIA",
|
||||
"modelsOllama",
|
||||
"modelsOpenAI",
|
||||
"modelsPerplexity",
|
||||
"modelsQianfan",
|
||||
"modelsVertex AI",
|
||||
];
|
||||
|
||||
await Promise.all(
|
||||
visibleModelSpecsTestIds.map((id) =>
|
||||
expect(page.getByTestId(id)).toBeVisible(),
|
||||
),
|
||||
);
|
||||
|
||||
const chainInputElements1 = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-llm-left")
|
||||
.all();
|
||||
|
||||
for (const element of chainInputElements1) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.click();
|
||||
await visibleElementHandle.blur();
|
||||
|
||||
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-memories")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-logic")).toBeVisible();
|
||||
});
|
||||
await visibleElementHandle.click({
|
||||
force: true,
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
|
||||
const rqaChainInputElements0 = await page
|
||||
.getByTestId("handle-retrievalqa-shownode-template-left")
|
||||
.all();
|
||||
|
||||
for (const element of rqaChainInputElements0) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-memories")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-logic")).toBeVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test.describe("Flow Page tests", () => {
|
||||
test("save", async ({ page }) => {
|
||||
test("save", { tag: ["@release"] }, async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
|
|
|
|||
|
|
@ -1,78 +1,82 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("flowSettings", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"flowSettings",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("flow_name").click();
|
||||
await page.getByText("Flow Settings").first().click();
|
||||
await page
|
||||
.getByPlaceholder("Flow name")
|
||||
.fill(
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
|
||||
);
|
||||
await page.getByTestId("flow_name").click();
|
||||
await page.getByText("Flow Settings").first().click();
|
||||
await page
|
||||
.getByPlaceholder("Flow name")
|
||||
.fill(
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
|
||||
);
|
||||
|
||||
await page.getByText("Character limit reached").isVisible();
|
||||
await page.getByText("Character limit reached").isVisible();
|
||||
|
||||
await page.getByPlaceholder("Flow name").click();
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
await page.getByPlaceholder("Flow name").fill(randomName);
|
||||
await page.getByPlaceholder("Flow name").click();
|
||||
await page
|
||||
.getByPlaceholder("Flow description")
|
||||
.fill(
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
|
||||
);
|
||||
await page.getByPlaceholder("Flow name").click();
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
await page.getByPlaceholder("Flow name").fill(randomName);
|
||||
await page.getByPlaceholder("Flow name").click();
|
||||
await page
|
||||
.getByPlaceholder("Flow description")
|
||||
.fill(
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
|
||||
);
|
||||
|
||||
await page.getByTestId("save-flow-settings").click();
|
||||
await page.getByTestId("save-flow-settings").click();
|
||||
|
||||
await page.getByText("Changes saved successfully").isVisible();
|
||||
await page.getByText("Changes saved successfully").isVisible();
|
||||
|
||||
await page.getByTestId("flow_name").click();
|
||||
await page.getByText("Flow Settings").first().click();
|
||||
await page.getByTestId("flow_name").click();
|
||||
await page.getByText("Flow Settings").first().click();
|
||||
|
||||
const flowName = await page.getByPlaceholder("Flow name").inputValue();
|
||||
const flowDescription = await page
|
||||
.getByPlaceholder("Flow description")
|
||||
.inputValue();
|
||||
const flowName = await page.getByPlaceholder("Flow name").inputValue();
|
||||
const flowDescription = await page
|
||||
.getByPlaceholder("Flow description")
|
||||
.inputValue();
|
||||
|
||||
if (flowName != randomName) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
if (flowName != randomName) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
if (
|
||||
flowDescription !=
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test"
|
||||
) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.getByText("Saved").first().isVisible();
|
||||
await page.getByTestId("icon-CheckCircle2").first().isVisible();
|
||||
});
|
||||
if (
|
||||
flowDescription !=
|
||||
"Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test"
|
||||
) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.getByText("Saved").first().isVisible();
|
||||
await page.getByTestId("icon-CheckCircle2").first().isVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,87 +1,91 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user should be able to see integrations in the sidebar if mvp_components is true", async ({
|
||||
page,
|
||||
}) => {
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: true,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
test(
|
||||
"user should be able to see integrations in the sidebar if mvp_components is true",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: true,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByText("Bundles")).toBeVisible();
|
||||
await expect(page.getByText("Notion")).toBeVisible();
|
||||
await expect(page.getByText("AssemblyAI")).toBeVisible();
|
||||
});
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByText("Bundles")).toBeVisible();
|
||||
await expect(page.getByText("Notion")).toBeVisible();
|
||||
await expect(page.getByText("AssemblyAI")).toBeVisible();
|
||||
},
|
||||
);
|
||||
|
||||
test("user should NOT be able to see integrations in the sidebar if mvp_components is false", async ({
|
||||
page,
|
||||
}) => {
|
||||
// await page.waitForTimeout(4000);
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: false,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
// await page.goto("/");
|
||||
// await page.waitForTimeout(1000);
|
||||
// let modalCount = 0;
|
||||
// try {
|
||||
// const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
// if (modalTitleElement) {
|
||||
// modalCount = await modalTitleElement.count();
|
||||
// }
|
||||
// } catch (error) {
|
||||
// modalCount = 0;
|
||||
// }
|
||||
// while (modalCount === 0) {
|
||||
// await page.getByText("New Project", { exact: true }).click();
|
||||
// await page.waitForTimeout(3000);
|
||||
// modalCount = await page.getByTestId("modal-title")?.count();
|
||||
// }
|
||||
// await page.getByTestId("blank-flow").click();
|
||||
// await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
// timeout: 30000,
|
||||
// });
|
||||
// await expect(page.getByText("Integrations")).not.toBeVisible();
|
||||
// await expect(page.getByText("Notion")).not.toBeVisible();
|
||||
});
|
||||
test(
|
||||
"user should NOT be able to see integrations in the sidebar if mvp_components is false",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
// await page.waitForTimeout(4000);
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: false,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
// await page.goto("/");
|
||||
// await page.waitForTimeout(1000);
|
||||
// let modalCount = 0;
|
||||
// try {
|
||||
// const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
// if (modalTitleElement) {
|
||||
// modalCount = await modalTitleElement.count();
|
||||
// }
|
||||
// } catch (error) {
|
||||
// modalCount = 0;
|
||||
// }
|
||||
// while (modalCount === 0) {
|
||||
// await page.getByText("New Project", { exact: true }).click();
|
||||
// await page.waitForTimeout(3000);
|
||||
// modalCount = await page.getByTestId("modal-title")?.count();
|
||||
// }
|
||||
// await page.getByTestId("blank-flow").click();
|
||||
// await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
// timeout: 30000,
|
||||
// });
|
||||
// await expect(page.getByText("Integrations")).not.toBeVisible();
|
||||
// await expect(page.getByText("Notion")).not.toBeVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,114 +1,119 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
test("LangflowShortcuts", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
test(
|
||||
"LangflowShortcuts",
|
||||
{ tag: ["@release", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("modelsOllama")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page
|
||||
.getByTestId("modelsOllama")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click();
|
||||
await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
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("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+Shift+A`);
|
||||
await page.getByText("Close").last().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("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+Shift+A`);
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.getByTestId("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+d`);
|
||||
await page.getByTestId("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+d`);
|
||||
|
||||
let numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
let numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
const ollamaTitleElement = await page.getByTestId("title-Ollama").last();
|
||||
const ollamaTitleElement = await page.getByTestId("title-Ollama").last();
|
||||
|
||||
await ollamaTitleElement.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
await ollamaTitleElement.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+c`);
|
||||
await page.getByTestId("generic-node-title-arrangement").click();
|
||||
await page.keyboard.press(`ControlOrMeta+c`);
|
||||
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await ollamaTitleElement.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
await ollamaTitleElement.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press(`ControlOrMeta+x`);
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press(`ControlOrMeta+x`);
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 0) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 0) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
// Test undo (Command+Z or Control+Z)
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press("Backspace");
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(0);
|
||||
// Test undo (Command+Z or Control+Z)
|
||||
await page.getByTestId("title-Ollama").click();
|
||||
await page.keyboard.press("Backspace");
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(0);
|
||||
|
||||
await page.keyboard.press(`ControlOrMeta+z`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(1);
|
||||
await page.keyboard.press(`ControlOrMeta+z`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(1);
|
||||
|
||||
// Test redo (Command+Y or Control+Y)
|
||||
await page.keyboard.press(`ControlOrMeta+y`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(0);
|
||||
});
|
||||
// Test redo (Command+Y or Control+Y)
|
||||
await page.keyboard.press(`ControlOrMeta+y`);
|
||||
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||
expect(numberOfNodes).toBe(0);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,137 +3,141 @@ import * as dotenv from "dotenv";
|
|||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
test("user should not be able to upload a file larger than the limit", async ({
|
||||
page,
|
||||
}) => {
|
||||
const maxFileSizeUpload = 0.001;
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
max_file_size_upload: maxFileSizeUpload,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
test(
|
||||
"user should not be able to upload a file larger than the limit",
|
||||
{ tag: ["@release", "@api", "@database"] },
|
||||
async ({ page }) => {
|
||||
const maxFileSizeUpload = 0.001;
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
max_file_size_upload: maxFileSizeUpload,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
test.skip(
|
||||
!process?.env?.OPENAI_API_KEY,
|
||||
"OPENAI_API_KEY required to run this test",
|
||||
);
|
||||
test.skip(
|
||||
!process?.env?.OPENAI_API_KEY,
|
||||
"OPENAI_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.goto("/");
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
let outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
|
||||
|
||||
while (outdatedComponents > 0) {
|
||||
await page.getByTestId("icon-AlertTriangle").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
|
||||
}
|
||||
|
||||
let filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||
while (filledApiKey > 0) {
|
||||
await page.getByTestId("remove-icon-badge").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||
}
|
||||
|
||||
const apiKeyInput = page.getByTestId("popover-anchor-input-api_key");
|
||||
const isApiKeyInputVisible = await apiKeyInput.isVisible();
|
||||
|
||||
if (isApiKeyInputVisible) {
|
||||
await apiKeyInput.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
}
|
||||
|
||||
await page.getByTestId("dropdown_str_model_name").click();
|
||||
await page.getByTestId("gpt-4o-1-option").click();
|
||||
|
||||
await page.waitForSelector("text=Chat Input", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("advanced-button-modal").click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
// Read the image file as a binary string
|
||||
const filePath = "tests/assets/chain.png";
|
||||
const fileContent = readFileSync(filePath, "base64");
|
||||
|
||||
// Create the DataTransfer and File objects within the browser context
|
||||
const dataTransfer = await page.evaluateHandle(
|
||||
({ fileContent }) => {
|
||||
const dt = new DataTransfer();
|
||||
const byteCharacters = atob(fileContent);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const file = new File([byteArray], "chain.png", { type: "image/png" });
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
},
|
||||
{ fileContent },
|
||||
);
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
// Locate the target element
|
||||
const element = await page.getByTestId("input-chat-playground");
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
// Dispatch the drop event on the target element
|
||||
await element.dispatchEvent("drop", { dataTransfer });
|
||||
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.waitForTimeout(1000);
|
||||
let outdatedComponents = await page
|
||||
.getByTestId("icon-AlertTriangle")
|
||||
.count();
|
||||
|
||||
await page.waitForSelector("text=The file size is too large", {
|
||||
timeout: 10000,
|
||||
});
|
||||
while (outdatedComponents > 0) {
|
||||
await page.getByTestId("icon-AlertTriangle").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
|
||||
}
|
||||
|
||||
await expect(
|
||||
page.getByText(
|
||||
`The file size is too large. Please select a file smaller than ${maxFileSizeUpload}MB`,
|
||||
),
|
||||
).toBeVisible();
|
||||
});
|
||||
let filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||
while (filledApiKey > 0) {
|
||||
await page.getByTestId("remove-icon-badge").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||
}
|
||||
|
||||
const apiKeyInput = page.getByTestId("popover-anchor-input-api_key");
|
||||
const isApiKeyInputVisible = await apiKeyInput.isVisible();
|
||||
|
||||
if (isApiKeyInputVisible) {
|
||||
await apiKeyInput.fill(process.env.OPENAI_API_KEY ?? "");
|
||||
}
|
||||
|
||||
await page.getByTestId("dropdown_str_model_name").click();
|
||||
await page.getByTestId("gpt-4o-1-option").click();
|
||||
|
||||
await page.waitForSelector("text=Chat Input", { timeout: 30000 });
|
||||
|
||||
await page.getByText("Chat Input", { exact: true }).click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("advanced-button-modal").click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
// Read the image file as a binary string
|
||||
const filePath = "tests/assets/chain.png";
|
||||
const fileContent = readFileSync(filePath, "base64");
|
||||
|
||||
// Create the DataTransfer and File objects within the browser context
|
||||
const dataTransfer = await page.evaluateHandle(
|
||||
({ fileContent }) => {
|
||||
const dt = new DataTransfer();
|
||||
const byteCharacters = atob(fileContent);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const file = new File([byteArray], "chain.png", { type: "image/png" });
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
},
|
||||
{ fileContent },
|
||||
);
|
||||
|
||||
await page.waitForSelector('[data-testid="input-chat-playground"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
// Locate the target element
|
||||
const element = await page.getByTestId("input-chat-playground");
|
||||
|
||||
// Dispatch the drop event on the target element
|
||||
await element.dispatchEvent("drop", { dataTransfer });
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector("text=The file size is too large", {
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
await expect(
|
||||
page.getByText(
|
||||
`The file size is too large. Please select a file smaller than ${maxFileSizeUpload}MB`,
|
||||
),
|
||||
).toBeVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,82 +1,88 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user must be able to minimize and expand a component", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("inputsText Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page
|
||||
.locator('//*[@id="react-flow-id"]')
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(-800, 300);
|
||||
test(
|
||||
"user must be able to minimize and expand a component",
|
||||
{ tag: ["@release", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.mouse.up();
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.waitForTimeout(1000);
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("minimize-button-modal").first().click();
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-left.no-show").first(),
|
||||
).toBeVisible();
|
||||
await page
|
||||
.getByTestId("inputsText Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-right.no-show").first(),
|
||||
).toBeVisible();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page
|
||||
.locator('//*[@id="react-flow-id"]')
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(-800, 300);
|
||||
});
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.mouse.up();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("expand-button-modal").first().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.waitForTimeout(1000);
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(page.locator(".react-flow__handle-left").first()).toBeVisible();
|
||||
await page.getByTestId("minimize-button-modal").first().click();
|
||||
|
||||
await expect(page.locator(".react-flow__handle-right").first()).toBeVisible();
|
||||
});
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-left.no-show").first(),
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-right.no-show").first(),
|
||||
).toBeVisible();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("expand-button-modal").first().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-left").first(),
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator(".react-flow__handle-right").first(),
|
||||
).toBeVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,38 +1,42 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("python_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"python_api_generation",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
});
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,85 +1,86 @@
|
|||
import { expect, Page, test } from "@playwright/test";
|
||||
|
||||
test("user must be able to interact with starter projects", async ({
|
||||
page,
|
||||
context,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
test(
|
||||
"user must be able to interact with starter projects",
|
||||
{ tag: ["@release", "@starter-projects"] },
|
||||
async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
expect(page.getByText("Start from scratch", { exact: true })).toBeVisible();
|
||||
expect(page.getByRole("button", { name: "Blank Flow" })).toBeVisible();
|
||||
expect(page.getByText("Start from scratch", { exact: true })).toBeVisible();
|
||||
expect(page.getByRole("button", { name: "Blank Flow" })).toBeVisible();
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByPlaceholder("Search...").fill("Document");
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByPlaceholder("Search...").fill("Document");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
page.getByTestId("template_basic-prompting-(hello,-world)"),
|
||||
).not.toBeVisible();
|
||||
expect(
|
||||
page.getByTestId("template_basic-prompting-(hello,-world)"),
|
||||
).not.toBeVisible();
|
||||
|
||||
expect(page.getByTestId("template_document-q&a").first()).toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_sequential-tasks-agents`).first(),
|
||||
).toBeVisible();
|
||||
expect(page.getByTestId("template_document-q&a").first()).toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_sequential-tasks-agents`).first(),
|
||||
).toBeVisible();
|
||||
|
||||
expect(page.getByTestId("template_vector-store")).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_simple-agent`)).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_dynamic-agent`)).not.toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_hierarchical-tasks-agent`),
|
||||
).not.toBeVisible();
|
||||
expect(page.getByTestId("template_vector-store")).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_simple-agent`)).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_dynamic-agent`)).not.toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_hierarchical-tasks-agent`),
|
||||
).not.toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByTestId(`side_nav_options_prompting`).click();
|
||||
await page.waitForTimeout(500);
|
||||
expect(page.getByTestId(`category_title_prompting`)).toBeVisible();
|
||||
await page.getByTestId(`side_nav_options_prompting`).click();
|
||||
await page.waitForTimeout(500);
|
||||
expect(page.getByTestId(`category_title_prompting`)).toBeVisible();
|
||||
|
||||
await page.getByTestId(`side_nav_options_rag`).click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId(`side_nav_options_rag`).click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(page.getByTestId(`category_title_rag`)).toBeVisible();
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).toBeVisible();
|
||||
expect(page.getByTestId(`category_title_rag`)).toBeVisible();
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).toBeVisible();
|
||||
|
||||
expect(
|
||||
page.getByTestId(`template_basic-prompting-(hello,-world)`),
|
||||
).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_basic-prompting-(hello,-world)`),
|
||||
).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
|
||||
await page.getByTestId(`side_nav_options_agents`).click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId(`side_nav_options_agents`).click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(page.getByTestId(`category_title_agents`)).toBeVisible();
|
||||
expect(page.getByTestId(`category_title_agents`)).toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
page.getByTestId(`template_basic-prompting-(hello,-world)`),
|
||||
).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).not.toBeVisible();
|
||||
expect(
|
||||
page.getByTestId(`template_basic-prompting-(hello,-world)`),
|
||||
).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).not.toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await waitForTemplateVisibility(page, templateIds);
|
||||
});
|
||||
await waitForTemplateVisibility(page, templateIds);
|
||||
},
|
||||
);
|
||||
|
||||
async function waitForTemplateVisibility(page: Page, templateIds: string[]) {
|
||||
const timeout = 10000; // Increased timeout for better reliability
|
||||
|
|
|
|||
|
|
@ -1,36 +1,40 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
|
||||
test("user should be able to interact with sticky notes", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"user should be able to interact with sticky notes",
|
||||
{ tag: ["@release", "@workspace"] },
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
|
||||
const randomTitle = Math.random()
|
||||
.toString(36)
|
||||
.substring(7)
|
||||
.padEnd(8, "x")
|
||||
.substring(0, 8);
|
||||
const randomTitle = Math.random()
|
||||
.toString(36)
|
||||
.substring(7)
|
||||
.padEnd(8, "x")
|
||||
.substring(0, 8);
|
||||
|
||||
const noteText = `# ${randomTitle}
|
||||
const noteText = `# ${randomTitle}
|
||||
|
||||
Artificial Intelligence (AI) has rapidly evolved from a speculative concept in science fiction to a transformative force reshaping industries and everyday life. The term AI encompasses a broad range of technologies, from simple algorithms designed to perform specific tasks to complex systems capable of learning and adapting independently. As AI continues to advance, its applications are becoming increasingly diverse, impacting everything from healthcare to finance, entertainment, and beyond.
|
||||
|
||||
|
|
@ -51,122 +55,123 @@ Despite its many benefits, AI also raises important ethical and societal questio
|
|||
The future of AI is both exciting and uncertain. As the technology continues to advance, it will undoubtedly bring about profound changes in society. The challenge will be to harness AI's potential for good while addressing the ethical and societal issues that arise. Whether it's through smarter healthcare, more efficient transportation, or enhanced creativity, AI has the potential to reshape the world in ways we are only beginning to imagine. The journey of AI is far from over, and its impact will be felt for generations to come.
|
||||
`;
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.getByTestId("add_note").click();
|
||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.getByTestId("add_note").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
const targetElement = await page.locator('//*[@id="react-flow-id"]');
|
||||
await targetElement.click();
|
||||
const targetElement = await page.locator('//*[@id="react-flow-id"]');
|
||||
await targetElement.click();
|
||||
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("note_node").click();
|
||||
|
||||
await page.locator(".generic-node-desc-text").last().dblclick();
|
||||
await page.getByTestId("textarea").fill(noteText);
|
||||
await page.locator(".generic-node-desc-text").last().dblclick();
|
||||
await page.getByTestId("textarea").fill(noteText);
|
||||
|
||||
expect(await page.getByText("2500/2500")).toBeVisible();
|
||||
expect(await page.getByText("2500/2500")).toBeVisible();
|
||||
|
||||
await targetElement.click();
|
||||
const textMarkdown = await page.locator(".markdown").innerText();
|
||||
await targetElement.click();
|
||||
const textMarkdown = await page.locator(".markdown").innerText();
|
||||
|
||||
const textLength = textMarkdown.length;
|
||||
const noteTextLength = noteText.length;
|
||||
const textLength = textMarkdown.length;
|
||||
const noteTextLength = noteText.length;
|
||||
|
||||
expect(textLength).toBeLessThan(noteTextLength);
|
||||
expect(textLength).toBeLessThan(noteTextLength);
|
||||
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("note_node").click();
|
||||
|
||||
let element = await page.getByTestId("note_node");
|
||||
let element = await page.getByTestId("note_node");
|
||||
|
||||
let hasStyles = await element?.evaluate((el) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
return (
|
||||
style.backgroundColor === "rgb(252, 211, 77)" ||
|
||||
style.backgroundColor === "rgb(253, 230, 138)"
|
||||
);
|
||||
});
|
||||
expect(hasStyles).toBe(true);
|
||||
let hasStyles = await element?.evaluate((el) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
return (
|
||||
style.backgroundColor === "rgb(252, 211, 77)" ||
|
||||
style.backgroundColor === "rgb(253, 230, 138)"
|
||||
);
|
||||
});
|
||||
expect(hasStyles).toBe(true);
|
||||
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("note_node").click();
|
||||
|
||||
await page.getByTestId("color_picker").click();
|
||||
await page.getByTestId("color_picker").click();
|
||||
|
||||
await page.getByTestId("color_picker_button_rose").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("color_picker_button_rose").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("note_node").click();
|
||||
|
||||
element = await page.getByTestId("note_node");
|
||||
element = await page.getByTestId("note_node");
|
||||
|
||||
hasStyles = await element?.evaluate((el) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
hasStyles = await element?.evaluate((el) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
|
||||
return (
|
||||
style.backgroundColor === "rgb(253, 164, 175)" ||
|
||||
style.backgroundColor === "rgb(254, 205, 211)"
|
||||
);
|
||||
});
|
||||
expect(hasStyles).toBe(true);
|
||||
return (
|
||||
style.backgroundColor === "rgb(253, 164, 175)" ||
|
||||
style.backgroundColor === "rgb(254, 205, 211)"
|
||||
);
|
||||
});
|
||||
expect(hasStyles).toBe(true);
|
||||
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("note_node").click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByText("Duplicate").click();
|
||||
await page.getByText("Duplicate").click();
|
||||
|
||||
let titleNumber = await page.getByText(randomTitle).count();
|
||||
expect(titleNumber).toBe(2);
|
||||
let titleNumber = await page.getByText(randomTitle).count();
|
||||
expect(titleNumber).toBe(2);
|
||||
|
||||
await page.getByTestId("note_node").last().click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("note_node").last().click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.getByText("Copy").click();
|
||||
await page.getByText("Copy").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
targetElement.focus();
|
||||
targetElement.click();
|
||||
await page.waitForTimeout(1000);
|
||||
targetElement.click();
|
||||
await page.waitForTimeout(1000);
|
||||
targetElement.click();
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
targetElement.focus();
|
||||
targetElement.click();
|
||||
await page.waitForTimeout(1000);
|
||||
targetElement.click();
|
||||
await page.waitForTimeout(1000);
|
||||
targetElement.click();
|
||||
await page.keyboard.press(`ControlOrMeta+v`);
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
titleNumber = await page.getByText(randomTitle).count();
|
||||
expect(titleNumber).toBe(3);
|
||||
titleNumber = await page.getByText(randomTitle).count();
|
||||
expect(titleNumber).toBe(3);
|
||||
|
||||
await page.getByTestId("note_node").nth(0).focus();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByText("Delete").first().click();
|
||||
await page.getByTestId("note_node").nth(0).focus();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByText("Delete").first().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
titleNumber = await page.getByText(randomTitle).count();
|
||||
titleNumber = await page.getByText(randomTitle).count();
|
||||
|
||||
expect(titleNumber).toBe(2);
|
||||
});
|
||||
expect(titleNumber).toBe(2);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,63 +1,64 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
|
||||
test("User must be able to stop building from inside Playground", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"User must be able to stop building from inside Playground",
|
||||
{ tag: ["@release", "@api"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
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("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
await page.getByTestId("div-generic-node").nth(0).click();
|
||||
await page.getByTestId("div-generic-node").nth(0).click();
|
||||
|
||||
await page.getByTestId("code-button-modal").nth(0).click();
|
||||
await page.getByTestId("code-button-modal").nth(0).click();
|
||||
|
||||
const waitTimeoutCode = `
|
||||
const waitTimeoutCode = `
|
||||
# from langflow.field_typing import Data
|
||||
from langflow.custom import Component
|
||||
from langflow.io import MessageTextInput, Output
|
||||
|
|
@ -86,59 +87,60 @@ class CustomComponent(Component):
|
|||
sleep(60)
|
||||
return data`;
|
||||
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
|
||||
await page.locator(".ace_content").click();
|
||||
await page.keyboard.press(`ControlOrMeta+A`);
|
||||
await page.locator("textarea").fill(waitTimeoutCode);
|
||||
await page.locator(".ace_content").click();
|
||||
await page.keyboard.press(`ControlOrMeta+A`);
|
||||
await page.locator("textarea").fill(waitTimeoutCode);
|
||||
|
||||
await page.getByText("Check & Save").last().click();
|
||||
await page.getByText("Check & Save").last().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
//connection 1
|
||||
const elementCustomComponentOutput = await page
|
||||
.getByTestId("handle-customcomponent-shownode-output-right")
|
||||
.first();
|
||||
//connection 1
|
||||
const elementCustomComponentOutput = await page
|
||||
.getByTestId("handle-customcomponent-shownode-output-right")
|
||||
.first();
|
||||
|
||||
await elementCustomComponentOutput.hover();
|
||||
await page.mouse.down();
|
||||
const elementChatOutput = await page
|
||||
.getByTestId("handle-chatoutput-shownode-text-left")
|
||||
.first();
|
||||
await elementChatOutput.hover();
|
||||
await page.mouse.up();
|
||||
await elementCustomComponentOutput.hover();
|
||||
await page.mouse.down();
|
||||
const elementChatOutput = await page
|
||||
.getByTestId("handle-chatoutput-shownode-text-left")
|
||||
.first();
|
||||
await elementChatOutput.hover();
|
||||
await page.mouse.up();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector('[data-testid="button-stop"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[data-testid="button-stop"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
const elements = await page.$$('[data-testid="button-stop"]');
|
||||
const elements = await page.$$('[data-testid="button-stop"]');
|
||||
|
||||
if (elements.length > 0) {
|
||||
const lastElement = elements[elements.length - 1];
|
||||
await lastElement.waitForElementState("visible");
|
||||
}
|
||||
if (elements.length > 0) {
|
||||
const lastElement = elements[elements.length - 1];
|
||||
await lastElement.waitForElementState("visible");
|
||||
}
|
||||
|
||||
expect(await page.getByTestId("button-stop").last()).toBeVisible();
|
||||
expect(await page.getByTestId("button-stop").last()).toBeVisible();
|
||||
|
||||
await page.getByTestId("button-stop").last().click();
|
||||
await page.getByTestId("button-stop").last().click();
|
||||
|
||||
await page.waitForSelector("text=build stopped", { timeout: 30000 });
|
||||
expect(await page.getByText("build stopped").isVisible()).toBeTruthy();
|
||||
});
|
||||
await page.waitForSelector("text=build stopped", { timeout: 30000 });
|
||||
expect(await page.getByText("build stopped").isVisible()).toBeTruthy();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test("should exists Store", async ({ page }) => {
|
||||
test("should exists Store", { tag: ["@release"] }, async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ test("should exists Store", async ({ page }) => {
|
|||
await page.getByTestId("button-store").isEnabled();
|
||||
});
|
||||
|
||||
test("should not have an API key", async ({ page }) => {
|
||||
test("should not have an API key", { tag: ["@release"] }, async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,138 +2,146 @@ import { expect, test } from "@playwright/test";
|
|||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
test.skip("should like and add components and flows", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
test.skip(
|
||||
"should like and add components and flows",
|
||||
{ tag: ["@release"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
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(process.env.STORE_API_KEY ?? "");
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForSelector('[data-testid="likes-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("likes-Website Content QA").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
const likedValue = await page
|
||||
.getByTestId("likes-Website Content QA")
|
||||
.innerText();
|
||||
await page.getByTestId("like-Website Content QA").click();
|
||||
await page.waitForSelector('[data-testid="likes-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.waitForTimeout(1000);
|
||||
const likedValueAfter = await page
|
||||
.getByTestId("likes-Website Content QA")
|
||||
.innerText();
|
||||
if (Number(likedValue) === Number(likedValueAfter)) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
await page.waitForSelector('[data-testid="downloads-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
const downloadValue = await page
|
||||
.getByTestId("downloads-Website Content QA")
|
||||
.innerText();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("install-Website Content QA").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Flow Installed Successfully").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
const downloadValueAfter = await page
|
||||
.getByTestId("downloads-Website Content QA")
|
||||
.innerText();
|
||||
if (Number(downloadValue) === Number(downloadValueAfter)) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
await page.getByTestId("install-Basic RAG").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Component Installed Successfully").isVisible();
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.waitForSelector("text=Website Content QA", { timeout: 30000 });
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
await page.getByText("Components").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector("text=Basic RAG", { timeout: 30000 });
|
||||
await page.getByText("Basic RAG").first().isVisible();
|
||||
});
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
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(process.env.STORE_API_KEY ?? "");
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForSelector('[data-testid="likes-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("likes-Website Content QA").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
const likedValue = await page
|
||||
.getByTestId("likes-Website Content QA")
|
||||
.innerText();
|
||||
await page.getByTestId("like-Website Content QA").click();
|
||||
await page.waitForSelector('[data-testid="likes-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.waitForTimeout(1000);
|
||||
const likedValueAfter = await page
|
||||
.getByTestId("likes-Website Content QA")
|
||||
.innerText();
|
||||
if (Number(likedValue) === Number(likedValueAfter)) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
await page.waitForSelector('[data-testid="downloads-Website Content QA"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
const downloadValue = await page
|
||||
.getByTestId("downloads-Website Content QA")
|
||||
.innerText();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("install-Website Content QA").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Flow Installed Successfully").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
const downloadValueAfter = await page
|
||||
.getByTestId("downloads-Website Content QA")
|
||||
.innerText();
|
||||
if (Number(downloadValue) === Number(downloadValueAfter)) {
|
||||
expect(false).toBe(true);
|
||||
}
|
||||
await page.getByTestId("install-Basic RAG").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Component Installed Successfully").isVisible();
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.waitForSelector("text=Website Content QA", { timeout: 30000 });
|
||||
await page.getByText("Website Content QA").first().isVisible();
|
||||
await page.getByText("Components").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector("text=Basic RAG", { timeout: 30000 });
|
||||
await page.getByText("Basic RAG").first().isVisible();
|
||||
},
|
||||
);
|
||||
|
||||
test.skip("should find a searched Component on Store", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
test.skip(
|
||||
"should find a searched Component on Store",
|
||||
{ tag: ["@release"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.getByTestId("button-store").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="search-store-input"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
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();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
await page.getByTestId("search-store-input").fill("File Loader");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("File Loader").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("Basic RAG");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
await page.getByTestId("search-store-input").fill("Basic RAG");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("search-store-input").fill("YouTube QA");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("YouTube QA").isVisible();
|
||||
});
|
||||
await page.getByTestId("search-store-input").fill("YouTube QA");
|
||||
await page.getByTestId("search-store-button").click();
|
||||
await page.getByText("YouTube QA").isVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,53 +2,57 @@ import { expect, test } from "@playwright/test";
|
|||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
test("should order the visualization", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
test(
|
||||
"should order the visualization",
|
||||
{ tag: ["@release"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
await page.getByTestId("api-key-button-store").click();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("button-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Alphabetical").click();
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Alphabetical").click();
|
||||
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
await page.getByText("Album Cover Builder").isVisible();
|
||||
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.getByText("Popular").click();
|
||||
await page.getByTestId("select-order-store").click();
|
||||
await page.getByText("Popular").click();
|
||||
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
});
|
||||
await page.getByText("Basic RAG").isVisible();
|
||||
},
|
||||
);
|
||||
|
||||
test("should filter by type", async ({ page }) => {
|
||||
test("should filter by type", { tag: ["@release"] }, async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.STORE_API_KEY,
|
||||
"STORE_API_KEY required to run this test",
|
||||
|
|
|
|||
|
|
@ -1,57 +1,61 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test("user should be able to see multiple edges and interact with them", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"user should be able to see multiple edges and interact with them",
|
||||
{ tag: ["@release", "@api", "@workspace"] },
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Vector Store RAG", { exact: true }).last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Retriever", { exact: true }).first().isVisible();
|
||||
await page.getByText("Search Results", { exact: true }).first().isVisible();
|
||||
|
||||
await page.getByText("Vector Store RAG", { exact: true }).last().click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.getByText("Retriever", { exact: true }).first().isVisible();
|
||||
await page.getByText("Search Results", { exact: true }).first().isVisible();
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
const focusElements = await page.getByTestId("fit_view");
|
||||
await focusElements.click();
|
||||
};
|
||||
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
await page.waitForSelector('[data-testid="fit_view"]', { timeout: 30000 });
|
||||
const focusElements = await page.getByTestId("fit_view");
|
||||
await focusElements.click();
|
||||
};
|
||||
await focusElementsOnBoard({ page });
|
||||
|
||||
await focusElementsOnBoard({ page });
|
||||
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.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("input-inspection-retriever").first().click();
|
||||
await page.getByText("Retriever", { exact: true }).first().isHidden();
|
||||
await page.getByTestId("icon-ChevronDown").last().isVisible();
|
||||
await page.getByTestId("icon-ChevronDown").last().click();
|
||||
await page.getByText("Retriever", { exact: true }).first().isVisible();
|
||||
await page.getByText("Search Results", { exact: true }).first().isVisible();
|
||||
|
||||
await page.getByTestId("input-inspection-retriever").first().click();
|
||||
await page.getByText("Retriever", { exact: true }).first().isHidden();
|
||||
await page.getByTestId("icon-ChevronDown").last().isVisible();
|
||||
await page.getByTestId("icon-ChevronDown").last().click();
|
||||
await page.getByText("Retriever", { exact: true }).first().isVisible();
|
||||
await page.getByText("Search Results", { exact: true }).first().isVisible();
|
||||
|
||||
await page.getByTestId("icon-EyeOff").nth(0).isVisible();
|
||||
});
|
||||
await page.getByTestId("icon-EyeOff").nth(0).isVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,111 +1,124 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test("should see general profile gradient", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
test(
|
||||
"should see general profile gradient",
|
||||
{ tag: ["@release"] },
|
||||
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.waitForTimeout(1000);
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByText("Settings").click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitForSelector('[id="new-project-btn"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("General").nth(2).isVisible();
|
||||
await page.getByText("Profile Gradient").isVisible();
|
||||
});
|
||||
await page.getByText("Settings").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
test("should interact with global variables", async ({ page }) => {
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
const randomName2 = Math.random().toString(36).substring(2);
|
||||
const randomName3 = Math.random().toString(36).substring(2);
|
||||
await page.getByText("General").nth(2).isVisible();
|
||||
await page.getByText("Profile Gradient").isVisible();
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.getByText("Settings").click();
|
||||
await page.getByText("Global Variables").click();
|
||||
await page.getByText("Global Variables").nth(2);
|
||||
await page.getByText("Global Variables", { exact: true }).nth(1).isVisible();
|
||||
await page.getByText("Add New").click();
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName);
|
||||
await page.getByTestId("select-type-global-variables").first().click();
|
||||
await page.getByText("Generic", { exact: true }).last().isVisible();
|
||||
await page.getByText("Generic", { exact: true }).last().click();
|
||||
test(
|
||||
"should interact with global variables",
|
||||
{ tag: ["@release", "@workspace", "@api"] },
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert a value for the variable...")
|
||||
.fill("testtesttesttesttesttesttesttest");
|
||||
await page.getByTestId("popover-anchor-apply-to-fields").click();
|
||||
async ({ page }) => {
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
const randomName2 = Math.random().toString(36).substring(2);
|
||||
const randomName3 = Math.random().toString(36).substring(2);
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.getByText("Settings").click();
|
||||
await page.getByText("Global Variables").click();
|
||||
await page.getByText("Global Variables").nth(2);
|
||||
await page
|
||||
.getByText("Global Variables", { exact: true })
|
||||
.nth(1)
|
||||
.isVisible();
|
||||
await page.getByText("Add New").click();
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName);
|
||||
await page.getByTestId("select-type-global-variables").first().click();
|
||||
await page.getByText("Generic", { exact: true }).last().isVisible();
|
||||
await page.getByText("Generic", { exact: true }).last().click();
|
||||
|
||||
await page.getByPlaceholder("Search options...").fill("System");
|
||||
await page
|
||||
.getByPlaceholder("Insert a value for the variable...")
|
||||
.fill("testtesttesttesttesttesttesttest");
|
||||
await page.getByTestId("popover-anchor-apply-to-fields").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector("text=System", { timeout: 30000 });
|
||||
await page.getByPlaceholder("Search options...").fill("System");
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText("System").last().click();
|
||||
await page.waitForSelector("text=System", { timeout: 30000 });
|
||||
|
||||
await page.getByPlaceholder("Search options...").fill("openAI");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.waitForSelector("text=openai", { timeout: 30000 });
|
||||
await page.getByText("System").last().click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByPlaceholder("Search options...").fill("openAI");
|
||||
|
||||
await page.getByText("openai").last().click();
|
||||
await page.waitForSelector("text=openai", { timeout: 30000 });
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByPlaceholder("Search options...").fill("ollama");
|
||||
await page.getByText("openai").last().click();
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
await page.getByText("Save Variable", { exact: true }).click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText(randomName).last().isVisible();
|
||||
await page.getByPlaceholder("Search options...").fill("ollama");
|
||||
|
||||
await page.getByText(randomName).last().click();
|
||||
await page.getByText(randomName).last().click();
|
||||
await page.keyboard.press("Escape");
|
||||
await page.getByText("Save Variable", { exact: true }).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByText(randomName).last().isVisible();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName2);
|
||||
await page.getByText(randomName).last().click();
|
||||
await page.getByText(randomName).last().click();
|
||||
|
||||
await page.getByText("Update Variable", { exact: true }).last().click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText(randomName2).last().isVisible();
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName2);
|
||||
|
||||
await page.getByText(randomName2).last().click();
|
||||
await page.getByText("Update Variable", { exact: true }).last().click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByText(randomName2).last().isVisible();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName3);
|
||||
await page.getByText(randomName2).last().click();
|
||||
|
||||
await page.getByText("Update Variable", { exact: true }).last().click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText(randomName3).last().isVisible();
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for the variable...")
|
||||
.fill(randomName3);
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("Update Variable", { exact: true }).last().click();
|
||||
|
||||
await page.locator(".ag-checkbox-input").first().click();
|
||||
await page.getByTestId("icon-Trash2").click();
|
||||
await page.getByText("No data available").isVisible();
|
||||
});
|
||||
await page.getByText(randomName3).last().isVisible();
|
||||
|
||||
test("should see shortcuts", async ({ page }) => {
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator(".ag-checkbox-input").first().click();
|
||||
await page.getByTestId("icon-Trash2").click();
|
||||
await page.getByText("No data available").isVisible();
|
||||
},
|
||||
);
|
||||
|
||||
test("should see shortcuts", { tag: ["@release"] }, async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
|
|
@ -144,25 +157,30 @@ test("should see shortcuts", async ({ page }) => {
|
|||
await page.getByText("Reset Columns").last().isVisible();
|
||||
});
|
||||
|
||||
test("should interact with API Keys", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.getByText("Settings").click();
|
||||
await page.getByText("Langflow API").first().click();
|
||||
await page.getByText("Langflow API", { exact: true }).nth(1).isVisible();
|
||||
await page.getByText("Add New").click();
|
||||
await page.getByPlaceholder("Insert a name for your API Key").isVisible();
|
||||
test(
|
||||
"should interact with API Keys",
|
||||
{ tag: ["@release", "@api"] },
|
||||
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.getByText("Settings").click();
|
||||
await page.getByText("Langflow API").first().click();
|
||||
await page.getByText("Langflow API", { exact: true }).nth(1).isVisible();
|
||||
await page.getByText("Add New").click();
|
||||
await page.getByPlaceholder("Insert a name for your API Key").isVisible();
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for your API Key")
|
||||
.fill(randomName);
|
||||
await page.getByText("Create Secret Key", { exact: true }).click();
|
||||
await page.getByText("Please save").isVisible();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Api Key Copied!").isVisible();
|
||||
await page.getByText(randomName).isVisible();
|
||||
});
|
||||
const randomName = Math.random().toString(36).substring(2);
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert a name for your API Key")
|
||||
.fill(randomName);
|
||||
await page.getByText("Create Secret Key", { exact: true }).click();
|
||||
await page.getByText("Please save").isVisible();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("Api Key Copied!").isVisible();
|
||||
await page.getByText(randomName).isVisible();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue