feat(core): mode in query string (#7904)

This commit is contained in:
EYHN
2024-08-16 10:59:43 +00:00
parent 83716c2fd9
commit c822594882
16 changed files with 174 additions and 29 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { Page } from '@playwright/test';
export function getCurrentDocIdFromUrl(page: Page) {
const pathname = new URL(page.url()).pathname;
const match = pathname.match(/\/workspace\/([^/]+)\/([^/]+)\/?/);
if (match && match[2]) {
return match[2];
}
throw new Error('Failed to get doc id from url');
}
export function getCurrentCollectionIdFromUrl(page: Page) {
const pathname = new URL(page.url()).pathname;
const match = pathname.match(/\/workspace\/([^/]+)\/collection\/([^/]+)\/?/);
if (match && match[2]) {
return match[2];
}
throw new Error('Failed to get collection id from url');
}