Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/playwright/impact-map.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@
"playwright/e2e/Features/AppMode/AppModePageSizeIsolation.spec.ts",
"playwright/e2e/Features/AppMode/AppModeResolver.spec.ts",
"playwright/e2e/Features/AppMode/AppModeRouteIsolation.spec.ts",
"playwright/e2e/Features/AppMode/AppModeSettings.spec.ts"
"playwright/e2e/Features/AppMode/AppModeSettings.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts"
]
},
{
Expand Down Expand Up @@ -682,6 +683,7 @@
"playwright/e2e/Features/AppMode/AppModePreferenceRoundTrip.spec.ts",
"playwright/e2e/Features/AppMode/AppModeResolver.spec.ts",
"playwright/e2e/Features/AppMode/AppModeRouteIsolation.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts",
"playwright/e2e/Features/DataQuality/RunTestCase.spec.ts",
"playwright/e2e/Features/DataQuality/TestCaseDetailsPage.spec.ts",
"playwright/e2e/Pages/BotsProfile.spec.ts"
Expand Down Expand Up @@ -3792,6 +3794,7 @@
"playwright/e2e/Features/AppMode/AppModeResolver.spec.ts",
"playwright/e2e/Features/AppMode/AppModeRouteIsolation.spec.ts",
"playwright/e2e/Features/AppMode/AppModeSettings.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts",
"playwright/e2e/Features/ArticleReviewerWorkflow.spec.ts",
"playwright/e2e/Features/AutoPilot.spec.ts",
"playwright/e2e/Features/BulkEditEntity.spec.ts",
Expand Down Expand Up @@ -10233,6 +10236,7 @@
],
"specs": [
"playwright/e2e/Features/AIMode/IncidentGroups.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts",
"playwright/e2e/Pages/IntakeForm.spec.ts"
]
},
Expand Down Expand Up @@ -10283,6 +10287,14 @@
"playwright/e2e/Features/DataQuality/DataQualityDashboard.spec.ts"
]
},
{
"sources": [
"openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/AINotFoundPage/AINotFoundPage.tsx"
],
"specs": [
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts"
]
},
{
"sources": [
"openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/Sidebar/Sidebar.tsx"
Expand All @@ -10296,6 +10308,7 @@
"playwright/e2e/Features/AppMode/AppModePrecedence.spec.ts",
"playwright/e2e/Features/AppMode/AppModePreferenceRoundTrip.spec.ts",
"playwright/e2e/Features/AppMode/AppModeResolver.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts",
"playwright/e2e/Features/PersonaAppLayout.spec.ts"
]
},
Expand Down Expand Up @@ -10721,6 +10734,7 @@
"playwright/e2e/Features/AppMode/AppModeResolver.spec.ts",
"playwright/e2e/Features/AppMode/AppModeRouteIsolation.spec.ts",
"playwright/e2e/Features/AppMode/AppModeSettings.spec.ts",
"playwright/e2e/Features/AppMode/AppModeUrlHandling.spec.ts",
"playwright/e2e/Features/ArticleReviewerWorkflow.spec.ts",
"playwright/e2e/Features/AutoPilot.spec.ts",
"playwright/e2e/Features/BlockEditorEmbedLink.spec.ts",
Expand Down
2 changes: 1 addition & 1 deletion .github/playwright/timing-baseline.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Copyright 2026 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Page } from '@playwright/test';
import { waitForAllLoadersToDisappear } from '../../../utils/entity';
import { enableAiAppMode } from '../../Utils/appMode';
import { expect, test } from './fixtures';

test.describe('AppMode — URL handling', { tag: ['@Platform'] }, () => {
test('redirects /service/<cat>/<fqn> to /connections/<cat>/<fqn> in AI mode', async ({
page,
}) => {
await enableAiAppMode(page);

await test.step('Visit /service/<cat>/<fqn>', async () => {
await page.goto('/service/databaseServices/sampleService.foo', {
waitUntil: 'domcontentloaded',
});
});

await test.step('URL is rewritten to the /connections namespace', async () => {
await expect(page).toHaveURL(
/\/connections\/databaseServices\/sampleService\.foo/
);
await expect(page.getByTestId('ask-sidebar')).toBeVisible();
});
});

test('renders the AI not-found page at /404 in AI mode (does NOT delegate to the catch-all)', async ({
page,
}) => {
await enableAiAppMode(page);

await test.step('Navigate to /404 inside AI mode', async () => {
await page.goto('/404', { waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);
});

await test.step('AI not-found page is rendered (not an infinite redirect loop)', async () => {
await expect(page).toHaveURL(/\/404$/);
await expect(page.getByTestId('ai-not-found-page')).toBeVisible();
});
});

test('delegates classic-only URLs to the default tree wrapped in the AI shell', async ({
page,
}) => {
await enableAiAppMode(page);

await test.step('Visit /explore — a route no app-mode module defines', async () => {
await page.goto('/explore', { waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);
});

await test.step('Page renders inside the AI shell (sidebar visible) at the delegated URL', async () => {
await expect(page).toHaveURL(/\/explore/);
await expect(page.getByTestId('ask-sidebar')).toBeVisible();
});
});

test('serves the AI My Data page at the /my-data path in AI mode', async ({
page,
}) => {
await enableAiAppMode(page);

await test.step('Visit /my-data while in AI mode', async () => {
await page.goto('/my-data', { waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);
});

await test.step('The AI My Data page renders in the AI shell at /my-data', async () => {
await expect(page).toHaveURL(/\/my-data$/);
await expect(page.getByTestId('ask-sidebar')).toBeVisible();
});
});

/**
* Install-gated plugin modules register their routes only once
* `/api/v1/apps/installed` resolves. Before that the route table is
* incomplete, and the catch-all used to navigate to /404 — destroying the
* requested URL before the full table mounted. Any deep link or reload in AI
* mode could land on Not Found.
*/
test.describe('cold boot with route registration still in flight', () => {
// Holding the response keeps that window open on every run. Without it the
// defect only surfaced on some boots, so the test would pass by luck.
const holdApplicationsFetch = async (page: Page, delayMs = 2500) => {
await page.route('**/api/v1/apps/installed*', async (route) => {
await new Promise((resolve) => setTimeout(resolve, delayMs));
await route.continue();
});
};

const AI_ROUTES = [
'/observability/data-quality',
'/observability/incident-manager',
];

for (const route of AI_ROUTES) {
test(`keeps ${route} instead of redirecting to /404`, async ({
page,
}) => {
await enableAiAppMode(page);
await holdApplicationsFetch(page);

await page.goto(route, { waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);

await expect(page).toHaveURL(new RegExp(`${route}$`));
});
}

test('preserves the query string across a reload', async ({ page }) => {
// The reported repro: apply a filter, then hit reload.
const filtered =
'/observability/incident-manager?testCaseResolutionStatusType=New';

await enableAiAppMode(page);
await holdApplicationsFetch(page);

await page.goto(filtered, { waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);

await expect(page).toHaveURL(/testCaseResolutionStatusType=New/);

await page.reload({ waitUntil: 'domcontentloaded' });
await waitForAllLoadersToDisappear(page);

await expect(page).toHaveURL(/testCaseResolutionStatusType=New/);
await expect(page.getByTestId('incident-groups')).toBeVisible();
});
});
});
Loading