11import { strict as assert } from "assert" ;
2- import _ from "lodash" ;
32import { launchBrowser } from "../../../src/browser/standalone" ;
4- import { BrowserName } from "../../../src/browser/types " ;
3+ import { BROWSER_CONFIG } from "./constants " ;
54
65describe ( "Standalone Browser E2E Tests" , function ( ) {
76 this . timeout ( 25000 ) ;
@@ -16,32 +15,14 @@ describe("Standalone Browser E2E Tests", function () {
1615
1716 let browser : WebdriverIO . Browser ;
1817
19- const browserName = ( process . env . BROWSER || "chrome" ) . toLowerCase ( ) as keyof typeof BrowserName ;
20-
2118 after ( async function ( ) {
2219 if ( browser ) {
2320 await browser . deleteSession ( ) ;
2421 }
2522 } ) ;
2623
2724 it ( "should launch browser and access a website" , async function ( ) {
28- const browserConfig = {
29- desiredCapabilities : {
30- browserName,
31- } ,
32- headless : true ,
33- system : {
34- debug : Boolean ( process . env . DEBUG ) || false ,
35- } ,
36- } ;
37-
38- if ( / c h r o m e / i. test ( browserName ) ) {
39- _ . set ( browserConfig . desiredCapabilities , "goog:chromeOptions" , {
40- args : [ "--no-sandbox" , "--disable-dev-shm-usage" ] ,
41- } ) ;
42- }
43-
44- browser = await launchBrowser ( browserConfig ) ;
25+ browser = await launchBrowser ( BROWSER_CONFIG ) ;
4526
4627 assert . ok ( browser , "Browser should be initialized" ) ;
4728 assert . ok ( browser . sessionId , "Browser should have a valid session ID" ) ;
0 commit comments