mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 19:32:07 +00:00
open.gitbook.com e2e test
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
CustomizationHeaderPreset,
|
||||
CustomizationIconsStyle,
|
||||
CustomizationLocale,
|
||||
PublishedSiteContentLookup,
|
||||
SiteCustomizationSettings,
|
||||
} from '@gitbook/api';
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
@@ -763,6 +764,32 @@ const testCases: TestsCase[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'open.gitbook.com',
|
||||
baseUrl: 'https://open.gitbook.com/',
|
||||
tests: [
|
||||
{
|
||||
name: 'GitBook Docs',
|
||||
url: await (async () => {
|
||||
const res = await fetch(
|
||||
`https://api.gitbook.com/v1/urls/published?url=https://docs.gitbook.com`,
|
||||
);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error('Failed to get published URL');
|
||||
}
|
||||
|
||||
const published = await res.json<PublishedSiteContentLookup>();
|
||||
if (!('site' in published)) {
|
||||
throw new Error('Expected site for published URL');
|
||||
}
|
||||
|
||||
return `~site/${published.site}?token=${published.apiToken}`;
|
||||
})(),
|
||||
run: waitForCookiesDialog,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
for (const testCase of testCases) {
|
||||
|
||||
Reference in New Issue
Block a user