File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
roles/tests-unit/files/FWO.Test Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public async Task GeneratePdf()
3333
3434 string path = "" ;
3535 Platform platform = Platform . Unknown ;
36+ const SupportedBrowser wantedBrowser = SupportedBrowser . ChromeHeadlessShell ;
3637
3738 switch ( os . Platform )
3839 {
@@ -47,20 +48,21 @@ public async Task GeneratePdf()
4748 break ;
4849 }
4950
50- InstalledBrowser ? installedBrowser = new BrowserFetcher ( new BrowserFetcherOptions ( ) { Platform = platform , Browser = SupportedBrowser . Chrome , Path = path } ) . GetInstalledBrowsers ( )
51- . FirstOrDefault ( _ => _ . Platform == platform && _ . Browser == SupportedBrowser . Chrome ) ;
51+ InstalledBrowser ? installedBrowser = new BrowserFetcher ( new BrowserFetcherOptions ( ) { Platform = platform , Browser = wantedBrowser , Path = path } ) . GetInstalledBrowsers ( )
52+ . FirstOrDefault ( _ => _ . Platform == platform && _ . Browser == wantedBrowser ) ;
5253
53- foreach ( var brw in new BrowserFetcher ( new BrowserFetcherOptions ( ) { Platform = platform , Browser = SupportedBrowser . Chrome , Path = path } ) . GetInstalledBrowsers ( ) )
54+ if ( installedBrowser == null )
5455 {
55- Log . WriteInfo ( "Test Log" , $ "Browser: { brw . GetExecutablePath ( ) } ") ;
56+ throw new Exception ( $ "Browser: { wantedBrowser } is not installed! ") ;
5657 }
5758
5859 Log . WriteInfo ( "Test Log" , $ "Browser Path: { installedBrowser . GetExecutablePath ( ) } ") ;
5960
6061 using IBrowser ? browser = await Puppeteer . LaunchAsync ( new LaunchOptions
6162 {
6263 ExecutablePath = installedBrowser . GetExecutablePath ( ) ,
63- Headless = true
64+ Headless = true ,
65+ HeadlessMode = HeadlessMode . True
6466 } ) ;
6567
6668 try
You can’t perform that action at this time.
0 commit comments