Skip to content

Commit

Permalink
fix: brave os local path (#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaisailovic authored Feb 29, 2024
1 parent 3867c37 commit fbaa405
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion apps/laboratory/tests/shared/constants/browsers.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
export const BRAVE_MACOS_PATH = '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser'
export const BRAVE_UBUNTU_PATH = '/usr/bin/brave-browser'
export const BRAVE_LINUX_PATH = '/usr/bin/brave-browser'
export const BRAVE_WINDOWS_PATH =
'C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe'

export function getLocalBravePath(): string {
switch (process.platform) {
case 'linux':
return BRAVE_LINUX_PATH
case 'win32':
return BRAVE_WINDOWS_PATH
default:
return BRAVE_MACOS_PATH
}
}
4 changes: 2 additions & 2 deletions apps/laboratory/tests/shared/utils/project.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { devices } from '@playwright/test'
import { getAvailableDevices } from './device'
import { getValue } from './config'
import { BRAVE_MACOS_PATH, BRAVE_UBUNTU_PATH } from '../constants/browsers'
import { getLocalBravePath, BRAVE_LINUX_PATH } from '../constants/browsers'

const availableDevices = getAvailableDevices()

Expand Down Expand Up @@ -29,7 +29,7 @@ export type CustomProjectProperties = {

const braveOptions: UseOptions = {
launchOptions: {
executablePath: getValue(BRAVE_UBUNTU_PATH, BRAVE_MACOS_PATH)
executablePath: getValue(BRAVE_LINUX_PATH, getLocalBravePath())
}
}

Expand Down

0 comments on commit fbaa405

Please sign in to comment.