File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 3
3
CustomizationHeaderPreset ,
4
4
CustomizationIconsStyle ,
5
5
CustomizationLocale ,
6
+ PublishedSiteContentLookup ,
6
7
SiteCustomizationSettings ,
7
8
} from '@gitbook/api' ;
8
9
import { test , expect , Page } from '@playwright/test' ;
@@ -763,6 +764,32 @@ const testCases: TestsCase[] = [
763
764
} ,
764
765
] ,
765
766
} ,
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
+ } ,
766
793
] ;
767
794
768
795
for ( const testCase of testCases ) {
You can’t perform that action at this time.
0 commit comments