Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open.gitbook.com e2e test #2515

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Next Next commit
open.gitbook.com e2e test
  • Loading branch information
taranvohra committed Oct 11, 2024
commit 66f9526594fc7e3b187daf0087178d90fa83bafa
27 changes: 27 additions & 0 deletions packages/gitbook/e2e/pages.spec.ts
Original file line number Diff line number Diff line change
@@ -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) {
Loading
Oops, something went wrong.