diff --git a/.github/workflows/pr-chromatic-tests.yml b/.github/workflows/pr-chromatic-tests.yml index f7a2e81eb93..334d14a4865 100644 --- a/.github/workflows/pr-chromatic-tests.yml +++ b/.github/workflows/pr-chromatic-tests.yml @@ -111,6 +111,7 @@ jobs: cd deployment/docker_compose ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true \ AUTH_TYPE=basic \ + GEN_AI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ REQUIRE_EMAIL_VERIFICATION=false \ DISABLE_TELEMETRY=true \ IMAGE_TAG=test \ diff --git a/backend/onyx/connectors/google_utils/shared_constants.py b/backend/onyx/connectors/google_utils/shared_constants.py index 9e1a7553692..2f3c3e4f7b8 100644 --- a/backend/onyx/connectors/google_utils/shared_constants.py +++ b/backend/onyx/connectors/google_utils/shared_constants.py @@ -44,9 +44,9 @@ class GoogleOAuthAuthenticationMethod(str, PyEnum): MISSING_SCOPES_ERROR_STR = "client not authorized for any of the scopes requested" # Documentation and error messages -SCOPE_DOC_URL = "https://docs.danswer.dev/connectors/google_drive/overview" +SCOPE_DOC_URL = "https://docs.onyx.app/connectors/google_drive/overview" ONYX_SCOPE_INSTRUCTIONS = ( - "You have upgraded Danswer without updating the Google Auth scopes. " + "You have upgraded Onyx without updating the Google Auth scopes. " f"Please refer to the documentation to learn how to update the scopes: {SCOPE_DOC_URL}" ) diff --git a/backend/tests/daily/connectors/gmail/conftest.py b/backend/tests/daily/connectors/gmail/conftest.py index 3855f62a076..8d13a50c262 100644 --- a/backend/tests/daily/connectors/gmail/conftest.py +++ b/backend/tests/daily/connectors/gmail/conftest.py @@ -54,7 +54,7 @@ def parse_credentials(env_str: str) -> dict: @pytest.fixture def google_gmail_oauth_connector_factory() -> Callable[..., GmailConnector]: def _connector_factory( - primary_admin_email: str = "admin@danswer-test.com", + primary_admin_email: str = "admin@onyx-test.com", ) -> GmailConnector: print("Creating GmailConnector with OAuth credentials") connector = GmailConnector() @@ -76,7 +76,7 @@ def _connector_factory( @pytest.fixture def google_gmail_service_acct_connector_factory() -> Callable[..., GmailConnector]: def _connector_factory( - primary_admin_email: str = "admin@danswer-test.com", + primary_admin_email: str = "admin@onyx-test.com", ) -> GmailConnector: print("Creating GmailConnector with service account credentials") connector = GmailConnector() diff --git a/backend/tests/integration/connector_job_tests/slack/conftest.py b/backend/tests/integration/connector_job_tests/slack/conftest.py index 1e4ee4b0132..38b851de809 100644 --- a/backend/tests/integration/connector_job_tests/slack/conftest.py +++ b/backend/tests/integration/connector_job_tests/slack/conftest.py @@ -15,7 +15,7 @@ def slack_test_setup() -> Generator[tuple[dict[str, Any], dict[str, Any]], None, None]: slack_client = SlackManager.get_slack_client(os.environ["SLACK_BOT_TOKEN"]) admin_user_id = SlackManager.build_slack_user_email_id_map(slack_client)[ - "admin@danswer-test.com" + "admin@onyx-test.com" ] ( diff --git a/backend/tests/integration/connector_job_tests/slack/test_permission_sync.py b/backend/tests/integration/connector_job_tests/slack/test_permission_sync.py index eed67d6a381..a0574e34ac4 100644 --- a/backend/tests/integration/connector_job_tests/slack/test_permission_sync.py +++ b/backend/tests/integration/connector_job_tests/slack/test_permission_sync.py @@ -231,7 +231,7 @@ def test_slack_group_permission_sync( # Creating an admin user (first user created is automatically an admin) admin_user: DATestUser = UserManager.create( - email="admin@danswer-test.com", + email="admin@onyx-test.com", ) # Creating a non-admin user diff --git a/deployment/cloud_kubernetes/workers/beat.yaml b/deployment/cloud_kubernetes/workers/beat.yaml index 607b41b27ea..226ecbd167a 100644 --- a/deployment/cloud_kubernetes/workers/beat.yaml +++ b/deployment/cloud_kubernetes/workers/beat.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: celery-beat - image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.4 + image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.20 imagePullPolicy: IfNotPresent command: [ diff --git a/deployment/cloud_kubernetes/workers/heavy_worker.yaml b/deployment/cloud_kubernetes/workers/heavy_worker.yaml index 409623fb300..c829f897d57 100644 --- a/deployment/cloud_kubernetes/workers/heavy_worker.yaml +++ b/deployment/cloud_kubernetes/workers/heavy_worker.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: celery-worker-heavy - image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.4 + image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.20 imagePullPolicy: IfNotPresent command: [ diff --git a/deployment/cloud_kubernetes/workers/indexing_worker.yaml b/deployment/cloud_kubernetes/workers/indexing_worker.yaml index b41f6bd8d19..2eaedf77a1e 100644 --- a/deployment/cloud_kubernetes/workers/indexing_worker.yaml +++ b/deployment/cloud_kubernetes/workers/indexing_worker.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: celery-worker-indexing - image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.4 + image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.20 imagePullPolicy: IfNotPresent command: [ diff --git a/deployment/cloud_kubernetes/workers/light_worker.yaml b/deployment/cloud_kubernetes/workers/light_worker.yaml index 3e1c2fc8d80..332676a2959 100644 --- a/deployment/cloud_kubernetes/workers/light_worker.yaml +++ b/deployment/cloud_kubernetes/workers/light_worker.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: celery-worker-light - image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.4 + image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.20 imagePullPolicy: IfNotPresent command: [ diff --git a/deployment/cloud_kubernetes/workers/primary.yaml b/deployment/cloud_kubernetes/workers/primary.yaml index ee360748fef..eddfe24739f 100644 --- a/deployment/cloud_kubernetes/workers/primary.yaml +++ b/deployment/cloud_kubernetes/workers/primary.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: celery-worker-primary - image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.4 + image: onyxdotapp/onyx-backend-cloud:v0.14.0-cloud.beta.20 imagePullPolicy: IfNotPresent command: [ diff --git a/deployment/docker_compose/docker-compose.dev.yml b/deployment/docker_compose/docker-compose.dev.yml index 3cf9f062b7b..da383eb2bdc 100644 --- a/deployment/docker_compose/docker-compose.dev.yml +++ b/deployment/docker_compose/docker-compose.dev.yml @@ -47,6 +47,7 @@ services: - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} - BING_API_KEY=${BING_API_KEY:-} - DISABLE_LLM_DOC_RELEVANCE=${DISABLE_LLM_DOC_RELEVANCE:-} + - GEN_AI_API_KEY=${GEN_AI_API_KEY:-} # if set, allows for the use of the token budget system - TOKEN_BUDGET_GLOBALLY_ENABLED=${TOKEN_BUDGET_GLOBALLY_ENABLED:-} # Enables the use of bedrock models @@ -141,6 +142,7 @@ services: - GENERATIVE_MODEL_ACCESS_CHECK_FREQ=${GENERATIVE_MODEL_ACCESS_CHECK_FREQ:-} - DISABLE_LITELLM_STREAMING=${DISABLE_LITELLM_STREAMING:-} - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} + - GEN_AI_API_KEY=${GEN_AI_API_KEY:-} - BING_API_KEY=${BING_API_KEY:-} # Query Options - DOC_TIME_DECAY=${DOC_TIME_DECAY:-} # Recency Bias for search results, decay at 1 / (1 + DOC_TIME_DECAY * x years) diff --git a/web/playwright.config.ts b/web/playwright.config.ts index ddfb1d476a1..b55b8396d8a 100644 --- a/web/playwright.config.ts +++ b/web/playwright.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ { // dependency for admin workflows name: "admin_setup", - testMatch: /.*\admin_auth.setup\.ts/, + testMatch: /.*\admin_auth\.setup\.ts/, }, { // tests admin workflows diff --git a/web/screenshots/assistants_mine_page.png b/web/screenshots/assistants_mine_page.png new file mode 100644 index 00000000000..be5d5836561 Binary files /dev/null and b/web/screenshots/assistants_mine_page.png differ diff --git a/web/screenshots/chat_page.png b/web/screenshots/chat_page.png new file mode 100644 index 00000000000..bd554d45acd Binary files /dev/null and b/web/screenshots/chat_page.png differ diff --git a/web/screenshots/chat_page_after_create.png b/web/screenshots/chat_page_after_create.png new file mode 100644 index 00000000000..e5584f77a87 Binary files /dev/null and b/web/screenshots/chat_page_after_create.png differ diff --git a/web/screenshots/create_assistant_page.png b/web/screenshots/create_assistant_page.png new file mode 100644 index 00000000000..7d205d4355b Binary files /dev/null and b/web/screenshots/create_assistant_page.png differ diff --git a/web/src/app/admin/assistants/AssistantEditor.tsx b/web/src/app/admin/assistants/AssistantEditor.tsx index bee83a19a0a..8bc1a724bc7 100644 --- a/web/src/app/admin/assistants/AssistantEditor.tsx +++ b/web/src/app/admin/assistants/AssistantEditor.tsx @@ -595,6 +595,7 @@ export function AssistantEditor({ tooltip="Used to identify the Assistant in the UI." label="Name" placeholder="e.g. 'Email Assistant'" + aria-label="assistant-name-input" /> { - setFieldValue("system_prompt", e.target.value); - }} + data-testid="assistant-instructions-input" />
diff --git a/web/src/components/admin/connectors/Field.tsx b/web/src/components/admin/connectors/Field.tsx index 459c8101cd5..c45b27b4aca 100644 --- a/web/src/components/admin/connectors/Field.tsx +++ b/web/src/components/admin/connectors/Field.tsx @@ -241,6 +241,7 @@ export function TextFormField({ as={isTextArea ? "textarea" : "input"} type={type} defaultValue={value} + data-testid={name} name={name} id={name} className={` diff --git a/web/tests/e2e/admin_add_connector.spec.ts b/web/tests/e2e/admin_add_connector.spec.ts deleted file mode 100644 index 2385aed327e..00000000000 --- a/web/tests/e2e/admin_add_connector.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Connectors - Add Connector", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/add-connector"); - await expect(page.locator("h1.text-3xl")).toHaveText("Add Connector"); - await expect(page.locator("h1.text-lg").nth(0)).toHaveText(/^Storage/); - } -); diff --git a/web/tests/e2e/admin_api_key.spec.ts b/web/tests/e2e/admin_api_key.spec.ts deleted file mode 100644 index 6feb6be20cf..00000000000 --- a/web/tests/e2e/admin_api_key.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - User Management - API Keys", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/api-key"); - await expect(page.locator("h1.text-3xl")).toHaveText("API Keys"); - await expect(page.locator("p.text-sm")).toHaveText( - /^API Keys allow you to access Onyx APIs programmatically/ - ); - await expect( - page.getByRole("button", { name: "Create API Key" }) - ).toHaveCount(1); - } -); diff --git a/web/tests/e2e/admin_assistants.spec.ts b/web/tests/e2e/admin_assistants.spec.ts deleted file mode 100644 index a5ccf92c71f..00000000000 --- a/web/tests/e2e/admin_assistants.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Custom Assistants - Assistants", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/assistants"); - await expect(page.locator("h1.text-3xl")).toHaveText("Assistants"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - /^Assistants are a way to build/ - ); - - const generalTextLocator = page.locator("tr.border-b td").nth(1); - await expect(generalTextLocator.locator("p.text")).toHaveText("General"); - } -); diff --git a/web/tests/e2e/admin_bots.spec.ts b/web/tests/e2e/admin_bots.spec.ts deleted file mode 100644 index 309b0e90d89..00000000000 --- a/web/tests/e2e/admin_bots.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Custom Assistants - Slack Bots", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/bots"); - await expect(page.locator("h1.text-3xl")).toHaveText("Slack Bots"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - /^Setup Slack bots that connect to Onyx./ - ); - } -); diff --git a/web/tests/e2e/admin_configuration_document_processing.spec.ts b/web/tests/e2e/admin_configuration_document_processing.spec.ts deleted file mode 100644 index 3d9f6ce7a9b..00000000000 --- a/web/tests/e2e/admin_configuration_document_processing.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Configuration - Document Processing", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto( - "http://localhost:3000/admin/configuration/document-processing" - ); - await expect(page.locator("h1.text-3xl")).toHaveText("Document Processing"); - await expect(page.locator("h3.text-2xl")).toHaveText( - "Process with Unstructured API" - ); - } -); diff --git a/web/tests/e2e/admin_configuration_llm.spec.ts b/web/tests/e2e/admin_configuration_llm.spec.ts deleted file mode 100644 index aa5b3957179..00000000000 --- a/web/tests/e2e/admin_configuration_llm.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Configuration - LLM", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/configuration/llm"); - await expect(page.locator("h1.text-3xl")).toHaveText("LLM Setup"); - await expect(page.locator("h1.text-lg").nth(0)).toHaveText( - "Enabled LLM Providers" - ); - } -); diff --git a/web/tests/e2e/admin_configuration_search.spec.ts b/web/tests/e2e/admin_configuration_search.spec.ts deleted file mode 100644 index 57309a71414..00000000000 --- a/web/tests/e2e/admin_configuration_search.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Configuration - Search Settings", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/configuration/search"); - await expect(page.locator("h1.text-3xl")).toHaveText("Search Settings"); - await expect(page.locator("h1.text-lg").nth(0)).toHaveText( - "Embedding Model" - ); - } -); diff --git a/web/tests/e2e/admin_documents_explorer.spec.ts b/web/tests/e2e/admin_documents_explorer.spec.ts deleted file mode 100644 index 0b4d5ae93ae..00000000000 --- a/web/tests/e2e/admin_documents_explorer.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Document Management - Feedback", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/documents/explorer"); - await expect(page.locator("h1.text-3xl")).toHaveText("Document Explorer"); - await expect(page.locator("div.flex.text-emphasis.mt-3")).toHaveText( - "Search for a document above to modify its boost or hide it from searches." - ); - } -); diff --git a/web/tests/e2e/admin_documents_feedback.spec.ts b/web/tests/e2e/admin_documents_feedback.spec.ts deleted file mode 100644 index 4f19cea998e..00000000000 --- a/web/tests/e2e/admin_documents_feedback.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Document Management - Feedback", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/documents/feedback"); - await expect(page.locator("h1.text-3xl")).toHaveText("Document Feedback"); - await expect(page.locator("h1.text-lg").nth(0)).toHaveText( - "Most Liked Documents" - ); - await expect(page.locator("h1.text-lg").nth(1)).toHaveText( - "Most Disliked Documents" - ); - } -); diff --git a/web/tests/e2e/admin_documents_sets.spec.ts b/web/tests/e2e/admin_documents_sets.spec.ts deleted file mode 100644 index ac7d718fb70..00000000000 --- a/web/tests/e2e/admin_documents_sets.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Document Management - Document Sets", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/documents/sets"); - await expect(page.locator("h1.text-3xl")).toHaveText("Document Sets"); - await expect(page.locator("p.text-sm")).toHaveText( - /^Document Sets allow you to group logically connected documents into a single bundle./ - ); - } -); diff --git a/web/tests/e2e/admin_groups.spec.ts b/web/tests/e2e/admin_groups.spec.ts deleted file mode 100644 index 8e192bb8b43..00000000000 --- a/web/tests/e2e/admin_groups.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - User Management - Groups", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/groups"); - await expect(page.locator("h1.text-3xl")).toHaveText("Manage User Groups"); - await expect( - page.getByRole("button", { name: "Create New User Group" }) - ).toHaveCount(1); - } -); diff --git a/web/tests/e2e/admin_indexing_status.spec.ts b/web/tests/e2e/admin_indexing_status.spec.ts deleted file mode 100644 index c5b6bacc2bd..00000000000 --- a/web/tests/e2e/admin_indexing_status.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Connectors - Existing Connectors", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/indexing/status"); - await expect(page.locator("h1.text-3xl")).toHaveText("Existing Connectors"); - await expect(page.locator("p.text-sm")).toHaveText( - /^It looks like you don't have any connectors setup yet./ - ); - } -); diff --git a/web/tests/e2e/admin_pages.spec.ts b/web/tests/e2e/admin_pages.spec.ts new file mode 100644 index 00000000000..c5c80984b5a --- /dev/null +++ b/web/tests/e2e/admin_pages.spec.ts @@ -0,0 +1,52 @@ +import { test, expect } from "@playwright/test"; +import chromaticSnpashots from "./chromaticSnpashots.json"; +import type { Page } from "@playwright/test"; + +async function verifyAdminPageNavigation( + page: Page, + path: string, + pageTitle: string, + options?: { + paragraphText?: string | RegExp; + buttonName?: string; + subHeaderText?: string; + } +) { + await page.goto(`http://localhost:3000/admin/${path}`); + await expect(page.locator("h1.text-3xl")).toHaveText(pageTitle); + + if (options?.paragraphText) { + await expect(page.locator("p.text-sm").nth(0)).toHaveText( + options.paragraphText + ); + } + + if (options?.buttonName) { + await expect( + page.getByRole("button", { name: options.buttonName }) + ).toHaveCount(1); + } + + if (options?.subHeaderText) { + await expect(page.locator("h1.text-lg").nth(0)).toHaveText( + options.subHeaderText + ); + } +} + +for (const chromaticSnapshot of chromaticSnpashots) { + test( + `Admin - ${chromaticSnapshot.name}`, + { + tag: "@admin", + }, + async ({ page }) => { + await verifyAdminPageNavigation( + page, + chromaticSnapshot.path, + chromaticSnapshot.pageTitle, + chromaticSnapshot.options + ); + } + ); +} diff --git a/web/tests/e2e/admin_performance_custom_analytics.spec.ts b/web/tests/e2e/admin_performance_custom_analytics.spec.ts deleted file mode 100644 index 8f66ca6ac6d..00000000000 --- a/web/tests/e2e/admin_performance_custom_analytics.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Performance - Custom Analytics", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/performance/custom-analytics"); - await expect(page.locator("h1.text-3xl")).toHaveText("Custom Analytics"); - await expect(page.locator("div.font-medium").nth(0)).toHaveText( - "Custom Analytics is not enabled." - ); - } -); diff --git a/web/tests/e2e/admin_performance_query_history.spec.ts b/web/tests/e2e/admin_performance_query_history.spec.ts deleted file mode 100644 index d15dba7c635..00000000000 --- a/web/tests/e2e/admin_performance_query_history.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test.describe("Admin Performance Query History", () => { - // Ignores the diff for elements targeted by the specified list of selectors - // exclude button since they change based on the date - test.use({ ignoreSelectors: ["button"] }); - - test( - "Admin - Performance - Query History", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/performance/query-history"); - await expect(page.locator("h1.text-3xl")).toHaveText("Query History"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - "Feedback Type" - ); - } - ); -}); diff --git a/web/tests/e2e/admin_performance_usage.spec.ts b/web/tests/e2e/admin_performance_usage.spec.ts deleted file mode 100644 index 0a5fff426d3..00000000000 --- a/web/tests/e2e/admin_performance_usage.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test.describe("Admin Performance Usage", () => { - // Ignores the diff for elements targeted by the specified list of selectors - // exclude button and svg since they change based on the date - test.use({ ignoreSelectors: ["button", "svg"] }); - - test( - "Admin - Performance - Usage Statistics", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - await page.goto("http://localhost:3000/admin/performance/usage"); - await expect(page.locator("h1.text-3xl")).toHaveText("Usage Statistics"); - await expect(page.locator("h1.text-lg").nth(0)).toHaveText("Usage"); - await expect(page.locator("h1.text-lg").nth(1)).toHaveText("Feedback"); - } - ); -}); diff --git a/web/tests/e2e/admin_settings.spec.ts b/web/tests/e2e/admin_settings.spec.ts deleted file mode 100644 index d48fe13a736..00000000000 --- a/web/tests/e2e/admin_settings.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Settings - Workspace Settings", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/settings"); - await expect(page.locator("h1.text-3xl")).toHaveText("Workspace Settings"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - /^Manage general Onyx settings applicable to all users in the workspace./ - ); - await expect( - page.getByRole("button", { name: "Set Retention Limit" }) - ).toHaveCount(1); - } -); diff --git a/web/tests/e2e/admin_standard_answer.spec.ts b/web/tests/e2e/admin_standard_answer.spec.ts deleted file mode 100644 index 3a265f1b72a..00000000000 --- a/web/tests/e2e/admin_standard_answer.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Custom Assistants - Standard Answers", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/standard-answer"); - await expect(page.locator("h1.text-3xl")).toHaveText("Standard Answers"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - /^Manage the standard answers for pre-defined questions./ - ); - } -); diff --git a/web/tests/e2e/admin_token_rate_limits.spec.ts b/web/tests/e2e/admin_token_rate_limits.spec.ts deleted file mode 100644 index 359673c4e47..00000000000 --- a/web/tests/e2e/admin_token_rate_limits.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - User Management - Token Rate Limits", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/token-rate-limits"); - await expect(page.locator("h1.text-3xl")).toHaveText("Token Rate Limits"); - await expect(page.locator("p.text-sm").nth(0)).toHaveText( - /^Token rate limits enable you control how many tokens can be spent in a given time period./ - ); - await expect( - page.getByRole("button", { name: "Create a Token Rate Limit" }) - ).toHaveCount(1); - await expect(page.locator("h1.text-lg")).toHaveText( - "Global Token Rate Limits" - ); - } -); diff --git a/web/tests/e2e/admin_tools.spec.ts b/web/tests/e2e/admin_tools.spec.ts deleted file mode 100644 index 87152b9836b..00000000000 --- a/web/tests/e2e/admin_tools.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Custom Assistants - Tools", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/tools"); - await expect(page.locator("h1.text-3xl")).toHaveText("Tools"); - await expect(page.locator("p.text-sm")).toHaveText( - "Tools allow assistants to retrieve information or take actions." - ); - } -); diff --git a/web/tests/e2e/admin_users.spec.ts b/web/tests/e2e/admin_users.spec.ts deleted file mode 100644 index 2fc31888431..00000000000 --- a/web/tests/e2e/admin_users.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - User Management - Groups", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/users"); - await expect(page.locator("h1.text-3xl")).toHaveText("Manage Users"); - } -); diff --git a/web/tests/e2e/admin_whitelabeling.spec.ts b/web/tests/e2e/admin_whitelabeling.spec.ts deleted file mode 100644 index 2e49e52d145..00000000000 --- a/web/tests/e2e/admin_whitelabeling.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Admin - Performance - Whitelabeling", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/admin/whitelabeling"); - await expect(page.locator("h1.text-3xl")).toHaveText("Whitelabeling"); - await expect(page.locator("div.block").nth(0)).toHaveText( - "Application Name" - ); - await expect(page.locator("div.block").nth(1)).toHaveText("Custom Logo"); - await expect(page.getByRole("button", { name: "Update" })).toHaveCount(1); - } -); diff --git a/web/tests/e2e/chat.spec.ts b/web/tests/e2e/chat.spec.ts deleted file mode 100644 index e5d096ab0f6..00000000000 --- a/web/tests/e2e/chat.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { test, expect } from "@chromatic-com/playwright"; - -test( - "Chat", - { - tag: "@admin", - }, - async ({ page }, testInfo) => { - // Test simple loading - await page.goto("http://localhost:3000/chat"); - - // Check for the "General" text in the new UI element - await expect( - page.locator("div.flex.items-center span.font-bold") - ).toHaveText("General"); - - // Check for the presence of the new UI element - await expect( - page.locator("div.flex.justify-center div.bg-black.rounded-full") - ).toBeVisible(); - - // Check for the SVG icon - await expect( - page.locator("div.flex.justify-center svg.w-5.h-5") - ).toBeVisible(); - } -); diff --git a/web/tests/e2e/chromaticSnpashots.json b/web/tests/e2e/chromaticSnpashots.json new file mode 100644 index 00000000000..342e28fda0b --- /dev/null +++ b/web/tests/e2e/chromaticSnpashots.json @@ -0,0 +1,116 @@ +[ + { + "name": "Document Management - Explorer", + "path": "documents/explorer", + "pageTitle": "Document Explorer" + }, + { + "name": "Connectors - Add Connector", + "path": "add-connector", + "pageTitle": "Add Connector", + "options": { + "subHeaderText": "Storage" + } + }, + { + "name": "Custom Assistants - Assistants", + "path": "assistants", + "pageTitle": "Assistants", + "options": { + "paragraphText": "Assistants are a way to build custom search/question-answering experiences for different use cases." + } + }, + { + "name": "Configuration - Document Processing", + "path": "configuration/document-processing", + "pageTitle": "Document Processing" + }, + { + "name": "Document Management - Document Sets", + "path": "documents/sets", + "pageTitle": "Document Sets", + "options": { + "paragraphText": "Document Sets allow you to group logically connected documents into a single bundle. These can then be used as a filter when performing searches to control the scope of information Onyx searches over." + } + }, + { + "name": "Custom Assistants - Slack Bots", + "path": "bots", + "pageTitle": "Slack Bots", + "options": { + "paragraphText": "Setup Slack bots that connect to Onyx. Once setup, you will be able to ask questions to Onyx directly from Slack. Additionally, you can:" + } + }, + { + "name": "Custom Assistants - Standard Answers", + "path": "standard-answer", + "pageTitle": "Standard Answers" + }, + { + "name": "Performance - Usage Statistics", + "path": "performance/usage", + "pageTitle": "Usage Statistics" + }, + { + "name": "Document Management - Feedback", + "path": "documents/feedback", + "pageTitle": "Document Feedback", + "options": { + "subHeaderText": "Most Liked Documents" + } + }, + { + "name": "Configuration - LLM", + "path": "configuration/llm", + "pageTitle": "LLM Setup" + }, + { + "name": "Connectors - Existing Connectors", + "path": "indexing/status", + "pageTitle": "Existing Connectors" + }, + { + "name": "Custom Assistants - Prompt Library", + "path": "prompt-library", + "pageTitle": "Prompt Library", + "options": { + "paragraphText": "Create prompts that can be accessed with the `/` shortcut in Onyx Chat. Prompts created here will be accessible to all users." + } + }, + { + "name": "User Management - Groups", + "path": "groups", + "pageTitle": "Manage User Groups" + }, + { + "name": "Performance - Whitelabeling", + "path": "whitelabeling", + "pageTitle": "Whitelabeling" + }, + { + "name": "Configuration - Search Settings", + "path": "configuration/search", + "pageTitle": "Search Settings", + "options": { + "subHeaderText": "Embedding Model" + } + }, + { + "name": "Custom Assistants - Tools", + "path": "tools", + "pageTitle": "Tools", + "options": { + "paragraphText": "Tools allow assistants to retrieve information or take actions." + } + }, + { + "name": "User Management - Token Rate Limits", + "path": "token-rate-limits", + "pageTitle": "Token Rate Limits", + "options": { + "paragraphText": "Token rate limits enable you control how many tokens can be spent in a given time period. With token rate limits, you can:", + "buttonName": "Create a Token Rate Limit", + "subHeaderText": "Global Token Rate Limits" + } + } +] diff --git a/web/tests/e2e/constants.js b/web/tests/e2e/constants.js index d6f5f457c3b..b33de05897e 100644 --- a/web/tests/e2e/constants.js +++ b/web/tests/e2e/constants.js @@ -1,4 +1,3 @@ -// constants.js export const TEST_CREDENTIALS = { email: "admin_user@test.com", password: "test",