Skip to content

Commit 66f9526

Browse files
committed
open.gitbook.com e2e test
1 parent f9a075e commit 66f9526

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Diff for: packages/gitbook/e2e/pages.spec.ts

+27
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
CustomizationHeaderPreset,
44
CustomizationIconsStyle,
55
CustomizationLocale,
6+
PublishedSiteContentLookup,
67
SiteCustomizationSettings,
78
} from '@gitbook/api';
89
import { test, expect, Page } from '@playwright/test';
@@ -763,6 +764,32 @@ const testCases: TestsCase[] = [
763764
},
764765
],
765766
},
767+
{
768+
name: 'open.gitbook.com',
769+
baseUrl: 'https://open.gitbook.com/',
770+
tests: [
771+
{
772+
name: 'GitBook Docs',
773+
url: await (async () => {
774+
const res = await fetch(
775+
`https://api.gitbook.com/v1/urls/published?url=https://docs.gitbook.com`,
776+
);
777+
778+
if (!res.ok) {
779+
throw new Error('Failed to get published URL');
780+
}
781+
782+
const published = await res.json<PublishedSiteContentLookup>();
783+
if (!('site' in published)) {
784+
throw new Error('Expected site for published URL');
785+
}
786+
787+
return `~site/${published.site}?token=${published.apiToken}`;
788+
})(),
789+
run: waitForCookiesDialog,
790+
},
791+
],
792+
},
766793
];
767794

768795
for (const testCase of testCases) {

0 commit comments

Comments
 (0)